[Schmitzm-commits] r695 - in trunk/src: schmitzm/geotools/styling skrueger/geotools
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Fri Feb 12 21:46:10 CET 2010
Author: alfonx
Date: 2010-02-12 21:46:08 +0100 (Fri, 12 Feb 2010)
New Revision: 695
Modified:
trunk/src/schmitzm/geotools/styling/StylingUtil.java
trunk/src/skrueger/geotools/StyledLayerUtil.java
trunk/src/skrueger/geotools/XMapPane.java
Log:
* Improvements of the TextSymbolizer and GUI in AtlasStyler and better threading while calculating the statistics.
Modified: trunk/src/schmitzm/geotools/styling/StylingUtil.java
===================================================================
--- trunk/src/schmitzm/geotools/styling/StylingUtil.java 2010-02-12 11:28:41 UTC (rev 694)
+++ trunk/src/schmitzm/geotools/styling/StylingUtil.java 2010-02-12 20:46:08 UTC (rev 695)
@@ -158,7 +158,7 @@
static {
SLDTRANSFORMER.setEncoding(Charset.defaultCharset());
}
-
+
/** Standard-Instanz einer {@link StyleFactory} */
public static final StyleFactory STYLE_FACTORY = CommonFactoryFinder
.getStyleFactory(GeoTools.getDefaultHints());
@@ -177,7 +177,7 @@
*/
static final Literal size0 = FeatureUtil.FILTER_FACTORY2.literal(26);
-
+
static final Literal size1 = FeatureUtil.FILTER_FACTORY2.literal(9);
static final Literal size2 = FeatureUtil.FILTER_FACTORY2.literal(7);
static final Literal size3 = FeatureUtil.FILTER_FACTORY2.literal(3);
@@ -2725,17 +2725,18 @@
switch (geometryForm) {
case POINT:
-
+
Literal size0 = FeatureUtil.FILTER_FACTORY2.literal(26);
Literal size1 = FeatureUtil.FILTER_FACTORY2.literal(28);
-
+
Graphic bg1 = STYLE_FACTORY.createGraphic(new ExternalGraphic[0],
new Mark[] { STYLE_FACTORY.createMark(
FeatureUtil.FILTER_FACTORY2.literal("circle"),
- STYLE_BUILDER.createStroke(Color.red, 2.),null, size1,
- halfLit) }, new org.geotools.styling.Symbol[0],
- FeatureUtil.FILTER_FACTORY2.literal(1), size1, zeroLit);
-
+ STYLE_BUILDER.createStroke(Color.red, 2.), null,
+ size1, halfLit) },
+ new org.geotools.styling.Symbol[0],
+ FeatureUtil.FILTER_FACTORY2.literal(1), size1, zeroLit);
+
PointSymbolizer ps1 = STYLE_FACTORY.createPointSymbolizer();
ps1.setGraphic(bg1);
symbolizers = LangUtil.extendArray(symbolizers, ps1);
@@ -2747,18 +2748,21 @@
STYLE_BUILDER.createFill(Color.WHITE, 0.3), size0,
halfLit) }, new org.geotools.styling.Symbol[0],
FeatureUtil.FILTER_FACTORY2.literal(1), size0, zeroLit);
-
+
PointSymbolizer ps2 = STYLE_FACTORY.createPointSymbolizer();
ps2.setGraphic(bg2);
-
+
symbolizers = LangUtil.extendArray(symbolizers, ps2);
break;
- case POLYGON:
-
- PolygonSymbolizer pol1 = STYLE_BUILDER.createPolygonSymbolizer(STYLE_BUILDER.createStroke(Color.red, 4),null);
+ case POLYGON:
+
+ PolygonSymbolizer pol1 = STYLE_BUILDER.createPolygonSymbolizer(
+ STYLE_BUILDER.createStroke(Color.red, 4), null);
symbolizers = LangUtil.extendArray(symbolizers, pol1);
-
- PolygonSymbolizer pol2 = STYLE_BUILDER.createPolygonSymbolizer(STYLE_BUILDER.createStroke(Color.black, 2),STYLE_BUILDER.createFill(Color.WHITE, .5));
+
+ PolygonSymbolizer pol2 = STYLE_BUILDER.createPolygonSymbolizer(
+ STYLE_BUILDER.createStroke(Color.black, 2), STYLE_BUILDER
+ .createFill(Color.WHITE, .5));
symbolizers = LangUtil.extendArray(symbolizers, pol2);
break;
@@ -2772,10 +2776,10 @@
LineSymbolizer ls2 = STYLE_BUILDER.createLineSymbolizer(
Color.black, 4.);
symbolizers = LangUtil.extendArray(symbolizers, ls2);
-
+
LineSymbolizer ls3 = STYLE_BUILDER.createLineSymbolizer(
Color.white, 2.);
- symbolizers = LangUtil.extendArray(symbolizers, ls3);
+ symbolizers = LangUtil.extendArray(symbolizers, ls3);
break;
default:
@@ -2786,4 +2790,5 @@
Double.NaN);
}
+
}
Modified: trunk/src/skrueger/geotools/StyledLayerUtil.java
===================================================================
--- trunk/src/skrueger/geotools/StyledLayerUtil.java 2010-02-12 11:28:41 UTC (rev 694)
+++ trunk/src/skrueger/geotools/StyledLayerUtil.java 2010-02-12 20:46:08 UTC (rev 695)
@@ -951,7 +951,7 @@
for (final Rule rule : rules) {
// Check if this RULE shall actually appear in the legend
- if (rule.getName().endsWith(HIDE_IN_LAYER_LEGEND_HINT))
+ if (rule.getName() != null && rule.getName().endsWith(HIDE_IN_LAYER_LEGEND_HINT))
continue;
/**
Modified: trunk/src/skrueger/geotools/XMapPane.java
===================================================================
--- trunk/src/skrueger/geotools/XMapPane.java 2010-02-12 11:28:41 UTC (rev 694)
+++ trunk/src/skrueger/geotools/XMapPane.java 2010-02-12 20:46:08 UTC (rev 695)
@@ -125,6 +125,18 @@
return tool;
}
+ /**
+ * If the {@link JPanel} is disabled, it shows nothing and the images are disposed.
+ */
+ @Override
+ public void setEnabled(boolean enabled) {
+ super.setEnabled(enabled);
+ if (enabled == false)
+ disposeImages();
+ else
+ requestStartRendering();
+ }
+
private static final int IMAGETYPE_withAlpha = BufferedImage.TYPE_4BYTE_ABGR;
private final static Logger LOGGER = Logger.getLogger(XMapPane.class);
@@ -613,9 +625,9 @@
*/
public XMapPane(final MapContext localContext_,
final Map<Object, Object> rendererHints) {
-
+
super(true);
-
+
blinkTimer = initBlinkTimer();
// A default setting
@@ -729,7 +741,7 @@
@Override
public void actionPerformed(final ActionEvent e) {
synchronized (requestStartRendering) {
- if (requestStartRendering && isWellDefined()) {
+ if (requestStartRendering && isWellDefined() && isEnabled()) {
if (localExecuter.isRunning()) {
localExecuter.cancelTask();
@@ -747,7 +759,6 @@
}
-
/**
* Fuegt der Map einen Listener hinzu.
*
@@ -1966,7 +1977,7 @@
private long lastRenderingDuration = 1000;
private XMapPaneTool tool = null;
- private Timer blinkTimer ;
+ private Timer blinkTimer;
/**
* Set the minimum (nearest) allowed zoom scale. This is the bigger number
@@ -2707,10 +2718,9 @@
public double getDefaultMaxMapExtendMode() {
return defaultMaxMapExtendMode;
}
-
final static int BLINK_TIMER_DEPLAY = 800;
-
+
private Timer initBlinkTimer() {
Timer timer = new Timer(BLINK_TIMER_DEPLAY, new ActionListener() {
More information about the Schmitzm-commits
mailing list