schmitzm.geotools.gui
Class StyleToolBar

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JToolBar
                  extended by schmitzm.geotools.gui.StyleToolBar
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants, InputOptionListener

public class StyleToolBar
extends JToolBar
implements InputOptionListener

A toolbar to define simple parameters of a layer style.

.

Author:
Martin Schmitz (University of Bonn/Germany)
See Also:
Serialized Form

Nested Class Summary
 
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
static String BORDER_COLOR
          Identifies the "border color" (value type Color) for the PropertyChangeListener.
static String BORDER_WIDTH
          Identifies the "border width" (value type int) for the PropertyChangeListener.
protected  ColorInputOption borderColor
          InputOption to define the border color.
protected  JLabel borderColorLabel
          Label next to the border color InputOption.
protected  SelectionInputOption.Combo<Integer> borderWidth
          InputOption to define the border width.
protected  JLabel borderWidthLabel
          Label next to the border width InputOption.
static String FILL_COLOR
          Identifies the "fill color" (value type Color) for the PropertyChangeListener.
protected  ColorInputOption fillColor
          InputOption to define the fill color.
protected  JLabel fillColorLabel
          Label next to the fill color InputOption.
protected static Logger LOGGER
           
static String MARK_SIZE
          Identifies the "mark size" (value type int) for the PropertyChangeListener.
static String MARK_STYLE
          Identifies the "mark style" (value type String) for the PropertyChangeListener.
protected  JLabel markLabel
          Label next to the mark style and size InputOptions.
protected  SelectionInputOption.Combo<Integer> markSize
          InputOption to define the mark size.
protected  SelectionInputOption.Combo<String> markStyle
          InputOption to define the mark style.
 
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
StyleToolBar()
          Creates a new tool bar.
 
Method Summary
 Style createLineStyle()
          Creates a line style with the currently set border color and width.
 Style createPointStyle()
          Creates a point style with the currently set point style, size, fill and border color.
 Style createPolygonStyle()
          Creates a polygon style with the currently set fill, border color and width.
protected  void initGUI()
          Creates the GUI.
 void optionChanged(InputOption option, Object oldValue, Object newValue)
          Called whenever one of the input options of this tool bar has changed its value.
 void optionGainedFocus(InputOption option)
          Called whenever one of the input options of this tool bar gained focus.
 void optionLostFocus(InputOption option)
          Called whenever one of the input options of this tool bar lost focus.
 
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 javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOGGER

protected static final Logger LOGGER

FILL_COLOR

public static final String FILL_COLOR
Identifies the "fill color" (value type Color) for the PropertyChangeListener.

See Also:
Container.addPropertyChangeListener(PropertyChangeListener), Constant Field Values

BORDER_COLOR

public static final String BORDER_COLOR
Identifies the "border color" (value type Color) for the PropertyChangeListener.

See Also:
Container.addPropertyChangeListener(PropertyChangeListener), Constant Field Values

BORDER_WIDTH

public static final String BORDER_WIDTH
Identifies the "border width" (value type int) for the PropertyChangeListener.

See Also:
Container.addPropertyChangeListener(PropertyChangeListener), Constant Field Values

MARK_STYLE

public static final String MARK_STYLE
Identifies the "mark style" (value type String) for the PropertyChangeListener.

See Also:
Container.addPropertyChangeListener(PropertyChangeListener), Constant Field Values

MARK_SIZE

public static final String MARK_SIZE
Identifies the "mark size" (value type int) for the PropertyChangeListener.

See Also:
Container.addPropertyChangeListener(PropertyChangeListener), Constant Field Values

fillColorLabel

protected JLabel fillColorLabel
Label next to the fill color InputOption.


fillColor

protected ColorInputOption fillColor
InputOption to define the fill color.


borderColorLabel

protected JLabel borderColorLabel
Label next to the border color InputOption.


borderColor

protected ColorInputOption borderColor
InputOption to define the border color.


borderWidthLabel

protected JLabel borderWidthLabel
Label next to the border width InputOption.


borderWidth

protected SelectionInputOption.Combo<Integer> borderWidth
InputOption to define the border width.


markLabel

protected JLabel markLabel
Label next to the mark style and size InputOptions.


markStyle

protected SelectionInputOption.Combo<String> markStyle
InputOption to define the mark style.


markSize

protected SelectionInputOption.Combo<Integer> markSize
InputOption to define the mark size.

Constructor Detail

StyleToolBar

public StyleToolBar()
Creates a new tool bar. Calls initGUI().

Method Detail

initGUI

protected void initGUI()
Creates the GUI.


createPointStyle

public Style createPointStyle()
Creates a point style with the currently set point style, size, fill and border color.


createLineStyle

public Style createLineStyle()
Creates a line style with the currently set border color and width.


createPolygonStyle

public Style createPolygonStyle()
Creates a polygon style with the currently set fill, border color and width.


optionChanged

public void optionChanged(InputOption option,
                          Object oldValue,
                          Object newValue)
Called whenever one of the input options of this tool bar has changed its value. Invokes a PropertyChangeEvent according to the changed input option.

Specified by:
optionChanged in interface InputOptionListener
Parameters:
option - Option, die sich geaendert hat
oldValue - alter Wert
newValue - neuer Wert
See Also:
FILL_COLOR, BORDER_COLOR, BORDER_WIDTH, MARK_STYLE, MARK_SIZE

optionLostFocus

public void optionLostFocus(InputOption option)
Called whenever one of the input options of this tool bar lost focus. Does nothing.

Specified by:
optionLostFocus in interface InputOptionListener
Parameters:
option - Option, die den Focus verloren hat

optionGainedFocus

public void optionGainedFocus(InputOption option)
Called whenever one of the input options of this tool bar gained focus. Does nothing.

Specified by:
optionGainedFocus in interface InputOptionListener
Parameters:
option - Option, die den Focus erhalten hat