Revision 9533

View differences:

org.gvsig.legend.vectorfilterexpression.app.mainplugin/tags/org.gvsig.legend.vectorfilterexpression.app.mainplugin-1.0.228/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.legend.vectorfilterexpression.app.mainplugin</artifactId>
7
    <name>${project.artifactId}</name>
8
    <version>1.0.228</version>
9

  
10
    <parent>
11
        <groupId>org.gvsig</groupId>
12
        <artifactId>org.gvsig.desktop</artifactId>
13
        <version>2.0.430</version>
14
    </parent>
15

  
16
    <url>https://devel.gvsig.org/redmine/projects/gvsig-base-legends</url>
17

  
18
    <scm>
19
        <connection>scm:svn:https://devel.gvsig.org/svn/gvsig-base-legends/org.gvsig.legend.vectorfilterexpression.app.mainplugin/tags/org.gvsig.legend.vectorfilterexpression.app.mainplugin-1.0.228</connection>
20
        <developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-base-legends/org.gvsig.legend.vectorfilterexpression.app.mainplugin/tags/org.gvsig.legend.vectorfilterexpression.app.mainplugin-1.0.228</developerConnection>
21
        <url>scm:svn:https://devel.gvsig.org/svn/gvsig-base-legends/org.gvsig.legend.vectorfilterexpression.app.mainplugin/tags/org.gvsig.legend.vectorfilterexpression.app.mainplugin-1.0.228</url>
22
    </scm>
23
    <repositories>
24
        <repository>
25
            <id>gvsig-public-http-repository</id>
26
            <name>gvSIG maven public HTTP repository</name>
27
            <url>http://devel.gvsig.org/m2repo/j2se</url>
28
            <releases>
29
                <enabled>true</enabled>
30
                <updatePolicy>daily</updatePolicy>
31
                <checksumPolicy>warn</checksumPolicy>
32
            </releases>
33
            <snapshots>
34
                <enabled>true</enabled>
35
                <updatePolicy>daily</updatePolicy>
36
                <checksumPolicy>warn</checksumPolicy>
37
            </snapshots>
38
        </repository>
39
    </repositories>
40

  
41
    <description>Vector legend: Filter by expression. For each feature, the symbol is only visible if the expression is evaluated to true.</description>
42
    <build>
43

  
44
        <plugins>
45

  
46
            <plugin>
47
                <artifactId>maven-release-plugin</artifactId>
48
                <configuration>
49
                    <tagBase>https://devel.gvsig.org/svn/gvsig-base-legends/org.gvsig.legend.vectorfilterexpression.app.mainplugin/tags</tagBase>
50
                </configuration>
51
            </plugin>
52

  
53
        </plugins>
54
    </build>
55
    <dependencies>
56
        <dependency>
57
            <groupId>org.gvsig</groupId>
58
            <artifactId>org.gvsig.app.mainplugin</artifactId>
59
        </dependency>
60
        <dependency>
61
            <groupId>org.gvsig</groupId>
62
            <artifactId>org.gvsig.andami</artifactId>
63
        </dependency>
64
        <dependency>
65
            <groupId>org.gvsig</groupId>
66
            <artifactId>org.gvsig.symbology.lib.api</artifactId>
67
        </dependency>
68
        <dependency>
69
            <groupId>org.gvsig</groupId>
70
            <artifactId>org.gvsig.symbology.lib.impl</artifactId>
71
        </dependency>
72
        <dependency>
73
            <groupId>org.gvsig</groupId>
74
            <artifactId>org.gvsig.symbology.swing.api</artifactId>
75
        </dependency>
76
        <dependency>
77
            <groupId>org.gvsig</groupId>
78
            <artifactId>org.gvsig.fmap.mapcontext.api</artifactId>
79
        </dependency>
80
        <dependency>
81
            <groupId>org.gvsig</groupId>
82
            <artifactId>org.gvsig.utils</artifactId>
83
        </dependency>
84
        <dependency>
85
            <groupId>org.gvsig</groupId>
86
            <artifactId>org.gvsig.fmap.dal.api</artifactId>
87
        </dependency>
88

  
89
        <dependency>
90
            <groupId>org.gvsig</groupId>
91
            <artifactId>org.gvsig.i18n</artifactId>
92
        </dependency>
93

  
94
        <dependency>
95
            <groupId>org.gvsig</groupId>
96
            <artifactId>org.gvsig.fmap.geometry.api</artifactId>
97
        </dependency>
98

  
99
        <dependency>
100
            <groupId>org.gvsig</groupId>
101
            <artifactId>org.gvsig.tools.lib</artifactId>
102
        </dependency>
103
        <dependency>
104
            <groupId>org.gvsig</groupId>
105
            <artifactId>org.gvsig.ui</artifactId>
106
        </dependency>
107
        <dependency>
108
            <groupId>org.gvsig</groupId>
109
            <artifactId>org.gvsig.projection.api</artifactId>
110
        </dependency>
111
        <dependency>
112
            <groupId>org.gvsig</groupId>
113
            <artifactId>org.gvsig.metadata.lib.basic.api</artifactId>
114
        </dependency>
115

  
116
        <dependency>
117
            <groupId>org.gvsig</groupId>
118
            <artifactId>org.gvsig.compat.api</artifactId>
119
        </dependency>
120

  
121
        <dependency>
122
            <groupId>org.gvsig</groupId>
123
            <artifactId>org.gvsig.tools.evaluator.sqljep</artifactId>
124
        </dependency>
125

  
126
        <dependency>
127
            <groupId>org.gvsig</groupId>
128
            <artifactId>org.gvsig.tools.lib</artifactId>
129
            <scope>compile</scope>
130
        </dependency>
131

  
132
        <dependency>
133
            <groupId>org.gvsig</groupId>
134
            <artifactId>org.gvsig.tools.swing.api</artifactId>
135
        </dependency>
136

  
137
        <!--
138
        <dependency>
139
                <groupId>bsf</groupId>
140
                <artifactId>bsf</artifactId>
141
    <scope>compile</scope>
142
        </dependency>
143
        -->
144

  
145
    </dependencies>
146

  
147
    <properties>
148
        <gvsig.package.info.name>Vector legend: Filter by expression</gvsig.package.info.name>
149
        <gvsig.package.info.categories>View,Vector,Symbology</gvsig.package.info.categories>
150
        <gvsig.package.info.official>true</gvsig.package.info.official>
151
        <gvsig.package.info.dependencies>required: org.gvsig.app.mainplugin -ge 2.1.0-A</gvsig.package.info.dependencies>
152
        <gvsig.package.info.state>testing</gvsig.package.info.state>
153
        <gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/gvsig-base-legends/pool</gvsig.package.info.poolURL>
154
    </properties>
155

  
156

  
157
</project>
org.gvsig.legend.vectorfilterexpression.app.mainplugin/tags/org.gvsig.legend.vectorfilterexpression.app.mainplugin-1.0.228/buildNumber.properties
1
#Wed Oct 04 18:48:44 CEST 2023
2
buildNumber=233
org.gvsig.legend.vectorfilterexpression.app.mainplugin/tags/org.gvsig.legend.vectorfilterexpression.app.mainplugin-1.0.228/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.symbology.library.VectorFilterExpressionLibrary
org.gvsig.legend.vectorfilterexpression.app.mainplugin/tags/org.gvsig.legend.vectorfilterexpression.app.mainplugin-1.0.228/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
<!-- No dependencies
51
  <dependencySets>
52
    <dependencySet>
53
      <useProjectArtifact>false</useProjectArtifact>
54
      <useTransitiveDependencies>false</useTransitiveDependencies>
55
      <outputDirectory>lib</outputDirectory>
56
      <includes>
57
		<include>...</include>
58
      </includes>
59
    </dependencySet>
60
  </dependencySets>
61
-->
62

  
63
</assembly>
64

  
org.gvsig.legend.vectorfilterexpression.app.mainplugin/tags/org.gvsig.legend.vectorfilterexpression.app.mainplugin-1.0.228/src/main/java/org/gvsig/symbology/fmap/rendering/VectorFilterExpressionLegend.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2020 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or
7
 * modify it under the terms of the GNU General Public License
8
 * as published by the Free Software Foundation; either version 3
9
 * of the License, or (at your option) any later version.
10
 *
11
 * This program is distributed in the hope that it will be useful,
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 * GNU General Public License for more details.
15
 *
16
 * You should have received a copy of the GNU General Public License
17
 * along with this program; if not, write to the Free Software
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19
 * MA  02110-1301, USA.
20
 *
21
 * For any additional information, do not hesitate to contact us
22
 * at info AT gvsig.com, or visit our website www.gvsig.com.
23
 */
24
package org.gvsig.symbology.fmap.rendering;
25

  
26
import java.awt.Graphics2D;
27
import java.awt.image.BufferedImage;
28
import java.util.ArrayList;
29
import javax.swing.JOptionPane;
30
import org.cresques.cts.ICoordTrans;
31
import org.gvsig.app.ApplicationLocator;
32
import org.gvsig.fmap.dal.DALLocator;
33
import org.gvsig.fmap.dal.DataManager;
34
import org.gvsig.fmap.dal.exception.InitializeException;
35

  
36
import org.slf4j.Logger;
37
import org.slf4j.LoggerFactory;
38

  
39
import org.gvsig.fmap.dal.feature.Feature;
40
import org.gvsig.fmap.dal.feature.FeatureSelection;
41
import org.gvsig.fmap.dal.feature.FeatureSet;
42
import org.gvsig.fmap.geom.Geometry;
43
import org.gvsig.fmap.geom.GeometryLocator;
44
import org.gvsig.fmap.geom.GeometryManager;
45
import org.gvsig.fmap.mapcontext.MapContextLocator;
46
import org.gvsig.fmap.mapcontext.MapContextManager;
47
import org.gvsig.fmap.mapcontext.ViewPort;
48
import org.gvsig.fmap.mapcontext.rendering.legend.events.SymbolLegendEvent;
49
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
50
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolManager;
51
import org.gvsig.i18n.Messages;
52
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.driver.impl.PersistenceBasedLegendWriter;
53
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractClassifiedVectorLegend;
54
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.DefaultFeatureDrawnNotification;
55
import org.gvsig.tools.ToolsLocator;
56
import org.gvsig.tools.dynobject.DynStruct;
57
import org.gvsig.tools.evaluator.Evaluator;
58
import org.gvsig.tools.evaluator.EvaluatorData;
59
import org.gvsig.tools.exception.BaseException;
60
import org.gvsig.tools.i18n.I18nManager;
61
import org.gvsig.tools.persistence.PersistenceManager;
62
import org.gvsig.tools.persistence.PersistentState;
63
import org.gvsig.tools.persistence.exception.PersistenceException;
64
import org.gvsig.tools.task.Cancellable;
65
import org.gvsig.tools.util.Callable;
66
import org.gvsig.tools.util.Caller;
67
import org.gvsig.tools.util.impl.DefaultCaller;
68

  
69
/**
70
 *
71
 * Implements a vector legend which represents the elements of a layer depending
72
 * on the value of an expression. That is, if the expression is evaluated to
73
 * true, then the symbol associated to the expression is painted. In other case
74
 * it is not showed.
75
 *
76
 * If the expression result is a string, it is considered false if it is the
77
 * empty string "", true otherwise.
78
 *
79
 * If the expression result is numeric, it is considered false if it is zero,
80
 * and true otherwise.
81
 *
82
 * In other cases, it is considered false if the result is null and true
83
 * otherwise.
84
 *
85
 * @author gvSIG Team
86
 */
87
public class VectorFilterExpressionLegend
88
        extends AbstractClassifiedVectorLegend {
89

  
90
    private static final Logger logger = LoggerFactory.getLogger(
91
            VectorFilterExpressionLegend.class);
92

  
93
    public static final String FILTER_EXPRESSION_LEGEND_PERSISTENCE_DEFINITION_NAME
94
            = "FILTER_EXPRESSION_LEGEND_PERSISTENCE_DEFINITION_NAME";
95

  
96
    public static final String FILTER_EXPRESSION_LEGEND_NAME = "FILTER_EXPRESSION_LEGEND_NAME";
97

  
98
    public static final String I18N_DEFAULT = Messages.getText("default_value");
99
    public static final String NON_I18N_DEFAULT = Messages.getText("Default");
100

  
101
    private int shapeType;
102
    private ISymbol defaultSymbol;
103

  
104
    private boolean useDefaultSymbol = false;
105

  
106
    private long error_msg_count = 0;
107

  
108
    private ArrayList<Item> newSymbols = new ArrayList<Item>() {
109
        private static final long serialVersionUID = 1L;
110

  
111
        public int indexOf(String expr) {
112
            return super.indexOf(new Item(expr, null));
113
        }
114
    };
115

  
116
    private class Item implements Cloneable {
117

  
118
        private ISymbol sym;
119
        private Evaluator evaluator;
120

  
121
        public Item(String expression, ISymbol sym) {
122
            this.sym = sym;
123
            DataManager dataManager = DALLocator.getDataManager();
124
            try {
125
                evaluator = dataManager.createFilter(expression);
126
            } catch (InitializeException ex) {
127
                evaluator = null;
128
            }
129
        }
130

  
131
        public boolean equals(Object obj) {
132
            if (obj == null) {
133
                return false;
134
            }
135
            if (!obj.getClass().equals(Item.class)) {
136
                return false;
137
            }
138
            return this.evaluator.getSQL().equals(
139
                    ((Item) obj).evaluator.getSQL()
140
            );
141
        }
142

  
143
        public String getStringExpression() {
144
            return evaluator.getSQL();
145
        }
146

  
147
        public Evaluator getEvaluator() {
148
            return evaluator;
149
        }
150

  
151
        public Object clone() {
152

  
153
            ISymbol clonesym = null;
154
            try {
155
                clonesym = (ISymbol) this.sym.clone();
156
            } catch (CloneNotSupportedException e) {
157
                logger.info("Error: unable to clone symbol.", e);
158
                clonesym = this.sym;
159
            }
160
            return new Item(getStringExpression(), clonesym);
161
        }
162
    }
163

  
164
    public VectorFilterExpressionLegend() {
165
        this.setClassifyingFieldNames(new String[0]);
166
        this.setClassifyingFieldTypes(new int[0]);
167
    }
168

  
169
    public ISymbol getSymbolByFeature(Feature featu) {
170

  
171
        EvaluatorData evda = featu.getEvaluatorData();
172

  
173
        ISymbol returnSymbol = null;
174
        Object result = null;
175
        String expr = null;
176

  
177
        try {
178

  
179
            for (int i = 0; i < newSymbols.size(); i++) {
180

  
181
                Evaluator eval = newSymbols.get(i).getEvaluator();
182
                expr = eval.getSQL();
183

  
184
                if (expr.equalsIgnoreCase(VectorFilterExpressionLegend.I18N_DEFAULT)) {
185
                    /*
186
                     * Skip default item
187
                     */
188
                    continue;
189
                }
190

  
191
                result = eval.evaluate(evda);
192
                if (isConsideredTrue(result)) {
193
                    returnSymbol = newSymbols.get(i).sym;
194
                    if (returnSymbol != null) {
195
                        return returnSymbol;
196
                    }
197
                }
198
            }
199
        } catch (Exception e) {
200

  
201
            if (error_msg_count % 1000 == 0) {
202
                I18nManager i18n = ToolsLocator.getI18nManager();
203
                String s;
204
                try{
205
                    s = featu.toJson().toString().replace("\n", " ");
206
                } catch (Throwable t) {
207
                    s=featu.toString();
208
                }
209
                logger.info("Error (msg every 1000 occurrences) while getting symbol in VectorFilterExpressionLegend Expression = ["+expr+"], Feature = ["+s+"]", e);
210
                error_msg_count = 0;
211
                ApplicationLocator.getManager().message(
212
                        i18n.getTranslation("_Error_in_expressions_legend")+
213
                                ". "+
214
                        i18n.getTranslation("_see_error_log_for_more_information")
215
                        , JOptionPane.WARNING_MESSAGE);
216
            }
217
            error_msg_count++;
218
            
219
            return getDefaultSymbol();
220
        }
221

  
222
        if (useDefaultSymbol) {
223
            return getDefaultSymbol();
224
        }
225

  
226
        return null;
227
    }
228

  
229
    /**
230
     * Tells whether the input object is considered true. Basically, it is false
231
     * if it has an empty value (FALSE, null, 0, "")
232
     *
233
     * @param result
234
     * @return
235
     */
236
    private boolean isConsideredTrue(Object res) {
237

  
238
        if (res == null) {
239
            return false;
240
        }
241

  
242
        if (res instanceof Boolean) {
243
            return ((Boolean) res).booleanValue();
244
        }
245

  
246
        if (res instanceof Number) {
247
            return ((Number) res).doubleValue() != 0d;
248
        }
249

  
250
        if (res instanceof String) {
251
            return ((String) res).length() > 0;
252
        }
253

  
254
        // Because it is not null
255
        return true;
256
    }
257

  
258
    public void addSymbol(Object key, ISymbol symbol) {
259
        newSymbols.add(new Item((String) key.toString(),
260
                symbol));
261
    }
262

  
263
    public void clear() {
264
        newSymbols.clear();
265
    }
266

  
267
    public void resetItems() {
268
        newSymbols = new ArrayList<Item>() {
269
            private static final long serialVersionUID = 1L;
270

  
271
            public int indexOf(String expr) {
272
                return super.indexOf(new Item(expr, null));
273
            }
274
        };
275
    }
276

  
277
    public void delSymbol(Object key) {
278
        ISymbol mySymbol = null;
279
        for (int i = 0; i < newSymbols.size(); i++) {
280
            if (newSymbols.get(i).evaluator.getSQL().equals(key)) {
281
                newSymbols.remove(i);
282
            }
283
        }
284
        fireClassifiedSymbolChangeEvent(new SymbolLegendEvent(mySymbol, null));
285
    }
286

  
287
    public void replace(ISymbol oldSymbol, ISymbol newSymbol) {
288

  
289
        for (int i = 0; i < newSymbols.size(); i++) {
290
            if (newSymbols.get(i).sym.equals(oldSymbol)) {
291
                newSymbols.get(i).sym = newSymbol;
292
            }
293
        }
294

  
295
        fireClassifiedSymbolChangeEvent(new SymbolLegendEvent(oldSymbol, newSymbol));
296
    }
297

  
298
    public String[] getDescriptions() {
299
        String[] descriptions = new String[newSymbols.size()];
300
        ISymbol[] auxSym = getSymbols();
301

  
302
        for (int i = 0; i < descriptions.length; i++) {
303
            descriptions[i] = auxSym[i].getDescription();
304
        }
305

  
306
        return descriptions;
307
    }
308

  
309
    public ISymbol[] getSymbols() {
310

  
311
        if (newSymbols != null) {
312
            ISymbol[] mySymbols = new ISymbol[newSymbols.size()];
313
            for (int i = 0; i < newSymbols.size(); i++) {
314
                mySymbols[i] = newSymbols.get(i).sym;
315
            }
316
            return mySymbols;
317
        }
318
        return null;
319
    }
320

  
321
    public ISymbol getDefaultSymbol() {
322
        if (defaultSymbol == null) {
323

  
324
            defaultSymbol = MapContextLocator.getSymbolManager().createSymbol(shapeType);
325
            fireDefaultSymbolChangedEvent(new SymbolLegendEvent(null, defaultSymbol));
326
        }
327
        return defaultSymbol;
328
    }
329

  
330
    public String getClassName() {
331
        return getClass().getName();
332
    }
333

  
334
    public int getShapeType() {
335
        return shapeType;
336
    }
337

  
338
    public boolean isUseDefaultSymbol() {
339
        return useDefaultSymbol;
340
    }
341

  
342
    public void setDefaultSymbol(ISymbol s) throws IllegalArgumentException {
343
        if (s == null) {
344
            throw new NullPointerException("Default symbol cannot be null");
345
        }
346
        ISymbol old = defaultSymbol;
347
        defaultSymbol = s;
348
        fireDefaultSymbolChangedEvent(new SymbolLegendEvent(old, defaultSymbol));
349
    }
350

  
351
    public void setShapeType(int shapeType) {
352
        if (this.shapeType != shapeType) {
353

  
354
            ISymbol sym = MapContextLocator.getSymbolManager().createSymbol(shapeType);
355
            setDefaultSymbol(sym);
356
            this.shapeType = shapeType;
357
        }
358
    }
359

  
360
    public void useDefaultSymbol(boolean b) {
361
        useDefaultSymbol = b;
362
    }
363

  
364
    public Object[] getValues() {
365
        if (newSymbols != null) {
366
            Object[] myObjects = new Object[newSymbols.size()];
367
            for (int i = 0; i < newSymbols.size(); i++) {
368
                myObjects[i] = newSymbols.get(i).getStringExpression();
369
            }
370
            return myObjects;
371
        }
372
        return null;
373
    }
374

  
375
    public static boolean isPolygonal(int ty) {
376
        GeometryManager geomManager = GeometryLocator.getGeometryManager();
377
        return geomManager.isSubtype(Geometry.TYPES.MULTISURFACE, ty)
378
                || geomManager.isSubtype(Geometry.TYPES.SURFACE, ty);
379
    }
380

  
381
    public static boolean isLinear(int ty) {
382
        GeometryManager geomManager = GeometryLocator.getGeometryManager();
383
        return geomManager.isSubtype(Geometry.TYPES.MULTICURVE, ty)
384
                || geomManager.isSubtype(Geometry.TYPES.CURVE, ty);
385
    }
386

  
387
    public static boolean isPoint(int ty) {
388
        GeometryManager geomManager = GeometryLocator.getGeometryManager();
389
        return geomManager.isSubtype(Geometry.TYPES.MULTIPOINT, ty)
390
                || geomManager.isSubtype(Geometry.TYPES.POINT, ty);
391
    }
392

  
393
    public void removeDefaultSymbol() {
394

  
395
    }
396

  
397
    // =============================
398
    public static class RegisterPersistence implements Callable {
399

  
400
        public Object call() throws Exception {
401

  
402
            PersistenceManager manager = ToolsLocator.getPersistenceManager();
403
            if (manager.getDefinition(
404
                    FILTER_EXPRESSION_LEGEND_PERSISTENCE_DEFINITION_NAME) == null) {
405
                DynStruct definition = manager
406
                        .addDefinition(VectorFilterExpressionLegend.class,
407
                                FILTER_EXPRESSION_LEGEND_PERSISTENCE_DEFINITION_NAME,
408
                                FILTER_EXPRESSION_LEGEND_PERSISTENCE_DEFINITION_NAME
409
                                + " Persistence definition", null, null);
410

  
411
                definition.extend(manager.getDefinition(
412
                        AbstractClassifiedVectorLegend.CLASSIFIED_VECTOR_LEGEND_PERSISTENCE_DEFINITION_NAME));
413

  
414
                definition.addDynFieldBoolean("useDefaultSymbol")
415
                        .setMandatory(true);
416
                definition.addDynFieldObject("defaultSymbol")
417
                        .setClassOfValue(ISymbol.class).setMandatory(true);
418
                definition.addDynFieldInt("shapeType")
419
                        .setMandatory(true);
420

  
421
                definition.addDynFieldArray("itemSymbolArray")
422
                        .setClassOfItems(ISymbol.class);
423
                definition.addDynFieldArray("itemStringArray")
424
                        .setClassOfItems(String.class);
425

  
426
            }
427
            return Boolean.TRUE;
428
        }
429

  
430
    }
431

  
432
    public static class RegisterLegend implements Callable {
433

  
434
        public Object call() throws Exception {
435
            MapContextManager manager
436
                    = MapContextLocator.getMapContextManager();
437

  
438
            manager.registerLegend(
439
                    FILTER_EXPRESSION_LEGEND_NAME,
440
                    VectorFilterExpressionLegend.class);
441

  
442
            return Boolean.TRUE;
443
        }
444

  
445
    }
446

  
447
    public void saveToState(PersistentState state) throws PersistenceException {
448

  
449
        super.saveToState(state);
450
        state.set("useDefaultSymbol", this.isUseDefaultSymbol());
451
        state.set("defaultSymbol", this.getDefaultSymbol());
452
        state.set("shapeType", this.getShapeType());
453

  
454
        ISymbol[] syms = this.getSymbols();
455
        if (syms == null) {
456
            syms = new ISymbol[0];
457
        }
458
        Object[] vals = this.getValues();
459
        String[] vals_str = null;
460
        if (vals == null) {
461
            vals_str = new String[0];
462
        } else {
463
            vals_str = new String[vals.length];
464
            for (int i = 0; i < vals.length; i++) {
465
                String aux = ((vals[i] == null) ? null : vals[i].toString());
466
                // Prevents saving localized version of 'Default'
467
                aux = translateDefault(aux, false);
468
                vals_str[i] = aux;
469
            }
470
        }
471

  
472
        state.set("itemSymbolArray", syms);
473
        state.set("itemStringArray", vals_str);
474

  
475
    }
476

  
477
    public void loadFromState(PersistentState state)
478
            throws PersistenceException {
479

  
480
        super.loadFromState(state);
481

  
482
        this.setShapeType(state.getInt("shapeType"));
483
        Boolean b = state.getBoolean("useDefaultSymbol");
484
        this.useDefaultSymbol(b);
485
        ISymbol defsym = (ISymbol) state.get("defaultSymbol");
486
        this.setDefaultSymbol(defsym);
487

  
488
        String[] strs = state.getStringArray("itemStringArray");
489
        ISymbol[] syms = (ISymbol[]) state.getArray("itemSymbolArray",
490
                ISymbol.class);
491

  
492
        if (strs.length != syms.length) {
493
            logger.info("VectorFilterExpressionLegend - load state - Different size in arrays: " + strs.length + ", " + syms.length);
494
        }
495
        int nmin = Math.min(strs.length, syms.length);
496
        for (int i = 0; i < nmin; i++) {
497
            String aux = strs[i];
498
            aux = translateDefault(aux, true);
499
            this.addSymbol(aux, syms[i]);
500
        }
501
    }
502

  
503
    /**
504
     * Utility method to (un)translate the word 'Default'
505
     *
506
     * @param aux
507
     * @param forward If TRUE, then translate (Default -> Por defecto) If FALSE
508
     * then untranslate (Por defecto -> Default)
509
     * @return
510
     */
511
    private String translateDefault(String aux, boolean forward) {
512

  
513
        if (aux == null) {
514
            return null;
515
        }
516
        if (forward && aux.compareTo(NON_I18N_DEFAULT) == 0) {
517
            return I18N_DEFAULT;
518
        }
519
        if (!forward && aux.compareTo(I18N_DEFAULT) == 0) {
520
            return NON_I18N_DEFAULT;
521
        }
522
        return aux;
523
    }
524

  
525
    public Object clone() throws CloneNotSupportedException {
526

  
527
        VectorFilterExpressionLegend resp
528
                = (VectorFilterExpressionLegend) super.clone();
529

  
530
        Object[] vals = this.getValues();
531
        ISymbol[] syms = this.getSymbols();
532
        if (vals != null && syms != null) {
533

  
534
            resp.resetItems();
535

  
536
            int n = Math.min(vals.length, syms.length);
537
            for (int i = 0; i < n; i++) {
538
                resp.addSymbol(
539
                        vals[i],
540
                        (ISymbol) syms[i].clone());
541
            }
542
        }
543
        ISymbol sym = this.getDefaultSymbol();
544
        sym = (ISymbol) sym.clone();
545
        resp.setDefaultSymbol(sym);
546
        return resp;
547
    }
548

  
549
    public static void selfRegister() {
550
        Caller caller = new DefaultCaller();
551

  
552
        caller.add(new VectorFilterExpressionLegend.RegisterLegend());
553
        caller.add(new VectorFilterExpressionLegend.RegisterPersistence());
554

  
555
        if (!caller.call()) {
556
            throw new RuntimeException(
557
                    "Can't register VectorFilterExpressionLegend",
558
                    caller.getException()
559
            );
560
        }
561
        MapContextManager mcoman = MapContextLocator.getMapContextManager();
562
        mcoman.registerLegendWriter(
563
                VectorFilterExpressionLegend.class,
564
                SymbolManager.LEGEND_FILE_EXTENSION.substring(1),
565
                PersistenceBasedLegendWriter.class);
566

  
567
    }
568

  
569
    @Override
570
    protected void drawFeatures(BufferedImage image, Graphics2D g, ViewPort viewPort, Cancellable cancel, ICoordTrans coordTrans, double dpi, DefaultFeatureDrawnNotification drawnNotification, FeatureSet featureSet, FeatureSelection selection) throws BaseException {
571
        error_msg_count = 0;
572
        super.drawFeatures(image, g, viewPort, cancel, coordTrans, dpi, drawnNotification, featureSet, selection); //To change body of generated methods, choose Tools | Templates.
573
    }
574
    
575
    
576

  
577
}
org.gvsig.legend.vectorfilterexpression.app.mainplugin/tags/org.gvsig.legend.vectorfilterexpression.app.mainplugin-1.0.228/src/main/java/org/gvsig/symbology/gui/layerproperties/ExpressionSymbolPanelView.java
1
package org.gvsig.symbology.gui.layerproperties;
2

  
3
import com.jeta.forms.components.separator.TitledSeparator;
4
import com.jeta.open.i18n.I18NUtils;
5
import com.jgoodies.forms.layout.CellConstraints;
6
import com.jgoodies.forms.layout.FormLayout;
7
import java.awt.BorderLayout;
8
import java.awt.ComponentOrientation;
9
import java.awt.Container;
10
import java.awt.Dimension;
11
import javax.swing.Box;
12
import javax.swing.ImageIcon;
13
import javax.swing.JButton;
14
import javax.swing.JFrame;
15
import javax.swing.JPanel;
16
import javax.swing.JScrollPane;
17
import javax.swing.JTextArea;
18

  
19

  
20
public class ExpressionSymbolPanelView extends JPanel
21
{
22
   TitledSeparator lblExpression = new TitledSeparator();
23
   TitledSeparator lblSymbolAndDescriptor = new TitledSeparator();
24
   JPanel pnlExpression = new JPanel();
25
   JButton btnSymbolPreview = new JButton();
26
   JTextArea txtSymbolDescription = new JTextArea();
27

  
28
   /**
29
    * Default constructor
30
    */
31
   public ExpressionSymbolPanelView()
32
   {
33
      initializePanel();
34
   }
35

  
36
   /**
37
    * Adds fill components to empty cells in the first row and first column of the grid.
38
    * This ensures that the grid spacing will be the same as shown in the designer.
39
    * @param cols an array of column indices in the first row where fill components should be added.
40
    * @param rows an array of row indices in the first column where fill components should be added.
41
    */
42
   void addFillComponents( Container panel, int[] cols, int[] rows )
43
   {
44
      Dimension filler = new Dimension(10,10);
45

  
46
      boolean filled_cell_11 = false;
47
      CellConstraints cc = new CellConstraints();
48
      if ( cols.length > 0 && rows.length > 0 )
49
      {
50
         if ( cols[0] == 1 && rows[0] == 1 )
51
         {
52
            /** add a rigid area  */
53
            panel.add( Box.createRigidArea( filler ), cc.xy(1,1) );
54
            filled_cell_11 = true;
55
         }
56
      }
57

  
58
      for( int index = 0; index < cols.length; index++ )
59
      {
60
         if ( cols[index] == 1 && filled_cell_11 )
61
         {
62
            continue;
63
         }
64
         panel.add( Box.createRigidArea( filler ), cc.xy(cols[index],1) );
65
      }
66

  
67
      for( int index = 0; index < rows.length; index++ )
68
      {
69
         if ( rows[index] == 1 && filled_cell_11 )
70
         {
71
            continue;
72
         }
73
         panel.add( Box.createRigidArea( filler ), cc.xy(1,rows[index]) );
74
      }
75

  
76
   }
77

  
78
   /**
79
    * Helper method to load an image file from the CLASSPATH
80
    * @param imageName the package and name of the file to load relative to the CLASSPATH
81
    * @return an ImageIcon instance with the specified image file
82
    * @throws IllegalArgumentException if the image resource cannot be loaded.
83
    */
84
   public ImageIcon loadImage( String imageName )
85
   {
86
      try
87
      {
88
         ClassLoader classloader = getClass().getClassLoader();
89
         java.net.URL url = classloader.getResource( imageName );
90
         if ( url != null )
91
         {
92
            ImageIcon icon = new ImageIcon( url );
93
            return icon;
94
         }
95
      }
96
      catch( Exception e )
97
      {
98
         e.printStackTrace();
99
      }
100
      throw new IllegalArgumentException( "Unable to load image: " + imageName );
101
   }
102

  
103
   /**
104
    * Method for recalculating the component orientation for 
105
    * right-to-left Locales.
106
    * @param orientation the component orientation to be applied
107
    */
108
   public void applyComponentOrientation( ComponentOrientation orientation )
109
   {
110
      // Not yet implemented...
111
      // I18NUtils.applyComponentOrientation(this, orientation);
112
      super.applyComponentOrientation(orientation);
113
   }
114

  
115
   public JPanel createPanel()
116
   {
117
      JPanel jpanel1 = new JPanel();
118
      FormLayout formlayout1 = new FormLayout("FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE","CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,FILL:50PX:GROW(1.0),CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,FILL:DEFAULT:NONE,CENTER:2DLU:NONE");
119
      CellConstraints cc = new CellConstraints();
120
      jpanel1.setLayout(formlayout1);
121

  
122
      lblExpression.setName("lblExpression");
123
      lblExpression.setText("_Expression");
124
      jpanel1.add(lblExpression,cc.xy(2,2));
125

  
126
      lblSymbolAndDescriptor.setName("lblSymbolAndDescriptor");
127
      lblSymbolAndDescriptor.setText("_Symbol_and_description");
128
      jpanel1.add(lblSymbolAndDescriptor,cc.xy(2,6));
129

  
130
      pnlExpression.setName("pnlExpression");
131
      jpanel1.add(pnlExpression,cc.xy(2,4));
132

  
133
      jpanel1.add(createPanel1(),cc.xy(2,8));
134
      addFillComponents(jpanel1,new int[]{ 1,2,3 },new int[]{ 1,2,3,4,5,6,7,8,9 });
135
      return jpanel1;
136
   }
137

  
138
   public JPanel createPanel1()
139
   {
140
      JPanel jpanel1 = new JPanel();
141
      FormLayout formlayout1 = new FormLayout("FILL:35PX:NONE,FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0)","FILL:35PX:NONE");
142
      CellConstraints cc = new CellConstraints();
143
      jpanel1.setLayout(formlayout1);
144

  
145
      btnSymbolPreview.setName("btnSymbolPreview");
146
      jpanel1.add(btnSymbolPreview,new CellConstraints(1,1,1,1,CellConstraints.FILL,CellConstraints.FILL));
147

  
148
      txtSymbolDescription.setName("txtSymbolDescription");
149
      JScrollPane jscrollpane1 = new JScrollPane();
150
      jscrollpane1.setViewportView(txtSymbolDescription);
151
      jscrollpane1.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
152
      jscrollpane1.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
153
      jpanel1.add(jscrollpane1,cc.xy(3,1));
154

  
155
      addFillComponents(jpanel1,new int[]{ 2 },new int[0]);
156
      return jpanel1;
157
   }
158

  
159
   /**
160
    * Initializer
161
    */
162
   protected void initializePanel()
163
   {
164
      setLayout(new BorderLayout());
165
      add(createPanel(), BorderLayout.CENTER);
166
   }
167

  
168

  
169
}
org.gvsig.legend.vectorfilterexpression.app.mainplugin/tags/org.gvsig.legend.vectorfilterexpression.app.mainplugin-1.0.228/src/main/java/org/gvsig/symbology/gui/layerproperties/VectorFilterExpressionPanelView.xml
1
<?xml version="1.0" encoding="UTF-8"?>
2

  
3
<object classname="com.jeta.forms.store.memento.FormPackage">
4
 <at name="fileversion">
5
  <object classname="com.jeta.forms.store.memento.FormsVersion2">
6
   <at name="major">2</at>
7
   <at name="minor">0</at>
8
   <at name="sub">0</at>
9
  </object>
10
 </at>
11
 <at name="form">
12
  <object classname="com.jeta.forms.store.memento.FormMemento">
13
   <super classname="com.jeta.forms.store.memento.ComponentMemento">
14
    <at name="cellconstraints">
15
     <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
16
      <at name="column">1</at>
17
      <at name="row">1</at>
18
      <at name="colspan">1</at>
19
      <at name="rowspan">1</at>
20
      <at name="halign">default</at>
21
      <at name="valign">default</at>
22
      <at name="insets" object="insets">0,0,0,0</at>
23
     </object>
24
    </at>
25
    <at name="componentclass">com.jeta.forms.gui.form.FormComponent</at>
26
   </super>
27
   <at name="id">/home/jjdelcerro/datos/devel/org.gvsig.legend.vectorfilterexpression.app.mainplugin/src/main/java/org/gvsig/symbology/gui/layerproperties/VectorFilterExpressionPanelView.xml</at>
28
   <at name="rowspecs">CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,FILL:DEFAULT:GROW(1.0),CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE</at>
29
   <at name="colspecs">FILL:4DLU:NONE,FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:4DLU:NONE</at>
30
   <at name="components">
31
    <object classname="java.util.LinkedList">
32
     <item >
33
      <at name="value">
34
       <object classname="com.jeta.forms.store.memento.BeanMemento">
35
        <super classname="com.jeta.forms.store.memento.ComponentMemento">
36
         <at name="cellconstraints">
37
          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
38
           <at name="column">2</at>
39
           <at name="row">4</at>
40
           <at name="colspan">1</at>
41
           <at name="rowspan">1</at>
42
           <at name="halign">default</at>
43
           <at name="valign">default</at>
44
           <at name="insets" object="insets">0,0,0,0</at>
45
          </object>
46
         </at>
47
         <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
48
        </super>
49
        <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
50
        <at name="beanclass">javax.swing.JTable</at>
51
        <at name="beanproperties">
52
         <object classname="com.jeta.forms.store.memento.PropertiesMemento">
53
          <at name="classname">javax.swing.JTable</at>
54
          <at name="properties">
55
           <object classname="com.jeta.forms.store.support.PropertyMap">
56
            <at name="border">
57
             <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
58
              <super classname="com.jeta.forms.store.properties.BorderProperty">
59
               <at name="name">border</at>
60
              </super>
61
              <at name="borders">
62
               <object classname="java.util.LinkedList">
63
                <item >
64
                 <at name="value">
65
                  <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
66
                   <super classname="com.jeta.forms.store.properties.BorderProperty">
67
                    <at name="name">border</at>
68
                   </super>
69
                  </object>
70
                 </at>
71
                </item>
72
               </object>
73
              </at>
74
             </object>
75
            </at>
76
            <at name="name">tblSymbols</at>
77
            <at name="width">832</at>
78
            <at name="scollBars">
79
             <object classname="com.jeta.forms.store.properties.ScrollBarsProperty">
80
              <at name="name">scollBars</at>
81
              <at name="verticalpolicy">20</at>
82
              <at name="horizontalpolicy">30</at>
83
              <at name="border">
84
               <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
85
                <super classname="com.jeta.forms.store.properties.BorderProperty">
86
                 <at name="name">border</at>
87
                </super>
88
                <at name="borders">
89
                 <object classname="java.util.LinkedList">
90
                  <item >
91
                   <at name="value">
92
                    <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
93
                     <super classname="com.jeta.forms.store.properties.BorderProperty">
94
                      <at name="name">border</at>
95
                     </super>
96
                    </object>
97
                   </at>
98
                  </item>
99
                 </object>
100
                </at>
101
               </object>
102
              </at>
103
             </object>
104
            </at>
105
            <at name="height">32</at>
106
           </object>
107
          </at>
108
         </object>
109
        </at>
110
       </object>
111
      </at>
112
     </item>
113
     <item >
114
      <at name="value">
115
       <object classname="com.jeta.forms.store.memento.FormMemento">
116
        <super classname="com.jeta.forms.store.memento.ComponentMemento">
117
         <at name="cellconstraints">
118
          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
119
           <at name="column">2</at>
120
           <at name="row">2</at>
121
           <at name="colspan">1</at>
122
           <at name="rowspan">1</at>
123
           <at name="halign">default</at>
124
           <at name="valign">default</at>
125
           <at name="insets" object="insets">0,0,0,0</at>
126
          </object>
127
         </at>
128
         <at name="componentclass">com.jeta.forms.gui.form.FormComponent</at>
129
        </super>
130
        <at name="id">embedded.1564275243</at>
131
        <at name="rowspecs">CENTER:MAX(22PX;MIN):NONE</at>
132
        <at name="colspecs">FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:100PX:NONE</at>
133
        <at name="components">
134
         <object classname="java.util.LinkedList">
135
          <item >
136
           <at name="value">
137
            <object classname="com.jeta.forms.store.memento.BeanMemento">
138
             <super classname="com.jeta.forms.store.memento.ComponentMemento">
139
              <at name="cellconstraints">
140
               <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
141
                <at name="column">1</at>
142
                <at name="row">1</at>
143
                <at name="colspan">1</at>
144
                <at name="rowspan">1</at>
145
                <at name="halign">default</at>
146
                <at name="valign">default</at>
147
                <at name="insets" object="insets">0,0,0,0</at>
148
               </object>
149
              </at>
150
              <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
151
             </super>
152
             <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
153
             <at name="beanclass">javax.swing.JCheckBox</at>
154
             <at name="beanproperties">
155
              <object classname="com.jeta.forms.store.memento.PropertiesMemento">
156
               <at name="classname">javax.swing.JCheckBox</at>
157
               <at name="properties">
158
                <object classname="com.jeta.forms.store.support.PropertyMap">
159
                 <at name="border">
160
                  <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
161
                   <super classname="com.jeta.forms.store.properties.BorderProperty">
162
                    <at name="name">border</at>
163
                   </super>
164
                   <at name="borders">
165
                    <object classname="java.util.LinkedList">
166
                     <item >
167
                      <at name="value">
168
                       <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
169
                        <super classname="com.jeta.forms.store.properties.BorderProperty">
170
                         <at name="name">border</at>
171
                        </super>
172
                       </object>
173
                      </at>
174
                     </item>
175
                    </object>
176
                   </at>
177
                  </object>
178
                 </at>
179
                 <at name="actionCommand">_Resto_de_valores</at>
180
                 <at name="name">chkDefaultValues</at>
181
                 <at name="width">97</at>
182
                 <at name="text">resto_valores</at>
183
                 <at name="height">16</at>
184
                </object>
185
               </at>
186
              </object>
187
             </at>
188
            </object>
189
           </at>
190
          </item>
191
          <item >
192
           <at name="value">
193
            <object classname="com.jeta.forms.store.memento.BeanMemento">
194
             <super classname="com.jeta.forms.store.memento.ComponentMemento">
195
              <at name="cellconstraints">
196
               <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
197
                <at name="column">3</at>
198
                <at name="row">1</at>
199
                <at name="colspan">1</at>
200
                <at name="rowspan">1</at>
201
                <at name="halign">fill</at>
202
                <at name="valign">fill</at>
203
                <at name="insets" object="insets">0,0,0,0</at>
204
               </object>
205
              </at>
206
              <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
207
             </super>
208
             <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
209
             <at name="beanclass">javax.swing.JButton</at>
210
             <at name="beanproperties">
211
              <object classname="com.jeta.forms.store.memento.PropertiesMemento">
212
               <at name="classname">javax.swing.JButton</at>
213
               <at name="properties">
214
                <object classname="com.jeta.forms.store.support.PropertyMap">
215
                 <at name="border">
216
                  <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
217
                   <super classname="com.jeta.forms.store.properties.BorderProperty">
218
                    <at name="name">border</at>
219
                   </super>
220
                   <at name="borders">
221
                    <object classname="java.util.LinkedList">
222
                     <item >
223
                      <at name="value">
224
                       <object classname="com.jeta.forms.store.properties.LineBorderProperty">
225
                        <super classname="com.jeta.forms.store.properties.BorderProperty">
226
                         <at name="name">border</at>
227
                        </super>
228
                        <at name="thickness">1</at>
229
                        <at name="color">
230
                         <object classname="com.jeta.forms.store.properties.ColorProperty">
231
                          <at name="name">dyncolor</at>
232
                          <at name="colorkey">constant</at>
233
                          <at name="constantcolor" object="color">0,0,0</at>
234
                         </object>
235
                        </at>
236
                        <at name="curved">false</at>
237
                       </object>
238
                      </at>
239
                     </item>
240
                    </object>
241
                   </at>
242
                  </object>
243
                 </at>
244
                 <at name="name">btnDefaultValuesPreview</at>
245
                 <at name="width">96</at>
246
                 <at name="height">18</at>
247
                </object>
248
               </at>
249
              </object>
250
             </at>
251
            </object>
252
           </at>
253
          </item>
254
         </object>
255
        </at>
256
        <at name="properties">
257
         <object classname="com.jeta.forms.store.memento.PropertiesMemento">
258
          <at name="classname">com.jeta.forms.gui.form.GridView</at>
259
          <at name="properties">
260
           <object classname="com.jeta.forms.store.support.PropertyMap">
261
            <at name="border">
262
             <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
263
              <super classname="com.jeta.forms.store.properties.BorderProperty">
264
               <at name="name">border</at>
265
              </super>
266
              <at name="borders">
267
               <object classname="java.util.LinkedList"/>
268
              </at>
269
             </object>
270
            </at>
271
            <at name="name"/>
272
            <at name="fill">
273
             <object classname="com.jeta.forms.store.properties.effects.PaintProperty">
274
              <at name="name">fill</at>
275
             </object>
276
            </at>
277
            <at name="scollBars">
278
             <object classname="com.jeta.forms.store.properties.ScrollBarsProperty">
279
              <at name="name">scollBars</at>
280
              <at name="verticalpolicy">21</at>
281
              <at name="horizontalpolicy">31</at>
282
              <at name="border">
283
               <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
284
                <super classname="com.jeta.forms.store.properties.BorderProperty">
285
                 <at name="name">border</at>
286
                </super>
287
                <at name="borders">
288
                 <object classname="java.util.LinkedList">
289
                  <item >
290
                   <at name="value">
291
                    <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
292
                     <super classname="com.jeta.forms.store.properties.BorderProperty">
293
                      <at name="name">border</at>
294
                     </super>
295
                    </object>
296
                   </at>
297
                  </item>
298
                 </object>
299
                </at>
300
               </object>
301
              </at>
302
             </object>
303
            </at>
304
           </object>
305
          </at>
306
         </object>
307
        </at>
308
        <at name="cellpainters">
309
         <object classname="com.jeta.forms.store.support.Matrix">
310
          <at name="rows">
311
           <object classname="[Ljava.lang.Object;" size="1">
312
            <at name="item" index="0">
313
             <object classname="[Ljava.lang.Object;" size="3"/>
314
            </at>
315
           </object>
316
          </at>
317
         </object>
318
        </at>
319
        <at name="rowgroups">
320
         <object classname="com.jeta.forms.store.memento.FormGroupSet">
321
          <at name="groups">
322
           <object classname="java.util.HashMap"/>
323
          </at>
324
         </object>
325
        </at>
326
        <at name="colgroups">
327
         <object classname="com.jeta.forms.store.memento.FormGroupSet">
328
          <at name="groups">
329
           <object classname="java.util.HashMap"/>
330
          </at>
331
         </object>
332
        </at>
333
       </object>
334
      </at>
335
     </item>
336
     <item >
337
      <at name="value">
338
       <object classname="com.jeta.forms.store.memento.FormMemento">
339
        <super classname="com.jeta.forms.store.memento.ComponentMemento">
340
         <at name="cellconstraints">
341
          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
342
           <at name="column">4</at>
343
           <at name="row">4</at>
344
           <at name="colspan">1</at>
345
           <at name="rowspan">1</at>
346
           <at name="halign">default</at>
347
           <at name="valign">default</at>
348
           <at name="insets" object="insets">0,0,0,0</at>
349
          </object>
350
         </at>
351
         <at name="componentclass">com.jeta.forms.gui.form.FormComponent</at>
352
        </super>
353
        <at name="id">embedded.728334876</at>
354
        <at name="rowspecs">CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0)</at>
355
        <at name="colspecs">FILL:DEFAULT:NONE</at>
356
        <at name="components">
357
         <object classname="java.util.LinkedList">
358
          <item >
359
           <at name="value">
360
            <object classname="com.jeta.forms.store.memento.BeanMemento">
361
             <super classname="com.jeta.forms.store.memento.ComponentMemento">
362
              <at name="cellconstraints">
363
               <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
364
                <at name="column">1</at>
365
                <at name="row">1</at>
366
                <at name="colspan">1</at>
367
                <at name="rowspan">1</at>
368
                <at name="halign">default</at>
369
                <at name="valign">default</at>
370
                <at name="insets" object="insets">0,0,0,0</at>
371
               </object>
372
              </at>
373
              <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
374
             </super>
375
             <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
376
             <at name="beanclass">javax.swing.JButton</at>
377
             <at name="beanproperties">
378
              <object classname="com.jeta.forms.store.memento.PropertiesMemento">
379
               <at name="classname">javax.swing.JButton</at>
380
               <at name="properties">
381
                <object classname="com.jeta.forms.store.support.PropertyMap">
382
                 <at name="border">
383
                  <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
384
                   <super classname="com.jeta.forms.store.properties.BorderProperty">
385
                    <at name="name">border</at>
386
                   </super>
387
                   <at name="borders">
388
                    <object classname="java.util.LinkedList">
389
                     <item >
390
                      <at name="value">
391
                       <object classname="com.jeta.forms.store.properties.EmptyBorderProperty">
392
                        <super classname="com.jeta.forms.store.properties.BorderProperty">
393
                         <at name="name">border</at>
394
                        </super>
395
                        <at name="top">2</at>
396
                        <at name="left">2</at>
397
                        <at name="bottom">2</at>
398
                        <at name="right">2</at>
399
                       </object>
400
                      </at>
401
                     </item>
402
                    </object>
403
                   </at>
404
                  </object>
405
                 </at>
406
                 <at name="actionCommand">...</at>
407
                 <at name="name">btnUp</at>
408
                 <at name="width">16</at>
409
                 <at name="text">...</at>
410
                 <at name="height">18</at>
411
                </object>
412
               </at>
413
              </object>
414
             </at>
415
            </object>
416
           </at>
417
          </item>
418
          <item >
419
           <at name="value">
420
            <object classname="com.jeta.forms.store.memento.BeanMemento">
421
             <super classname="com.jeta.forms.store.memento.ComponentMemento">
422
              <at name="cellconstraints">
423
               <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
424
                <at name="column">1</at>
425
                <at name="row">3</at>
426
                <at name="colspan">1</at>
427
                <at name="rowspan">1</at>
428
                <at name="halign">default</at>
429
                <at name="valign">default</at>
430
                <at name="insets" object="insets">0,0,0,0</at>
431
               </object>
432
              </at>
433
              <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
434
             </super>
435
             <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
436
             <at name="beanclass">javax.swing.JButton</at>
437
             <at name="beanproperties">
438
              <object classname="com.jeta.forms.store.memento.PropertiesMemento">
439
               <at name="classname">javax.swing.JButton</at>
440
               <at name="properties">
441
                <object classname="com.jeta.forms.store.support.PropertyMap">
442
                 <at name="border">
443
                  <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
444
                   <super classname="com.jeta.forms.store.properties.BorderProperty">
445
                    <at name="name">border</at>
446
                   </super>
447
                   <at name="borders">
448
                    <object classname="java.util.LinkedList">
449
                     <item >
450
                      <at name="value">
451
                       <object classname="com.jeta.forms.store.properties.EmptyBorderProperty">
452
                        <super classname="com.jeta.forms.store.properties.BorderProperty">
453
                         <at name="name">border</at>
454
                        </super>
455
                        <at name="top">2</at>
456
                        <at name="left">2</at>
457
                        <at name="bottom">2</at>
458
                        <at name="right">2</at>
459
                       </object>
460
                      </at>
461
                     </item>
462
                    </object>
463
                   </at>
464
                  </object>
465
                 </at>
466
                 <at name="actionCommand">...</at>
467
                 <at name="name">btnDown</at>
468
                 <at name="width">16</at>
469
                 <at name="text">...</at>
470
                 <at name="height">18</at>
471
                </object>
472
               </at>
473
              </object>
474
             </at>
475
            </object>
476
           </at>
477
          </item>
478
         </object>
479
        </at>
480
        <at name="properties">
481
         <object classname="com.jeta.forms.store.memento.PropertiesMemento">
482
          <at name="classname">com.jeta.forms.gui.form.GridView</at>
483
          <at name="properties">
484
           <object classname="com.jeta.forms.store.support.PropertyMap">
485
            <at name="border">
486
             <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
487
              <super classname="com.jeta.forms.store.properties.BorderProperty">
488
               <at name="name">border</at>
489
              </super>
490
              <at name="borders">
491
               <object classname="java.util.LinkedList"/>
492
              </at>
493
             </object>
494
            </at>
495
            <at name="name"/>
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff