[Schmitzm-commits] r1364 - in trunk/src/schmitzm: geotools/gui geotools/gui/resource/locales lang swing
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Sun Dec 26 23:05:48 CET 2010
Author: alfonx
Date: 2010-12-26 23:05:47 +0100 (Sun, 26 Dec 2010)
New Revision: 1364
Modified:
trunk/src/schmitzm/geotools/gui/ScalePane.java
trunk/src/schmitzm/geotools/gui/XMapPane.java
trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle.properties
trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_de.properties
trunk/src/schmitzm/lang/LangUtil.java
trunk/src/schmitzm/swing/SwingUtil.java
Log:
Modified: trunk/src/schmitzm/geotools/gui/ScalePane.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/ScalePane.java 2010-12-26 21:40:53 UTC (rev 1363)
+++ trunk/src/schmitzm/geotools/gui/ScalePane.java 2010-12-26 22:05:47 UTC (rev 1364)
@@ -50,8 +50,12 @@
* @version 1.0
*/
public class ScalePane extends JPanel {
- private static final DecimalFormat numFormat = new DecimalFormat(
+ /** Numberformat used for meters */
+ static final DecimalFormat meterNumFormat = new DecimalFormat(
"###,###,##0.00");
+ /** Numberformat used for OGC Scale Denominator */
+ static final NumberFormat ogcScaleNumFormat = NumberFormat
+ .getIntegerInstance();
/** Massstab-Balken */
private ScalePanel scalePanel = new ScalePanel();
@@ -116,16 +120,21 @@
public void setScale(double meters, double scaleDenominator) {
getScalePanel().setScale(meters);
- // TODO i8n
if (isPixelEqualsLabelVisible() && meters != 0)
- scaleLabel.setText("1 pixel = " + numFormat.format(meters) + "m ");
+
+ scaleLabel.setText(GeotoolsGUIUtil.R("ScalePane.PixelMetersScale",
+ meterNumFormat.format(meters)) + " ");
+
else
scaleLabel.setText("");
if (isOgcScaleDenominatorVisible() && scaleDenominator != 0) {
- scaleLabel.setText(scaleLabel.getText() + "(OGC scale denominator "
- + NumberFormat.getNumberInstance().format(scaleDenominator)
- + ")");
+
+ final String ogcScaleText = GeotoolsGUIUtil.R(
+ "ScalePane.OGCScaleDenominator",
+ ogcScaleNumFormat.format(scaleDenominator));
+
+ scaleLabel.setText(scaleLabel.getText() + ogcScaleText);
}
repaint();
Modified: trunk/src/schmitzm/geotools/gui/XMapPane.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/XMapPane.java 2010-12-26 21:40:53 UTC (rev 1363)
+++ trunk/src/schmitzm/geotools/gui/XMapPane.java 2010-12-26 22:05:47 UTC (rev 1364)
@@ -2330,6 +2330,8 @@
public Envelope tranformWindowToGeo(final int ox, final int oy,
final int px, final int py) {
final AffineTransform at = getScreenToWorld();
+ if (at == null)
+ return null;
final Point2D geoO = at.transform(new Point2D.Double(ox, oy), null);
final Point2D geoP = at.transform(new Point2D.Double(px, py), null);
Modified: trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle.properties
===================================================================
--- trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle.properties 2010-12-26 21:40:53 UTC (rev 1363)
+++ trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle.properties 2010-12-26 22:05:47 UTC (rev 1364)
@@ -191,4 +191,5 @@
AtlasFeatureLayerFilterDialog.WindowTitle = Filter by attribute: ${0}
FilterTableCellEditor.FilterDialogTitle = Filter for ${0} (${1}), ${2}
-ScalePane.OGCScale=Scale: 1:${0}
+ScalePane.OGCScaleDenominator=Scale: 1:${0}
+ScalePane.PixelMetersScale=1 pixel = {0} meters
Modified: trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_de.properties
===================================================================
--- trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_de.properties 2010-12-26 21:40:53 UTC (rev 1363)
+++ trunk/src/schmitzm/geotools/gui/resource/locales/GTResourceBundle_de.properties 2010-12-26 22:05:47 UTC (rev 1364)
@@ -189,4 +189,5 @@
AtlasFeatureLayerFilterDialog.AttributeTableHeader.VariableName=Variable
AtlasFeatureLayerFilterDialog.WindowTitle=Attributfilter\: ${0}
-ScalePane.OGCScale=Ma\ufffdstab: 1:${0}
+ScalePane.OGCScaleDenominator=Ma\uFFFDstab\: 1\:${0}
+ScalePane.PixelMetersScale=1 Pixel = {0}m
Modified: trunk/src/schmitzm/lang/LangUtil.java
===================================================================
--- trunk/src/schmitzm/lang/LangUtil.java 2010-12-26 21:40:53 UTC (rev 1363)
+++ trunk/src/schmitzm/lang/LangUtil.java 2010-12-26 22:05:47 UTC (rev 1364)
@@ -1251,7 +1251,7 @@
* @param defMinValue
* value taken as minimum if a collection is empty
* @param collections
- * some collections
+ * some Integers.
*/
public static int min(int defMinValue, Collection<Integer>... collections) {
int minValue = defMinValue;
@@ -1434,7 +1434,7 @@
Logger.getLogger("com.sun.faces").setLevel(Level.WARN);
Logger.getLogger("org.hibernate").setLevel(Level.WARN);
Logger.getLogger("net.sf.ehcache.hibernate").setLevel(Level.WARN);
-
+
if (Logger.getRootLogger().getAllAppenders().hasMoreElements())
return;
Modified: trunk/src/schmitzm/swing/SwingUtil.java
===================================================================
--- trunk/src/schmitzm/swing/SwingUtil.java 2010-12-26 21:40:53 UTC (rev 1363)
+++ trunk/src/schmitzm/swing/SwingUtil.java 2010-12-26 22:05:47 UTC (rev 1364)
@@ -1244,9 +1244,11 @@
table.getColumnModel().getColumn(idx).setCellRenderer(cellRenderer);
if (minWidth != null)
table.getColumnModel().getColumn(idx).setMinWidth(minWidth);
- if (preferredWidth != null)
+ if (preferredWidth != null) {
table.getColumnModel().getColumn(idx)
.setPreferredWidth(preferredWidth);
+ table.getColumnModel().getColumn(idx).setWidth(preferredWidth);
+ }
if (maxWidth != null)
table.getColumnModel().getColumn(idx).setMaxWidth(maxWidth);
More information about the Schmitzm-commits
mailing list