Revision 2241

View differences:

org.gvsig.legend.heatmap/tags/org.gvsig.legend.heatmap-1.0.13/org.gvsig.legend.heatmap.lib/org.gvsig.legend.heatmap.lib.impl/src/main/resources/org/gvsig/legend/heatmap/lib/impl/DefaultHeatmapLegend.persistence.xml
1
<?xml version="1.0"?>
2
<definitions>
3
  <version>1.0.0</version>
4
  <classes>
5
    <class name="DefaultHeatmapLegend">
6
      <extends>
7
        <class>VectorialLegend</class>
8
      </extends>
9
      <fields>
10
        <field name="isRamp" type="boolean" defaultValue="true">
11
          <description></description>
12
        </field>
13
        <field name="sourceColorTable" type="list" classOfItems="java.awt.Color">
14
          <description></description>
15
        </field>
16
        <field name="colorTableHotColorAlpha" type="integer" defaultValue="255">
17
          <description></description>
18
        </field>
19
        <field name="colorTableColdColorAlpha" type="integer" defaultValue="255">
20
          <description></description>
21
        </field>
22
        <field name="useAlphaInColorTable" type="boolean" defaultValue="false">
23
          <description></description>
24
        </field>
25
        <field name="distance" type="integer" defaultValue="30">
26
          <description></description>
27
        </field>
28
        <field name="fieldName" type="String" defaultValue="">
29
          <description></description>
30
        </field>
31
        <field name="rampColdColor" type="Object" classOfValue="java.awt.Color">
32
          <description></description>
33
        </field>
34
        <field name="rampHotColor" type="Object" classOfValue="java.awt.Color">
35
          <description></description>
36
        </field>
37
        <field name="rampNumColors" type="integer" defaultValue="100">
38
          <description></description>
39
        </field>
40
      </fields>
41
    </class>
42

  
43
  </classes>
44
</definitions>
0 45

  
org.gvsig.legend.heatmap/tags/org.gvsig.legend.heatmap-1.0.13/org.gvsig.legend.heatmap.lib/org.gvsig.legend.heatmap.lib.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.legend.heatmap.lib.impl.HeatmapLegendLibraryImpl
org.gvsig.legend.heatmap/tags/org.gvsig.legend.heatmap-1.0.13/org.gvsig.legend.heatmap.lib/org.gvsig.legend.heatmap.lib.impl/src/main/java/org/gvsig/legend/heatmap/lib/impl/DefaultHeatmapLegend.java
1
package org.gvsig.legend.heatmap.lib.impl;
2

  
3
import java.awt.Color;
4
import java.awt.Graphics2D;
5
import java.awt.Image;
6
import java.awt.image.BufferedImage;
7
import java.util.Map;
8

  
9
import org.apache.commons.lang3.StringUtils;
10
import org.cresques.cts.ICoordTrans;
11

  
12
import org.gvsig.fmap.dal.exception.DataException;
13
import org.gvsig.fmap.dal.feature.Feature;
14
import org.gvsig.fmap.dal.feature.FeatureQuery;
15
import org.gvsig.fmap.dal.feature.FeatureSelection;
16
import org.gvsig.fmap.dal.feature.FeatureSet;
17
import org.gvsig.fmap.dal.feature.FeatureStore;
18
import org.gvsig.fmap.dal.feature.FeatureType;
19
import org.gvsig.fmap.geom.Geometry;
20
import org.gvsig.fmap.geom.primitive.Point;
21
import org.gvsig.fmap.mapcontext.MapContextException;
22
import org.gvsig.fmap.mapcontext.ViewPort;
23
import org.gvsig.fmap.mapcontext.layers.operations.IHasImageLegend;
24
import org.gvsig.fmap.mapcontext.rendering.legend.LegendException;
25
import org.gvsig.fmap.mapcontext.rendering.legend.events.SymbolLegendEvent;
26
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
27
import org.gvsig.gui.ColorTablePainter;
28
import org.gvsig.gui.DefaultColorTablePainter;
29
import org.gvsig.legend.heatmap.lib.api.HeatmapLegend;
30
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractVectorialLegend;
31
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.DefaultFeatureDrawnNotification;
32
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.impl.SimpleTextSymbol;
33
import org.gvsig.tools.exception.BaseException;
34
import org.gvsig.tools.persistence.PersistentState;
35
import org.gvsig.tools.persistence.exception.PersistenceException;
36
import org.gvsig.tools.swing.api.ToolsSwingLocator;
37
import org.gvsig.tools.swing.api.ToolsSwingManager;
38
import org.gvsig.tools.task.Cancellable;
39
import org.gvsig.tools.visitor.VisitCanceledException;
40
import org.gvsig.tools.visitor.Visitor;
41

  
42
public class DefaultHeatmapLegend extends AbstractVectorialLegend implements HeatmapLegend, IHasImageLegend {
43

  
44
    private class DensityAlgorithm {
45

  
46
        private double[][] grid;
47
        private double[][] kernel;
48
        private int distance;
49
        private int height;
50
        private int with;
51
        private double maxValue;
52
        private double minValue;
53

  
54
        public DensityAlgorithm(int distance) {
55
            this.setDistance(distance);
56
        }
57

  
58
        public void setDistance(int distance) {
59
            this.distance = distance;
60
            this.kernel = new double[2 * this.distance + 1][2 * this.distance + 1];
61
            for( int y = -this.distance; y < this.distance + 1; y++ ) {
62
                for( int x = -this.distance; x < this.distance + 1; x++ ) {
63
                    final double dDist = Math.sqrt(x * x + y * y);
64
                    if( dDist < this.distance ) {
65
                        this.kernel[x + this.distance][y + this.distance] = Math.pow(1 - (dDist * dDist) / (this.distance * this.distance), 2);
66
                    } else {
67
                        this.kernel[x + this.distance][y + this.distance] = 0;
68
                    }
69
                }
70
            }
71
        }
72

  
73
        public int getDistance() {
74
            return this.distance;
75
        }
76

  
77
        public void init(int with, int height) {
78
            this.with = with;
79
            this.height = height;
80
            this.grid = new double[with][height];
81
            this.maxValue = 0;
82
            this.minValue = 0;
83
        }
84

  
85
        public void add(int px, int py) {
86
            add(px, py, 1);
87
        }
88

  
89
        public void add(int px, int py, double value) {
90
            for( int y = -this.distance; y < this.distance + 1; y++ ) {
91
                for( int x = -this.distance; x < this.distance + 1; x++ ) {
92
                    if( this.kernel[x + this.distance][y + this.distance] != 0 ) {
93
                        addValue(px + x, py + y, value * this.kernel[x + this.distance][y + this.distance]);
94
                    }
95
                }
96
            }
97
        }
98

  
99
        private void addValue(int px, int py, double value) {
100
            if( px < 0 || py < 0 || px >= with || py >= height ) {
101
                return;
102
            }
103
            value += this.grid[px][py];
104
            this.grid[px][py] = value;
105
            if( value > this.maxValue ) {
106
                this.maxValue = value;
107
            }
108
            if( value < this.minValue ) {
109
                this.minValue = value;
110
            }
111
        }
112

  
113
        public void draw(BufferedImage img, Graphics2D g, Color[] colorTable, Cancellable cancel) {
114
            try {
115
                ToolsSwingManager toolsSwingManager = ToolsSwingLocator.getToolsSwingManager();
116
                Color c;
117
                int maxIndexColor = colorTable.length-1;
118
                for( int x = 0; x < with; x++ ) {
119
                    for( int y = 0; y < height; y++ ) {
120
                        if( cancel.isCanceled() ) {
121
                            return;
122
                        }
123
                        double value = this.grid[x][y];
124
                        if( value > 0 ) {
125
                            int icolor = (int) (value * maxIndexColor / maxValue);
126
                            c = toolsSwingManager.alphaBlendingWithOpaqueBackground(
127
                                    new Color(img.getRGB(x, y)),
128
                                    colorTable[icolor]
129
                            );
130
                            img.setRGB(x, y, c.getRGB());
131
                        }
132
                    }
133
                }
134
            } catch (Exception ex) {
135
                LOG.warn("Problems drawing heatmap", ex);
136
            }
137
        }
138
    }
139

  
140
    private ISymbol defaultSymbol;
141
    private DensityAlgorithm algorithm;
142
    private boolean isRamp;
143
    private Color[] sourceColorTable;
144
    private int colorTableHotColorAlpha;
145
    private int colorTableColdColorAlpha;
146
    private boolean useAlphaInColorTable;
147
    private String fieldName;
148
    private Image imageLegend;
149
    private HeatmapColorTable hmColorTable;
150
    private Color rampColdColor;
151
    private Color rampHotColor;
152
    private int rampNumColors;
153

  
154
    public DefaultHeatmapLegend() {
155
        this.defaultSymbol = new SimpleTextSymbol();
156
        this.algorithm = new DensityAlgorithm(30);
157
        this.colorTableHotColorAlpha = 255;
158
        this.colorTableColdColorAlpha = 0;
159
        this.useAlphaInColorTable = false;
160
        this.setColorTable(100, new Color(0, 0, 255, 0), new Color(255, 0, 0, 255));
161
        this.imageLegend = null;
162
        this.hmColorTable = null;
163
        this.fieldName = null;
164
    }
165

  
166
    @Override
167
    protected String[] getRequiredFeatureAttributeNames(FeatureStore featureStore) throws DataException {
168
        FeatureType ftype = featureStore.getDefaultFeatureType();
169
        if( StringUtils.isEmpty(this.fieldName) ) {
170
            return new String[]{
171
                ftype.getDefaultGeometryAttributeName()
172
            };
173
        }
174
        return new String[]{
175
            ftype.getDefaultGeometryAttributeName(),
176
            this.fieldName
177
        };
178
    }
179

  
180
    @Override
181
    public ISymbol getDefaultSymbol() {
182
        return this.defaultSymbol;
183
    }
184

  
185
    @Override
186
    public void setDefaultSymbol(ISymbol is) {
187
    }
188

  
189
    @Override
190
    public ISymbol getSymbolByFeature(Feature ftr) throws MapContextException {
191
        return this.defaultSymbol;
192
    }
193

  
194
    @Override
195
    public int getShapeType() {
196
        return Geometry.TYPES.GEOMETRY;
197
    }
198

  
199
    @Override
200
    public void setShapeType(int i) {
201
    }
202

  
203
    @Override
204
    public boolean isUseDefaultSymbol() {
205
        return true;
206
    }
207

  
208
    @Override
209
    public void useDefaultSymbol(boolean bln) {
210
    }
211

  
212
    @Override
213
    public boolean isSuitableForShapeType(int shapeType) {
214
        return true;
215
    }
216

  
217
    @Override
218
    protected void draw(BufferedImage image, Graphics2D g, ViewPort viewPort, Cancellable cancel, double scale, Map queryParameters, ICoordTrans coordTrans, FeatureStore featureStore, FeatureQuery featureQuery, double dpi) throws LegendException {
219
        this.algorithm.init(image.getWidth(), image.getHeight());
220
        super.draw(image, g, viewPort, cancel, scale, queryParameters, coordTrans, featureStore, featureQuery, dpi);
221
        if( !cancel.isCanceled() ) {
222
            this.algorithm.draw(image, g, this.getHeatMapColorTable().getColorTable(), cancel);
223
        }
224
    }
225

  
226
    @Override
227
    protected void drawFeatures(
228
        BufferedImage image,
229
        Graphics2D g,
230
        final ViewPort viewPort,
231
        final Cancellable cancel,
232
        final ICoordTrans coordTrans,
233
        double dpi,
234
        DefaultFeatureDrawnNotification drawnNotification,
235
        FeatureSet featureSet,
236
        FeatureSelection selection
237
    ) throws BaseException {
238
        int x = -1;
239
        if( !StringUtils.isEmpty(this.fieldName) ) {
240
            x = featureSet.getDefaultFeatureType().getIndex(this.fieldName);
241
        }
242
        final int n = x;
243
        featureSet.accept(new Visitor() {
244
            @Override
245
            public void visit(Object o) throws VisitCanceledException, BaseException {
246
                if( cancel.isCanceled() ) {
247
                    throw new VisitCanceledException();
248
                }
249
                Feature feature = (Feature) o;
250
                Geometry geom = feature.getDefaultGeometry();
251
                if( geom != null ) {
252
                    Point pointGeo = geom.centroid();
253
                    if( coordTrans != null ) {
254
                        pointGeo.reProject(coordTrans);
255
                    }
256
                    Point pointPixels = (Point) pointGeo.cloneGeometry();
257
                    pointPixels.transform(viewPort.getAffineTransform());
258
                    if( n >= 0 ) {
259
                        double value = 0;
260
                        try {
261
                            value = feature.getDouble(n);
262
                        } catch(Exception ex) {
263
                        }
264
                        if( value >0 ) {
265
                            algorithm.add((int) pointPixels.getX(), (int) pointPixels.getY(), value);
266
                        }
267
                    } else {
268
                        algorithm.add((int) pointPixels.getX(), (int) pointPixels.getY());
269
                    }
270
                }
271
            }
272
        });
273
    }
274

  
275
    /**
276
     * @return the distance
277
     */
278
    @Override
279
    public int getDistance() {
280
        return this.algorithm.getDistance();
281
    }
282

  
283
    /**
284
     * @param distance the distance to set
285
     */
286
    @Override
287
    public void setDistance(int distance) {
288
        this.algorithm.setDistance(distance);
289
    }
290

  
291
    @Override
292
    public void setColorTable(Color[] colorTable) {
293
        this.isRamp = false;
294
        this.sourceColorTable = colorTable;
295
        this.imageLegend = null;
296
        this.hmColorTable = null;
297
        this.fireDefaultSymbolChangedEvent(new SymbolLegendEvent(null,null));
298
    }
299

  
300
    @Override
301
    public void setColorTable(int numColors, Color coldColor, Color hotColor) {
302
        this.isRamp = true;
303
        this.rampColdColor = coldColor;
304
        this.rampHotColor = hotColor;
305
        this.rampNumColors = numColors;
306
        this.imageLegend = null;
307
        this.hmColorTable = null;
308
        this.fireDefaultSymbolChangedEvent(new SymbolLegendEvent(null,null));
309
    }
310

  
311
    @Override
312
    public Color[] getSourceColorTable() {
313
        return this.sourceColorTable;
314
    }
315

  
316
    @Override
317
    public Color[] getTargetColorTable() {
318
        return this.getHeatMapColorTable().getColorTable();
319
    }
320

  
321
    private HeatmapColorTable getHeatMapColorTable() {
322
        if (this.hmColorTable == null) {
323
            if (this.useRamp()) {
324
                this.hmColorTable = new HeatmapColorTable(this.rampColdColor, this.rampHotColor, this.rampNumColors);
325
            } else {
326
                if(useAlphaInColorTable) {
327
                    this.hmColorTable = new HeatmapColorTable(this.getSourceColorTable(), colorTableColdColorAlpha, colorTableHotColorAlpha);
328
                } else {
329
                this.hmColorTable =
330
                    this.hmColorTable = new HeatmapColorTable(this.getSourceColorTable());
331
                }
332
            }
333
        }
334
        return this.hmColorTable;
335
    }
336

  
337

  
338
    @Override
339
    public boolean useRamp() {
340
        return this.isRamp;
341
    }
342

  
343
    @Override
344
    public String getFieldName() {
345
        return this.fieldName;
346
    }
347

  
348
    @Override
349
    public void setFieldName(String fieldName) {
350
        this.fieldName = fieldName;
351
    }
352

  
353
    @Override
354
    public int getColorTableHotColorAlpha() {
355
        return colorTableHotColorAlpha;
356
    }
357

  
358
    @Override
359
    public void setColorTableHotColorAlpha(int colorTableHotColorAlpha) {
360
        this.colorTableHotColorAlpha = colorTableHotColorAlpha;
361
        this.imageLegend = null;
362
        this.hmColorTable = null;
363
    }
364

  
365
    @Override
366
    public int getColorTableColdColorAlpha() {
367
        return colorTableColdColorAlpha;
368
    }
369

  
370
    @Override
371
    public void setColorTableColdColorAlpha(int colorTableColdColorAlpha) {
372
        this.colorTableColdColorAlpha = colorTableColdColorAlpha;
373
        this.imageLegend = null;
374
        this.hmColorTable = null;
375
    }
376

  
377
    @Override
378
    public boolean useAlphaInColorTable() {
379
        return this.useAlphaInColorTable;
380
    }
381

  
382
    @Override
383
    public boolean setUseAlphaInColorTable(boolean use) {
384
        boolean x = this.useAlphaInColorTable;
385
        this.useAlphaInColorTable = use;
386
        this.hmColorTable = null;
387

  
388
        return x;
389
    }
390

  
391
    @Override
392
    public Image getImageLegend() {
393
        if( this.imageLegend==null ) {
394
            BufferedImage img = new BufferedImage(80, 20, BufferedImage.TYPE_INT_RGB);
395
            ColorTablePainter painter = new DefaultColorTablePainter(this.getTargetColorTable(),"");
396
            Graphics2D g = img.createGraphics();
397
            g.setClip(0, 0, 80, 20);
398
            g.setBackground(Color.WHITE);
399
            g.fillRect(0, 0, 80, 20);
400
            painter.paint(g, false);
401
            this.imageLegend = img;
402
        }
403
        return this.imageLegend;
404
    }
405

  
406
    @Override
407
    public String getPathImage() {
408
        return null;
409
    }
410

  
411
    @Override
412
    public void loadFromState(PersistentState state) throws PersistenceException {
413
        this.defaultSymbol = new SimpleTextSymbol();
414
        this.imageLegend = null;
415
        this.hmColorTable = null;
416

  
417
        super.loadFromState(state);
418
        this.isRamp = state.getBoolean("isRamp");
419
        this.sourceColorTable = (Color[]) state.getArray("sourceColorTable",Color.class);
420
        this.colorTableHotColorAlpha = state.getInt("colorTableHotColorAlpha");
421
        this.colorTableColdColorAlpha = state.getInt("colorTableColdColorAlpha");
422
        this.useAlphaInColorTable = state.getBoolean("useAlphaInColorTable");
423
        this.fieldName = state.getString("fieldName");
424
        this.rampNumColors = state.getInt("rampNumColors");
425
        this.rampColdColor = (Color)state.get("rampColdColor");
426
        this.rampHotColor = (Color)state.get("rampHotColor");
427

  
428
        this.algorithm = new DensityAlgorithm(state.getInt("distance"));
429
    }
430

  
431
    @Override
432
    public int getRampNumColors() {
433
        return this.rampNumColors;
434
    }
435

  
436
    @Override
437
    public Color getRampColdColor() {
438
        return this.rampColdColor;
439
    }
440

  
441
    @Override
442
    public Color getRampHotColor() {
443
        return this.rampHotColor;
444
    }
445

  
446
    @Override
447
    public void saveToState(PersistentState state) throws PersistenceException {
448
        super.saveToState(state);
449
        state.set("isRamp", isRamp);
450
        state.set("sourceColorTable", sourceColorTable);
451
        state.set("colorTableHotColorAlpha", colorTableHotColorAlpha);
452
        state.set("colorTableColdColorAlpha", colorTableColdColorAlpha);
453
        state.set("useAlphaInColorTable", useAlphaInColorTable);
454
        state.set("fieldName", fieldName);
455
        state.set("distance", algorithm.distance);
456

  
457
        state.set("rampNumColors", rampNumColors);
458
        state.set("rampColdColor", rampColdColor);
459
        state.set("rampHotColor", rampHotColor);
460
    }
461

  
462

  
463
    private static class HeatmapColorTable {
464

  
465
        private Color[] sourceColorTable = null;
466
        private int coldAlpha = -1;
467
        private int hotAlpha = -1;
468
        private Color coldColor = null;
469
        private Color hotColor = null;
470
        private Color[] targetColorTable = null;
471
        private int length = -1;
472

  
473
        public HeatmapColorTable(Color[] sourceColorTable){
474
            this.sourceColorTable  = sourceColorTable;
475
        }
476

  
477
        public HeatmapColorTable(Color[] sourceColorTable, int coldAlpha, int hotAlpha){
478
            this.sourceColorTable  = sourceColorTable;
479
            this.coldAlpha = coldAlpha;
480
            this.hotAlpha = hotAlpha;
481
        }
482

  
483
        public HeatmapColorTable(Color coldColor, Color hotColor, int length){
484
            this.coldColor = coldColor;
485
            this.hotColor = hotColor;
486
            this.length = length;
487
        }
488

  
489
        public Color[] getColorTable(){
490
            if(targetColorTable==null){
491
                if(sourceColorTable!=null){ //Tenemos tabla de color
492
                    if (coldAlpha >= 0 || hotAlpha >= 0) { //Se usa alpha para la tabla de color
493
                        double alphaDelta = getDelta(coldAlpha, hotAlpha, sourceColorTable.length);
494
                        targetColorTable = new Color[sourceColorTable.length];
495
                        for (int i = 0; i < sourceColorTable.length; i++) {
496
                            Color sourceColor = sourceColorTable[i];
497
                            if (coldAlpha >= 0 && hotAlpha >= 0) {
498
                                targetColorTable[i] =
499
                                    new Color(sourceColor.getRed(), sourceColor.getGreen(), sourceColor.getBlue(),
500
                                        coldAlpha + (int) (i * alphaDelta));
501
                            } else {
502
                                targetColorTable[i] = sourceColor;
503
                            }
504
                        }
505
                    } else { //No se usa alpha para la tabla de color
506
                        targetColorTable = sourceColorTable;
507
                    }
508
                } else { // Tenemos gradiente
509
                    targetColorTable = new Color[length];
510

  
511
                    double deltaRed = (hotColor.getRed() - coldColor.getRed()) / length;
512
                    double deltaGreen = (hotColor.getGreen() - coldColor.getGreen()) / length;
513
                    double deltaBlue = (hotColor.getBlue() - coldColor.getBlue()) / length;
514
                    double deltaAlpha = (hotColor.getAlpha() - coldColor.getAlpha()) / length;
515
                    for (int i = 0; i < length; i++) {
516
                        targetColorTable[i] =
517
                            new Color(
518
                                (int) (coldColor.getRed() + i * deltaRed),
519
                                (int) (coldColor.getGreen() + i * deltaGreen),
520
                                (int) (coldColor.getBlue() + i * deltaBlue),
521
                                (int) (coldColor.getAlpha() + i * deltaAlpha));
522
                    }
523
                }
524
            }
525
            return targetColorTable;
526
        }
527

  
528
        private double getDelta(int x1, int x2, int lenght){
529
            return (x2-x1)/((double)lenght-1);
530
        }
531
    }
532
}
org.gvsig.legend.heatmap/tags/org.gvsig.legend.heatmap-1.0.13/org.gvsig.legend.heatmap.lib/org.gvsig.legend.heatmap.lib.impl/src/main/java/org/gvsig/legend/heatmap/lib/impl/HeatmapLegendLibraryImpl.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright ? 2007-2015 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 2
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

  
25
package org.gvsig.legend.heatmap.lib.impl;
26

  
27
import org.gvsig.fmap.mapcontext.MapContextLibrary;
28
import org.gvsig.fmap.mapcontext.MapContextLocator;
29
import org.gvsig.fmap.mapcontext.MapContextManager;
30
import org.gvsig.legend.heatmap.lib.api.HeatmapLegendLibrary;
31
import org.gvsig.legend.heatmap.lib.api.HeatmapLegendLocator;
32
import org.gvsig.symbology.impl.SymbologyDefaultImplLibrary;
33
import org.gvsig.tools.ToolsLocator;
34
import org.gvsig.tools.library.AbstractLibrary;
35
import org.gvsig.tools.library.LibraryException;
36
import org.gvsig.tools.persistence.PersistenceManager;
37

  
38
public class HeatmapLegendLibraryImpl extends AbstractLibrary {
39

  
40
    @Override
41
    public void doRegistration() {
42
        registerAsImplementationOf(HeatmapLegendLibrary.class);
43
        this.require(MapContextLibrary.class);
44
        this.require(SymbologyDefaultImplLibrary.class);
45
    }
46

  
47
    @Override
48
    protected void doInitialize() throws LibraryException {
49
        HeatmapLegendLocator.registerHeatmapLegendManager(DefaultHeatmapLegendManager.class);
50
        MapContextManager mcmanager = MapContextLocator.getMapContextManager();
51
        mcmanager.registerLegend("HeatmapLegend", DefaultHeatmapLegend.class);
52
    }
53

  
54
    @Override
55
    protected void doPostInitialize() throws LibraryException {
56
        PersistenceManager persistenceManager = ToolsLocator.getPersistenceManager();
57
        persistenceManager.addDefinition(
58
            DefaultHeatmapLegend.class, 
59
            "DefaultHeatmapLegend", 
60
            "/org/gvsig/legend/heatmap/lib/impl/DefaultHeatmapLegend.persistence.xml"
61
        );
62
    }
63

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

  
25
import org.gvsig.legend.heatmap.lib.api.HeatmapLegend;
26
import org.gvsig.legend.heatmap.lib.api.HeatmapLegendManager;
27

  
28

  
29
public class DefaultHeatmapLegendManager implements HeatmapLegendManager {
30

  
31
    @Override
32
    public HeatmapLegend create() {
33
        return new DefaultHeatmapLegend();
34
    }
35

  
36
    @Override
37
    public Class<? extends HeatmapLegend> getLegendClass() {
38
        return DefaultHeatmapLegend.class;
39
    }
40

  
41
}
org.gvsig.legend.heatmap/tags/org.gvsig.legend.heatmap-1.0.13/org.gvsig.legend.heatmap.lib/org.gvsig.legend.heatmap.lib.impl/pom.xml
1
<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">
2
  <modelVersion>4.0.0</modelVersion>
3
  <artifactId>org.gvsig.legend.heatmap.lib.impl</artifactId>
4
  <name>org.gvsig.legend.heatmap.lib.impl</name>
5
  <parent>
6
    <groupId>org.gvsig</groupId>
7
    <artifactId>org.gvsig.legend.heatmap.lib</artifactId>
8
    <version>1.0.13</version>
9
  </parent>
10
  <groupId>org.gvsig</groupId>
11
  <dependencies>
12
    <dependency>
13
      <groupId>org.gvsig</groupId>
14
      <artifactId>org.gvsig.legend.heatmap.lib.api</artifactId>
15
      <scope>compile</scope>
16
    </dependency>
17
    <dependency>
18
      <groupId>org.gvsig</groupId>
19
      <artifactId>org.gvsig.fmap.dal.api</artifactId>
20
      <scope>compile</scope>
21
    </dependency>
22
    <dependency>
23
      <groupId>org.gvsig</groupId>
24
      <artifactId>org.gvsig.symbology.lib.impl</artifactId>
25
      <scope>compile</scope>
26
    </dependency>
27
    <dependency>
28
      <groupId>org.gvsig</groupId>
29
      <artifactId>org.gvsig.ui</artifactId>
30
      <scope>compile</scope>
31
    </dependency>
32
  </dependencies>
33
</project>
0 34

  
org.gvsig.legend.heatmap/tags/org.gvsig.legend.heatmap-1.0.13/org.gvsig.legend.heatmap.lib/pom.xml
1
<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">
2
  <modelVersion>4.0.0</modelVersion>
3
  <parent>
4
    <groupId>org.gvsig</groupId>
5
    <artifactId>org.gvsig.legend.heatmap</artifactId>
6
    <version>1.0.13</version>
7
  </parent>
8
  <groupId>org.gvsig</groupId>
9
  <artifactId>org.gvsig.legend.heatmap.lib</artifactId>
10
  <packaging>pom</packaging>
11
  <modules>
12
    <module>org.gvsig.legend.heatmap.lib.api</module>
13
    <module>org.gvsig.legend.heatmap.lib.impl</module>
14
  </modules>
15
</project>
org.gvsig.legend.heatmap/tags/org.gvsig.legend.heatmap-1.0.13/org.gvsig.legend.heatmap.lib/org.gvsig.legend.heatmap.lib.api/src/main/java/org/gvsig/legend/heatmap/lib/api/HeatmapLegendLocator.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2015 gvSIG Association
4
 *
5
 * This program is free software; you can redistribute it and/or
6
 * modify it under the terms of the GNU General Public License
7
 * as published by the Free Software Foundation; either version 2
8
 * of the License, or (at your option) any later version.
9
 *
10
 * This program is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with this program; if not, write to the Free Software
17
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
18
 * MA  02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us
21
 * at info AT gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.gvsig.legend.heatmap.lib.api;
24

  
25
import org.gvsig.tools.locator.AbstractLocator;
26
import org.gvsig.tools.locator.Locator;
27
import org.gvsig.tools.locator.LocatorException;
28

  
29

  
30
public class HeatmapLegendLocator extends AbstractLocator {
31

  
32
    /**
33
     * HeatmapLegend locator name
34
     */
35
    private static final String LOCATOR_NAME = "HeatmapLegendLocator";
36

  
37
    /**
38
     * HeatmapLegend manager name
39
     */
40
    public static final String MANAGER_NAME = "HeatmapLegendManager";
41

  
42
    /**
43
     * HeatmapLegend manager description
44
     */
45
    private static final String MANAGER_DESCRIPTION =
46
        "HeatmapLegend Manager of gvSIG";
47

  
48

  
49
    /**
50
     * Unique instance
51
     */
52
    private static final HeatmapLegendLocator instance = new HeatmapLegendLocator();
53

  
54
    @Override
55
    public String getLocatorName() {
56
        return LOCATOR_NAME;
57
    }
58

  
59
    /**
60
     * Registers the Class implementing the HeatmapLegendManager interface.
61
     *
62
     * @param clazz
63
     *            implementing the HeatmapLegendManager interface
64
     */
65
    public static void registerHeatmapLegendManager(Class clazz){
66
        getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz);
67
    }
68

  
69
    /**
70
     * Registers the default Class implementing the HeatmapLegendManager interface
71
     *
72
     * @param clazz
73
     *            implementing the HeatmapLegendManager interface
74
     */
75
    public static void registerDefaultHeatmapLegendManager(Class clazz){
76
        getInstance().registerDefault(MANAGER_NAME, MANAGER_DESCRIPTION, clazz);
77
    }
78

  
79
    /**
80
     * Return a reference to HeatmapLegendManager.
81
     *
82
     * @return a reference to HeatmapLegendManager
83
     * @throws LocatorException
84
     *             if there is no access to the class or the class
85
     *             cannot be instantiated
86
     * @see Locator#get(String)
87
     */
88
    public static HeatmapLegendManager getHeatmapLegendManager() throws LocatorException {
89
        return (HeatmapLegendManager) getInstance().get(MANAGER_NAME);
90
    }
91

  
92
    /**
93
     * @return
94
     */
95
    public static Locator getInstance() {
96
        return instance;
97
    }
98

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

  
25
import org.gvsig.fmap.mapcontext.MapContextLocator;
26
import org.gvsig.fmap.mapcontext.MapContextManager;
27
import org.gvsig.fmap.mapcontext.rendering.legend.driver.ILegendWriter;
28
import org.gvsig.fmap.mapcontext.rendering.symbols.SymbolManager;
29
import org.gvsig.symbology.SymbologyLocator;
30
import org.gvsig.symbology.SymbologyManager;
31
import org.gvsig.tools.library.AbstractLibrary;
32
import org.gvsig.tools.library.LibraryException;
33
import org.gvsig.tools.locator.ReferenceNotRegisteredException;
34

  
35

  
36
public class HeatmapLegendLibrary extends AbstractLibrary {
37

  
38
    @Override
39
    protected void doInitialize() throws LibraryException {
40
        registerAsAPI(HeatmapLegendLibrary.class);
41
    }
42

  
43
    @Override
44
    protected void doPostInitialize() throws LibraryException {
45
        // Validate there is any implementation registered.
46
        HeatmapLegendManager manager = HeatmapLegendLocator.getHeatmapLegendManager();
47
        if (manager == null) {
48
            throw new ReferenceNotRegisteredException(
49
                HeatmapLegendLocator.MANAGER_NAME, HeatmapLegendLocator.getInstance());
50
        }
51

  
52
        SymbologyManager symbolManager = SymbologyLocator.getSymbologyManager();
53
        ILegendWriter legendWriter = symbolManager.getDefaultLegendWriter();
54

  
55
        MapContextManager mcoman = MapContextLocator.getMapContextManager();
56
        mcoman.registerLegendWriter(
57
            HeatmapLegend.class,
58
            SymbolManager.LEGEND_FILE_EXTENSION.substring(1),
59
            legendWriter.getClass());
60
    }
61

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

  
25

  
26
public interface HeatmapLegendManager {
27

  
28
    /**
29
     * Creates an aggregate legend
30
     *
31
     * @return the aggregate legend
32
     */
33
    public HeatmapLegend create();
34

  
35
    public Class<? extends HeatmapLegend> getLegendClass();
36
}
org.gvsig.legend.heatmap/tags/org.gvsig.legend.heatmap-1.0.13/org.gvsig.legend.heatmap.lib/org.gvsig.legend.heatmap.lib.api/src/main/java/org/gvsig/legend/heatmap/lib/api/HeatmapLegend.java
1
package org.gvsig.legend.heatmap.lib.api;
2

  
3
import java.awt.Color;
4
import org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend;
5

  
6
public interface HeatmapLegend extends IVectorLegend {
7

  
8
    public int getDistance();
9

  
10
    public void setDistance(int distance);
11

  
12
    public void setColorTable(Color[] colorTable);
13

  
14
    public void setColorTable(int numColors, Color coldColor, Color hotColor);
15

  
16
    public Color[] getSourceColorTable();
17

  
18
    public Color[] getTargetColorTable();
19

  
20
    public boolean useRamp();
21

  
22
    public String getFieldName();
23

  
24
    public void setFieldName(String fieldName);
25

  
26
    public int getColorTableHotColorAlpha();
27

  
28
    public void setColorTableHotColorAlpha(int colorTableHotColorAlpha);
29

  
30
    public int getColorTableColdColorAlpha();
31

  
32
    public void setColorTableColdColorAlpha(int colorTableColdColorAlpha);
33

  
34
    public boolean useAlphaInColorTable();
35

  
36
    public boolean setUseAlphaInColorTable(boolean use);
37

  
38
    public int getRampNumColors();
39

  
40
    public Color getRampColdColor();
41

  
42
    public Color getRampHotColor();
43

  
44
}
org.gvsig.legend.heatmap/tags/org.gvsig.legend.heatmap-1.0.13/org.gvsig.legend.heatmap.lib/org.gvsig.legend.heatmap.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.legend.heatmap.lib.api.HeatmapLegendLibrary
org.gvsig.legend.heatmap/tags/org.gvsig.legend.heatmap-1.0.13/org.gvsig.legend.heatmap.lib/org.gvsig.legend.heatmap.lib.api/pom.xml
1
<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">
2
  <modelVersion>4.0.0</modelVersion>
3
  <groupId>org.gvsig</groupId>
4
  <artifactId>org.gvsig.legend.heatmap.lib.api</artifactId>
5
  <name>org.gvsig.legend.heatmap.lib.api</name>
6
  <parent>
7
    <groupId>org.gvsig</groupId>
8
    <artifactId>org.gvsig.legend.heatmap.lib</artifactId>
9
    <version>1.0.13</version>
10
  </parent>
11

  
12
  <build>
13
    <plugins>
14
      <plugin>
15
        <groupId>org.apache.maven.plugins</groupId>
16
        <artifactId>maven-jar-plugin</artifactId>
17
        <configuration>
18
        </configuration>
19
        <executions>
20
          <!-- Generates a jar file only with the test classes -->
21
          <execution>
22
            <goals>
23
              <goal>test-jar</goal>
24
            </goals>
25
          </execution>
26
        </executions>
27
      </plugin>
28
    </plugins>
29
  </build>
30

  
31
  <dependencies>
32
    <dependency>
33
      <groupId>org.gvsig</groupId>
34
      <artifactId>org.gvsig.tools.lib</artifactId>
35
      <scope>compile</scope>
36
    </dependency>
37
    <dependency>
38
      <groupId>org.gvsig</groupId>
39
      <artifactId>org.gvsig.fmap.mapcontext.api</artifactId>
40
      <scope>compile</scope>
41
    </dependency>
42
    <dependency>
43
      <groupId>org.gvsig</groupId>
44
      <artifactId>org.gvsig.symbology.lib.api</artifactId>
45
    </dependency>
46
  </dependencies>
47
</project>
0 48

  
org.gvsig.legend.heatmap/tags/org.gvsig.legend.heatmap-1.0.13/org.gvsig.legend.heatmap.swing/org.gvsig.legend.heatmap.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.gvsig.legend.heatmap.swing.impl.HeatmapLegendSwingLibrary
org.gvsig.legend.heatmap/tags/org.gvsig.legend.heatmap-1.0.13/org.gvsig.legend.heatmap.swing/org.gvsig.legend.heatmap.swing.impl/src/main/java/org/gvsig/legend/heatmap/swing/impl/DefaultHeatmapLegendEditorView.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/data/devel/org.gvsig.legend.heatmap/org.gvsig.legend.heatmap.swing/org.gvsig.legend.heatmap.swing.impl/src/main/java/org/gvsig/legend/heatmap/swing/impl/DefaultHeatmapLegendEditorView.xml</at>
28
   <at name="rowspecs">CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,CENTER:2DLU:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE</at>
29
   <at name="colspecs">FILL:4DLU:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0),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.FormMemento">
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">4</at>
39
           <at name="row">2</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.FormComponent</at>
48
        </super>
49
        <at name="id">embedded.1761555303</at>
50
        <at name="rowspecs">CENTER:DEFAULT:NONE</at>
51
        <at name="colspecs">FILL:DEFAULT:GROW(1.0),FILL:4DLU:NONE,FILL:DEFAULT:NONE</at>
52
        <at name="components">
53
         <object classname="java.util.LinkedList">
54
          <item >
55
           <at name="value">
56
            <object classname="com.jeta.forms.store.memento.BeanMemento">
57
             <super classname="com.jeta.forms.store.memento.ComponentMemento">
58
              <at name="cellconstraints">
59
               <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
60
                <at name="column">3</at>
61
                <at name="row">1</at>
62
                <at name="colspan">1</at>
63
                <at name="rowspan">1</at>
64
                <at name="halign">default</at>
65
                <at name="valign">default</at>
66
                <at name="insets" object="insets">0,0,0,0</at>
67
               </object>
68
              </at>
69
              <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
70
             </super>
71
             <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
72
             <at name="beanclass">com.jeta.forms.components.label.JETALabel</at>
73
             <at name="beanproperties">
74
              <object classname="com.jeta.forms.store.memento.PropertiesMemento">
75
               <at name="classname">com.jeta.forms.components.label.JETALabel</at>
76
               <at name="properties">
77
                <object classname="com.jeta.forms.store.support.PropertyMap">
78
                 <at name="border">
79
                  <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
80
                   <super classname="com.jeta.forms.store.properties.BorderProperty">
81
                    <at name="name">border</at>
82
                   </super>
83
                   <at name="borders">
84
                    <object classname="java.util.LinkedList">
85
                     <item >
86
                      <at name="value">
87
                       <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
88
                        <super classname="com.jeta.forms.store.properties.BorderProperty">
89
                         <at name="name">border</at>
90
                        </super>
91
                       </object>
92
                      </at>
93
                     </item>
94
                    </object>
95
                   </at>
96
                  </object>
97
                 </at>
98
                 <at name="name">lblPixels</at>
99
                 <at name="width">33</at>
100
                 <at name="text">pixels</at>
101
                 <at name="fill">
102
                  <object classname="com.jeta.forms.store.properties.effects.PaintProperty">
103
                   <at name="name">fill</at>
104
                  </object>
105
                 </at>
106
                 <at name="height">14</at>
107
                </object>
108
               </at>
109
              </object>
110
             </at>
111
            </object>
112
           </at>
113
          </item>
114
          <item >
115
           <at name="value">
116
            <object classname="com.jeta.forms.store.memento.BeanMemento">
117
             <super classname="com.jeta.forms.store.memento.ComponentMemento">
118
              <at name="cellconstraints">
119
               <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
120
                <at name="column">1</at>
121
                <at name="row">1</at>
122
                <at name="colspan">1</at>
123
                <at name="rowspan">1</at>
124
                <at name="halign">default</at>
125
                <at name="valign">default</at>
126
                <at name="insets" object="insets">0,0,0,0</at>
127
               </object>
128
              </at>
129
              <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
130
             </super>
131
             <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
132
             <at name="beanclass">javax.swing.JSpinner</at>
133
             <at name="beanproperties">
134
              <object classname="com.jeta.forms.store.memento.PropertiesMemento">
135
               <at name="classname">javax.swing.JSpinner</at>
136
               <at name="properties">
137
                <object classname="com.jeta.forms.store.support.PropertyMap">
138
                 <at name="name">spnDistance</at>
139
                 <at name="width">726</at>
140
                 <at name="height">20</at>
141
                </object>
142
               </at>
143
              </object>
144
             </at>
145
            </object>
146
           </at>
147
          </item>
148
         </object>
149
        </at>
150
        <at name="properties">
151
         <object classname="com.jeta.forms.store.memento.PropertiesMemento">
152
          <at name="classname">com.jeta.forms.gui.form.GridView</at>
153
          <at name="properties">
154
           <object classname="com.jeta.forms.store.support.PropertyMap">
155
            <at name="border">
156
             <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
157
              <super classname="com.jeta.forms.store.properties.BorderProperty">
158
               <at name="name">border</at>
159
              </super>
160
              <at name="borders">
161
               <object classname="java.util.LinkedList"/>
162
              </at>
163
             </object>
164
            </at>
165
            <at name="name"/>
166
            <at name="fill">
167
             <object classname="com.jeta.forms.store.properties.effects.PaintProperty">
168
              <at name="name">fill</at>
169
             </object>
170
            </at>
171
            <at name="scollBars">
172
             <object classname="com.jeta.forms.store.properties.ScrollBarsProperty">
173
              <at name="name">scollBars</at>
174
              <at name="verticalpolicy">21</at>
175
              <at name="horizontalpolicy">31</at>
176
              <at name="border">
177
               <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
178
                <super classname="com.jeta.forms.store.properties.BorderProperty">
179
                 <at name="name">border</at>
180
                </super>
181
                <at name="borders">
182
                 <object classname="java.util.LinkedList">
183
                  <item >
184
                   <at name="value">
185
                    <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
186
                     <super classname="com.jeta.forms.store.properties.BorderProperty">
187
                      <at name="name">border</at>
188
                     </super>
189
                    </object>
190
                   </at>
191
                  </item>
192
                 </object>
193
                </at>
194
               </object>
195
              </at>
196
             </object>
197
            </at>
198
           </object>
199
          </at>
200
         </object>
201
        </at>
202
        <at name="cellpainters">
203
         <object classname="com.jeta.forms.store.support.Matrix">
204
          <at name="rows">
205
           <object classname="[Ljava.lang.Object;" size="1">
206
            <at name="item" index="0">
207
             <object classname="[Ljava.lang.Object;" size="3"/>
208
            </at>
209
           </object>
210
          </at>
211
         </object>
212
        </at>
213
        <at name="rowgroups">
214
         <object classname="com.jeta.forms.store.memento.FormGroupSet">
215
          <at name="groups">
216
           <object classname="java.util.HashMap"/>
217
          </at>
218
         </object>
219
        </at>
220
        <at name="colgroups">
221
         <object classname="com.jeta.forms.store.memento.FormGroupSet">
222
          <at name="groups">
223
           <object classname="java.util.HashMap"/>
224
          </at>
225
         </object>
226
        </at>
227
       </object>
228
      </at>
229
     </item>
230
     <item >
231
      <at name="value">
232
       <object classname="com.jeta.forms.store.memento.BeanMemento">
233
        <super classname="com.jeta.forms.store.memento.ComponentMemento">
234
         <at name="cellconstraints">
235
          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
236
           <at name="column">2</at>
237
           <at name="row">4</at>
238
           <at name="colspan">1</at>
239
           <at name="rowspan">1</at>
240
           <at name="halign">default</at>
241
           <at name="valign">default</at>
242
           <at name="insets" object="insets">0,0,0,0</at>
243
          </object>
244
         </at>
245
         <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
246
        </super>
247
        <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
248
        <at name="beanclass">javax.swing.JRadioButton</at>
249
        <at name="beanproperties">
250
         <object classname="com.jeta.forms.store.memento.PropertiesMemento">
251
          <at name="classname">javax.swing.JRadioButton</at>
252
          <at name="properties">
253
           <object classname="com.jeta.forms.store.support.PropertyMap">
254
            <at name="border">
255
             <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
256
              <super classname="com.jeta.forms.store.properties.BorderProperty">
257
               <at name="name">border</at>
258
              </super>
259
              <at name="borders">
260
               <object classname="java.util.LinkedList">
261
                <item >
262
                 <at name="value">
263
                  <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
264
                   <super classname="com.jeta.forms.store.properties.BorderProperty">
265
                    <at name="name">border</at>
266
                   </super>
267
                  </object>
268
                 </at>
269
                </item>
270
               </object>
271
              </at>
272
             </object>
273
            </at>
274
            <at name="actionCommand">Use color ramp</at>
275
            <at name="buttonGroup">
276
             <object classname="com.jeta.forms.store.properties.ButtonGroupProperty">
277
              <at name="name">buttonGroup</at>
278
              <at name="groupname">1</at>
279
             </object>
280
            </at>
281
            <at name="name">rdbUseColorRamp</at>
282
            <at name="width">117</at>
283
            <at name="text">_Use_color_ramp</at>
284
            <at name="height">16</at>
285
           </object>
286
          </at>
287
         </object>
288
        </at>
289
       </object>
290
      </at>
291
     </item>
292
     <item >
293
      <at name="value">
294
       <object classname="com.jeta.forms.store.memento.BeanMemento">
295
        <super classname="com.jeta.forms.store.memento.ComponentMemento">
296
         <at name="cellconstraints">
297
          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
298
           <at name="column">2</at>
299
           <at name="row">2</at>
300
           <at name="colspan">1</at>
301
           <at name="rowspan">1</at>
302
           <at name="halign">default</at>
303
           <at name="valign">default</at>
304
           <at name="insets" object="insets">0,0,0,0</at>
305
          </object>
306
         </at>
307
         <at name="componentclass">com.jeta.forms.gui.form.StandardComponent</at>
308
        </super>
309
        <at name="jetabeanclass">com.jeta.forms.gui.beans.JETABean</at>
310
        <at name="beanclass">com.jeta.forms.components.label.JETALabel</at>
311
        <at name="beanproperties">
312
         <object classname="com.jeta.forms.store.memento.PropertiesMemento">
313
          <at name="classname">com.jeta.forms.components.label.JETALabel</at>
314
          <at name="properties">
315
           <object classname="com.jeta.forms.store.support.PropertyMap">
316
            <at name="border">
317
             <object classname="com.jeta.forms.store.properties.CompoundBorderProperty">
318
              <super classname="com.jeta.forms.store.properties.BorderProperty">
319
               <at name="name">border</at>
320
              </super>
321
              <at name="borders">
322
               <object classname="java.util.LinkedList">
323
                <item >
324
                 <at name="value">
325
                  <object classname="com.jeta.forms.store.properties.DefaultBorderProperty">
326
                   <super classname="com.jeta.forms.store.properties.BorderProperty">
327
                    <at name="name">border</at>
328
                   </super>
329
                  </object>
330
                 </at>
331
                </item>
332
               </object>
333
              </at>
334
             </object>
335
            </at>
336
            <at name="name">lblDistance</at>
337
            <at name="width">117</at>
338
            <at name="text">_Distance</at>
339
            <at name="fill">
340
             <object classname="com.jeta.forms.store.properties.effects.PaintProperty">
341
              <at name="name">fill</at>
342
             </object>
343
            </at>
344
            <at name="height">14</at>
345
           </object>
346
          </at>
347
         </object>
348
        </at>
349
       </object>
350
      </at>
351
     </item>
352
     <item >
353
      <at name="value">
354
       <object classname="com.jeta.forms.store.memento.FormMemento">
355
        <super classname="com.jeta.forms.store.memento.ComponentMemento">
356
         <at name="cellconstraints">
357
          <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
358
           <at name="column">2</at>
359
           <at name="row">6</at>
360
           <at name="colspan">3</at>
361
           <at name="rowspan">1</at>
362
           <at name="halign">default</at>
363
           <at name="valign">default</at>
364
           <at name="insets" object="insets">0,0,0,0</at>
365
          </object>
366
         </at>
367
         <at name="componentclass">com.jeta.forms.gui.form.FormComponent</at>
368
        </super>
369
        <at name="id">embedded.1329759412</at>
370
        <at name="rowspecs">CENTER:DEFAULT:NONE,CENTER:4DLU:NONE,CENTER:DEFAULT:NONE,CENTER:4DLU:NONE,CENTER:DEFAULT:NONE</at>
371
        <at name="colspecs">FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:NONE,FILL:DEFAULT:GROW(1.0)</at>
372
        <at name="components">
373
         <object classname="java.util.LinkedList">
374
          <item >
375
           <at name="value">
376
            <object classname="com.jeta.forms.store.memento.BeanMemento">
377
             <super classname="com.jeta.forms.store.memento.ComponentMemento">
378
              <at name="cellconstraints">
379
               <object classname="com.jeta.forms.store.memento.CellConstraintsMemento">
380
                <at name="column">2</at>
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff