|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JToolBar
schmitzm.geotools.gui.JMapEditorToolBar
public class JMapEditorToolBar
A toolbar to control the operations of a JMapEditorPane
.
Nested Class Summary | |
---|---|
static class |
JMapEditorToolBar.EditorPaneToolBarAction
Extends the AbstractAction with maintaining an ID and
the JMapEditorToolBar the action controls. |
Nested classes/interfaces inherited from class javax.swing.JToolBar |
---|
JToolBar.AccessibleJToolBar, JToolBar.Separator |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected SortedMap<Integer,JButton> |
actionButtons
Holds the action buttons of the bar. |
static int |
EDIT_CLEAR
Constant for the tool "Undo all editor actions" (100). |
static int |
EDIT_FINISH
Constant for the tool "Finish current segment" (130). |
static int |
EDIT_REDO
Constant for the tool "Redo last undone editor action" (120). |
static int |
EDIT_UNDO
Constant for the tool "Undo last editor action" (110). |
protected JMapEditorPane |
editorPane
Holds the JMapEditorPane this tool bar controls. |
static int |
LAYER_CANCEL
Constant for the tool "Cancel layer" (30). |
static int |
LAYER_NEW
Constant for the tool "New layer" (10). |
static int |
LAYER_SAVE
Constant for the tool "Save layer" (20). |
protected JMapPaneListener |
mapPaneListener
Holds the listener, that reacts on editor actions. |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
JMapEditorToolBar()
Creates a new toolbar. |
|
JMapEditorToolBar(JMapEditorPane editorPane)
Creates a new tool bar. |
Method Summary | |
---|---|
void |
addAction(JMapEditorToolBar.EditorPaneToolBarAction buttonAction)
Adds an action to the tool bar and resets the toolbar GUI. |
void |
addAction(JMapEditorToolBar.EditorPaneToolBarAction buttonAction,
boolean resetToolBar)
Adds an action to the tool bar. |
protected void |
createNewLayer()
Starts new layer. |
JButton |
getActionButton(int action)
Returns the button for a specific action. |
AbstractButton |
getButton(int id)
Returns the button for a specific tool or action. |
int |
getMaxActionID()
Returns the maximum ID of actions. |
int |
getMinActionID()
Returns the minimum ID of actions. |
protected static String |
getResourceString(String key,
Object... params)
|
protected void |
init()
Calls initActions() and then puts all action buttons
to the tool bar. |
protected void |
initActions()
Creates the action buttons and adds them to actionButtons . |
protected void |
initToolBar()
Clears the GUI of all components and adds all action buttons to the tool bar. |
boolean |
isButtonEnabled(int id)
Checks whether a tool is activated. |
boolean |
isButtonIDUsed(int id)
Checks whether a ID is already used for a tool or action. |
protected void |
performActionButton(int action,
ActionEvent e)
Performs the action of an action button. |
void |
setAllActionsEnabled(boolean enabled,
boolean hideOnDisable)
Sets the activation for all actions. |
void |
setButtonEnabled(int id,
boolean enabled)
Sets whether an action is activated or not. |
void |
setButtonEnabled(int id,
boolean enabled,
boolean hideOnDisable)
Sets whether an action is activated or not. |
void |
setMapPane(JMapEditorPane editorPane)
Sets the JMapEditorPane controlled by this tool bar. |
protected void |
updateButtonActivation(JMapEditorPane.EditorMode editorMode)
Sets the enables/disables property for every toolbar button according to the current editor state. |
Methods inherited from class javax.swing.JToolBar |
---|
add, addImpl, addSeparator, addSeparator, createActionChangeListener, createActionComponent, getAccessibleContext, getComponentAtIndex, getComponentIndex, getMargin, getOrientation, getUI, getUIClassID, isBorderPainted, isFloatable, isRollover, paintBorder, paramString, setBorderPainted, setFloatable, setLayout, setMargin, setOrientation, setRollover, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int LAYER_NEW
public static final int LAYER_SAVE
public static final int LAYER_CANCEL
public static final int EDIT_CLEAR
public static final int EDIT_UNDO
public static final int EDIT_REDO
public static final int EDIT_FINISH
protected SortedMap<Integer,JButton> actionButtons
protected JMapEditorPane editorPane
JMapEditorPane
this tool bar controls.
protected JMapPaneListener mapPaneListener
Constructor Detail |
---|
public JMapEditorToolBar()
setMapPane(JMapEditorPane)
is called!
public JMapEditorToolBar(JMapEditorPane editorPane)
editorPane
- JMapEditorPane
the tool bar controlsMethod Detail |
---|
public void setMapPane(JMapEditorPane editorPane)
JMapEditorPane
controlled by this tool bar.
editorPane
- JMapEditorPane
to control (if null
this
tool bar controls NOTHING!)protected void init()
initActions()
and then puts all action buttons
to the tool bar.
protected void initActions()
actionButtons
.
protected void initToolBar()
protected void performActionButton(int action, ActionEvent e)
tool
- the actione
- the event of the buttonprotected void updateButtonActivation(JMapEditorPane.EditorMode editorMode)
editorMode
- editor mode (because some events are fired BEFORE
the new mode is set)protected void createNewLayer()
public void addAction(JMapEditorToolBar.EditorPaneToolBarAction buttonAction, boolean resetToolBar)
buttonAction
- action for the buttonresetToolBar
- indicates whether the toolbar GUI is reset after adding
the button (if adding several actions it useful only to
reset the GUI for the last added tool)public void addAction(JMapEditorToolBar.EditorPaneToolBarAction buttonAction)
buttonAction
- action for the toggle buttonpublic AbstractButton getButton(int id)
id
- the constant for a tool
JButton
if id
specifies an action button
or JToogleButton
if id
specifies a tool buttonpublic JButton getActionButton(int action)
action
- the constant an actionpublic void setButtonEnabled(int id, boolean enabled)
id
- actionIDenabled
- if true
the action becomes availablepublic void setButtonEnabled(int id, boolean enabled, boolean hideOnDisable)
id
- actionIDenabled
- if true
the tool becomes availablehideOnDisable
- if true
the button is also hidden if
enabled
is false
public boolean isButtonIDUsed(int id)
tool
- tool IDpublic boolean isButtonEnabled(int id)
tool
- tool ID
false
if an unknown ID is specifiedpublic void setAllActionsEnabled(boolean enabled, boolean hideOnDisable)
enabled
- if true
all actions becomes availablehideOnDisable
- if true
the buttons are also hidden if
enabled
is false
public int getMaxActionID()
public int getMinActionID()
protected static String getResourceString(String key, Object... params)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |