Revision 4446
org.gvsig.legend.heatmapcomparison/tags/org.gvsig.legend.heatmapcomparison-1.0.54/org.gvsig.legend.heatmapcomparison.lib/org.gvsig.legend.heatmapcomparison.lib.api/src/main/java/org/gvsig/legend/heatmapcomparison/lib/api/HeatmapComparisonLegendManager.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.heatmapcomparison.lib.api; |
|
24 |
|
|
25 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
26 |
|
|
27 |
|
|
28 |
public interface HeatmapComparisonLegendManager { |
|
29 |
|
|
30 |
/** |
|
31 |
* Creates an aggregate legend |
|
32 |
* |
|
33 |
* @return the aggregate legend |
|
34 |
*/ |
|
35 |
public HeatmapComparisonLegend create(); |
|
36 |
|
|
37 |
public Class<? extends HeatmapComparisonLegend> getLegendClass(); |
|
38 |
} |
org.gvsig.legend.heatmapcomparison/tags/org.gvsig.legend.heatmapcomparison-1.0.54/org.gvsig.legend.heatmapcomparison.lib/org.gvsig.legend.heatmapcomparison.lib.api/src/main/java/org/gvsig/legend/heatmapcomparison/lib/api/HeatmapComparisonLegend.java | ||
---|---|---|
1 |
package org.gvsig.legend.heatmapcomparison.lib.api; |
|
2 |
|
|
3 |
import java.awt.Color; |
|
4 |
import org.gvsig.expressionevaluator.Expression; |
|
5 |
import org.gvsig.fmap.geom.Geometry; |
|
6 |
import org.gvsig.fmap.mapcontext.rendering.legend.IVectorLegend; |
|
7 |
|
|
8 |
public interface HeatmapComparisonLegend extends IVectorLegend { |
|
9 |
|
|
10 |
public int getDistance(); |
|
11 |
|
|
12 |
public void setDistance(int distance); |
|
13 |
|
|
14 |
public void setColorTable(int numColors, Color coldColor, Color midColor, Color hotColor); |
|
15 |
|
|
16 |
public Color[] getTargetColorTable(); |
|
17 |
|
|
18 |
public Geometry getROI(); |
|
19 |
|
|
20 |
public void setROI(Geometry roi); |
|
21 |
|
|
22 |
public String getFieldName(); |
|
23 |
|
|
24 |
public void setFieldName(String fieldName); |
|
25 |
|
|
26 |
public int getRampNumColors(); |
|
27 |
|
|
28 |
public Color getRampColdColor(); |
|
29 |
|
|
30 |
public Color getRampMidColor(); |
|
31 |
|
|
32 |
public Color getRampHotColor(); |
|
33 |
|
|
34 |
public void setHotFilter(Expression hotFilter); |
|
35 |
|
|
36 |
public void setColdFilter(Expression coldFilter); |
|
37 |
|
|
38 |
public Expression getColdFilter(); |
|
39 |
|
|
40 |
public Expression getHotFilter(); |
|
41 |
|
|
42 |
public boolean getUseWeight(); |
|
43 |
|
|
44 |
public void setUseWeight(boolean useWeight); |
|
45 |
|
|
46 |
} |
org.gvsig.legend.heatmapcomparison/tags/org.gvsig.legend.heatmapcomparison-1.0.54/org.gvsig.legend.heatmapcomparison.lib/org.gvsig.legend.heatmapcomparison.lib.api/src/main/java/org/gvsig/legend/heatmapcomparison/lib/api/HeatmapComparisonLegendLocator.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.heatmapcomparison.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 HeatmapComparisonLegendLocator extends AbstractLocator { |
|
31 |
|
|
32 |
/** |
|
33 |
* HeatmapLegend locator name |
|
34 |
*/ |
|
35 |
private static final String LOCATOR_NAME = "HeatmapComparisonLegendLocator"; |
|
36 |
|
|
37 |
/** |
|
38 |
* HeatmapLegend manager name |
|
39 |
*/ |
|
40 |
public static final String MANAGER_NAME = "HeatmapComparisonLegendManager"; |
|
41 |
|
|
42 |
/** |
|
43 |
* HeatmapLegend manager description |
|
44 |
*/ |
|
45 |
private static final String MANAGER_DESCRIPTION = |
|
46 |
"HeatmapComparisonLegend Manager of gvSIG"; |
|
47 |
|
|
48 |
|
|
49 |
/** |
|
50 |
* Unique instance |
|
51 |
*/ |
|
52 |
private static final HeatmapComparisonLegendLocator instance = new HeatmapComparisonLegendLocator(); |
|
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 registerHeatmapComparisonLegendManager(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 registerDefaultHeatmapComparisonLegendManager(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 HeatmapComparisonLegendManager getHeatmapComparisonLegendManager() throws LocatorException { |
|
89 |
return (HeatmapComparisonLegendManager) getInstance().get(MANAGER_NAME); |
|
90 |
} |
|
91 |
|
|
92 |
/** |
|
93 |
* @return |
|
94 |
*/ |
|
95 |
public static Locator getInstance() { |
|
96 |
return instance; |
|
97 |
} |
|
98 |
|
|
99 |
} |
org.gvsig.legend.heatmapcomparison/tags/org.gvsig.legend.heatmapcomparison-1.0.54/org.gvsig.legend.heatmapcomparison.lib/org.gvsig.legend.heatmapcomparison.lib.api/src/main/java/org/gvsig/legend/heatmapcomparison/lib/api/HeatmapComparisonLegendLibrary.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.heatmapcomparison.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 HeatmapComparisonLegendLibrary extends AbstractLibrary { |
|
37 |
|
|
38 |
@Override |
|
39 |
protected void doInitialize() throws LibraryException { |
|
40 |
registerAsAPI(HeatmapComparisonLegendLibrary.class); |
|
41 |
} |
|
42 |
|
|
43 |
@Override |
|
44 |
protected void doPostInitialize() throws LibraryException { |
|
45 |
// Validate there is any implementation registered. |
|
46 |
HeatmapComparisonLegendManager manager = HeatmapComparisonLegendLocator.getHeatmapComparisonLegendManager(); |
|
47 |
if (manager == null) { |
|
48 |
throw new ReferenceNotRegisteredException( |
|
49 |
HeatmapComparisonLegendLocator.MANAGER_NAME, HeatmapComparisonLegendLocator.getInstance()); |
|
50 |
} |
|
51 |
|
|
52 |
SymbologyManager symbolManager = SymbologyLocator.getSymbologyManager(); |
|
53 |
ILegendWriter legendWriter = symbolManager.getDefaultLegendWriter(); |
|
54 |
|
|
55 |
MapContextManager mcoman = MapContextLocator.getMapContextManager(); |
|
56 |
mcoman.registerLegendWriter( |
|
57 |
HeatmapComparisonLegend.class, |
|
58 |
SymbolManager.LEGEND_FILE_EXTENSION.substring(1), |
|
59 |
legendWriter.getClass()); |
|
60 |
} |
|
61 |
|
|
62 |
} |
org.gvsig.legend.heatmapcomparison/tags/org.gvsig.legend.heatmapcomparison-1.0.54/org.gvsig.legend.heatmapcomparison.lib/org.gvsig.legend.heatmapcomparison.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.legend.heatmapcomparison.lib.api.HeatmapComparisonLegendLibrary |
org.gvsig.legend.heatmapcomparison/tags/org.gvsig.legend.heatmapcomparison-1.0.54/org.gvsig.legend.heatmapcomparison.lib/org.gvsig.legend.heatmapcomparison.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.heatmapcomparison.lib.api</artifactId> |
|
5 |
<name>org.gvsig.legend.heatmapcomparison.lib.api</name> |
|
6 |
<parent> |
|
7 |
<groupId>org.gvsig</groupId> |
|
8 |
<artifactId>org.gvsig.legend.heatmapcomparison.lib</artifactId> |
|
9 |
<version>1.0.54</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> |
org.gvsig.legend.heatmapcomparison/tags/org.gvsig.legend.heatmapcomparison-1.0.54/org.gvsig.legend.heatmapcomparison.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.heatmapcomparison</artifactId> |
|
6 |
<version>1.0.54</version> |
|
7 |
</parent> |
|
8 |
<groupId>org.gvsig</groupId> |
|
9 |
<artifactId>org.gvsig.legend.heatmapcomparison.lib</artifactId> |
|
10 |
<packaging>pom</packaging> |
|
11 |
<modules> |
|
12 |
<module>org.gvsig.legend.heatmapcomparison.lib.api</module> |
|
13 |
<module>org.gvsig.legend.heatmapcomparison.lib.impl</module> |
|
14 |
</modules> |
|
15 |
</project> |
org.gvsig.legend.heatmapcomparison/tags/org.gvsig.legend.heatmapcomparison-1.0.54/org.gvsig.legend.heatmapcomparison.lib/org.gvsig.legend.heatmapcomparison.lib.impl/src/main/java/org/gvsig/legend/heatmapcomparison/lib/impl/DefaultHeatmapComparisonLegendManager.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.heatmapcomparison.lib.impl; |
|
24 |
|
|
25 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
26 |
import org.gvsig.legend.heatmapcomparison.lib.api.HeatmapComparisonLegend; |
|
27 |
import org.gvsig.legend.heatmapcomparison.lib.api.HeatmapComparisonLegendManager; |
|
28 |
|
|
29 |
|
|
30 |
public class DefaultHeatmapComparisonLegendManager implements HeatmapComparisonLegendManager { |
|
31 |
|
|
32 |
@Override |
|
33 |
public HeatmapComparisonLegend create() { |
|
34 |
return new DefaultHeatmapComparisonLegend(); |
|
35 |
} |
|
36 |
|
|
37 |
@Override |
|
38 |
public Class<? extends HeatmapComparisonLegend> getLegendClass() { |
|
39 |
return DefaultHeatmapComparisonLegend.class; |
|
40 |
} |
|
41 |
|
|
42 |
} |
org.gvsig.legend.heatmapcomparison/tags/org.gvsig.legend.heatmapcomparison-1.0.54/org.gvsig.legend.heatmapcomparison.lib/org.gvsig.legend.heatmapcomparison.lib.impl/src/main/java/org/gvsig/legend/heatmapcomparison/lib/impl/DefaultHeatmapComparisonLegend.java | ||
---|---|---|
1 |
package org.gvsig.legend.heatmapcomparison.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.ArrayList; |
|
8 |
import java.util.Map; |
|
9 |
|
|
10 |
import org.apache.commons.lang3.StringUtils; |
|
11 |
import org.cresques.cts.ICoordTrans; |
|
12 |
import org.gvsig.compat.print.PrintAttributes; |
|
13 |
import org.gvsig.expressionevaluator.Expression; |
|
14 |
import org.gvsig.expressionevaluator.ExpressionEvaluatorLocator; |
|
15 |
import org.gvsig.expressionevaluator.MutableSymbolTable; |
|
16 |
import org.gvsig.fmap.dal.DALLocator; |
|
17 |
|
|
18 |
import org.gvsig.fmap.dal.exception.DataException; |
|
19 |
import org.gvsig.fmap.dal.expressionevaluator.FeatureSymbolTable; |
|
20 |
import org.gvsig.fmap.dal.feature.Feature; |
|
21 |
import org.gvsig.fmap.dal.feature.FeatureAttributeDescriptor; |
|
22 |
import org.gvsig.fmap.dal.feature.FeatureQuery; |
|
23 |
import org.gvsig.fmap.dal.feature.FeatureSelection; |
|
24 |
import org.gvsig.fmap.dal.feature.FeatureSet; |
|
25 |
import org.gvsig.fmap.dal.feature.FeatureStore; |
|
26 |
import org.gvsig.fmap.dal.feature.FeatureType; |
|
27 |
import org.gvsig.fmap.geom.Geometry; |
|
28 |
import org.gvsig.fmap.geom.GeometryUtils; |
|
29 |
import org.gvsig.fmap.geom.primitive.Point; |
|
30 |
import org.gvsig.fmap.mapcontext.MapContextException; |
|
31 |
import org.gvsig.fmap.mapcontext.ViewPort; |
|
32 |
import org.gvsig.fmap.mapcontext.layers.operations.IHasImageLegend; |
|
33 |
import org.gvsig.fmap.mapcontext.rendering.legend.LegendException; |
|
34 |
import org.gvsig.fmap.mapcontext.rendering.legend.events.SymbolLegendEvent; |
|
35 |
import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol; |
|
36 |
import org.gvsig.gui.ColorTablePainter; |
|
37 |
import org.gvsig.gui.DefaultColorTablePainter; |
|
38 |
import org.gvsig.legend.heatmapcomparison.lib.api.HeatmapComparisonLegend; |
|
39 |
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.AbstractVectorialLegend; |
|
40 |
import org.gvsig.symbology.fmap.mapcontext.rendering.legend.impl.DefaultFeatureDrawnNotification; |
|
41 |
import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.text.impl.SimpleTextSymbol; |
|
42 |
import org.gvsig.tools.exception.BaseException; |
|
43 |
import org.gvsig.tools.persistence.PersistentState; |
|
44 |
import org.gvsig.tools.persistence.exception.PersistenceException; |
|
45 |
import org.gvsig.tools.swing.api.ToolsSwingLocator; |
|
46 |
import org.gvsig.tools.swing.api.ToolsSwingManager; |
|
47 |
import org.gvsig.tools.task.Cancellable; |
|
48 |
import org.gvsig.tools.visitor.VisitCanceledException; |
|
49 |
import org.gvsig.tools.visitor.Visitor; |
|
50 |
|
|
51 |
public class DefaultHeatmapComparisonLegend extends AbstractVectorialLegend implements HeatmapComparisonLegend, IHasImageLegend { |
|
52 |
|
|
53 |
private ISymbol defaultSymbol; |
|
54 |
private DensityAlgorithm algorithm; |
|
55 |
private String fieldName; |
|
56 |
private Color rampColdColor; |
|
57 |
private Color rampMidColor; |
|
58 |
private Color rampHotColor; |
|
59 |
private int rampNumColors; |
|
60 |
private Geometry roi; |
|
61 |
private Image imageLegend; |
|
62 |
private HeatmapColorTable hmColorTable; |
|
63 |
private Expression hotFilter; |
|
64 |
private Expression coldFilter; |
|
65 |
private boolean useWeight; |
|
66 |
|
|
67 |
public DefaultHeatmapComparisonLegend() { |
|
68 |
|
|
69 |
this.defaultSymbol = new SimpleTextSymbol(); |
|
70 |
this.algorithm = new DensityAlgorithm(30); |
|
71 |
this.fieldName = null; |
|
72 |
this.useWeight = false; |
|
73 |
this.setColorTable(10, Color.BLUE, new Color(255, 255, 0, 30), Color.RED); |
|
74 |
} |
|
75 |
|
|
76 |
@Override |
|
77 |
protected String[] getRequiredFeatureAttributeNames(FeatureStore featureStore) throws DataException { |
|
78 |
//TODO optimize required features |
|
79 |
FeatureType ftype = featureStore.getDefaultFeatureType(); |
|
80 |
// String[] allAttributes = new String[ftype.getAttributeDescriptors().length]; |
|
81 |
ArrayList<String> arrayAttributes = new ArrayList<>(); |
|
82 |
for (FeatureAttributeDescriptor attributeDescriptor : ftype.getAttributeDescriptors()) { |
|
83 |
arrayAttributes.add(attributeDescriptor.getName()); |
|
84 |
} |
|
85 |
String[] a = arrayAttributes.toArray(new String[arrayAttributes.size()]); |
|
86 |
return a; |
|
87 |
// if (StringUtils.isEmpty(this.fieldName)) { |
|
88 |
// return new String[]{ |
|
89 |
// ftype.getDefaultGeometryAttributeName() |
|
90 |
// }; |
|
91 |
// } |
|
92 |
// return new String[]{ |
|
93 |
// ftype.getDefaultGeometryAttributeName(), |
|
94 |
// this.fieldName |
|
95 |
// }; |
|
96 |
} |
|
97 |
|
|
98 |
@Override |
|
99 |
public ISymbol getDefaultSymbol() { |
|
100 |
return this.defaultSymbol; |
|
101 |
} |
|
102 |
|
|
103 |
@Override |
|
104 |
public void setDefaultSymbol(ISymbol is) { |
|
105 |
} |
|
106 |
|
|
107 |
@Override |
|
108 |
public ISymbol getSymbolByFeature(Feature ftr) throws MapContextException { |
|
109 |
return this.defaultSymbol; |
|
110 |
} |
|
111 |
|
|
112 |
@Override |
|
113 |
public int getShapeType() { |
|
114 |
return Geometry.TYPES.GEOMETRY; |
|
115 |
} |
|
116 |
|
|
117 |
@Override |
|
118 |
public void setShapeType(int i) { |
|
119 |
} |
|
120 |
|
|
121 |
@Override |
|
122 |
public boolean isUseDefaultSymbol() { |
|
123 |
return true; |
|
124 |
} |
|
125 |
|
|
126 |
@Override |
|
127 |
public void useDefaultSymbol(boolean bln) { |
|
128 |
} |
|
129 |
|
|
130 |
@Override |
|
131 |
public boolean isSuitableForShapeType(int shapeType) { |
|
132 |
return true; |
|
133 |
} |
|
134 |
|
|
135 |
@Override |
|
136 |
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 { |
|
137 |
int saved_distance = this.algorithm.getDistance(); |
|
138 |
try { |
|
139 |
int distance = (int) (this.algorithm.getDistance() * (dpi / 72)); |
|
140 |
Geometry theROI = null; |
|
141 |
if (this.roi != null) { |
|
142 |
theROI = this.roi.cloneGeometry(); |
|
143 |
theROI.transform(viewPort.getAffineTransform()); |
|
144 |
} |
|
145 |
this.algorithm.setDistance(distance); |
|
146 |
this.algorithm.init(image.getWidth(), image.getHeight()); |
|
147 |
super.draw(image, g, viewPort, cancel, scale, queryParameters, coordTrans, featureStore, featureQuery, dpi); |
|
148 |
if (!cancel.isCanceled()) { |
|
149 |
this.algorithm.drawWithOpaqueColors(image, g, this.getHeatMapColorTable().getColorTable(), cancel, theROI); |
|
150 |
} |
|
151 |
} finally { |
|
152 |
this.algorithm.setDistance(saved_distance); |
|
153 |
|
|
154 |
} |
|
155 |
} |
|
156 |
|
|
157 |
@Override |
|
158 |
public void print(Graphics2D g, ViewPort viewPort, Cancellable cancel, |
|
159 |
double scale, Map queryParameters, ICoordTrans coordTrans, |
|
160 |
FeatureStore featureStore, FeatureQuery featureQuery, PrintAttributes properties) |
|
161 |
throws LegendException { |
|
162 |
|
|
163 |
int saved_distance = this.algorithm.getDistance(); |
|
164 |
try { |
|
165 |
double dpi = viewPort.getDPI(); |
|
166 |
// Ver CartographicSupportToolkit.getCartographicLength |
|
167 |
int distance = (int) (this.algorithm.getDistance() * (dpi / 72)); |
|
168 |
Geometry theROI = null; |
|
169 |
if (this.roi != null) { |
|
170 |
theROI = this.roi.cloneGeometry(); |
|
171 |
theROI.transform(viewPort.getAffineTransform()); |
|
172 |
} |
|
173 |
this.algorithm.setDistance(distance); |
|
174 |
this.algorithm.init(viewPort.getImageWidth(), viewPort.getImageHeight()); |
|
175 |
BufferedImage image = new BufferedImage(viewPort.getImageWidth(), viewPort.getImageHeight(), BufferedImage.TYPE_INT_ARGB); |
|
176 |
super.draw(image, g, viewPort, cancel, scale, queryParameters, coordTrans, featureStore, featureQuery, dpi); |
|
177 |
if (!cancel.isCanceled()) { |
|
178 |
this.algorithm.drawWithAlphaColors(image, g, this.getHeatMapColorTable().getColorTable(), cancel, theROI); |
|
179 |
g.drawImage(image, 0, 0, null); |
|
180 |
} |
|
181 |
} finally { |
|
182 |
this.algorithm.setDistance(saved_distance); |
|
183 |
|
|
184 |
} |
|
185 |
} |
|
186 |
|
|
187 |
@Override |
|
188 |
protected void drawFeatures( |
|
189 |
BufferedImage image, |
|
190 |
Graphics2D g, |
|
191 |
final ViewPort viewPort, |
|
192 |
final Cancellable cancel, |
|
193 |
final ICoordTrans coordTrans, |
|
194 |
double dpi, |
|
195 |
DefaultFeatureDrawnNotification drawnNotification, |
|
196 |
FeatureSet featureSet, |
|
197 |
FeatureSelection selection |
|
198 |
) throws BaseException { |
|
199 |
int x = -1; |
|
200 |
if (!StringUtils.isEmpty(this.fieldName)) { |
|
201 |
x = featureSet.getDefaultFeatureType().getIndex(this.fieldName); |
|
202 |
} |
|
203 |
final int n = x; |
|
204 |
|
|
205 |
MutableSymbolTable s = ExpressionEvaluatorLocator.getManager().createSymbolTable(); |
|
206 |
FeatureSymbolTable fst = DALLocator.getDataManager().createFeatureSymbolTable(); |
|
207 |
s.addSymbolTable(fst); |
|
208 |
|
|
209 |
featureSet.accept(new Visitor() { |
|
210 |
@Override |
|
211 |
public void visit(Object o) throws VisitCanceledException, BaseException { |
|
212 |
if (cancel.isCanceled()) { |
|
213 |
throw new VisitCanceledException(); |
|
214 |
} |
|
215 |
Feature feature = (Feature) o; |
|
216 |
Geometry geom = feature.getDefaultGeometry(); |
|
217 |
if (geom != null) { |
|
218 |
Point pointGeo = geom.centroid(); |
|
219 |
if (coordTrans != null) { |
|
220 |
pointGeo.reProject(coordTrans); |
|
221 |
} |
|
222 |
Point pointPixels = (Point) pointGeo.cloneGeometry(); |
|
223 |
pointPixels.transform(viewPort.getAffineTransform()); |
|
224 |
|
|
225 |
double value = 0; |
|
226 |
try { |
|
227 |
fst.setFeature(feature); |
|
228 |
if (useWeight == true) { |
|
229 |
if (n > 0) { |
|
230 |
value = feature.getDouble(n); |
|
231 |
} |
|
232 |
fillAlgorithmHot(s, hotFilter, pointPixels, value); |
|
233 |
fillAlgorithmCold(s, coldFilter, pointPixels, value); |
|
234 |
} else { |
|
235 |
fillAlgorithmHot(s, hotFilter, pointPixels, 1.0); |
|
236 |
fillAlgorithmCold(s, coldFilter, pointPixels, 1.0); |
|
237 |
} |
|
238 |
} catch (Exception ex) { |
|
239 |
} |
|
240 |
|
|
241 |
} |
|
242 |
} |
|
243 |
} |
|
244 |
); |
|
245 |
} |
|
246 |
|
|
247 |
protected void fillAlgorithmCold(MutableSymbolTable s, Expression filter, Point pointPixels, Double value) { |
|
248 |
Object boolResult = filter.execute(s); |
|
249 |
if (boolResult instanceof Boolean) { |
|
250 |
boolean hbool = (Boolean) boolResult; |
|
251 |
if (hbool) { |
|
252 |
algorithm.addCold((int) pointPixels.getX(), (int) pointPixels.getY(), value); |
|
253 |
} |
|
254 |
} |
|
255 |
} |
|
256 |
|
|
257 |
protected void fillAlgorithmHot(MutableSymbolTable s, Expression filter, Point pointPixels, Double value) { |
|
258 |
Object boolResult = filter.execute(s); |
|
259 |
if (boolResult instanceof Boolean) { |
|
260 |
boolean hbool = (Boolean) boolResult; |
|
261 |
if (hbool) { |
|
262 |
algorithm.addHot((int) pointPixels.getX(), (int) pointPixels.getY(), value); |
|
263 |
} |
|
264 |
} |
|
265 |
} |
|
266 |
|
|
267 |
/** |
|
268 |
* @return the distance |
|
269 |
*/ |
|
270 |
@Override |
|
271 |
|
|
272 |
public int getDistance() { |
|
273 |
return this.algorithm.getDistance(); |
|
274 |
} |
|
275 |
|
|
276 |
/** |
|
277 |
* @param distance the distance to set |
|
278 |
*/ |
|
279 |
@Override |
|
280 |
public void setDistance(int distance) { |
|
281 |
this.algorithm.setDistance(distance); |
|
282 |
} |
|
283 |
|
|
284 |
@Override |
|
285 |
public void setColorTable(int numColors, Color coldColor, Color midColor, Color hotColor) { |
|
286 |
this.rampColdColor = coldColor; |
|
287 |
this.rampMidColor = midColor; |
|
288 |
this.rampHotColor = hotColor; |
|
289 |
this.rampNumColors = numColors; |
|
290 |
this.imageLegend = null; |
|
291 |
this.hmColorTable = null; |
|
292 |
this.fireDefaultSymbolChangedEvent(new SymbolLegendEvent(null, null)); |
|
293 |
} |
|
294 |
|
|
295 |
// @Override |
|
296 |
// public Color[] getSourceColorTable() { |
|
297 |
// return this.sourceColorTable; |
|
298 |
// } |
|
299 |
@Override |
|
300 |
public String getFieldName() { |
|
301 |
return this.fieldName; |
|
302 |
} |
|
303 |
|
|
304 |
@Override |
|
305 |
public void setFieldName(String fieldName) { |
|
306 |
this.fieldName = fieldName; |
|
307 |
} |
|
308 |
|
|
309 |
@Override |
|
310 |
public void setROI(Geometry roi) { |
|
311 |
this.roi = roi; |
|
312 |
} |
|
313 |
|
|
314 |
@Override |
|
315 |
public Geometry getROI() { |
|
316 |
return this.roi; |
|
317 |
} |
|
318 |
|
|
319 |
@Override |
|
320 |
public Image getImageLegend() { |
|
321 |
if (this.imageLegend == null) { |
|
322 |
BufferedImage img = new BufferedImage(80, 20, BufferedImage.TYPE_INT_RGB); |
|
323 |
ColorTablePainter painter = new DefaultColorTablePainter(this.getTargetColorTable(), ""); |
|
324 |
Graphics2D g = img.createGraphics(); |
|
325 |
g.setClip(0, 0, 80, 20); |
|
326 |
g.setBackground(Color.WHITE); |
|
327 |
g.fillRect(0, 0, 80, 20); |
|
328 |
painter.paint(g, false); |
|
329 |
this.imageLegend = img; |
|
330 |
} |
|
331 |
return this.imageLegend; |
|
332 |
} |
|
333 |
|
|
334 |
@Override |
|
335 |
public Color[] getTargetColorTable() { |
|
336 |
return this.getHeatMapColorTable().getColorTable(); |
|
337 |
} |
|
338 |
|
|
339 |
@Override |
|
340 |
public String getPathImage() { |
|
341 |
return null; |
|
342 |
} |
|
343 |
|
|
344 |
private HeatmapColorTable getHeatMapColorTable() { |
|
345 |
if (this.hmColorTable == null) { |
|
346 |
this.hmColorTable = new HeatmapColorTable(this.rampColdColor, this.rampMidColor, this.rampHotColor, this.rampNumColors); |
|
347 |
} |
|
348 |
return this.hmColorTable; |
|
349 |
} |
|
350 |
|
|
351 |
@Override |
|
352 |
public void loadFromState(PersistentState state) throws PersistenceException { |
|
353 |
this.defaultSymbol = new SimpleTextSymbol(); |
|
354 |
this.imageLegend = null; |
|
355 |
super.loadFromState(state); |
|
356 |
this.fieldName = state.getString("fieldName"); |
|
357 |
int distance = state.getInt("distance"); |
|
358 |
this.algorithm.setDistance(distance); |
|
359 |
this.rampNumColors = state.getInt("rampNumColors"); |
|
360 |
this.rampColdColor = (Color) state.get("rampColdColor"); |
|
361 |
this.rampMidColor = (Color) state.get("rampMidColor"); |
|
362 |
this.rampHotColor = (Color) state.get("rampHotColor"); |
|
363 |
this.useWeight = (boolean) state.get("useWeight"); |
|
364 |
this.coldFilter = (Expression) state.get("coldFilter"); |
|
365 |
this.hotFilter = (Expression) state.get("hotFilter"); |
|
366 |
} |
|
367 |
|
|
368 |
@Override |
|
369 |
public int getRampNumColors() { |
|
370 |
return this.rampNumColors; |
|
371 |
} |
|
372 |
|
|
373 |
@Override |
|
374 |
public Color getRampColdColor() { |
|
375 |
return this.rampColdColor; |
|
376 |
} |
|
377 |
|
|
378 |
@Override |
|
379 |
public Color getRampMidColor() { |
|
380 |
return this.rampMidColor; |
|
381 |
} |
|
382 |
|
|
383 |
@Override |
|
384 |
public Color getRampHotColor() { |
|
385 |
return this.rampHotColor; |
|
386 |
} |
|
387 |
|
|
388 |
@Override |
|
389 |
public void saveToState(PersistentState state) throws PersistenceException { |
|
390 |
super.saveToState(state); |
|
391 |
state.set("fieldName", fieldName); |
|
392 |
state.set("distance", algorithm.distance); |
|
393 |
state.set("rampNumColors", rampNumColors); |
|
394 |
state.set("rampColdColor", rampColdColor); |
|
395 |
state.set("rampMidColor", rampMidColor); |
|
396 |
state.set("rampHotColor", rampHotColor); |
|
397 |
state.set("useWeight", useWeight); |
|
398 |
state.set("coldFilter", coldFilter); |
|
399 |
state.set("hotFilter", hotFilter); |
|
400 |
} |
|
401 |
|
|
402 |
@Override |
|
403 |
public void setHotFilter(Expression hotFilter) { |
|
404 |
this.hotFilter = hotFilter; |
|
405 |
} |
|
406 |
|
|
407 |
@Override |
|
408 |
public void setColdFilter(Expression coldFilter) { |
|
409 |
this.coldFilter = coldFilter; |
|
410 |
} |
|
411 |
|
|
412 |
@Override |
|
413 |
public Expression getColdFilter() { |
|
414 |
return this.coldFilter; |
|
415 |
} |
|
416 |
|
|
417 |
@Override |
|
418 |
public Expression getHotFilter() { |
|
419 |
return this.hotFilter; |
|
420 |
} |
|
421 |
|
|
422 |
@Override |
|
423 |
public boolean getUseWeight() { |
|
424 |
return this.useWeight; |
|
425 |
} |
|
426 |
|
|
427 |
public void setUseWeight(boolean useWeight) { |
|
428 |
this.useWeight = useWeight; |
|
429 |
} |
|
430 |
|
|
431 |
private class DensityAlgorithm { |
|
432 |
|
|
433 |
private double[][] gridHot; |
|
434 |
private double[][] gridCold; |
|
435 |
private double[][] kernel; |
|
436 |
private int distance; |
|
437 |
private int height; |
|
438 |
private int with; |
|
439 |
private double maxValue; |
|
440 |
private double minValue; |
|
441 |
private final String HOT = "hot-value"; |
|
442 |
private final String COLD = "cold-value"; |
|
443 |
|
|
444 |
public DensityAlgorithm(int distance) { |
|
445 |
this.setDistance(distance); |
|
446 |
} |
|
447 |
|
|
448 |
public void setDistance(int distance) { |
|
449 |
if (this.distance == distance) { |
|
450 |
return; |
|
451 |
} |
|
452 |
this.distance = distance; |
|
453 |
this.kernel = new double[2 * this.distance + 1][2 * this.distance + 1]; |
|
454 |
double powDistance = Math.pow(this.distance, 2); // * this.distance; |
|
455 |
for (int y = -this.distance; y < this.distance + 1; y++) { |
|
456 |
for (int x = -this.distance; x < this.distance + 1; x++) { |
|
457 |
final double dDist = Math.sqrt(x * x + y * y); |
|
458 |
if (dDist < this.distance) { |
|
459 |
this.kernel[x + this.distance][y + this.distance] = Math.pow(1 - Math.pow(dDist, 2) / powDistance, 2); |
|
460 |
} else { |
|
461 |
this.kernel[x + this.distance][y + this.distance] = 0; |
|
462 |
} |
|
463 |
} |
|
464 |
} |
|
465 |
} |
|
466 |
|
|
467 |
public int getDistance() { |
|
468 |
return this.distance; |
|
469 |
} |
|
470 |
|
|
471 |
public void init(int with, int height) { |
|
472 |
this.with = with; |
|
473 |
this.height = height; |
|
474 |
this.gridHot = new double[with][height]; |
|
475 |
this.gridCold = new double[with][height]; |
|
476 |
this.maxValue = 0; |
|
477 |
this.minValue = 0; |
|
478 |
} |
|
479 |
|
|
480 |
public void addHot(int px, int py) { |
|
481 |
addHot(px, py, 1); |
|
482 |
} |
|
483 |
|
|
484 |
public void addHot(int px, int py, double value) { |
|
485 |
add(px, py, value, this.HOT); |
|
486 |
} |
|
487 |
|
|
488 |
public void addCold(int px, int py) { |
|
489 |
addCold(px, py, 1); |
|
490 |
} |
|
491 |
|
|
492 |
public void addCold(int px, int py, double value) { |
|
493 |
add(px, py, value, this.COLD); |
|
494 |
} |
|
495 |
|
|
496 |
public void add(int px, int py, double value, String grid) { |
|
497 |
for (int y = -this.distance; y < this.distance + 1; y++) { |
|
498 |
for (int x = -this.distance; x < this.distance + 1; x++) { |
|
499 |
if (this.kernel[x + this.distance][y + this.distance] != 0) { |
|
500 |
addValue(px + x, py + y, value * this.kernel[x + this.distance][y + this.distance], grid); |
|
501 |
} |
|
502 |
} |
|
503 |
} |
|
504 |
} |
|
505 |
|
|
506 |
private void addValue(int px, int py, double value, String grid) { |
|
507 |
if (px < 0 || py < 0 || px >= with || py >= height) { |
|
508 |
return; |
|
509 |
} |
|
510 |
if (grid == this.HOT) { |
|
511 |
value += this.gridHot[px][py]; |
|
512 |
this.gridHot[px][py] = value; |
|
513 |
if (value > this.maxValue) { |
|
514 |
this.maxValue = value; |
|
515 |
} |
|
516 |
} |
|
517 |
if (grid == this.COLD) { |
|
518 |
value += this.gridCold[px][py]; |
|
519 |
this.gridCold[px][py] = value; |
|
520 |
if (-value < this.minValue) { |
|
521 |
this.minValue = -value; |
|
522 |
} |
|
523 |
} |
|
524 |
|
|
525 |
} |
|
526 |
|
|
527 |
public void drawWithOpaqueColors(BufferedImage img, Graphics2D g, Color[] colorTable, Cancellable cancel, Geometry roi) { |
|
528 |
try { |
|
529 |
ToolsSwingManager toolsSwingManager = ToolsSwingLocator.getToolsSwingManager(); |
|
530 |
Color c; |
|
531 |
for (int x = 0; x < with; x++) { |
|
532 |
for (int y = 0; y < height; y++) { |
|
533 |
if (cancel.isCanceled()) { |
|
534 |
return; |
|
535 |
} |
|
536 |
if (roi != null) { |
|
537 |
Point point = GeometryUtils.createPoint(x, y); |
|
538 |
if (!roi.intersects(point)) { |
|
539 |
continue; |
|
540 |
} |
|
541 |
} |
|
542 |
double value = this.getResultGrid(x, y); |
|
543 |
|
|
544 |
int icolor = this.calculateIndexColorNotEqual(value, colorTable); |
|
545 |
if (value==0.0) { |
|
546 |
continue; |
|
547 |
} |
|
548 |
c = toolsSwingManager.alphaBlendingWithOpaqueBackground( |
|
549 |
new Color(img.getRGB(x, y)), |
|
550 |
colorTable[icolor] |
|
551 |
); |
|
552 |
img.setRGB(x, y, c.getRGB()); |
|
553 |
} |
|
554 |
} |
|
555 |
} catch (Exception ex) { |
|
556 |
LOG.warn("Problems drawing heatmap", ex); |
|
557 |
} |
|
558 |
} |
|
559 |
|
|
560 |
public void drawWithAlphaColors(BufferedImage img, Graphics2D g, Color[] colorTable, Cancellable cancel, Geometry roi) { |
|
561 |
try { |
|
562 |
Color c; |
|
563 |
ToolsSwingManager toolsSwingManager = ToolsSwingLocator.getToolsSwingManager(); |
|
564 |
for (int x = 0; x < with; x++) { |
|
565 |
for (int y = 0; y < height; y++) { |
|
566 |
if (cancel.isCanceled()) { |
|
567 |
return; |
|
568 |
} |
|
569 |
if (roi != null) { |
|
570 |
Point point = GeometryUtils.createPoint(x, y); |
|
571 |
if (!roi.intersects(point)) { |
|
572 |
continue; |
|
573 |
} |
|
574 |
} |
|
575 |
double value = this.getResultGrid(x, y); |
|
576 |
|
|
577 |
int icolor = this.calculateIndexColorNotEqual(value, colorTable); |
|
578 |
if (value==0.0) { |
|
579 |
continue; |
|
580 |
} |
|
581 |
c = colorTable[icolor]; |
|
582 |
img.setRGB(x, y, c.getRGB()); |
|
583 |
} |
|
584 |
} |
|
585 |
} catch (Exception ex) { |
|
586 |
LOG.warn("Problems printing heatmap", ex); |
|
587 |
} |
|
588 |
} |
|
589 |
|
|
590 |
private double getResultGrid(int x, int y) { |
|
591 |
double valueHot = this.gridHot[x][y]; |
|
592 |
double valueCold = this.gridCold[x][y]; |
|
593 |
return valueHot - valueCold; |
|
594 |
} |
|
595 |
|
|
596 |
private int calculateIndexColorNotEqual(double value, Color[] colorTable) { |
|
597 |
int midTable = (colorTable.length) / 2; |
|
598 |
if (value < 0) { |
|
599 |
int icolor = (int) (value * (midTable - 1) / minValue); |
|
600 |
int coldIndex = midTable - icolor - 1; |
|
601 |
return coldIndex; |
|
602 |
} else if (value > 0) { |
|
603 |
int icolor = (int) (value * (midTable - 1) / maxValue); |
|
604 |
int hotIndex = midTable + icolor + 1; |
|
605 |
return hotIndex; |
|
606 |
} |
|
607 |
return midTable; |
|
608 |
} |
|
609 |
|
|
610 |
} |
|
611 |
|
|
612 |
private static class HeatmapColorTable { |
|
613 |
|
|
614 |
private Color coldColor = null; |
|
615 |
private Color midColor = null; |
|
616 |
private Color hotColor = null; |
|
617 |
private Color[] targetColorTable = null; |
|
618 |
private int length = -1; |
|
619 |
|
|
620 |
public HeatmapColorTable(Color coldColor, Color midColor, Color hotColor, int length) { |
|
621 |
this.coldColor = coldColor; |
|
622 |
this.midColor = midColor; |
|
623 |
this.hotColor = hotColor; |
|
624 |
this.length = length; |
|
625 |
} |
|
626 |
|
|
627 |
public Color[] getColorTable() { |
|
628 |
if (targetColorTable == null) { |
|
629 |
targetColorTable = new Color[length * 2 + 1]; |
|
630 |
|
|
631 |
double deltaRed = (midColor.getRed() - coldColor.getRed()) / length; |
|
632 |
double deltaGreen = (midColor.getGreen() - coldColor.getGreen()) / length; |
|
633 |
double deltaBlue = (midColor.getBlue() - coldColor.getBlue()) / length; |
|
634 |
double deltaAlpha = (midColor.getAlpha() - coldColor.getAlpha()) / length; |
|
635 |
|
|
636 |
for (int i = 0; i < length; i++) { |
|
637 |
targetColorTable[i] |
|
638 |
= new Color( |
|
639 |
(int) (coldColor.getRed() + i * deltaRed), |
|
640 |
(int) (coldColor.getGreen() + i * deltaGreen), |
|
641 |
(int) (coldColor.getBlue() + i * deltaBlue), |
|
642 |
(int) (coldColor.getAlpha() + i * deltaAlpha)); |
|
643 |
} |
|
644 |
targetColorTable[length] =new Color(midColor.getRed(), midColor.getGreen(), midColor.getBlue(), midColor.getTransparency()); |
|
645 |
|
|
646 |
double deltaRedCold = (hotColor.getRed() - midColor.getRed()) / length; |
|
647 |
double deltaGreenCold = (hotColor.getGreen() - midColor.getGreen()) / length; |
|
648 |
double deltaBlueCold = (hotColor.getBlue() - midColor.getBlue()) / length; |
|
649 |
double deltaAlphaCold = (hotColor.getAlpha() - midColor.getAlpha()) / length; |
|
650 |
for (int i = 1; i < length+1; i++) { |
|
651 |
int fixi = length + i; |
|
652 |
targetColorTable[fixi] |
|
653 |
= new Color( |
|
654 |
(int) (midColor.getRed() + i * deltaRedCold), |
|
655 |
(int) (midColor.getGreen() + i * deltaGreenCold), |
|
656 |
(int) (midColor.getBlue() + i * deltaBlueCold), |
|
657 |
(int) (midColor.getAlpha() + i * deltaAlphaCold)); |
|
658 |
} |
|
659 |
} |
|
660 |
|
|
661 |
return targetColorTable; |
|
662 |
} |
|
663 |
|
|
664 |
// private double getDelta(int x1, int x2, int lenght) { |
|
665 |
// return (x2 - x1) / ((double) lenght - 1); |
|
666 |
// } |
|
667 |
} |
|
668 |
} |
org.gvsig.legend.heatmapcomparison/tags/org.gvsig.legend.heatmapcomparison-1.0.54/org.gvsig.legend.heatmapcomparison.lib/org.gvsig.legend.heatmapcomparison.lib.impl/src/main/java/org/gvsig/legend/heatmapcomparison/lib/impl/HeatmapComparisonLegendLibraryImpl.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.heatmapcomparison.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.heatmapcomparison.lib.api.HeatmapComparisonLegendLibrary; |
|
31 |
import org.gvsig.legend.heatmapcomparison.lib.api.HeatmapComparisonLegendLocator; |
|
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 HeatmapComparisonLegendLibraryImpl extends AbstractLibrary { |
|
39 |
|
|
40 |
@Override |
|
41 |
public void doRegistration() { |
|
42 |
registerAsImplementationOf(HeatmapComparisonLegendLibrary.class); |
|
43 |
this.require(MapContextLibrary.class); |
|
44 |
this.require(SymbologyDefaultImplLibrary.class); |
|
45 |
} |
|
46 |
|
|
47 |
@Override |
|
48 |
protected void doInitialize() throws LibraryException { |
|
49 |
HeatmapComparisonLegendLocator.registerHeatmapComparisonLegendManager(DefaultHeatmapComparisonLegendManager.class); |
|
50 |
MapContextManager mcmanager = MapContextLocator.getMapContextManager(); |
|
51 |
mcmanager.registerLegend("HeatmapComparisonLegend", DefaultHeatmapComparisonLegend.class); |
|
52 |
} |
|
53 |
|
|
54 |
@Override |
|
55 |
protected void doPostInitialize() throws LibraryException { |
|
56 |
PersistenceManager persistenceManager = ToolsLocator.getPersistenceManager(); |
|
57 |
persistenceManager.addDefinition( |
|
58 |
DefaultHeatmapComparisonLegend.class, |
|
59 |
"DefaultHeatmapComparisonLegend", |
|
60 |
"/org/gvsig/legend/heatmapcomparison/lib/impl/DefaultHeatmapComparisonLegend.persistence.xml" |
|
61 |
); |
|
62 |
} |
|
63 |
|
|
64 |
} |
org.gvsig.legend.heatmapcomparison/tags/org.gvsig.legend.heatmapcomparison-1.0.54/org.gvsig.legend.heatmapcomparison.lib/org.gvsig.legend.heatmapcomparison.lib.impl/src/main/resources/org/gvsig/legend/heatmapcomparison/lib/impl/DefaultHeatmapComparisonLegend.persistence.xml | ||
---|---|---|
1 |
<?xml version="1.0"?> |
|
2 |
<definitions> |
|
3 |
<version>1.0.0</version> |
|
4 |
<classes> |
|
5 |
<class name="DefaultHeatmapComparisonLegend"> |
|
6 |
<extends> |
|
7 |
<class>VectorialLegend</class> |
|
8 |
</extends> |
|
9 |
<fields> |
|
10 |
<field name="useWeight" type="boolean" defaultValue="false"> |
|
11 |
<description></description> |
|
12 |
</field> |
|
13 |
<field name="distance" type="integer" defaultValue="30"> |
|
14 |
<description></description> |
|
15 |
</field> |
|
16 |
<field name="fieldName" type="String" defaultValue=""> |
|
17 |
<description></description> |
|
18 |
</field> |
|
19 |
<field name="rampColdColor" type="Object" classOfValue="java.awt.Color"> |
|
20 |
<description></description> |
|
21 |
</field> |
|
22 |
<field name="rampMidColor" type="Object" classOfValue="java.awt.Color"> |
|
23 |
<description></description> |
|
24 |
</field> |
|
25 |
<field name="rampHotColor" type="Object" classOfValue="java.awt.Color"> |
|
26 |
<description></description> |
|
27 |
</field> |
|
28 |
<field name="rampNumColors" type="integer" defaultValue="10"> |
|
29 |
<description></description> |
|
30 |
</field> |
|
31 |
<field name="hotFilter" type="Object" classOfValue="org.gvsig.expressionevaluator.Expression"> |
|
32 |
<description></description> |
|
33 |
</field> |
|
34 |
<field name="coldFilter" type="Object" classOfValue="org.gvsig.expressionevaluator.Expression"> |
|
35 |
<description></description> |
|
36 |
</field> |
|
37 |
</fields> |
|
38 |
</class> |
|
39 |
|
|
40 |
</classes> |
|
41 |
</definitions> |
org.gvsig.legend.heatmapcomparison/tags/org.gvsig.legend.heatmapcomparison-1.0.54/org.gvsig.legend.heatmapcomparison.lib/org.gvsig.legend.heatmapcomparison.lib.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.legend.heatmapcomparison.lib.impl.HeatmapComparisonLegendLibraryImpl |
org.gvsig.legend.heatmapcomparison/tags/org.gvsig.legend.heatmapcomparison-1.0.54/org.gvsig.legend.heatmapcomparison.lib/org.gvsig.legend.heatmapcomparison.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.heatmapcomparison.lib.impl</artifactId> |
|
4 |
<name>org.gvsig.legend.heatmapcomparison.lib.impl</name> |
|
5 |
<parent> |
|
6 |
<groupId>org.gvsig</groupId> |
|
7 |
<artifactId>org.gvsig.legend.heatmapcomparison.lib</artifactId> |
|
8 |
<version>1.0.54</version> |
|
9 |
</parent> |
|
10 |
<groupId>org.gvsig</groupId> |
|
11 |
<dependencies> |
|
12 |
<dependency> |
|
13 |
<groupId>org.gvsig</groupId> |
|
14 |
<artifactId>org.gvsig.legend.heatmapcomparison.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> |
org.gvsig.legend.heatmapcomparison/tags/org.gvsig.legend.heatmapcomparison-1.0.54/org.gvsig.legend.heatmapcomparison.swing/org.gvsig.legend.heatmapcomparison.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library | ||
---|---|---|
1 |
org.gvsig.legend.heatmapcomparison.swing.impl.HeatmapComparisonLegendSwingLibrary |
org.gvsig.legend.heatmapcomparison/tags/org.gvsig.legend.heatmapcomparison-1.0.54/org.gvsig.legend.heatmapcomparison.swing/org.gvsig.legend.heatmapcomparison.swing.impl/src/main/java/org/gvsig/legend/heatmapcomparison/swing/impl/DefaultHeatmapComparisonLegendEditorView.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/osc/devel/org.gvsig.legend.heatmapcomparison/org.gvsig.legend.heatmapcomparison.swing/org.gvsig.legend.heatmapcomparison.swing.impl/src/main/java/org/gvsig/legend/heatmapcomparison/swing/impl/DefaultHeatmapComparisonLegendEditorView.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</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.1289908987</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">600</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">2</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">com.jeta.forms.components.label.JETALabel</at> |
|
249 |
<at name="beanproperties"> |
|
250 |
<object classname="com.jeta.forms.store.memento.PropertiesMemento"> |
|
251 |
<at name="classname">com.jeta.forms.components.label.JETALabel</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> |
Also available in: Unified diff