Revision 510
org.gvsig.expressionfield/tags/org.gvsig.expressionfield-2.0.96/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 |
|
|
3 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
4 |
|
|
5 |
<modelVersion>4.0.0</modelVersion> |
|
6 |
<artifactId>org.gvsig.expressionfield</artifactId> |
|
7 |
<name>${project.artifactId}</name> |
|
8 |
<version>2.0.96</version> |
|
9 |
<description>Field calculator (Expression from assistant or from text file)</description> |
|
10 |
|
|
11 |
<parent> |
|
12 |
<groupId>org.gvsig</groupId> |
|
13 |
<artifactId>org.gvsig.desktop</artifactId> |
|
14 |
<version>2.0.265</version> |
|
15 |
</parent> |
|
16 |
|
|
17 |
<url>https://devel.gvsig.org/redmine/projects/gvsig-expression-field</url> |
|
18 |
|
|
19 |
<scm> |
|
20 |
<connection>scm:svn:https://devel.gvsig.org/svn/gvsig-expression-field/org.gvsig.expressionfield/tags/org.gvsig.expressionfield-2.0.96</connection> |
|
21 |
<developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-expression-field/org.gvsig.expressionfield/tags/org.gvsig.expressionfield-2.0.96</developerConnection> |
|
22 |
<url>scm:svn:https://devel.gvsig.org/svn/gvsig-expression-field/org.gvsig.expressionfield/tags/org.gvsig.expressionfield-2.0.96</url> |
|
23 |
</scm> |
|
24 |
|
|
25 |
<repositories> |
|
26 |
<repository> |
|
27 |
<id>gvsig-public-http-repository</id> |
|
28 |
<name>gvSIG maven public HTTP repository</name> |
|
29 |
<url>http://devel.gvsig.org/m2repo/j2se</url> |
|
30 |
<releases> |
|
31 |
<enabled>true</enabled> |
|
32 |
<updatePolicy>daily</updatePolicy> |
|
33 |
<checksumPolicy>warn</checksumPolicy> |
|
34 |
</releases> |
|
35 |
<snapshots> |
|
36 |
<enabled>true</enabled> |
|
37 |
<updatePolicy>daily</updatePolicy> |
|
38 |
<checksumPolicy>warn</checksumPolicy> |
|
39 |
</snapshots> |
|
40 |
</repository> |
|
41 |
</repositories> |
|
42 |
|
|
43 |
<dependencyManagement> |
|
44 |
<dependencies> |
|
45 |
<!-- Adding this dependency because this project is using a jython version |
|
46 |
different to the version defined by the parent pom --> |
|
47 |
<dependency> |
|
48 |
<groupId>org.python</groupId> |
|
49 |
<artifactId>jython</artifactId> |
|
50 |
<version>2.2.1</version> |
|
51 |
</dependency> |
|
52 |
</dependencies> |
|
53 |
</dependencyManagement> |
|
54 |
|
|
55 |
<dependencies> |
|
56 |
<dependency> |
|
57 |
<groupId>org.gvsig</groupId> |
|
58 |
<artifactId>org.gvsig.app.mainplugin</artifactId> |
|
59 |
<scope>compile</scope> |
|
60 |
</dependency> |
|
61 |
<dependency> |
|
62 |
<groupId>org.gvsig</groupId> |
|
63 |
<artifactId>org.gvsig.app.document.table.app.mainplugin</artifactId> |
|
64 |
<scope>compile</scope> |
|
65 |
</dependency> |
|
66 |
<dependency> |
|
67 |
<groupId>bsf</groupId> |
|
68 |
<artifactId>bsf</artifactId> |
|
69 |
<scope>compile</scope> |
|
70 |
</dependency> |
|
71 |
|
|
72 |
<dependency> |
|
73 |
<groupId>bsh</groupId> |
|
74 |
<artifactId>bsh</artifactId> |
|
75 |
<scope>compile</scope> |
|
76 |
</dependency> |
|
77 |
|
|
78 |
<dependency> |
|
79 |
<groupId>org.gvsig</groupId> |
|
80 |
<artifactId>org.gvsig.about.api</artifactId> |
|
81 |
<scope>compile</scope> |
|
82 |
</dependency> |
|
83 |
<dependency> |
|
84 |
<groupId>org.gvsig</groupId> |
|
85 |
<artifactId>org.gvsig.andami</artifactId> |
|
86 |
<scope>compile</scope> |
|
87 |
</dependency> |
|
88 |
<dependency> |
|
89 |
<groupId>org.gvsig</groupId> |
|
90 |
<artifactId>org.gvsig.fmap.dal.api</artifactId> |
|
91 |
<scope>compile</scope> |
|
92 |
</dependency> |
|
93 |
<dependency> |
|
94 |
<groupId>org.gvsig</groupId> |
|
95 |
<artifactId>org.gvsig.fmap.mapcontext.api</artifactId> |
|
96 |
<scope>compile</scope> |
|
97 |
</dependency> |
|
98 |
<dependency> |
|
99 |
<groupId>org.gvsig</groupId> |
|
100 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
101 |
<scope>compile</scope> |
|
102 |
</dependency> |
|
103 |
<dependency> |
|
104 |
<groupId>org.gvsig</groupId> |
|
105 |
<artifactId>org.gvsig.tools.swing.api</artifactId> |
|
106 |
<scope>compile</scope> |
|
107 |
</dependency> |
|
108 |
<dependency> |
|
109 |
<groupId>org.gvsig</groupId> |
|
110 |
<artifactId>org.gvsig.fmap.geometry.api</artifactId> |
|
111 |
<scope>compile</scope> |
|
112 |
</dependency> |
|
113 |
<dependency> |
|
114 |
<groupId>org.gvsig</groupId> |
|
115 |
<artifactId>org.gvsig.metadata.lib.basic.api</artifactId> |
|
116 |
<scope>compile</scope> |
|
117 |
</dependency> |
|
118 |
<dependency> |
|
119 |
<groupId>org.gvsig</groupId> |
|
120 |
<artifactId>org.gvsig.ui</artifactId> |
|
121 |
<scope>compile</scope> |
|
122 |
</dependency> |
|
123 |
<dependency> |
|
124 |
<groupId>org.gvsig</groupId> |
|
125 |
<artifactId>org.gvsig.projection.api</artifactId> |
|
126 |
<scope>compile</scope> |
|
127 |
</dependency> |
|
128 |
<dependency> |
|
129 |
<groupId>org.gvsig</groupId> |
|
130 |
<artifactId>org.gvsig.fmap.control</artifactId> |
|
131 |
<scope>compile</scope> |
|
132 |
</dependency> |
|
133 |
<dependency> |
|
134 |
<groupId>org.gvsig</groupId> |
|
135 |
<artifactId>org.gvsig.utils</artifactId> |
|
136 |
<scope>compile</scope> |
|
137 |
</dependency> |
|
138 |
<dependency> |
|
139 |
<groupId>org.gvsig</groupId> |
|
140 |
<artifactId>org.gvsig.timesupport.lib.api</artifactId> |
|
141 |
<scope>compile</scope> |
|
142 |
</dependency> |
|
143 |
<dependency> |
|
144 |
<groupId>com.fifesoft</groupId> |
|
145 |
<artifactId>rsyntaxtextarea</artifactId> |
|
146 |
<scope>compile</scope> |
|
147 |
</dependency> |
|
148 |
<dependency> |
|
149 |
<groupId>org.python</groupId> |
|
150 |
<artifactId>jython</artifactId> |
|
151 |
<scope>runtime</scope> |
|
152 |
</dependency> |
|
153 |
</dependencies> |
|
154 |
|
|
155 |
|
|
156 |
<build> |
|
157 |
|
|
158 |
<plugins> |
|
159 |
<plugin> |
|
160 |
<groupId>org.apache.maven.plugins</groupId> |
|
161 |
<artifactId>maven-surefire-plugin</artifactId> |
|
162 |
<configuration> |
|
163 |
<skipTests>true</skipTests> |
|
164 |
</configuration> |
|
165 |
</plugin> |
|
166 |
|
|
167 |
<plugin> |
|
168 |
<artifactId>maven-release-plugin</artifactId> |
|
169 |
<version>2.0</version> |
|
170 |
<configuration> |
|
171 |
<tagBase>https://devel.gvsig.org/svn/gvsig-expression-field/org.gvsig.expressionfield/tags</tagBase> |
|
172 |
</configuration> |
|
173 |
</plugin> |
|
174 |
|
|
175 |
</plugins> |
|
176 |
|
|
177 |
</build> |
|
178 |
|
|
179 |
|
|
180 |
<properties> |
|
181 |
<gvsig.package.info.name>Tools: Field calculator</gvsig.package.info.name> |
|
182 |
<gvsig.package.info.dependencies>required: org.gvsig.app.document.table.app.mainplugin -ge 2</gvsig.package.info.dependencies> |
|
183 |
<gvsig.package.info.javaVM>j1_6</gvsig.package.info.javaVM> |
|
184 |
<gvsig.package.info.state>testing</gvsig.package.info.state> |
|
185 |
<gvsig.package.info.official>true</gvsig.package.info.official> |
|
186 |
<!-- alpha-devel --> |
|
187 |
<gvsig.package.info.categories>Table</gvsig.package.info.categories> |
|
188 |
<gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/gvsig-expression-field/pool</gvsig.package.info.poolURL> |
|
189 |
|
|
190 |
</properties> |
|
191 |
</project> |
org.gvsig.expressionfield/tags/org.gvsig.expressionfield-2.0.96/buildNumber.properties | ||
---|---|---|
1 |
#Wed Jan 29 15:09:52 CET 2020 |
|
2 |
buildNumber=2174 |
org.gvsig.expressionfield/tags/org.gvsig.expressionfield-2.0.96/src/test/java/org/gvsig/expressionfield/AllTests.java | ||
---|---|---|
1 |
package org.gvsig.expressionfield; |
|
2 |
|
|
3 |
import junit.framework.Test; |
|
4 |
import junit.framework.TestSuite; |
|
5 |
|
|
6 |
public class AllTests { |
|
7 |
|
|
8 |
public static Test suite() { |
|
9 |
TestSuite suite = new TestSuite( |
|
10 |
"Test for com.iver.cit.gvsig.expressionField"); |
|
11 |
//$JUnit-BEGIN$ |
|
12 |
|
|
13 |
//$JUnit-END$ |
|
14 |
return suite; |
|
15 |
} |
|
16 |
|
|
17 |
} |
org.gvsig.expressionfield/tags/org.gvsig.expressionfield-2.0.96/src/main/assembly/gvsig-plugin-package.xml | ||
---|---|---|
1 |
<!-- |
|
2 |
|
|
3 |
gvSIG. Desktop Geographic Information System. |
|
4 |
|
|
5 |
Copyright (C) 2007-2013 gvSIG Association. |
|
6 |
|
|
7 |
This program is free software; you can redistribute it and/or |
|
8 |
modify it under the terms of the GNU General Public License |
|
9 |
as published by the Free Software Foundation; either version 3 |
|
10 |
of the License, or (at your option) any later version. |
|
11 |
|
|
12 |
This program is distributed in the hope that it will be useful, |
|
13 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15 |
GNU General Public License for more details. |
|
16 |
|
|
17 |
You should have received a copy of the GNU General Public License |
|
18 |
along with this program; if not, write to the Free Software |
|
19 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
20 |
MA 02110-1301, USA. |
|
21 |
|
|
22 |
For any additional information, do not hesitate to contact us |
|
23 |
at info AT gvsig.com, or visit our website www.gvsig.com. |
|
24 |
|
|
25 |
--> |
|
26 |
<assembly> |
|
27 |
<id>gvsig-plugin-package</id> |
|
28 |
<formats> |
|
29 |
<format>zip</format> |
|
30 |
</formats> |
|
31 |
<baseDirectory>${project.artifactId}</baseDirectory> |
|
32 |
<includeBaseDirectory>true</includeBaseDirectory> |
|
33 |
<files> |
|
34 |
<file> |
|
35 |
<source>target/${project.artifactId}-${project.version}.jar</source> |
|
36 |
<outputDirectory>lib</outputDirectory> |
|
37 |
</file> |
|
38 |
<file> |
|
39 |
<source>target/package.info</source> |
|
40 |
</file> |
|
41 |
</files> |
|
42 |
|
|
43 |
<fileSets> |
|
44 |
<fileSet> |
|
45 |
<directory>src/main/resources-plugin</directory> |
|
46 |
<outputDirectory>.</outputDirectory> |
|
47 |
</fileSet> |
|
48 |
</fileSets> |
|
49 |
|
|
50 |
<dependencySets> |
|
51 |
<dependencySet> |
|
52 |
<useProjectArtifact>false</useProjectArtifact> |
|
53 |
<useTransitiveDependencies>false</useTransitiveDependencies> |
|
54 |
<outputDirectory>lib</outputDirectory> |
|
55 |
<includes> |
|
56 |
<include>bsf:bsf</include> |
|
57 |
<include>org.python:jython</include> |
|
58 |
<include>com.fifesoft:rsyntaxtextarea</include> |
|
59 |
</includes> |
|
60 |
</dependencySet> |
|
61 |
</dependencySets> |
|
62 |
|
|
63 |
</assembly> |
|
64 |
|
org.gvsig.expressionfield/tags/org.gvsig.expressionfield-2.0.96/src/main/java/org/gvsig/expressionfield/ExpressionFieldExtension.java | ||
---|---|---|
1 |
/** |
|
2 |
* ***************************************************************************** |
|
3 |
* |
|
4 |
* gvSIG. Desktop Geographic Information System. |
|
5 |
* |
|
6 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
7 |
* |
|
8 |
* This program is free software; you can redistribute it and/or |
|
9 |
* modify it under the terms of the GNU General Public License |
|
10 |
* as published by the Free Software Foundation; either version 3 |
|
11 |
* of the License, or (at your option) any later version. |
|
12 |
* |
|
13 |
* This program is distributed in the hope that it will be useful, |
|
14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
* GNU General Public License for more details. |
|
17 |
* |
|
18 |
* You should have received a copy of the GNU General Public License |
|
19 |
* along with this program; if not, write to the Free Software |
|
20 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
21 |
* MA 02110-1301, USA. |
|
22 |
* |
|
23 |
* For any additional information, do not hesitate to contact us |
|
24 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
25 |
* |
|
26 |
****************************************************************************** |
|
27 |
*/ |
|
28 |
package org.gvsig.expressionfield; |
|
29 |
|
|
30 |
import java.awt.Component; |
|
31 |
import java.util.ArrayList; |
|
32 |
import java.util.Iterator; |
|
33 |
|
|
34 |
import javax.swing.JOptionPane; |
|
35 |
|
|
36 |
import org.apache.bsf.BSFManager; |
|
37 |
|
|
38 |
import org.gvsig.andami.IconThemeHelper; |
|
39 |
import org.gvsig.andami.PluginServices; |
|
40 |
import org.gvsig.andami.messages.NotificationManager; |
|
41 |
import org.gvsig.andami.plugins.Extension; |
|
42 |
import org.gvsig.app.project.documents.table.gui.FeatureTableDocumentPanel; |
|
43 |
import org.gvsig.expressionfield.gui.FieldExpressionPage; |
|
44 |
import org.gvsig.expressionfield.project.documents.table.IOperator; |
|
45 |
import org.gvsig.expressionfield.project.documents.table.gui.EvalExpressionDialog; |
|
46 |
import org.gvsig.expressionfield.project.documents.table.operators.Abs; |
|
47 |
import org.gvsig.expressionfield.project.documents.table.operators.Acos; |
|
48 |
import org.gvsig.expressionfield.project.documents.table.operators.After; |
|
49 |
import org.gvsig.expressionfield.project.documents.table.operators.Area; |
|
50 |
import org.gvsig.expressionfield.project.documents.table.operators.Asin; |
|
51 |
import org.gvsig.expressionfield.project.documents.table.operators.Atan; |
|
52 |
import org.gvsig.expressionfield.project.documents.table.operators.Before; |
|
53 |
import org.gvsig.expressionfield.project.documents.table.operators.Ceil; |
|
54 |
import org.gvsig.expressionfield.project.documents.table.operators.Cos; |
|
55 |
import org.gvsig.expressionfield.project.documents.table.operators.DateToString; |
|
56 |
import org.gvsig.expressionfield.project.documents.table.operators.Distinct; |
|
57 |
import org.gvsig.expressionfield.project.documents.table.operators.Division; |
|
58 |
import org.gvsig.expressionfield.project.documents.table.operators.E; |
|
59 |
import org.gvsig.expressionfield.project.documents.table.operators.EndsWith; |
|
60 |
import org.gvsig.expressionfield.project.documents.table.operators.Equal; |
|
61 |
import org.gvsig.expressionfield.project.documents.table.operators.Equals; |
|
62 |
import org.gvsig.expressionfield.project.documents.table.operators.Exp; |
|
63 |
import org.gvsig.expressionfield.project.documents.table.operators.Floor; |
|
64 |
import org.gvsig.expressionfield.project.documents.table.operators.Geometry; |
|
65 |
import org.gvsig.expressionfield.project.documents.table.operators.GetTimeDate; |
|
66 |
import org.gvsig.expressionfield.project.documents.table.operators.IndexOf; |
|
67 |
import org.gvsig.expressionfield.project.documents.table.operators.IsNumber; |
|
68 |
import org.gvsig.expressionfield.project.documents.table.operators.LastIndexOf; |
|
69 |
import org.gvsig.expressionfield.project.documents.table.operators.Length; |
|
70 |
import org.gvsig.expressionfield.project.documents.table.operators.LessEquals; |
|
71 |
import org.gvsig.expressionfield.project.documents.table.operators.LessThan; |
|
72 |
import org.gvsig.expressionfield.project.documents.table.operators.Log; |
|
73 |
import org.gvsig.expressionfield.project.documents.table.operators.Max; |
|
74 |
import org.gvsig.expressionfield.project.documents.table.operators.Min; |
|
75 |
import org.gvsig.expressionfield.project.documents.table.operators.Minus; |
|
76 |
import org.gvsig.expressionfield.project.documents.table.operators.MoreEquals; |
|
77 |
import org.gvsig.expressionfield.project.documents.table.operators.MoreThan; |
|
78 |
import org.gvsig.expressionfield.project.documents.table.operators.Perimeter; |
|
79 |
import org.gvsig.expressionfield.project.documents.table.operators.Pi; |
|
80 |
import org.gvsig.expressionfield.project.documents.table.operators.Plus; |
|
81 |
import org.gvsig.expressionfield.project.documents.table.operators.PointX; |
|
82 |
import org.gvsig.expressionfield.project.documents.table.operators.PointY; |
|
83 |
import org.gvsig.expressionfield.project.documents.table.operators.Pow; |
|
84 |
import org.gvsig.expressionfield.project.documents.table.operators.Random; |
|
85 |
import org.gvsig.expressionfield.project.documents.table.operators.RecordIndex; |
|
86 |
import org.gvsig.expressionfield.project.documents.table.operators.Replace; |
|
87 |
import org.gvsig.expressionfield.project.documents.table.operators.Round; |
|
88 |
import org.gvsig.expressionfield.project.documents.table.operators.SetTimeDate; |
|
89 |
import org.gvsig.expressionfield.project.documents.table.operators.Sin; |
|
90 |
import org.gvsig.expressionfield.project.documents.table.operators.Sqrt; |
|
91 |
import org.gvsig.expressionfield.project.documents.table.operators.StartsWith; |
|
92 |
import org.gvsig.expressionfield.project.documents.table.operators.SubString; |
|
93 |
import org.gvsig.expressionfield.project.documents.table.operators.Tan; |
|
94 |
import org.gvsig.expressionfield.project.documents.table.operators.Times; |
|
95 |
import org.gvsig.expressionfield.project.documents.table.operators.ToDate; |
|
96 |
import org.gvsig.expressionfield.project.documents.table.operators.ToDegrees; |
|
97 |
import org.gvsig.expressionfield.project.documents.table.operators.ToLowerCase; |
|
98 |
import org.gvsig.expressionfield.project.documents.table.operators.ToNumber; |
|
99 |
import org.gvsig.expressionfield.project.documents.table.operators.ToRadians; |
|
100 |
import org.gvsig.expressionfield.project.documents.table.operators.ToString; |
|
101 |
import org.gvsig.expressionfield.project.documents.table.operators.ToUpperCase; |
|
102 |
import org.gvsig.expressionfield.project.documents.table.operators.Trim; |
|
103 |
import org.gvsig.fmap.dal.exception.DataException; |
|
104 |
import org.gvsig.tools.ToolsLocator; |
|
105 |
import org.gvsig.tools.extensionpoint.ExtensionPoint; |
|
106 |
import org.gvsig.tools.extensionpoint.ExtensionPointManager; |
|
107 |
import org.gvsig.utils.swing.threads.AbstractMonitorableTask; |
|
108 |
|
|
109 |
import org.slf4j.Logger; |
|
110 |
import org.slf4j.LoggerFactory; |
|
111 |
|
|
112 |
/** |
|
113 |
* @author Vicente Caballero Navarro |
|
114 |
*/ |
|
115 |
public class ExpressionFieldExtension extends Extension { |
|
116 |
|
|
117 |
private static Logger logger = LoggerFactory.getLogger(ExpressionFieldExtension.class); |
|
118 |
|
|
119 |
public static final String JYTHON = "jython"; |
|
120 |
private static BSFManager interpreter = new BSFManager(); |
|
121 |
private FeatureTableDocumentPanel table = null; |
|
122 |
private static ArrayList<IOperator> operators = new ArrayList<IOperator>(); |
|
123 |
|
|
124 |
public void initialize() { |
|
125 |
registerIcons(); |
|
126 |
registerOperations(); |
|
127 |
} |
|
128 |
|
|
129 |
public void execute(String actionCommand) { |
|
130 |
if ( "table-expression-field".equalsIgnoreCase(actionCommand) ) { |
|
131 |
org.gvsig.andami.ui.mdiManager.IWindow window = PluginServices.getMDIManager().getActiveWindow(); |
|
132 |
table = (FeatureTableDocumentPanel) window; |
|
133 |
if ( !table.getModel().getStore().isEditing() ) { |
|
134 |
int option = JOptionPane.showConfirmDialog((Component) PluginServices.getMainFrame(), PluginServices.getText(this, "is_not_in_editing_are_you_sure")); |
|
135 |
if ( option != JOptionPane.OK_OPTION ) { |
|
136 |
return; |
|
137 |
} |
|
138 |
} |
|
139 |
if ( operators.isEmpty() ) { |
|
140 |
PluginServices.cancelableBackgroundExecution(new EvalOperatorsTask()); |
|
141 |
} else { |
|
142 |
EvalExpressionDialog eed = new EvalExpressionDialog(table, interpreter, operators); |
|
143 |
PluginServices.getMDIManager().addWindow(eed); |
|
144 |
} |
|
145 |
} |
|
146 |
} |
|
147 |
|
|
148 |
public void postInitialize() { |
|
149 |
|
|
150 |
} |
|
151 |
|
|
152 |
public boolean isEnabled() { |
|
153 |
org.gvsig.andami.ui.mdiManager.IWindow window = PluginServices.getMDIManager().getActiveWindow(); |
|
154 |
if ( window instanceof FeatureTableDocumentPanel ) { |
|
155 |
FeatureTableDocumentPanel table = (FeatureTableDocumentPanel) window; |
|
156 |
int columnSelected = 0; |
|
157 |
try { |
|
158 |
columnSelected = table.getTablePanel().getTable().getSelectedColumnCount(); |
|
159 |
} catch (DataException e) { |
|
160 |
logger.error("Can't get selected column in table.", e); |
|
161 |
} |
|
162 |
if ( columnSelected > 0 && table.getModel().getStore().isEditing() ) { |
|
163 |
return true; |
|
164 |
} |
|
165 |
} |
|
166 |
return false; |
|
167 |
} |
|
168 |
|
|
169 |
public boolean isVisible() { |
|
170 |
|
|
171 |
org.gvsig.andami.ui.mdiManager.IWindow window = PluginServices.getMDIManager().getActiveWindow(); |
|
172 |
if ( window instanceof FeatureTableDocumentPanel ) { |
|
173 |
return true; |
|
174 |
} |
|
175 |
return false; |
|
176 |
} |
|
177 |
|
|
178 |
private void registerOperations() { |
|
179 |
ExtensionPointManager extensionPointsManager =ToolsLocator.getExtensionPointManager(); |
|
180 |
ExtensionPoint ep = extensionPointsManager.add("AplicationPreferences", ""); |
|
181 |
ep.append("fieldExpression", "", new FieldExpressionPage()); |
|
182 |
|
|
183 |
ExtensionPoint extensionPoints = ToolsLocator.getExtensionPointManager().add( |
|
184 |
"ColumnOperators", ""); |
|
185 |
extensionPoints.append(Abs.class.toString(), "", Abs.class); |
|
186 |
extensionPoints.append(Acos.class.toString(), "", Acos.class); |
|
187 |
extensionPoints.append(After.class.toString(), "", After.class); |
|
188 |
extensionPoints.append(Area.class.toString(), "", Area.class); |
|
189 |
extensionPoints.append(Asin.class.toString(), "", Asin.class); |
|
190 |
extensionPoints.append(Atan.class.toString(), "", Atan.class); |
|
191 |
extensionPoints.append(Acos.class.toString(), "", Acos.class); |
|
192 |
extensionPoints.append(Before.class.toString(), "", Before.class); |
|
193 |
extensionPoints.append(Ceil.class.toString(), "", Ceil.class); |
|
194 |
extensionPoints.append(Cos.class.toString(), "", Cos.class); |
|
195 |
extensionPoints.append(DateToString.class.toString(), "", DateToString.class); |
|
196 |
extensionPoints.append(Distinct.class.toString(), "", Distinct.class); |
|
197 |
extensionPoints.append(Division.class.toString(), "", Division.class); |
|
198 |
extensionPoints.append(E.class.toString(), "", E.class); |
|
199 |
extensionPoints.append(EndsWith.class.toString(), "", EndsWith.class); |
|
200 |
extensionPoints.append(Equal.class.toString(), "", Equal.class); |
|
201 |
extensionPoints.append(Equals.class.toString(), "", Equals.class); |
|
202 |
extensionPoints.append(Exp.class.toString(), "", Exp.class); |
|
203 |
extensionPoints.append(Floor.class.toString(), "", Floor.class); |
|
204 |
extensionPoints.append(Geometry.class.toString(), "", Geometry.class); |
|
205 |
extensionPoints.append(GetTimeDate.class.toString(), "", GetTimeDate.class); |
|
206 |
extensionPoints.append(IndexOf.class.toString(), "", IndexOf.class); |
|
207 |
extensionPoints.append(IsNumber.class.toString(), "", IsNumber.class); |
|
208 |
extensionPoints.append(LastIndexOf.class.toString(), "", LastIndexOf.class); |
|
209 |
extensionPoints.append(Length.class.toString(), "", Length.class); |
|
210 |
extensionPoints.append(LessEquals.class.toString(), "", LessEquals.class); |
|
211 |
extensionPoints.append(LessThan.class.toString(), "", LessThan.class); |
|
212 |
extensionPoints.append(Log.class.toString(), "", Log.class); |
|
213 |
extensionPoints.append(Max.class.toString(), "", Max.class); |
|
214 |
extensionPoints.append(Min.class.toString(), "", Min.class); |
|
215 |
extensionPoints.append(Minus.class.toString(), "", Minus.class); |
|
216 |
extensionPoints.append(MoreEquals.class.toString(), "", MoreEquals.class); |
|
217 |
extensionPoints.append(MoreThan.class.toString(), "", MoreThan.class); |
|
218 |
extensionPoints.append(Perimeter.class.toString(), "", Perimeter.class); |
|
219 |
extensionPoints.append(Pi.class.toString(), "", Pi.class); |
|
220 |
extensionPoints.append(Plus.class.toString(), "", Plus.class); |
|
221 |
extensionPoints.append(PointX.class.toString(), "", PointX.class); |
|
222 |
extensionPoints.append(PointY.class.toString(), "", PointY.class); |
|
223 |
extensionPoints.append(Pow.class.toString(), "", Pow.class); |
|
224 |
extensionPoints.append(Random.class.toString(), "", Random.class); |
|
225 |
|
|
226 |
// Added November 2013 |
|
227 |
extensionPoints.append(RecordIndex.class.toString(), "", RecordIndex.class); |
|
228 |
|
|
229 |
extensionPoints.append(Replace.class.toString(), "", Replace.class); |
|
230 |
extensionPoints.append(Round.class.toString(), "", Round.class); |
|
231 |
extensionPoints.append(SetTimeDate.class.toString(), "", SetTimeDate.class); |
|
232 |
extensionPoints.append(Sin.class.toString(), "", Sin.class); |
|
233 |
extensionPoints.append(Sqrt.class.toString(), "", Sqrt.class); |
|
234 |
extensionPoints.append(StartsWith.class.toString(), "", StartsWith.class); |
|
235 |
extensionPoints.append(SubString.class.toString(), "", SubString.class); |
|
236 |
extensionPoints.append(Tan.class.toString(), "", Tan.class); |
|
237 |
extensionPoints.append(Times.class.toString(), "", Times.class); |
|
238 |
extensionPoints.append(ToDate.class.toString(), "", ToDate.class); |
|
239 |
extensionPoints.append(ToDegrees.class.toString(), "", ToDegrees.class); |
|
240 |
extensionPoints.append(ToLowerCase.class.toString(), "", ToLowerCase.class); |
|
241 |
extensionPoints.append(ToNumber.class.toString(), "", ToNumber.class); |
|
242 |
extensionPoints.append(ToRadians.class.toString(), "", ToRadians.class); |
|
243 |
extensionPoints.append(ToString.class.toString(), "", ToString.class); |
|
244 |
extensionPoints.append(ToUpperCase.class.toString(), "", ToUpperCase.class); |
|
245 |
extensionPoints.append(Trim.class.toString(), "", Trim.class); |
|
246 |
} |
|
247 |
|
|
248 |
private void registerIcons() { |
|
249 |
IconThemeHelper.registerIcon("action", "table-expression-field", this); |
|
250 |
IconThemeHelper.registerIcon("preferences", "expression-field-preferences", this); |
|
251 |
} |
|
252 |
|
|
253 |
private class EvalOperatorsTask extends AbstractMonitorableTask { |
|
254 |
|
|
255 |
private ExtensionPoint extensionPoint; |
|
256 |
|
|
257 |
public EvalOperatorsTask() { |
|
258 |
setInitialStep(0); |
|
259 |
setDeterminatedProcess(true); |
|
260 |
setStatusMessage(PluginServices.getText(this, "charging_operators") + "..."); |
|
261 |
this.extensionPoint = ToolsLocator.getExtensionPointManager().get( |
|
262 |
"ColumnOperators"); |
|
263 |
setFinalStep(extensionPoint.getCount() + 1); |
|
264 |
} |
|
265 |
|
|
266 |
public void run() throws Exception { |
|
267 |
NotificationManager.addInfo(PluginServices.getText(this, "charging_operators")); |
|
268 |
long t1 = System.currentTimeMillis(); |
|
269 |
Iterator iterator = extensionPoint.iterator(); |
|
270 |
while ( iterator.hasNext() ) { |
|
271 |
try { |
|
272 |
if ( isCanceled() ) { |
|
273 |
return; |
|
274 |
} |
|
275 |
org.gvsig.tools.extensionpoint.ExtensionPoint.Extension obj = (org.gvsig.tools.extensionpoint.ExtensionPoint.Extension) iterator.next(); |
|
276 |
IOperator operator = (IOperator) extensionPoint.create(obj.getName()); |
|
277 |
|
|
278 |
operator.eval(interpreter); |
|
279 |
operators.add(operator); |
|
280 |
reportStep(); |
|
281 |
setNote(operator.getClass().getName()); |
|
282 |
} catch (InstantiationException e) { |
|
283 |
e.printStackTrace(); |
|
284 |
} catch (IllegalAccessException e) { |
|
285 |
e.printStackTrace(); |
|
286 |
} catch (ClassCastException e) { |
|
287 |
e.printStackTrace(); |
|
288 |
} |
|
289 |
} |
|
290 |
long t2 = System.currentTimeMillis(); |
|
291 |
System.out.println("Tiempo en evaluar y crear del extension point = " + (t2 - t1)); |
|
292 |
long t3 = System.currentTimeMillis(); |
|
293 |
System.out.println("Tiempo en a?adir los operadores correctos = " + (t3 - t2)); |
|
294 |
reportStep(); |
|
295 |
} |
|
296 |
|
|
297 |
public void finished() { |
|
298 |
if ( isCanceled() ) { |
|
299 |
return; |
|
300 |
} |
|
301 |
NotificationManager.addInfo(PluginServices.getText(this, "charged_operators")); |
|
302 |
EvalExpressionDialog eed = new EvalExpressionDialog(table, interpreter, operators); |
|
303 |
PluginServices.getMDIManager().addWindow(eed); |
|
304 |
} |
|
305 |
|
|
306 |
} |
|
307 |
} |
org.gvsig.expressionfield/tags/org.gvsig.expressionfield-2.0.96/src/main/java/org/gvsig/expressionfield/gui/FieldExpressionPage.java | ||
---|---|---|
1 |
/******************************************************************************* |
|
2 |
* |
|
3 |
* gvSIG. Desktop Geographic Information System. |
|
4 |
* |
|
5 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
6 |
* |
|
7 |
* This program is free software; you can redistribute it and/or |
|
8 |
* modify it under the terms of the GNU General Public License |
|
9 |
* as published by the Free Software Foundation; either version 3 |
|
10 |
* of the License, or (at your option) any later version. |
|
11 |
* |
|
12 |
* This program is distributed in the hope that it will be useful, |
|
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15 |
* GNU General Public License for more details. |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License |
|
18 |
* along with this program; if not, write to the Free Software |
|
19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
20 |
* MA 02110-1301, USA. |
|
21 |
* |
|
22 |
* For any additional information, do not hesitate to contact us |
|
23 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
24 |
* |
|
25 |
*******************************************************************************/ |
|
26 |
package org.gvsig.expressionfield.gui; |
|
27 |
|
|
28 |
import java.awt.event.MouseEvent; |
|
29 |
import java.awt.event.MouseListener; |
|
30 |
import java.util.prefs.Preferences; |
|
31 |
|
|
32 |
import javax.swing.ImageIcon; |
|
33 |
import javax.swing.JCheckBox; |
|
34 |
import javax.swing.JPanel; |
|
35 |
import javax.swing.JTextArea; |
|
36 |
import javax.swing.JTextField; |
|
37 |
|
|
38 |
import org.gvsig.andami.IconThemeHelper; |
|
39 |
import org.gvsig.andami.PluginServices; |
|
40 |
import org.gvsig.andami.preferences.AbstractPreferencePage; |
|
41 |
import org.gvsig.andami.preferences.StoreException; |
|
42 |
|
|
43 |
|
|
44 |
/** |
|
45 |
* @author Vicente Caballero Navarro |
|
46 |
*/ |
|
47 |
public class FieldExpressionPage extends AbstractPreferencePage { |
|
48 |
private static Preferences prefs = Preferences.userRoot().node( "fieldExpressionOptions" ); |
|
49 |
private JTextArea jTextArea = null; |
|
50 |
private JTextField txtLimit; |
|
51 |
private JCheckBox ckLimit=null; |
|
52 |
private ImageIcon icon; |
|
53 |
|
|
54 |
public FieldExpressionPage() { |
|
55 |
super(); |
|
56 |
|
|
57 |
icon = IconThemeHelper.getImageIcon("expression-field-preferences"); |
|
58 |
|
|
59 |
addComponent(getJTextArea()); |
|
60 |
|
|
61 |
addComponent(PluginServices.getText(this, "limit_rows_in_memory") + ":", |
|
62 |
txtLimit = new JTextField("", 15)); |
|
63 |
addComponent(ckLimit = new JCheckBox(PluginServices.getText(this, "without_limit"))); |
|
64 |
ckLimit.addMouseListener(new MouseListener() { |
|
65 |
public void mouseClicked(MouseEvent e) { |
|
66 |
if (ckLimit.isSelected()) { |
|
67 |
txtLimit.setText(PluginServices.getText(this, "without_limit")); |
|
68 |
}else { |
|
69 |
if (txtLimit.getText().equals(PluginServices.getText(this, "without_limit"))) |
|
70 |
txtLimit.setText("500000"); |
|
71 |
} |
|
72 |
|
|
73 |
} |
|
74 |
public void mouseEntered(MouseEvent e) { |
|
75 |
} |
|
76 |
public void mouseExited(MouseEvent e) { |
|
77 |
} |
|
78 |
public void mousePressed(MouseEvent e) { |
|
79 |
} |
|
80 |
public void mouseReleased(MouseEvent e) { |
|
81 |
} |
|
82 |
|
|
83 |
}); |
|
84 |
} |
|
85 |
|
|
86 |
public void initializeValues() { |
|
87 |
int limit = prefs.getInt("limit_rows_in_memory",-1); |
|
88 |
if (limit==-1) { |
|
89 |
ckLimit.setSelected(true); |
|
90 |
txtLimit.setText(PluginServices.getText(this,"without_limit")); |
|
91 |
}else { |
|
92 |
ckLimit.setSelected(false); |
|
93 |
txtLimit.setText(String.valueOf(limit)); |
|
94 |
} |
|
95 |
} |
|
96 |
|
|
97 |
public String getID() { |
|
98 |
return this.getClass().getName(); |
|
99 |
} |
|
100 |
|
|
101 |
public String getTitle() { |
|
102 |
return PluginServices.getText(this, "limit_rows_in_memory"); |
|
103 |
} |
|
104 |
|
|
105 |
public JPanel getPanel() { |
|
106 |
return this; |
|
107 |
} |
|
108 |
|
|
109 |
public void storeValues() throws StoreException { |
|
110 |
int limit; |
|
111 |
try{ |
|
112 |
if (ckLimit.isSelected()) { |
|
113 |
limit=-1; |
|
114 |
}else { |
|
115 |
// if (txtLimit.getText().equals(PluginServices.getText(this,"without_limit"))) { |
|
116 |
// limit=-1; |
|
117 |
// }else { |
|
118 |
limit=Integer.parseInt(txtLimit.getText()); |
|
119 |
} |
|
120 |
}catch (Exception e) { |
|
121 |
throw new StoreException(PluginServices.getText(this,"limit_rows_in_memory")+PluginServices.getText(this,"error")); |
|
122 |
} |
|
123 |
prefs.putInt("limit_rows_in_memory", limit); |
|
124 |
} |
|
125 |
|
|
126 |
public void initializeDefaults() { |
|
127 |
int limit=prefs.getInt("limit_rows_in_memory",-1); |
|
128 |
if (limit==-1) { |
|
129 |
ckLimit.setSelected(true); |
|
130 |
txtLimit.setText(PluginServices.getText(this,"without_limit")); |
|
131 |
}else { |
|
132 |
ckLimit.setSelected(false); |
|
133 |
txtLimit.setText(String.valueOf(limit)); |
|
134 |
} |
|
135 |
} |
|
136 |
|
|
137 |
public ImageIcon getIcon() { |
|
138 |
return icon; |
|
139 |
} |
|
140 |
/** |
|
141 |
* This method initializes jTextArea |
|
142 |
* |
|
143 |
* @return javax.swing.JTextArea |
|
144 |
*/ |
|
145 |
private JTextArea getJTextArea() { |
|
146 |
if (jTextArea == null) { |
|
147 |
jTextArea = new JTextArea(); |
|
148 |
jTextArea.setBounds(new java.awt.Rectangle(13,7,285,57)); |
|
149 |
jTextArea.setForeground(java.awt.Color.black); |
|
150 |
jTextArea.setBackground(java.awt.SystemColor.control); |
|
151 |
jTextArea.setRows(3); |
|
152 |
jTextArea.setWrapStyleWord(true); |
|
153 |
jTextArea.setLineWrap(true); |
|
154 |
jTextArea.setEditable(false); |
|
155 |
jTextArea.setText(PluginServices.getText(this,"specifies_the_limit_rows_in_memory_when_the_program_eval_the_expression")); |
|
156 |
} |
|
157 |
return jTextArea; |
|
158 |
} |
|
159 |
|
|
160 |
public boolean isValueChanged() { |
|
161 |
return super.hasChanged(); |
|
162 |
} |
|
163 |
|
|
164 |
public void setChangesApplied() { |
|
165 |
setChanged(false); |
|
166 |
} |
|
167 |
} |
org.gvsig.expressionfield/tags/org.gvsig.expressionfield-2.0.96/src/main/java/org/gvsig/expressionfield/project/documents/table/AbstractOperator.java | ||
---|---|---|
1 |
/******************************************************************************* |
|
2 |
* |
|
3 |
* gvSIG. Desktop Geographic Information System. |
|
4 |
* |
|
5 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
6 |
* |
|
7 |
* This program is free software; you can redistribute it and/or |
|
8 |
* modify it under the terms of the GNU General Public License |
|
9 |
* as published by the Free Software Foundation; either version 3 |
|
10 |
* of the License, or (at your option) any later version. |
|
11 |
* |
|
12 |
* This program is distributed in the hope that it will be useful, |
|
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15 |
* GNU General Public License for more details. |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License |
|
18 |
* along with this program; if not, write to the Free Software |
|
19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
20 |
* MA 02110-1301, USA. |
|
21 |
* |
|
22 |
* For any additional information, do not hesitate to contact us |
|
23 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
24 |
* |
|
25 |
*******************************************************************************/ |
|
26 |
package org.gvsig.expressionfield.project.documents.table; |
|
27 |
|
|
28 |
import org.gvsig.andami.PluginServices; |
|
29 |
|
|
30 |
/** |
|
31 |
* @author Vicente Caballero Navarro |
|
32 |
*/ |
|
33 |
public abstract class AbstractOperator implements IOperator{ |
|
34 |
private int type; |
|
35 |
|
|
36 |
public void setType(int type) { |
|
37 |
this.type=type; |
|
38 |
} |
|
39 |
public int getType() { |
|
40 |
return type; |
|
41 |
} |
|
42 |
public abstract String toString(); |
|
43 |
|
|
44 |
public String getTooltip(){ |
|
45 |
return PluginServices.getText(this,"operator")+": "+addText(PluginServices.getText(this,"parameter"))+"\n"+getDescription(); |
|
46 |
} |
|
47 |
public abstract String getDescription(); |
|
48 |
} |
org.gvsig.expressionfield/tags/org.gvsig.expressionfield-2.0.96/src/main/java/org/gvsig/expressionfield/project/documents/table/FeatureIndex.java | ||
---|---|---|
1 |
/******************************************************************************* |
|
2 |
* |
|
3 |
* gvSIG. Desktop Geographic Information System. |
|
4 |
* |
|
5 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
6 |
* |
|
7 |
* This program is free software; you can redistribute it and/or |
|
8 |
* modify it under the terms of the GNU General Public License |
|
9 |
* as published by the Free Software Foundation; either version 3 |
|
10 |
* of the License, or (at your option) any later version. |
|
11 |
* |
|
12 |
* This program is distributed in the hope that it will be useful, |
|
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15 |
* GNU General Public License for more details. |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License |
|
18 |
* along with this program; if not, write to the Free Software |
|
19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
20 |
* MA 02110-1301, USA. |
|
21 |
* |
|
22 |
* For any additional information, do not hesitate to contact us |
|
23 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
24 |
* |
|
25 |
*******************************************************************************/ |
|
26 |
package org.gvsig.expressionfield.project.documents.table; |
|
27 |
|
|
28 |
/** |
|
29 |
* Utility class to use in Jython bean |
|
30 |
* |
|
31 |
* @author jldominguez |
|
32 |
* |
|
33 |
*/ |
|
34 |
public class FeatureIndex { |
|
35 |
|
|
36 |
private long index = -1; |
|
37 |
|
|
38 |
public void next() { |
|
39 |
index++; |
|
40 |
} |
|
41 |
|
|
42 |
public void previous() { |
|
43 |
index--; |
|
44 |
} |
|
45 |
|
|
46 |
public long get() { |
|
47 |
return index; |
|
48 |
} |
|
49 |
|
|
50 |
public void set(long i) { |
|
51 |
index = i; |
|
52 |
} |
|
53 |
} |
org.gvsig.expressionfield/tags/org.gvsig.expressionfield-2.0.96/src/main/java/org/gvsig/expressionfield/project/documents/table/IOperator.java | ||
---|---|---|
1 |
/******************************************************************************* |
|
2 |
* |
|
3 |
* gvSIG. Desktop Geographic Information System. |
|
4 |
* |
|
5 |
* Copyright (C) 2007-2013 gvSIG Association. |
|
6 |
* |
|
7 |
* This program is free software; you can redistribute it and/or |
|
8 |
* modify it under the terms of the GNU General Public License |
|
9 |
* as published by the Free Software Foundation; either version 3 |
|
10 |
* of the License, or (at your option) any later version. |
|
11 |
* |
|
12 |
* This program is distributed in the hope that it will be useful, |
|
13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
15 |
* GNU General Public License for more details. |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License |
|
18 |
* along with this program; if not, write to the Free Software |
|
19 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
20 |
* MA 02110-1301, USA. |
|
21 |
* |
|
22 |
* For any additional information, do not hesitate to contact us |
|
23 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
24 |
* |
|
25 |
*******************************************************************************/ |
|
26 |
package org.gvsig.expressionfield.project.documents.table; |
|
27 |
|
|
28 |
import org.apache.bsf.BSFException; |
|
29 |
import org.apache.bsf.BSFManager; |
|
30 |
|
|
31 |
/** |
|
32 |
* @author Vicente Caballero Navarro |
|
33 |
*/ |
|
34 |
public interface IOperator { |
|
35 |
int NUMBER = 0; |
|
36 |
int STRING = 1; |
|
37 |
int DATE = 2; |
|
38 |
public String addText(String s); |
|
39 |
public String toString(); |
|
40 |
public void eval(BSFManager interpreter) throws BSFException ; |
|
41 |
public boolean isEnable(); |
|
42 |
public void setType(int fieldType); |
|
43 |
public String getTooltip(); |
|
44 |
} |
org.gvsig.expressionfield/tags/org.gvsig.expressionfield-2.0.96/src/main/java/org/gvsig/expressionfield/project/documents/table/gui/AdvancedPanelLayout.java | ||
---|---|---|
1 |
/* |
|
2 |
* To change this license header, choose License Headers in Project Properties. |
|
3 |
* To change this template file, choose Tools | Templates |
|
4 |
* and open the template in the editor. |
|
5 |
*/ |
|
6 |
package org.gvsig.expressionfield.project.documents.table.gui; |
|
7 |
|
|
8 |
/** |
|
9 |
* |
|
10 |
* @author jjdelcerro |
|
11 |
*/ |
|
12 |
public class AdvancedPanelLayout extends javax.swing.JPanel { |
|
13 |
|
|
14 |
/** |
|
15 |
* Creates new form AdvancedPanel |
|
16 |
*/ |
|
17 |
public AdvancedPanelLayout() { |
|
18 |
initComponents(); |
|
19 |
} |
|
20 |
|
|
21 |
/** |
|
22 |
* This method is called from within the constructor to initialize the form. |
|
23 |
* WARNING: Do NOT modify this code. The content of this method is always |
|
24 |
* regenerated by the Form Editor. |
|
25 |
*/ |
|
26 |
@SuppressWarnings("unchecked") |
|
27 |
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents |
|
28 |
private void initComponents() { |
|
29 |
java.awt.GridBagConstraints gridBagConstraints; |
|
30 |
|
|
31 |
filler2 = new javax.swing.Box.Filler(new java.awt.Dimension(4, 4), new java.awt.Dimension(4, 4), new java.awt.Dimension(4, 4)); |
|
32 |
butLoad = new javax.swing.JButton(); |
|
33 |
butSave = new javax.swing.JButton(); |
|
34 |
butTest = new javax.swing.JButton(); |
|
35 |
filler3 = new javax.swing.Box.Filler(new java.awt.Dimension(0, 0), new java.awt.Dimension(0, 0), new java.awt.Dimension(32767, 0)); |
|
36 |
filler4 = new javax.swing.Box.Filler(new java.awt.Dimension(4, 4), new java.awt.Dimension(4, 4), new java.awt.Dimension(4, 4)); |
|
37 |
editorContainer = new javax.swing.JPanel(); |
|
38 |
|
|
39 |
java.awt.GridBagLayout layout = new java.awt.GridBagLayout(); |
|
40 |
layout.columnWidths = new int[] {0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0}; |
|
41 |
layout.rowHeights = new int[] {0, 5, 0, 5, 0, 5, 0}; |
|
42 |
setLayout(layout); |
|
43 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
44 |
gridBagConstraints.gridx = 0; |
|
45 |
gridBagConstraints.gridy = 0; |
|
46 |
add(filler2, gridBagConstraints); |
|
47 |
|
|
48 |
butLoad.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gvsig/expressionfield/project/documents/table/gui/document-open.png"))); // NOI18N |
|
49 |
butLoad.setToolTipText("Load script from file"); // NOI18N |
|
50 |
butLoad.setBorder(null); |
|
51 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
52 |
gridBagConstraints.gridx = 2; |
|
53 |
gridBagConstraints.gridy = 2; |
|
54 |
add(butLoad, gridBagConstraints); |
|
55 |
|
|
56 |
butSave.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gvsig/expressionfield/project/documents/table/gui/document-save.png"))); // NOI18N |
|
57 |
butSave.setToolTipText("Save script to file"); |
|
58 |
butSave.setBorder(null); |
|
59 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
60 |
gridBagConstraints.gridx = 4; |
|
61 |
gridBagConstraints.gridy = 2; |
|
62 |
add(butSave, gridBagConstraints); |
|
63 |
|
|
64 |
butTest.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/gvsig/expressionfield/project/documents/table/gui/tools-scripting-launcher.png"))); // NOI18N |
|
65 |
butTest.setToolTipText("Run script for testing"); |
|
66 |
butTest.setBorder(null); |
|
67 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
68 |
gridBagConstraints.gridx = 6; |
|
69 |
gridBagConstraints.gridy = 2; |
|
70 |
add(butTest, gridBagConstraints); |
|
71 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
72 |
gridBagConstraints.gridx = 8; |
|
73 |
gridBagConstraints.gridy = 2; |
|
74 |
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL; |
|
75 |
gridBagConstraints.weightx = 0.1; |
|
76 |
add(filler3, gridBagConstraints); |
|
77 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
78 |
gridBagConstraints.gridx = 10; |
|
79 |
gridBagConstraints.gridy = 6; |
|
80 |
add(filler4, gridBagConstraints); |
|
81 |
|
|
82 |
editorContainer.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); |
|
83 |
gridBagConstraints = new java.awt.GridBagConstraints(); |
|
84 |
gridBagConstraints.gridx = 2; |
|
85 |
gridBagConstraints.gridy = 4; |
|
86 |
gridBagConstraints.gridwidth = 7; |
|
87 |
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH; |
|
88 |
gridBagConstraints.weightx = 0.1; |
|
89 |
gridBagConstraints.weighty = 0.1; |
|
90 |
add(editorContainer, gridBagConstraints); |
|
91 |
}// </editor-fold>//GEN-END:initComponents |
|
92 |
|
|
93 |
|
|
94 |
// Variables declaration - do not modify//GEN-BEGIN:variables |
|
95 |
protected javax.swing.JButton butLoad; |
|
96 |
protected javax.swing.JButton butSave; |
|
97 |
protected javax.swing.JButton butTest; |
|
98 |
protected javax.swing.JPanel editorContainer; |
|
99 |
protected javax.swing.Box.Filler filler2; |
|
100 |
protected javax.swing.Box.Filler filler3; |
|
101 |
protected javax.swing.Box.Filler filler4; |
|
102 |
// End of variables declaration//GEN-END:variables |
|
103 |
} |
org.gvsig.expressionfield/tags/org.gvsig.expressionfield-2.0.96/src/main/java/org/gvsig/expressionfield/project/documents/table/gui/AdvancedPanel.java | ||
---|---|---|
1 |
package org.gvsig.expressionfield.project.documents.table.gui; |
|
2 |
|
|
3 |
import java.awt.BorderLayout; |
|
4 |
import java.awt.event.ActionEvent; |
|
5 |
import java.awt.event.ActionListener; |
|
6 |
import java.io.File; |
|
7 |
import java.io.IOException; |
|
8 |
import javax.swing.JFileChooser; |
|
9 |
import javax.swing.JOptionPane; |
|
10 |
import org.apache.bsf.BSFException; |
|
11 |
import org.apache.bsf.BSFManager; |
|
12 |
import org.apache.commons.io.FileUtils; |
|
13 |
import org.apache.commons.lang.StringUtils; |
|
14 |
import org.gvsig.app.ApplicationLocator; |
|
15 |
import org.gvsig.app.ApplicationManager; |
|
16 |
import org.gvsig.expressionfield.ExpressionFieldExtension; |
|
17 |
import org.gvsig.tools.ToolsLocator; |
|
18 |
import org.gvsig.tools.i18n.I18nManager; |
|
19 |
import org.gvsig.utils.GenericFileFilter; |
|
20 |
import org.slf4j.Logger; |
|
21 |
import org.slf4j.LoggerFactory; |
|
22 |
import org.gvsig.expressionfield.project.documents.table.gui.syntaxhighlight.JRSyntaxTextArea; |
|
23 |
import org.gvsig.expressionfield.project.documents.table.gui.syntaxhighlight.SyntaxtHighlightTextComponent; |
|
24 |
|
|
25 |
public class AdvancedPanel extends AdvancedPanelLayout { |
|
26 |
|
|
27 |
private static Logger logger = LoggerFactory.getLogger(AdvancedPanel.class); |
|
28 |
|
|
29 |
private BSFManager interpreter = null; |
|
30 |
private SyntaxtHighlightTextComponent textArea = null; |
|
31 |
|
|
32 |
public AdvancedPanel(BSFManager interpreter) { |
|
33 |
super(); |
|
34 |
this.interpreter = interpreter; |
|
35 |
initComponents(); |
|
36 |
translate(); |
|
37 |
} |
|
38 |
|
|
39 |
private void translate() { |
|
40 |
I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
41 |
this.butLoad.setToolTipText(i18nManager.getTranslation("_Load_script_from_file")); |
|
42 |
this.butSave.setToolTipText(i18nManager.getTranslation("_Save_script_to_file")); |
|
43 |
this.butTest.setToolTipText(i18nManager.getTranslation("_Run_script_for_testing")); |
|
44 |
} |
|
45 |
|
|
46 |
private void initComponents() { |
|
47 |
// this.butLoad.setIcon(...); |
|
48 |
// this.butSave.setIcon(...); |
|
49 |
// this.butTest.setIcon(...); |
|
50 |
this.editorContainer.setLayout(new BorderLayout()); |
|
51 |
this.textArea = new JRSyntaxTextArea(); |
|
52 |
this.editorContainer.add(textArea.getJTextComponent(), BorderLayout.CENTER); |
|
53 |
|
|
54 |
this.butLoad.addActionListener(new ActionListener() { |
|
55 |
public void actionPerformed(ActionEvent ae) { |
|
56 |
doLoad(); |
|
57 |
} |
|
58 |
}); |
|
59 |
this.butSave.addActionListener(new ActionListener() { |
|
60 |
public void actionPerformed(ActionEvent ae) { |
|
61 |
doSave(); |
|
62 |
} |
|
63 |
}); |
|
64 |
this.butTest.addActionListener(new ActionListener() { |
|
65 |
public void actionPerformed(ActionEvent ae) { |
|
66 |
doTest(); |
|
67 |
} |
|
68 |
}); |
|
69 |
} |
|
70 |
|
|
71 |
private void doLoad() { |
|
72 |
final I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
73 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
74 |
File files[] = application.showChooserDialog( |
|
75 |
i18nManager.getTranslation("_Seleccione_el_script_a_cargar"), |
|
76 |
JFileChooser.OPEN_DIALOG, |
|
77 |
JFileChooser.FILES_ONLY, |
|
78 |
false, |
|
79 |
null, |
|
80 |
new GenericFileFilter(new String[]{"py", "txt"}, i18nManager.getTranslation("python")), |
|
81 |
false |
|
82 |
); |
|
83 |
if (files != null && files.length >= 1) { |
|
84 |
String code; |
|
85 |
try { |
|
86 |
code = FileUtils.readFileToString(files[0]); |
|
87 |
} catch (IOException ex) { |
|
88 |
logger.warn("Can't read file '" + files[0].getAbsolutePath() + "'.", ex); |
|
89 |
application.messageDialog( |
|
90 |
i18nManager.getTranslation("_No_se_puede_cargar_el_fichero_seleccionado"), |
|
91 |
i18nManager.getTranslation("_Atencion"), |
|
92 |
JOptionPane.WARNING_MESSAGE); |
|
93 |
return; |
|
94 |
} |
|
95 |
this.textArea.setText(code); |
|
96 |
} |
|
97 |
} |
|
98 |
|
|
99 |
private void doSave() { |
|
100 |
final I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
101 |
ApplicationManager application = ApplicationLocator.getManager(); |
|
102 |
String code = this.getCode(); |
|
103 |
if (code == null) { |
|
104 |
application.messageDialog( |
|
105 |
i18nManager.getTranslation("_No_hay_ningun_script_cargado"), |
|
106 |
i18nManager.getTranslation("_Informacion"), |
|
107 |
JOptionPane.INFORMATION_MESSAGE); |
|
108 |
return; |
|
109 |
} |
|
110 |
File files[] = application.showChooserDialog( |
|
111 |
i18nManager.getTranslation("_Seleccione_el_script_a_cargar"), |
|
112 |
JFileChooser.SAVE_DIALOG, |
|
113 |
JFileChooser.FILES_ONLY, |
|
114 |
false, |
|
115 |
null, |
|
116 |
new GenericFileFilter(new String[]{"py", "txt"}, i18nManager.getTranslation("python")), |
|
117 |
false |
|
118 |
); |
|
119 |
if (files != null && files.length >= 1) { |
|
120 |
try { |
|
121 |
FileUtils.writeStringToFile(files[0], code); |
|
122 |
} catch (IOException ex) { |
|
123 |
logger.warn("Can't write file '" + files[0].getAbsolutePath() + "'.", ex); |
|
124 |
application.messageDialog( |
|
125 |
i18nManager.getTranslation("_No_se_puede_guardar_en_el_fichero_seleccionado"), |
|
126 |
i18nManager.getTranslation("_Atencion"), |
|
127 |
JOptionPane.WARNING_MESSAGE); |
|
128 |
return; |
|
129 |
} |
|
130 |
} |
|
131 |
} |
|
132 |
|
|
133 |
private void doTest() { |
|
134 |
final I18nManager i18nManager = ToolsLocator.getI18nManager(); |
|
135 |
final ApplicationManager application = ApplicationLocator.getManager(); |
|
136 |
String code = this.getCode(); |
|
137 |
if (code == null) { |
|
138 |
application.messageDialog( |
|
139 |
i18nManager.getTranslation("_No_hay_ningun_script_cargado"), |
|
140 |
i18nManager.getTranslation("_Informacion"), |
|
141 |
JOptionPane.INFORMATION_MESSAGE); |
|
142 |
return; |
|
143 |
} |
|
144 |
try { |
|
145 |
interpreter.exec(ExpressionFieldExtension.JYTHON, null, -1, -1, code); |
|
146 |
} catch (BSFException ex) { |
|
147 |
logger.warn("Can't execute script:\n" + code + "\n", ex); |
|
148 |
application.messageDialog( |
|
149 |
i18nManager.getTranslation("_Se_han_producido_errores") + "\n\n" + ex.getMessage(), |
|
150 |
i18nManager.getTranslation("_Atencion"), |
|
151 |
JOptionPane.WARNING_MESSAGE); |
|
152 |
return; |
|
153 |
} |
|
154 |
application.messageDialog( |
|
155 |
i18nManager.getTranslation("_Ejecucion_correcta"), |
|
156 |
i18nManager.getTranslation("_Informacion"), |
|
157 |
JOptionPane.INFORMATION_MESSAGE); |
|
158 |
} |
|
159 |
|
|
160 |
public String getCode() { |
|
161 |
String code = this.textArea.getText(); |
|
162 |
code = code.trim(); |
|
163 |
if (StringUtils.isBlank(code)) { |
|
164 |
return null; |
|
165 |
} |
|
166 |
return code; |
|
167 |
} |
|
168 |
|
|
169 |
} |
org.gvsig.expressionfield/tags/org.gvsig.expressionfield-2.0.96/src/main/java/org/gvsig/expressionfield/project/documents/table/gui/AdvancedPanelLayout.form | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
|
|
3 |
<Form version="1.8" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JPanelFormInfo"> |
|
4 |
<AuxValues> |
|
5 |
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> |
|
6 |
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> |
|
7 |
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> |
|
8 |
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> |
|
9 |
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> |
|
10 |
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> |
|
11 |
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> |
|
12 |
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> |
|
13 |
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="4"/> |
|
14 |
<AuxValue name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/> |
|
15 |
</AuxValues> |
|
16 |
<SubComponents> |
|
17 |
<Component class="javax.swing.Box$Filler" name="filler2"> |
|
18 |
<Properties> |
|
19 |
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> |
|
20 |
<Dimension value="[4, 4]"/> |
|
21 |
</Property> |
|
22 |
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> |
|
23 |
<Dimension value="[4, 4]"/> |
|
24 |
</Property> |
|
25 |
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> |
|
26 |
<Dimension value="[4, 4]"/> |
|
27 |
</Property> |
|
28 |
</Properties> |
|
29 |
<AuxValues> |
|
30 |
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.RigidArea"/> |
|
31 |
</AuxValues> |
|
32 |
<Constraints> |
|
33 |
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> |
|
34 |
<GridBagConstraints gridX="0" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/> |
|
35 |
</Constraint> |
|
36 |
</Constraints> |
|
37 |
</Component> |
|
38 |
<Component class="javax.swing.JButton" name="butLoad"> |
|
39 |
<Properties> |
|
40 |
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> |
|
41 |
<Image iconType="3" name="/org/gvsig/expressionfield/project/documents/table/gui/document-open.png"/> |
|
42 |
</Property> |
|
43 |
<Property name="toolTipText" type="java.lang.String" value="Load script from file" noResource="true"/> |
|
44 |
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> |
|
45 |
<Border info="null"/> |
|
46 |
</Property> |
|
47 |
</Properties> |
|
48 |
<Constraints> |
|
49 |
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> |
|
50 |
<GridBagConstraints gridX="2" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/> |
|
51 |
</Constraint> |
|
52 |
</Constraints> |
|
53 |
</Component> |
|
54 |
<Component class="javax.swing.JButton" name="butSave"> |
|
55 |
<Properties> |
|
56 |
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> |
|
57 |
<Image iconType="3" name="/org/gvsig/expressionfield/project/documents/table/gui/document-save.png"/> |
|
58 |
</Property> |
|
59 |
<Property name="toolTipText" type="java.lang.String" value="Save script to file"/> |
|
60 |
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> |
|
61 |
<Border info="null"/> |
|
62 |
</Property> |
|
63 |
</Properties> |
|
64 |
<Constraints> |
|
65 |
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> |
|
66 |
<GridBagConstraints gridX="4" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/> |
|
67 |
</Constraint> |
|
68 |
</Constraints> |
|
69 |
</Component> |
|
70 |
<Component class="javax.swing.JButton" name="butTest"> |
|
71 |
<Properties> |
|
72 |
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> |
|
73 |
<Image iconType="3" name="/org/gvsig/expressionfield/project/documents/table/gui/tools-scripting-launcher.png"/> |
|
74 |
</Property> |
|
75 |
<Property name="toolTipText" type="java.lang.String" value="Run script for testing"/> |
|
76 |
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> |
|
77 |
<Border info="null"/> |
|
78 |
</Property> |
|
79 |
</Properties> |
|
80 |
<Constraints> |
|
81 |
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> |
|
82 |
<GridBagConstraints gridX="6" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/> |
|
83 |
</Constraint> |
|
84 |
</Constraints> |
|
85 |
</Component> |
|
86 |
<Component class="javax.swing.Box$Filler" name="filler3"> |
|
87 |
<Properties> |
|
88 |
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> |
|
89 |
<Dimension value="[32767, 0]"/> |
|
90 |
</Property> |
|
91 |
</Properties> |
|
92 |
<AuxValues> |
|
93 |
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.HorizontalGlue"/> |
|
94 |
</AuxValues> |
|
95 |
<Constraints> |
|
96 |
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> |
|
97 |
<GridBagConstraints gridX="8" gridY="2" gridWidth="1" gridHeight="1" fill="2" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.1" weightY="0.0"/> |
|
98 |
</Constraint> |
|
99 |
</Constraints> |
|
100 |
</Component> |
|
101 |
<Component class="javax.swing.Box$Filler" name="filler4"> |
|
102 |
<Properties> |
|
103 |
<Property name="maximumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> |
|
104 |
<Dimension value="[4, 4]"/> |
|
105 |
</Property> |
|
106 |
<Property name="minimumSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> |
|
107 |
<Dimension value="[4, 4]"/> |
|
108 |
</Property> |
|
109 |
<Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor"> |
|
110 |
<Dimension value="[4, 4]"/> |
|
111 |
</Property> |
|
112 |
</Properties> |
|
113 |
<AuxValues> |
|
114 |
<AuxValue name="classDetails" type="java.lang.String" value="Box.Filler.RigidArea"/> |
|
115 |
</AuxValues> |
|
116 |
<Constraints> |
|
117 |
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> |
|
118 |
<GridBagConstraints gridX="10" gridY="6" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.0" weightY="0.0"/> |
|
119 |
</Constraint> |
|
120 |
</Constraints> |
|
121 |
</Component> |
|
122 |
<Container class="javax.swing.JPanel" name="editorContainer"> |
|
123 |
<Properties> |
|
124 |
<Property name="border" type="javax.swing.border.Border" editor="org.netbeans.modules.form.editors2.BorderEditor"> |
|
125 |
<Border info="org.netbeans.modules.form.compat2.border.LineBorderInfo"> |
|
126 |
<LineBorder/> |
|
127 |
</Border> |
|
128 |
</Property> |
|
129 |
</Properties> |
|
130 |
<Constraints> |
|
131 |
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> |
|
132 |
<GridBagConstraints gridX="2" gridY="4" gridWidth="7" gridHeight="1" fill="1" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="10" weightX="0.1" weightY="0.1"/> |
|
133 |
</Constraint> |
|
134 |
</Constraints> |
|
135 |
|
|
136 |
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignFlowLayout"/> |
|
137 |
</Container> |
|
138 |
</SubComponents> |
|
139 |
<LayoutCode> |
|
140 |
<CodeStatement> |
|
141 |
<CodeExpression id="1_layout"> |
|
142 |
<CodeVariable name="layout" type="4096" declaredType="java.awt.GridBagLayout"/> |
|
143 |
<ExpressionOrigin> |
|
144 |
<ExpressionProvider type="CodeConstructor"> |
|
145 |
<CodeConstructor class="java.awt.GridBagLayout" parameterTypes=""/> |
|
146 |
</ExpressionProvider> |
|
147 |
</ExpressionOrigin> |
|
148 |
</CodeExpression> |
|
149 |
<StatementProvider type="CodeExpression"> |
|
150 |
<CodeExpression id="1_layout"/> |
|
151 |
</StatementProvider> |
|
152 |
</CodeStatement> |
|
153 |
<CodeStatement> |
|
154 |
<CodeExpression id="1_layout"/> |
|
155 |
<StatementProvider type="CodeField"> |
|
156 |
<CodeField name="columnWidths" class="java.awt.GridBagLayout"/> |
|
157 |
</StatementProvider> |
|
158 |
<Parameters> |
|
159 |
<CodeExpression id="2"> |
|
160 |
<ExpressionOrigin> |
|
161 |
<Value type="[I" editor="org.netbeans.modules.form.layoutsupport.delegates.GridBagLayoutSupport$IntArrayPropertyEditor"> |
|
162 |
<PropertyValue value="[0, 5, 0, 5, 0, 5, 0, 5, 0, 5, 0]"/> |
|
163 |
</Value> |
|
164 |
</ExpressionOrigin> |
|
165 |
</CodeExpression> |
|
166 |
</Parameters> |
|
167 |
</CodeStatement> |
|
168 |
<CodeStatement> |
|
169 |
<CodeExpression id="1_layout"/> |
|
170 |
<StatementProvider type="CodeField"> |
|
171 |
<CodeField name="rowHeights" class="java.awt.GridBagLayout"/> |
|
172 |
</StatementProvider> |
|
173 |
<Parameters> |
|
174 |
<CodeExpression id="3"> |
|
175 |
<ExpressionOrigin> |
|
176 |
<Value type="[I" editor="org.netbeans.modules.form.layoutsupport.delegates.GridBagLayoutSupport$IntArrayPropertyEditor"> |
|
177 |
<PropertyValue value="[0, 5, 0, 5, 0, 5, 0]"/> |
|
178 |
</Value> |
|
179 |
</ExpressionOrigin> |
|
180 |
</CodeExpression> |
|
181 |
</Parameters> |
|
182 |
</CodeStatement> |
|
183 |
<CodeStatement> |
|
184 |
<CodeExpression id="4"> |
|
185 |
<ExpressionOrigin> |
|
186 |
<ExpressionProvider type="ComponentRef"> |
|
187 |
<ComponentRef name="."/> |
|
188 |
</ExpressionProvider> |
|
189 |
</ExpressionOrigin> |
|
190 |
</CodeExpression> |
|
191 |
<StatementProvider type="CodeMethod"> |
|
192 |
<CodeMethod name="setLayout" class="java.awt.Container" parameterTypes="java.awt.LayoutManager"/> |
|
193 |
</StatementProvider> |
|
194 |
<Parameters> |
|
195 |
<CodeExpression id="1_layout"/> |
|
196 |
</Parameters> |
|
197 |
</CodeStatement> |
|
198 |
<CodeStatement> |
|
199 |
<CodeExpression id="5_gridBagConstraints"> |
|
200 |
<CodeVariable name="gridBagConstraints" type="20480" declaredType="java.awt.GridBagConstraints"/> |
|
201 |
<ExpressionOrigin> |
|
202 |
<ExpressionProvider type="CodeConstructor"> |
|
203 |
<CodeConstructor class="java.awt.GridBagConstraints" parameterTypes=""/> |
|
204 |
</ExpressionProvider> |
|
205 |
</ExpressionOrigin> |
|
206 |
</CodeExpression> |
|
207 |
<StatementProvider type="CodeExpression"> |
|
208 |
<CodeExpression id="5_gridBagConstraints"/> |
|
209 |
</StatementProvider> |
|
210 |
</CodeStatement> |
|
211 |
<CodeStatement> |
|
212 |
<CodeExpression id="5_gridBagConstraints"/> |
|
213 |
<StatementProvider type="CodeField"> |
|
214 |
<CodeField name="gridx" class="java.awt.GridBagConstraints"/> |
|
215 |
</StatementProvider> |
|
216 |
<Parameters> |
|
217 |
<CodeExpression id="6"> |
|
218 |
<ExpressionOrigin> |
|
219 |
<Value type="int" value="0"/> |
|
220 |
</ExpressionOrigin> |
|
221 |
</CodeExpression> |
|
222 |
</Parameters> |
|
223 |
</CodeStatement> |
|
224 |
<CodeStatement> |
|
225 |
<CodeExpression id="5_gridBagConstraints"/> |
|
226 |
<StatementProvider type="CodeField"> |
|
227 |
<CodeField name="gridy" class="java.awt.GridBagConstraints"/> |
|
228 |
</StatementProvider> |
|
229 |
<Parameters> |
|
230 |
<CodeExpression id="7"> |
|
231 |
<ExpressionOrigin> |
|
232 |
<Value type="int" value="0"/> |
|
233 |
</ExpressionOrigin> |
|
234 |
</CodeExpression> |
|
235 |
</Parameters> |
|
236 |
</CodeStatement> |
|
237 |
<CodeStatement> |
|
238 |
<CodeExpression id="4"/> |
|
239 |
<StatementProvider type="CodeMethod"> |
|
240 |
<CodeMethod name="add" class="java.awt.Container" parameterTypes="java.awt.Component, java.lang.Object"/> |
|
241 |
</StatementProvider> |
|
242 |
<Parameters> |
|
243 |
<CodeExpression id="8_filler2"> |
|
244 |
<CodeVariable name="filler2" type="8196" declaredType="javax.swing.Box$Filler"/> |
|
245 |
<ExpressionOrigin> |
|
246 |
<ExpressionProvider type="ComponentRef"> |
|
247 |
<ComponentRef name="filler2"/> |
|
248 |
</ExpressionProvider> |
|
249 |
</ExpressionOrigin> |
|
250 |
</CodeExpression> |
|
251 |
<CodeExpression id="5_gridBagConstraints"/> |
|
252 |
</Parameters> |
|
253 |
</CodeStatement> |
|
254 |
<CodeStatement> |
|
255 |
<CodeExpression id="9_gridBagConstraints"> |
|
256 |
<CodeVariable name="gridBagConstraints"/> |
|
257 |
<ExpressionOrigin> |
|
258 |
<ExpressionProvider type="CodeConstructor"> |
|
259 |
<CodeConstructor class="java.awt.GridBagConstraints" parameterTypes=""/> |
|
260 |
</ExpressionProvider> |
|
261 |
</ExpressionOrigin> |
|
262 |
</CodeExpression> |
|
263 |
<StatementProvider type="CodeExpression"> |
|
264 |
<CodeExpression id="9_gridBagConstraints"/> |
|
265 |
</StatementProvider> |
|
266 |
</CodeStatement> |
|
267 |
<CodeStatement> |
|
268 |
<CodeExpression id="9_gridBagConstraints"/> |
|
269 |
<StatementProvider type="CodeField"> |
|
270 |
<CodeField name="gridx" class="java.awt.GridBagConstraints"/> |
|
271 |
</StatementProvider> |
|
272 |
<Parameters> |
|
273 |
<CodeExpression id="10"> |
|
274 |
<ExpressionOrigin> |
|
275 |
<Value type="int" value="2"/> |
|
276 |
</ExpressionOrigin> |
Also available in: Unified diff