[Schmitzm-commits] r557 - branches/1.0-gt2-2.6/src/skrueger/geotools
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Nov 24 14:00:55 CET 2009
Author: alfonx
Date: 2009-11-24 14:00:54 +0100 (Tue, 24 Nov 2009)
New Revision: 557
Modified:
branches/1.0-gt2-2.6/src/skrueger/geotools/XMapPane.java
Log:
BAckround defaults to parten background color if parent is available
Modified: branches/1.0-gt2-2.6/src/skrueger/geotools/XMapPane.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/geotools/XMapPane.java 2009-11-24 12:56:09 UTC (rev 556)
+++ branches/1.0-gt2-2.6/src/skrueger/geotools/XMapPane.java 2009-11-24 13:00:54 UTC (rev 557)
@@ -616,7 +616,7 @@
if (!isWellDefined())
return;
- LOGGER.info("resizeTimer performed");
+ LOGGER.debug("resizeTimer performed");
final Rectangle bounds = getVisibleRect();
//
@@ -628,10 +628,10 @@
bounds.y + bounds.height);
if (setMapArea(geoMapArea)) {
- LOGGER.info(" maparea changed");
+ LOGGER.debug(" maparea changed");
paneResized = true;
} else
- LOGGER.info(" maparea NOT changed");
+ LOGGER.debug(" maparea NOT changed");
}
});
resizeTimer.setRepeats(false);
@@ -646,11 +646,11 @@
// Seems to be called twice with the same size..
if (oldVisibleRect != null
&& oldVisibleRect.equals(getVisibleRect())) {
- LOGGER.info("skipping resize.");
+ LOGGER.debug("skipping resize.");
return;
}
- LOGGER.info("resized: " + getVisibleRect());
+ LOGGER.debug("resized: " + getVisibleRect());
resizeTimer.restart();
oldVisibleRect = getVisibleRect();
}
@@ -1146,9 +1146,15 @@
}
/**
- * Returns the background {@link Color} of the map pane. Default is white.
+ * Returns the background {@link Color} of the map pane. If not set, the
+ * methods looks for a parent component and will use its background color.
+ * If no parent component is available, WHITE is returned.
**/
public Color getMapBackgroundColor() {
+ if (mapBackgroundColor == null){
+ if (getParent() != null) return getParent().getBackground();
+ else return Color.WHITE;
+ }
return mapBackgroundColor;
}
@@ -1418,7 +1424,7 @@
* completed.
*/
public void onRenderingCompleted() {
- LOGGER.info("complete");
+ LOGGER.debug("complete");
repaintTimer.stop();
@@ -1796,8 +1802,6 @@
* @param if <code>null</code>, white is used.
*/
public void setMapBackgroundColor(Color bgColor) {
- if (bgColor == null)
- bgColor = Color.WHITE;
this.mapBackgroundColor = bgColor;
}
More information about the Schmitzm-commits
mailing list