[Schmitzm-commits] r785 - trunk/src/schmitzm/geotools/gui

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Apr 6 13:30:38 CEST 2010


Author: alfonx
Date: 2010-04-06 13:30:36 +0200 (Tue, 06 Apr 2010)
New Revision: 785

Modified:
   trunk/src/schmitzm/geotools/gui/XMapPaneTool.java
Log:
die icon png bilder werden nun anders referenziert...


Modified: trunk/src/schmitzm/geotools/gui/XMapPaneTool.java
===================================================================
--- trunk/src/schmitzm/geotools/gui/XMapPaneTool.java	2010-04-04 16:56:57 UTC (rev 784)
+++ trunk/src/schmitzm/geotools/gui/XMapPaneTool.java	2010-04-06 11:30:36 UTC (rev 785)
@@ -24,444 +24,461 @@
  * {@link XMapPaneAction}s and provides a tool icon and a default mouse cursor.
  */
 public class XMapPaneTool implements Copyable<XMapPaneTool> {
-  public static ResourceProvider RESOURCE = new ResourceProvider(
-      LangUtil.extendPackagePath(MapPaneToolBar.class,
-      "resource.locales.mapPaneToolbar"),
-      Locale.ENGLISH);
-  public static String R(String key, Object... values) {
-    return RESOURCE.getString(key, values);
-  }
+	public static ResourceProvider RESOURCE = new ResourceProvider(LangUtil
+			.extendPackagePath(MapPaneToolBar.class,
+					"resource.locales.mapPaneToolbar"), Locale.ENGLISH);
 
-  /** The cursor of the mouse if the tool is active **/
-  private Cursor cursor = null;
+	public static String R(String key, Object... values) {
+		return RESOURCE.getString(key, values);
+	}
 
-  /** A tool-tip for the tool , optional **/
-  private String toolTip = null;
+	/** The cursor of the mouse if the tool is active **/
+	private Cursor cursor = null;
 
-  /** The icon for the button **/
-  private Icon icon = null;
+	/** A tool-tip for the tool , optional **/
+	private String toolTip = null;
 
-  /**
-   * Defines which {@link XMapPaneAction} should be should be called when a
-   * {@link MouseInputType} is triggered
-   **/
-  Map<MouseInputType, XMapPaneAction> mouseActions = new HashMap<MouseInputType, XMapPaneAction>();
+	/** The icon for the button **/
+	private Icon icon = null;
 
-  /**
-   * Defines which {@link XMapPaneAction#performKeyboard(XMapPane, Object)}
-   * should be called when a {@link KeyStroke} is triggered
-   **/
-  Map<KeyStroke, XMapPaneAction> keyAction = new HashMap<KeyStroke, XMapPaneAction>();
+	/**
+	 * Defines which {@link XMapPaneAction} should be should be called when a
+	 * {@link MouseInputType} is triggered
+	 **/
+	Map<MouseInputType, XMapPaneAction> mouseActions = new HashMap<MouseInputType, XMapPaneAction>();
 
-  /**
-   * Defines which optional parameter should be passed to
-   * {@link XMapPaneAction#performKeyboard(XMapPane, Object)} if a
-   * {@link KeyStroke} is triggered
-   **/
-  Map<KeyStroke, Object> keyActionParams = new HashMap<KeyStroke, Object>();
+	/**
+	 * Defines which {@link XMapPaneAction#performKeyboard(XMapPane, Object)}
+	 * should be called when a {@link KeyStroke} is triggered
+	 **/
+	Map<KeyStroke, XMapPaneAction> keyAction = new HashMap<KeyStroke, XMapPaneAction>();
 
-  /**
-   * The default constructor sets some default keyboard settings
-   */
-  public XMapPaneTool() {
-    initTool();
-  }
+	/**
+	 * Defines which optional parameter should be passed to
+	 * {@link XMapPaneAction#performKeyboard(XMapPane, Object)} if a
+	 * {@link KeyStroke} is triggered
+	 **/
+	Map<KeyStroke, Object> keyActionParams = new HashMap<KeyStroke, Object>();
 
-  /**
-   * Called by the constructor. Initializes the tool actions by defining default
-   * keyboard actions.
-   */
-  protected void initTool() {
-    // + and - keys zoom
-    keyAction.put(KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, 0),
-                  XMapPaneAction.ZOOM_IN);
-    keyAction.put(KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, 0),
-                  XMapPaneAction.ZOOM_OUT);
+	/**
+	 * The default constructor sets some default keyboard settings
+	 */
+	public XMapPaneTool() {
+		initTool();
+	}
 
-    KeyStroke keyStroke;
-    for (int modifier : new int[] { InputEvent.ALT_DOWN_MASK,
-                                   InputEvent.ALT_GRAPH_DOWN_MASK,
-                                   InputEvent.CTRL_DOWN_MASK,
-                                   InputEvent.SHIFT_DOWN_MASK,
-                                   InputEvent.META_DOWN_MASK }) {
-      // RIGHT button pan
-      keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, modifier);
-      keyAction.put(keyStroke, XMapPaneAction.PAN);
-      keyActionParams.put(keyStroke, XMapPaneAction_Pan.Direction.RIGHT);
+	/**
+	 * Called by the constructor. Initializes the tool actions by defining
+	 * default keyboard actions.
+	 */
+	protected void initTool() {
+		// + and - keys zoom
+		keyAction.put(KeyStroke.getKeyStroke(KeyEvent.VK_PLUS, 0),
+				XMapPaneAction.ZOOM_IN);
+		keyAction.put(KeyStroke.getKeyStroke(KeyEvent.VK_MINUS, 0),
+				XMapPaneAction.ZOOM_OUT);
 
-      // LEFT button pan
-      keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, modifier);
-      keyAction.put(keyStroke, XMapPaneAction.PAN);
-      keyActionParams.put(keyStroke, XMapPaneAction_Pan.Direction.LEFT);
+		KeyStroke keyStroke;
+		for (int modifier : new int[] { InputEvent.ALT_DOWN_MASK,
+				InputEvent.ALT_GRAPH_DOWN_MASK, InputEvent.CTRL_DOWN_MASK,
+				InputEvent.SHIFT_DOWN_MASK, InputEvent.META_DOWN_MASK }) {
+			// RIGHT button pan
+			keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_LEFT, modifier);
+			keyAction.put(keyStroke, XMapPaneAction.PAN);
+			keyActionParams.put(keyStroke, XMapPaneAction_Pan.Direction.RIGHT);
 
-      // UP button pan
-      keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, modifier);
-      keyAction.put(keyStroke, XMapPaneAction.PAN);
-      keyActionParams.put(keyStroke, XMapPaneAction_Pan.Direction.UP);
+			// LEFT button pan
+			keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT, modifier);
+			keyAction.put(keyStroke, XMapPaneAction.PAN);
+			keyActionParams.put(keyStroke, XMapPaneAction_Pan.Direction.LEFT);
 
-      // DOWN button pan
-      keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_UP, modifier);
-      keyAction.put(keyStroke, XMapPaneAction.PAN);
-      keyActionParams.put(keyStroke, XMapPaneAction_Pan.Direction.DOWN);
-    }
-  }
-  
-  /**
-   * Returns a copy of the tool to derive other tools.
-   */
-  public XMapPaneTool copy() {
-    return copyTo(null);
-  }
+			// UP button pan
+			keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_DOWN, modifier);
+			keyAction.put(keyStroke, XMapPaneAction.PAN);
+			keyActionParams.put(keyStroke, XMapPaneAction_Pan.Direction.UP);
 
-  /**
-   * Copies all actions of this tool to another.
-   * @param tool tool to copy the actions to (if {@code null} a new
-   *             tool is created)
-   * @return the modified or created tool
-   */
-  public XMapPaneTool copyTo(XMapPaneTool tool) {
-    if ( tool == null )
-      tool = new XMapPaneTool();
-    
-    tool.setCursor( getCursor() );
-    tool.setIcon( getIcon() );
-    tool.setToolTip( getToolTip() );
-    for ( MouseInputType type : mouseActions.keySet() )
-      tool.setMouseAction(type, getMouseAction(type));
-    for ( KeyStroke stroke : keyAction.keySet() )
-      tool.setKeyAction(stroke, getKeyAction(stroke));
-    for ( KeyStroke stroke : keyActionParams.keySet() )
-      tool.setKeyActionParam(stroke, getKeyActionParam(stroke));
-    
-    return tool;
-  }
+			// DOWN button pan
+			keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_UP, modifier);
+			keyAction.put(keyStroke, XMapPaneAction.PAN);
+			keyActionParams.put(keyStroke, XMapPaneAction_Pan.Direction.DOWN);
+		}
+	}
 
-  /**
-   * @return the {@link Cursor} that shall be set as the default mouse cursor
-   *         (when no button is clicked)
-   */
-  public Cursor getCursor() {
-    return cursor;
-  }
+	/**
+	 * Returns a copy of the tool to derive other tools.
+	 */
+	public XMapPaneTool copy() {
+		return copyTo(null);
+	}
 
-  /**
-   * @return the {@link Cursor} that shall be set as the default mouse cursor
-   *         (when no button is clicked)
-   */
-  public void setCursor(Cursor cursor) {
-    this.cursor = cursor;
-  }
+	/**
+	 * Copies all actions of this tool to another.
+	 * 
+	 * @param tool
+	 *            tool to copy the actions to (if {@code null} a new tool is
+	 *            created)
+	 * @return the modified or created tool
+	 */
+	public XMapPaneTool copyTo(XMapPaneTool tool) {
+		if (tool == null)
+			tool = new XMapPaneTool();
 
-  public String getToolTip() {
-    return toolTip;
-  }
+		tool.setCursor(getCursor());
+		tool.setIcon(getIcon());
+		tool.setToolTip(getToolTip());
+		for (MouseInputType type : mouseActions.keySet())
+			tool.setMouseAction(type, getMouseAction(type));
+		for (KeyStroke stroke : keyAction.keySet())
+			tool.setKeyAction(stroke, getKeyAction(stroke));
+		for (KeyStroke stroke : keyActionParams.keySet())
+			tool.setKeyActionParam(stroke, getKeyActionParam(stroke));
 
-  public void setToolTip(String toolTip) {
-    this.toolTip = toolTip;
-  }
+		return tool;
+	}
 
-  /**
-   * An icon to use if the tool is associated with a button. May be
-   * <code>null</code>.
-   */
-  public Icon getIcon() {
-    return icon;
-  }
+	/**
+	 * @return the {@link Cursor} that shall be set as the default mouse cursor
+	 *         (when no button is clicked)
+	 */
+	public Cursor getCursor() {
+		return cursor;
+	}
 
-  /**
-   * An icon to use if the tool is associated with a button. May be
-   * <code>null</code>.
-   */
-  public void setIcon(Icon icon) {
-    this.icon = icon;
-  }
+	/**
+	 * @return the {@link Cursor} that shall be set as the default mouse cursor
+	 *         (when no button is clicked)
+	 */
+	public void setCursor(Cursor cursor) {
+		this.cursor = cursor;
+	}
 
-  /**
-   * @return The {@link XMapPaneAction} associated with a given
-   *         {@link MouseInputType}
-   */
-  public XMapPaneAction getMouseAction(MouseInputType type) {
-    return mouseActions.get(type);
-  }
+	public String getToolTip() {
+		return toolTip;
+	}
 
-  /**
-   * Sets the {@link XMapPaneAction} for a given {@link MouseInputType}
-   */
-  public void setMouseAction(MouseInputType type, XMapPaneAction mouseAction) {
-    this.mouseActions.put(type, mouseAction);
-  }
+	public void setToolTip(String toolTip) {
+		this.toolTip = toolTip;
+	}
 
-  /**
-   * @return The {@link XMapPaneAction} associated with a {@link KeyStroke}
-   */
-  public XMapPaneAction getKeyAction(KeyStroke keyStroke) {
-    return keyAction.get(keyStroke);
-  }
+	/**
+	 * An icon to use if the tool is associated with a button. May be
+	 * <code>null</code>.
+	 */
+	public Icon getIcon() {
+		return icon;
+	}
 
-  /**
-   * Set the {@link XMapPaneAction} for a {@link KeyStroke}
-   */
-  public void setKeyAction(KeyStroke keyStroke, XMapPaneAction keyAction) {
-    this.keyAction.put(keyStroke, keyAction);
-  }
+	/**
+	 * An icon to use if the tool is associated with a button. May be
+	 * <code>null</code>.
+	 */
+	public void setIcon(Icon icon) {
+		this.icon = icon;
+	}
 
-  /**
-   * Get the optional parameter for a{@link XMapPaneAction} when triggered by
-   * {@link KeyStroke}
-   */
-  public Object getKeyActionParam(KeyStroke keyStroke) {
-    return keyActionParams.get(keyStroke);
-  }
+	/**
+	 * @return The {@link XMapPaneAction} associated with a given
+	 *         {@link MouseInputType}
+	 */
+	public XMapPaneAction getMouseAction(MouseInputType type) {
+		return mouseActions.get(type);
+	}
 
-  /**
-   * Set the optional parameter for a{@link XMapPaneAction} when triggered by
-   * {@link KeyStroke}
-   */
-  public void setKeyActionParam(KeyStroke keyStroke, Object param) {
-    this.keyActionParams.put(keyStroke, param);
-  }
+	/**
+	 * Sets the {@link XMapPaneAction} for a given {@link MouseInputType}
+	 */
+	public void setMouseAction(MouseInputType type, XMapPaneAction mouseAction) {
+		this.mouseActions.put(type, mouseAction);
+	}
 
-  /** This {@link XMapPaneTool} does nothing **/
-  public static XMapPaneTool NO_ACTION = new XMapPaneTool();
-  static {
-    // Remove the keyboard mapping that are defined by the default
-    // constructor
-    NO_ACTION.keyAction.clear();
-    NO_ACTION.keyActionParams.clear();
-  }
+	/**
+	 * @return The {@link XMapPaneAction} associated with a {@link KeyStroke}
+	 */
+	public XMapPaneAction getKeyAction(KeyStroke keyStroke) {
+		return keyAction.get(keyStroke);
+	}
 
-  /** The configuration of the default ZOOM IN {@link XMapPaneTool} **/
-  public static XMapPaneTool ZOOM_IN = new XMapPaneTool();
-  static {
-    ZOOM_IN.icon = new ImageIcon(
-        MapView.class.getResource("resource/icons/zoom_in.png"));
-    ZOOM_IN.toolTip = R("MapPaneButtons.ZoomIn.TT");
-    ZOOM_IN.cursor = SwingUtil.ZOOMIN_CURSOR;
+	/**
+	 * Set the {@link XMapPaneAction} for a {@link KeyStroke}
+	 */
+	public void setKeyAction(KeyStroke keyStroke, XMapPaneAction keyAction) {
+		this.keyAction.put(keyStroke, keyAction);
+	}
 
-    // Left mouse click & drag zoom in
-    ZOOM_IN.mouseActions.put(MouseInputType.LClick, XMapPaneAction.ZOOM_IN);
-    ZOOM_IN.mouseActions.put(MouseInputType.LDrag, XMapPaneAction.ZOOM_IN);
+	/**
+	 * Get the optional parameter for a{@link XMapPaneAction} when triggered by
+	 * {@link KeyStroke}
+	 */
+	public Object getKeyActionParam(KeyStroke keyStroke) {
+		return keyActionParams.get(keyStroke);
+	}
 
-    // Right mouse click & drag zoom out
-    ZOOM_IN.mouseActions.put(MouseInputType.RClick, XMapPaneAction.ZOOM_OUT);
-    ZOOM_IN.mouseActions.put(MouseInputType.RDrag, XMapPaneAction.PAN);
+	/**
+	 * Set the optional parameter for a{@link XMapPaneAction} when triggered by
+	 * {@link KeyStroke}
+	 */
+	public void setKeyActionParam(KeyStroke keyStroke, Object param) {
+		this.keyActionParams.put(keyStroke, param);
+	}
 
-    // Mousewheel can zoom too
-    ZOOM_IN.mouseActions.put(MouseInputType.Wheel, XMapPaneAction.ZOOM_IN);
-  }
+	/** This {@link XMapPaneTool} does nothing **/
+	public static XMapPaneTool NO_ACTION = new XMapPaneTool();
+	static {
+		// Remove the keyboard mapping that are defined by the default
+		// constructor
+		NO_ACTION.keyAction.clear();
+		NO_ACTION.keyActionParams.clear();
+	}
 
-  /** The configuration of the default ZOOM IN {@link XMapPaneTool} **/
-  public static XMapPaneTool ZOOM_OUT = new XMapPaneTool();
-  static {
-    ZOOM_OUT.icon = new ImageIcon(
-        MapView.class.getResource("resource/icons/zoom_out.png"));
-    ZOOM_OUT.toolTip = R("MapPaneButtons.ZoomOut.TT");
-    ZOOM_OUT.cursor = SwingUtil.ZOOMOUT_CURSOR;
+	/** The configuration of the default ZOOM IN {@link XMapPaneTool} **/
+	public static XMapPaneTool ZOOM_IN = new XMapPaneTool();
+	static {
+		ZOOM_IN.icon = new ImageIcon(XMapPaneTool.class
+				.getResource("/skrueger/geotools/resource/icons/zoom_in.png"));
+		ZOOM_IN.toolTip = R("MapPaneButtons.ZoomIn.TT");
+		ZOOM_IN.cursor = SwingUtil.ZOOMIN_CURSOR;
 
-    // Left mouse click & drag zoom in
-    ZOOM_OUT.mouseActions.put(MouseInputType.LClick, XMapPaneAction.ZOOM_OUT);
-    ZOOM_OUT.mouseActions.put(MouseInputType.LDrag, XMapPaneAction.ZOOM_OUT);
+		// Left mouse click & drag zoom in
+		ZOOM_IN.mouseActions.put(MouseInputType.LClick, XMapPaneAction.ZOOM_IN);
+		ZOOM_IN.mouseActions.put(MouseInputType.LDrag, XMapPaneAction.ZOOM_IN);
 
-    // Right mouse click & drag zoom out
-    ZOOM_OUT.mouseActions.put(MouseInputType.RClick, XMapPaneAction.ZOOM_IN);
-    ZOOM_OUT.mouseActions.put(MouseInputType.RDrag, XMapPaneAction.PAN);
+		// Right mouse click & drag zoom out
+		ZOOM_IN.mouseActions
+				.put(MouseInputType.RClick, XMapPaneAction.ZOOM_OUT);
+		ZOOM_IN.mouseActions.put(MouseInputType.RDrag, XMapPaneAction.PAN);
 
-    // Mousewheel can zoom
-    ZOOM_OUT.mouseActions.put(MouseInputType.Wheel, XMapPaneAction.ZOOM_IN);
+		// Mousewheel can zoom too
+		ZOOM_IN.mouseActions.put(MouseInputType.Wheel, XMapPaneAction.ZOOM_IN);
+	}
 
-  }
+	/** The configuration of the default ZOOM IN {@link XMapPaneTool} **/
+	public static XMapPaneTool ZOOM_OUT = new XMapPaneTool();
+	static {
+		ZOOM_OUT.icon = new ImageIcon(XMapPaneTool.class
+				.getResource("/skrueger/geotools/resource/icons/zoom_out.png"));
+		ZOOM_OUT.toolTip = R("MapPaneButtons.ZoomOut.TT");
+		ZOOM_OUT.cursor = SwingUtil.ZOOMOUT_CURSOR;
 
-  /** The configuration of the PAN {@link XMapPaneTool} **/
-  public static final XMapPaneTool PAN = new XMapPaneTool();
-  static {
-    PAN.icon = new ImageIcon(
-        MapView.class.getResource("resource/icons/pan.png"));
-    PAN.toolTip = R("MapPaneButtons.Pan.TT");
-    PAN.cursor = SwingUtil.PAN_CURSOR;
+		// Left mouse click & drag zoom in
+		ZOOM_OUT.mouseActions.put(MouseInputType.LClick,
+				XMapPaneAction.ZOOM_OUT);
+		ZOOM_OUT.mouseActions
+				.put(MouseInputType.LDrag, XMapPaneAction.ZOOM_OUT);
 
-    // Left mouse click & drag zoom in
-    PAN.mouseActions.put(MouseInputType.LClick, XMapPaneAction.PAN);
-    PAN.mouseActions.put(MouseInputType.LDrag, XMapPaneAction.PAN);
+		// Right mouse click & drag zoom out
+		ZOOM_OUT.mouseActions
+				.put(MouseInputType.RClick, XMapPaneAction.ZOOM_IN);
+		ZOOM_OUT.mouseActions.put(MouseInputType.RDrag, XMapPaneAction.PAN);
 
-    // Right mouse click & drag zoom out
-    PAN.mouseActions.put(MouseInputType.RClick, XMapPaneAction.PAN);
-    PAN.mouseActions.put(MouseInputType.RDrag, XMapPaneAction.PAN);
+		// Mousewheel can zoom
+		ZOOM_OUT.mouseActions.put(MouseInputType.Wheel, XMapPaneAction.ZOOM_IN);
 
-    // Mousewheel can zoom
-    PAN.mouseActions.put(MouseInputType.Wheel, XMapPaneAction.ZOOM_IN);
+	}
 
-  }
+	/** The configuration of the PAN {@link XMapPaneTool} **/
+	public static final XMapPaneTool PAN = new XMapPaneTool();
+	static {
+		PAN.icon = new ImageIcon(XMapPaneTool.class
+				.getResource("/skrueger/geotools/resource/icons/pan.png"));
+		PAN.toolTip = R("MapPaneButtons.Pan.TT");
+		PAN.cursor = SwingUtil.PAN_CURSOR;
 
-  /** A tool that will do a select_top action on the left mouse button **/
-  public static final XMapPaneTool SELECTION_TOP_LAYER = new XMapPaneTool();
-  static {
-    SELECTION_TOP_LAYER.icon = new ImageIcon(
-        MapView.class.getResource("resource/icons/selection_set.png"));
+		// Left mouse click & drag zoom in
+		PAN.mouseActions.put(MouseInputType.LClick, XMapPaneAction.PAN);
+		PAN.mouseActions.put(MouseInputType.LDrag, XMapPaneAction.PAN);
 
-    SELECTION_TOP_LAYER.cursor = SwingUtil.SELECTION_SET_CURSOR;
+		// Right mouse click & drag zoom out
+		PAN.mouseActions.put(MouseInputType.RClick, XMapPaneAction.PAN);
+		PAN.mouseActions.put(MouseInputType.RDrag, XMapPaneAction.PAN);
 
-    // Left mouse click & drag zoom in
-    SELECTION_TOP_LAYER.mouseActions.put(MouseInputType.LClick,
-                                         XMapPaneAction.SELECT_TOP);
-    SELECTION_TOP_LAYER.mouseActions.put(MouseInputType.LDrag,
-                                         XMapPaneAction.SELECT_TOP);
+		// Mousewheel can zoom
+		PAN.mouseActions.put(MouseInputType.Wheel, XMapPaneAction.ZOOM_IN);
 
-    SELECTION_TOP_LAYER.mouseActions.put(MouseInputType.RDrag,
-                                         XMapPaneAction.PAN);
+	}
 
-    // Mousewheel can zoom
-    SELECTION_TOP_LAYER.mouseActions.put(MouseInputType.Wheel,
-                                         XMapPaneAction.ZOOM_IN);
+	/** A tool that will do a select_top action on the left mouse button **/
+	public static final XMapPaneTool SELECTION_TOP_LAYER = new XMapPaneTool();
+	static {
+		SELECTION_TOP_LAYER.icon = new ImageIcon(
+				XMapPaneTool.class
+						.getResource("/skrueger/geotools/resource/icons/selection_set.png"));
 
-    // TODO Strg-A shoud select all
-  }
+		SELECTION_TOP_LAYER.cursor = SwingUtil.SELECTION_SET_CURSOR;
 
-  /** A tool that will do a select_top action on the left mouse button **/
-  public static final XMapPaneTool SELECTION_ONE_FROM_TOP_LAYER = new XMapPaneTool();
-  static {
-    SELECTION_ONE_FROM_TOP_LAYER.icon = new ImageIcon(
-        MapView.class.getResource("resource/icons/selection_set.png"));
+		// Left mouse click & drag zoom in
+		SELECTION_TOP_LAYER.mouseActions.put(MouseInputType.LClick,
+				XMapPaneAction.SELECT_TOP);
+		SELECTION_TOP_LAYER.mouseActions.put(MouseInputType.LDrag,
+				XMapPaneAction.SELECT_TOP);
 
-    SELECTION_ONE_FROM_TOP_LAYER.cursor = SwingUtil.SELECTION_SET_CURSOR;
+		SELECTION_TOP_LAYER.mouseActions.put(MouseInputType.RDrag,
+				XMapPaneAction.PAN);
 
-    // Left mouse click & drag zoom in
-    SELECTION_ONE_FROM_TOP_LAYER.mouseActions.put(
-                                                  MouseInputType.LClick,
-                                                  XMapPaneAction.SELECT_ONE_FROM_TOP);
-    SELECTION_ONE_FROM_TOP_LAYER.mouseActions.put(
-                                                  MouseInputType.LDrag,
-                                                  XMapPaneAction.SELECT_ONE_FROM_TOP);
+		// Mousewheel can zoom
+		SELECTION_TOP_LAYER.mouseActions.put(MouseInputType.Wheel,
+				XMapPaneAction.ZOOM_IN);
 
-    SELECTION_ONE_FROM_TOP_LAYER.mouseActions.put(MouseInputType.RDrag,
-                                                  XMapPaneAction.PAN);
+		// TODO Strg-A shoud select all
+	}
 
-    // Mousewheel can zoom
-    SELECTION_ONE_FROM_TOP_LAYER.mouseActions.put(MouseInputType.Wheel,
-                                                  XMapPaneAction.ZOOM_IN);
+	/** A tool that will do a select_top action on the left mouse button **/
+	public static final XMapPaneTool SELECTION_ONE_FROM_TOP_LAYER = new XMapPaneTool();
+	static {
+		SELECTION_ONE_FROM_TOP_LAYER.icon = new ImageIcon(
+				XMapPaneTool.class
+						.getResource("/skrueger/geotools/resource/icons/selection_set.png"));
 
-    // TODO Strg-A shoud select all
-  }
+		SELECTION_ONE_FROM_TOP_LAYER.cursor = SwingUtil.SELECTION_SET_CURSOR;
 
-  /** A tool that will do a select_top action on the left mouse button **/
-  public static final XMapPaneTool SELECTION_ALL_LAYERS = new XMapPaneTool();
-  static {
-    SELECTION_ALL_LAYERS.icon = new ImageIcon(
-        MapView.class.getResource("resource/icons/selection_set.png"));
+		// Left mouse click & drag zoom in
+		SELECTION_ONE_FROM_TOP_LAYER.mouseActions.put(MouseInputType.LClick,
+				XMapPaneAction.SELECT_ONE_FROM_TOP);
+		SELECTION_ONE_FROM_TOP_LAYER.mouseActions.put(MouseInputType.LDrag,
+				XMapPaneAction.SELECT_ONE_FROM_TOP);
 
-    SELECTION_ALL_LAYERS.cursor = SwingUtil.SELECTION_SET_CURSOR;
+		SELECTION_ONE_FROM_TOP_LAYER.mouseActions.put(MouseInputType.RDrag,
+				XMapPaneAction.PAN);
 
-    // Left mouse click & drag zoom in
-    SELECTION_ALL_LAYERS.mouseActions.put(MouseInputType.LClick,
-                                          XMapPaneAction.SELECT_ALL);
-    SELECTION_ALL_LAYERS.mouseActions.put(MouseInputType.LDrag,
-                                          XMapPaneAction.SELECT_ALL);
+		// Mousewheel can zoom
+		SELECTION_ONE_FROM_TOP_LAYER.mouseActions.put(MouseInputType.Wheel,
+				XMapPaneAction.ZOOM_IN);
 
-    SELECTION_ALL_LAYERS.mouseActions.put(MouseInputType.RDrag,
-                                          XMapPaneAction.PAN);
+		// TODO Strg-A shoud select all
+	}
 
-    // Mousewheel can zoom
-    SELECTION_ALL_LAYERS.mouseActions.put(MouseInputType.Wheel,
-                                          XMapPaneAction.ZOOM_IN);
+	/** A tool that will do a select_top action on the left mouse button **/
+	public static final XMapPaneTool SELECTION_ALL_LAYERS = new XMapPaneTool();
+	static {
+		SELECTION_ALL_LAYERS.icon = new ImageIcon(
+				XMapPaneTool.class
+						.getResource("/skrueger/geotools/resource/icons/selection_set.png"));
 
-    // TODO Strg-A shoud select all
-  }
+		SELECTION_ALL_LAYERS.cursor = SwingUtil.SELECTION_SET_CURSOR;
 
-  /** The configuration of the INFO {@link XMapPaneTool} **/
-  public static final XMapPaneTool INFO = new XMapPaneTool();
+		// Left mouse click & drag zoom in
+		SELECTION_ALL_LAYERS.mouseActions.put(MouseInputType.LClick,
+				XMapPaneAction.SELECT_ALL);
+		SELECTION_ALL_LAYERS.mouseActions.put(MouseInputType.LDrag,
+				XMapPaneAction.SELECT_ALL);
 
-  static {
-    INFO.icon = new ImageIcon(
-        MapView.class.getResource("resource/icons/info.png"));
-    INFO.toolTip = R("MapPaneButtons.Info.TT");
-    INFO.cursor = SwingUtil.INFO_CURSOR;
+		SELECTION_ALL_LAYERS.mouseActions.put(MouseInputType.RDrag,
+				XMapPaneAction.PAN);
 
-    // Left mouse click & drag zoom in
-    INFO.mouseActions.put(MouseInputType.LClick,
-                          XMapPaneAction.SELECT_ONE_FROM_TOP);
-    // INFO.mouseActions.put(MouseInputType.LDrag,
-    // XMapPaneAction.SELECT_ONE_FROM_TOP);
+		// Mousewheel can zoom
+		SELECTION_ALL_LAYERS.mouseActions.put(MouseInputType.Wheel,
+				XMapPaneAction.ZOOM_IN);
 
-    INFO.mouseActions.put(MouseInputType.RDrag, XMapPaneAction.PAN);
+		// TODO Strg-A shoud select all
+	}
 
-    // Mousewheel can zoom
-    INFO.mouseActions.put(MouseInputType.Wheel, XMapPaneAction.ZOOM_IN);
+	/** The configuration of the INFO {@link XMapPaneTool} **/
+	public static final XMapPaneTool INFO = new XMapPaneTool();
 
-  }
+	static {
+		INFO.icon = new ImageIcon(XMapPaneTool.class
+				.getResource("/skrueger/geotools/resource/icons/info.png"));
 
-  public static final XMapPaneTool SELECTION_ADD = new XMapPaneTool();
-  static {
-    SELECTION_ADD.icon = new ImageIcon(
-        MapView.class.getResource("resource/icons/selection_add.png"));
-    SELECTION_ADD.toolTip = R("MapPaneButtons.Selection.AddSelection.TT"); // TODO
-    // move
-    // to
-    // schmitzm
+		INFO.toolTip = R("MapPaneButtons.Info.TT");
+		INFO.cursor = SwingUtil.INFO_CURSOR;
 
-    SELECTION_ADD.cursor = SwingUtil.SELECTION_ADD_CURSOR;
+		// Left mouse click & drag zoom in
+		INFO.mouseActions.put(MouseInputType.LClick,
+				XMapPaneAction.SELECT_ONE_FROM_TOP);
+		// INFO.mouseActions.put(MouseInputType.LDrag,
+		// XMapPaneAction.SELECT_ONE_FROM_TOP);
 
-    // Left mouse click & drag zoom in
-    SELECTION_ADD.mouseActions.put(MouseInputType.LClick,
-                                   XMapPaneAction.SELECT_ALL);
-    SELECTION_ADD.mouseActions.put(MouseInputType.LDrag,
-                                   XMapPaneAction.SELECT_ALL);
+		INFO.mouseActions.put(MouseInputType.RDrag, XMapPaneAction.PAN);
 
-    SELECTION_ADD.mouseActions.put(MouseInputType.RDrag, XMapPaneAction.PAN);
+		// Mousewheel can zoom
+		INFO.mouseActions.put(MouseInputType.Wheel, XMapPaneAction.ZOOM_IN);
 
-    // Mousewheel can zoom
-    SELECTION_ADD.mouseActions.put(MouseInputType.Wheel, XMapPaneAction.ZOOM_IN);
+	}
 
-    // TODO Strg-A shoud select all
-  }
+	public static final XMapPaneTool SELECTION_ADD = new XMapPaneTool();
+	static {
+		SELECTION_ADD.icon = new ImageIcon(
+				XMapPaneTool.class
+						.getResource("/skrueger/geotools/resource/icons/selection_add.png"));
 
-  public static final XMapPaneTool SELECTION_REMOVE = new XMapPaneTool();
-  static {
-    SELECTION_REMOVE.icon = new ImageIcon(
-        MapView.class.getResource("resource/icons/selection_remove.png"));
-    SELECTION_REMOVE.toolTip = R("MapPaneButtons.Selection.RemoveSelection.TT"); // TODO
-    // move
-    // to
-    // schmitzm
+		SELECTION_ADD.toolTip = R("MapPaneButtons.Selection.AddSelection.TT"); // TODO
+		// move
+		// to
+		// schmitzm
 
-    SELECTION_REMOVE.cursor = SwingUtil.SELECTION_REMOVE_CURSOR;
+		SELECTION_ADD.cursor = SwingUtil.SELECTION_ADD_CURSOR;
 
-    // Left mouse click & drag zoom in
-    SELECTION_REMOVE.mouseActions.put(MouseInputType.LClick,
-                                      XMapPaneAction.SELECT_ALL);
-    SELECTION_REMOVE.mouseActions.put(MouseInputType.LDrag,
-                                      XMapPaneAction.SELECT_ALL);
+		// Left mouse click & drag zoom in
+		SELECTION_ADD.mouseActions.put(MouseInputType.LClick,
+				XMapPaneAction.SELECT_ALL);
+		SELECTION_ADD.mouseActions.put(MouseInputType.LDrag,
+				XMapPaneAction.SELECT_ALL);
 
-    SELECTION_REMOVE.mouseActions.put(MouseInputType.RDrag, XMapPaneAction.PAN);
+		SELECTION_ADD.mouseActions
+				.put(MouseInputType.RDrag, XMapPaneAction.PAN);
 
-    // Mousewheel can zoom
-    SELECTION_REMOVE.mouseActions.put(MouseInputType.Wheel,
-                                      XMapPaneAction.ZOOM_IN);
+		// Mousewheel can zoom
+		SELECTION_ADD.mouseActions.put(MouseInputType.Wheel,
+				XMapPaneAction.ZOOM_IN);
 
-    // TODO Strg-A shoud select all
-  }
+		// TODO Strg-A shoud select all
+	}
 
-  public static final XMapPaneTool SELECTION_SET = new XMapPaneTool();
-  static {
-    SELECTION_SET.icon = new ImageIcon(
-        MapView.class.getResource("resource/icons/selection_set.png"));
-    SELECTION_SET.toolTip = R("MapPaneButtons.Selection.SetSelection.TT"); // TODO
-    // move
-    // to
-    // schmitzm
+	public static final XMapPaneTool SELECTION_REMOVE = new XMapPaneTool();
+	static {
+		SELECTION_REMOVE.icon = new ImageIcon(
+				XMapPaneTool.class
+						.getResource("/skrueger/geotools/resource/icons/selection_remove.png"));
 
-    SELECTION_SET.cursor = SwingUtil.SELECTION_SET_CURSOR;
+		SELECTION_REMOVE.toolTip = R("MapPaneButtons.Selection.RemoveSelection.TT"); // TODO
+		// move
+		// to
+		// schmitzm
 
-    // Left mouse click & drag zoom in
-    SELECTION_SET.mouseActions.put(MouseInputType.LClick,
-                                   XMapPaneAction.SELECT_ALL);
-    SELECTION_SET.mouseActions.put(MouseInputType.LDrag,
-                                   XMapPaneAction.SELECT_ALL);
+		SELECTION_REMOVE.cursor = SwingUtil.SELECTION_REMOVE_CURSOR;
 
-    SELECTION_SET.mouseActions.put(MouseInputType.RDrag, XMapPaneAction.PAN);
+		// Left mouse click & drag zoom in
+		SELECTION_REMOVE.mouseActions.put(MouseInputType.LClick,
+				XMapPaneAction.SELECT_ALL);
+		SELECTION_REMOVE.mouseActions.put(MouseInputType.LDrag,
+				XMapPaneAction.SELECT_ALL);
 
-    // Mousewheel can zoom
-    SELECTION_SET.mouseActions.put(MouseInputType.Wheel, XMapPaneAction.ZOOM_IN);
+		SELECTION_REMOVE.mouseActions.put(MouseInputType.RDrag,
+				XMapPaneAction.PAN);
 
-    // TODO Strg-A shoud select all
-  }
+		// Mousewheel can zoom
+		SELECTION_REMOVE.mouseActions.put(MouseInputType.Wheel,
+				XMapPaneAction.ZOOM_IN);
 
+		// TODO Strg-A shoud select all
+	}
+
+	public static final XMapPaneTool SELECTION_SET = new XMapPaneTool();
+	static {
+		SELECTION_SET.icon = new ImageIcon(
+				XMapPaneTool.class
+						.getResource("/skrueger/geotools/resource/icons/selection_set.png"));
+
+		SELECTION_SET.toolTip = R("MapPaneButtons.Selection.SetSelection.TT"); // TODO
+		// move
+		// to
+		// schmitzm
+
+		SELECTION_SET.cursor = SwingUtil.SELECTION_SET_CURSOR;
+
+		// Left mouse click & drag zoom in
+		SELECTION_SET.mouseActions.put(MouseInputType.LClick,
+				XMapPaneAction.SELECT_ALL);
+		SELECTION_SET.mouseActions.put(MouseInputType.LDrag,
+				XMapPaneAction.SELECT_ALL);
+
+		SELECTION_SET.mouseActions
+				.put(MouseInputType.RDrag, XMapPaneAction.PAN);
+
+		// Mousewheel can zoom
+		SELECTION_SET.mouseActions.put(MouseInputType.Wheel,
+				XMapPaneAction.ZOOM_IN);
+
+		// TODO Strg-A shoud select all
+	}
+
 }



More information about the Schmitzm-commits mailing list