Source Code Cross Referenced for EditAttributeByFormulaDialog.java in  » GIS » openjump » de » fho » jump » pirol » plugins » EditAttributeByFormula » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » GIS » openjump » de.fho.jump.pirol.plugins.EditAttributeByFormula 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Created on 20.06.2005
003:         *
004:         * CVS information:
005:         *  $Author: javamap $
006:         *  $Date: 2007-06-18 21:15:27 -0700 (Mon, 18 Jun 2007) $
007:         *  $ID$
008:         *  $Rev: 856 $
009:         *  $Id: EditAttributeByFormulaDialog.java 856 2007-06-19 04:15:27Z javamap $
010:         *
011:         */
012:        package de.fho.jump.pirol.plugins.EditAttributeByFormula;
013:
014:        import java.awt.Frame;
015:        import java.awt.GridBagConstraints;
016:        import java.awt.GridBagLayout;
017:        import java.awt.HeadlessException;
018:        import java.awt.Insets;
019:
020:        import javax.swing.JDialog;
021:        import javax.swing.JPanel;
022:
023:        import com.vividsolutions.jump.feature.AttributeType;
024:        import com.vividsolutions.jump.feature.FeatureSchema;
025:
026:        import de.fho.jump.pirol.ui.eventHandling.OKCancelListener;
027:        import de.fho.jump.pirol.ui.panels.NewAttributePanel;
028:        import de.fho.jump.pirol.ui.panels.OkCancelButtonPanel;
029:        import de.fho.jump.pirol.ui.tools.DialogTools;
030:        import de.fho.jump.pirol.utilities.FormulaParsing.FormulaValue;
031:        import de.fho.jump.pirol.utilities.Properties.PropertiesHandler;
032:        import de.fho.jump.pirol.utilities.attributes.AttributeInfo;
033:
034:        /**
035:         * 
036:         * Dialog to ask the user for information on the new attribute and for a formular,
037:         * that represents a blue print to generate attribute values with.
038:         *
039:         * @author Ole Rahn
040:         * <br>
041:         * <br>FH Osnabr&uuml;ck - University of Applied Sciences Osnabr&uuml;ck,
042:         * <br>Project: PIROL (2005),
043:         * <br>Subproject: Daten- und Wissensmanagement
044:         * 
045:         * @version $Rev: 856 $
046:         */
047:        public class EditAttributeByFormulaDialog extends JDialog {
048:
049:            private static final long serialVersionUID = 3581710389701646491L;
050:
051:            protected NewAttributePanel newAttrPanel = null;
052:            protected OkCancelButtonPanel okCancelPanel = null;
053:            protected FormulaEditingPanel formPanel = null;
054:
055:            protected OKCancelListener okCancelListener = null;
056:
057:            protected String text = null;
058:
059:            protected FeatureSchema featureSchema = null;
060:
061:            protected PropertiesHandler storedFormulas = null;
062:
063:            /**
064:             * @param parentFrame
065:             * @param title
066:             * @param modal
067:             * @throws java.awt.HeadlessException
068:             */
069:            public EditAttributeByFormulaDialog(Frame parentFrame,
070:                    String title, boolean modal, String text,
071:                    FeatureSchema featureSchema,
072:                    PropertiesHandler storedFormulas) throws HeadlessException {
073:                super (parentFrame, title, modal);
074:
075:                this .text = text;
076:                this .featureSchema = featureSchema;
077:                this .storedFormulas = storedFormulas;
078:
079:                this .okCancelListener = new OKCancelListener(this );
080:
081:                this .setupUI();
082:            }
083:
084:            //[sstein 24.March 2007] new - since we dont have stored formulas
085:            public EditAttributeByFormulaDialog(Frame parentFrame,
086:                    String title, boolean modal, String text,
087:                    FeatureSchema featureSchema) throws HeadlessException {
088:                super (parentFrame, title, modal);
089:
090:                this .text = text;
091:                this .featureSchema = featureSchema;
092:
093:                this .okCancelListener = new OKCancelListener(this );
094:
095:                this .setupUI();
096:            }
097:
098:            protected void setupUI() {
099:                JPanel content = new JPanel();
100:                GridBagLayout gridbagLayout = new GridBagLayout();
101:                GridBagConstraints c = new GridBagConstraints();
102:                c.insets = new Insets(5, 5, 5, 5);
103:
104:                int gridy = 1;
105:                c.gridx = 1;
106:                c.anchor = GridBagConstraints.NORTHWEST;
107:                c.fill = GridBagConstraints.HORIZONTAL;
108:                c.ipady = 20;
109:                content.setLayout(gridbagLayout);
110:
111:                c.gridy = gridy++;
112:                content.add(DialogTools.getPanelWithLabels(this .text, 50), c);
113:
114:                this .newAttrPanel = new NewAttributePanel(true,
115:                        new AttributeType[] { AttributeType.DOUBLE }, false);
116:                c.gridy = gridy++;
117:                content.add(this .newAttrPanel, c);
118:
119:                //[sstein 24.March 2007] we dont have stored formulas
120:                if (this .storedFormulas != null) {
121:                    this .formPanel = new FormulaEditingPanel(
122:                            this .featureSchema, this .storedFormulas,
123:                            this .newAttrPanel);
124:                } else {
125:                    this .formPanel = new FormulaEditingPanel(
126:                            this .featureSchema, this .newAttrPanel);
127:                }
128:                this .okCancelListener.addValueChecker(this .formPanel);
129:                c.gridy = gridy++;
130:                content.add(this .formPanel, c);
131:
132:                this .okCancelPanel = new OkCancelButtonPanel();
133:                this .okCancelPanel.addActionListener(this .okCancelListener);
134:                c.gridy = gridy++;
135:                content.add(this .okCancelPanel, c);
136:
137:                content.doLayout();
138:
139:                this .getContentPane().add(content);
140:                this .pack();
141:
142:            }
143:
144:            public FormulaValue getParsedFormula() {
145:                return formPanel.getParsedFormula();
146:            }
147:
148:            public String getFormula() {
149:                return formPanel.getFormula();
150:            }
151:
152:            /**
153:             * @see NewAttributePanel#getAttributeInfo()
154:             * @return Info on the new attribute
155:             */
156:            public AttributeInfo getAttributeInfo() {
157:                return newAttrPanel.getAttributeInfo();
158:            }
159:
160:            /**
161:             * @see OKCancelListener#wasOkClicked()
162:             */
163:            public boolean wasOkClicked() {
164:                return okCancelListener.wasOkClicked();
165:            }
166:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.