59 |
import schmitzm.lang.LangUtil; |
import schmitzm.lang.LangUtil; |
60 |
import schmitzm.lang.ResourceProvider; |
import schmitzm.lang.ResourceProvider; |
61 |
import schmitzm.swing.ButtonGroup; |
import schmitzm.swing.ButtonGroup; |
|
import schmitzm.swing.SwingUtil; |
|
62 |
import skrueger.swing.SmallButton; |
import skrueger.swing.SmallButton; |
63 |
import skrueger.swing.SmallToggleButton; |
import skrueger.swing.SmallToggleButton; |
64 |
|
|
95 |
|
|
96 |
/** Constant for the tool "Zoom In" (110). */ |
/** Constant for the tool "Zoom In" (110). */ |
97 |
public static final int TOOL_ZOOMIN = 110; |
public static final int TOOL_ZOOMIN = 110; |
98 |
|
public static final int ACTION_ZOOM_DEFAULT = 150; |
99 |
/** Constant for the tool "Zoom Out" (120). */ |
/** Constant for the tool "Zoom Out" (120). */ |
100 |
public static final int TOOL_ZOOMOUT = 120; |
public static final int TOOL_ZOOMOUT = 120; |
101 |
/** Constant for the action "Zoom back" (130). */ |
/** Constant for the action "Zoom back" (130). */ |
318 |
// MapView.class.getResource("resource/icons/info.png")), |
// MapView.class.getResource("resource/icons/info.png")), |
319 |
// R("MapPaneButtons.Info.TT")), false); |
// R("MapPaneButtons.Info.TT")), false); |
320 |
addTool(new MapPaneToolBarAction(TOOL_INFO, this, XMapPaneTool.INFO), false); |
addTool(new MapPaneToolBarAction(TOOL_INFO, this, XMapPaneTool.INFO), false); |
321 |
|
|
322 |
// Zoom in |
// Zoom in |
323 |
addTool(new MapPaneToolBarAction(TOOL_ZOOMIN, this, XMapPaneTool.ZOOM_IN), false); |
addTool(new MapPaneToolBarAction(TOOL_ZOOMIN, this, XMapPaneTool.ZOOM_IN), false); |
324 |
|
|
491 |
protected void performActionButton(int action, ActionEvent e) { |
protected void performActionButton(int action, ActionEvent e) { |
492 |
if (mapPane == null) |
if (mapPane == null) |
493 |
return; |
return; |
494 |
|
|
495 |
// Perform the action "Zoom back": Revert the last zoom |
// Perform the action "Zoom back": Revert the last zoom |
496 |
if (action == ACTION_ZOOM_BACK) { |
if (action == ACTION_ZOOM_BACK) { |
497 |
if (zoomBackIndex <= 1) |
if (zoomBackIndex <= 1) |
641 |
* {@linkplain #getToolButton(int) tool button} |
* {@linkplain #getToolButton(int) tool button} |
642 |
*/ |
*/ |
643 |
public AbstractButton getButton(int id) { |
public AbstractButton getButton(int id) { |
644 |
|
|
645 |
|
//ACHUTNG: Das ist ein SK QUICK FIX! TODO |
646 |
|
if (!(toolAndActionButtons.get(id) instanceof AbstractButton)) return null; |
647 |
|
|
648 |
AbstractButton button = (AbstractButton) toolAndActionButtons.get(id); |
AbstractButton button = (AbstractButton) toolAndActionButtons.get(id); |
649 |
if (button == null) |
if (button == null) |
650 |
LOGGER.warn("Unknown tool or action ID: " + id); |
LOGGER.warn("Unknown tool or action ID: " + id); |
786 |
* is {@code false} |
* is {@code false} |
787 |
*/ |
*/ |
788 |
public void setAllToolsEnabled(boolean enabled, boolean hideOnDisable) { |
public void setAllToolsEnabled(boolean enabled, boolean hideOnDisable) { |
789 |
for (int tool : toolAndActionButtons.keySet()) |
for (int id : toolAndActionButtons.keySet()) { |
790 |
setButtonEnabled(tool, enabled, hideOnDisable); |
if (toolAndActionButtons.get(id) instanceof JToggleButton) { |
791 |
|
setButtonEnabled(id, enabled, hideOnDisable); |
792 |
|
} |
793 |
|
} |
794 |
} |
} |
795 |
|
|
796 |
/** |
/** |
797 |
* Sets the activation for all actions. |
* Sets the activation for all actions. |
798 |
* |
* |
914 |
} |
} |
915 |
|
|
916 |
public MapPaneToolBarAction(int id, MapPaneToolBar toolBar, XMapPaneTool tool) { |
public MapPaneToolBarAction(int id, MapPaneToolBar toolBar, XMapPaneTool tool) { |
917 |
this(id, toolBar, "", tool.icon, tool.toolTip); |
this(id, toolBar, "", tool.getIcon(), tool.getToolTip()); |
918 |
} |
} |
919 |
|
|
920 |
/** |
/** |