jwo.landserf.gui
Class VectAppearanceBox

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjava.awt.Window
              extended byjava.awt.Dialog
                  extended byjavax.swing.JDialog
                      extended byjwo.utils.gui.JWDialogue
                          extended byjwo.landserf.gui.VectAppearanceBox
All Implemented Interfaces:
Accessible, ActionListener, ChangeListener, EventListener, ImageObserver, ItemListener, MenuContainer, RootPaneContainer, Serializable, WindowConstants

public class VectAppearanceBox
extends JWDialogue
implements ActionListener, ChangeListener, ItemListener

Allows vector appearance to be controlled.

Version:
2.2, 4th June, 2004.
Author:
Jo Wood
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JDialog
JDialog.AccessibleJDialog
 
Nested classes inherited from class java.awt.Dialog
Dialog.AccessibleAWTDialog
 
Nested classes inherited from class java.awt.Window
Window.AccessibleAWTWindow
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 
Fields inherited from class jwo.utils.gui.JWDialogue
DIALOGUE, MONOLOGUE
 
Fields inherited from class javax.swing.JDialog
accessibleContext, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
VectAppearanceBox(GISFrame gisFrame, float pointSize, boolean pointFixed, float lineWidth, boolean lineFixed, float trans, Color boundColour, int style, boolean showLabels, Color labelBgColour, Color labelFgColour, float labelSize)
          Create a dialog allowing vector appearance to be changed.
 
Method Summary
 void actionPerformed(ActionEvent event)
          Responds to a press of the colour editor by bringing up a colour chooser and allowing the polygon boundary colour to be redefined.
 boolean checkInput()
          Checks that line width value is appropriate.
 Color getBoundaryColour()
          Reports the colour to use for polygon boundaries.
 Color getLabelBackgroundColour()
          Reports the colour to use for label backgrounds.
 Color getLabelForegroundColour()
          Reports the colour to use for label foregrounds.
 float getLabelSize()
          Reports the font size at which to display labels.
 float getLineWidth()
          Reports the line width (in pixels) chosen by the user.
 float getPointSize()
          Reports the size of point symbols (in pixels) chosen by the user.
 int getRenderingStyle()
          Reports the rendering style for all vectors.
 float getTransparency()
          Reports the transparency of polygon interiors selected by user.
 boolean isLineFixed()
          Reports whether line width should be fixed as user zooms in/out.
 boolean isPointFixed()
          Reports whether point symbol size should be fixed as user zooms in/out.
 boolean isShowLabels()
          Reports whether point lables are to be shown or not.
 void itemStateChanged(ItemEvent event)
          Responds to a checkbox item being changed by disabling non checked parameters.
 void stateChanged(ChangeEvent e)
          Responds to a change in the font size slider by altering the size of the displayed text.
 
Methods inherited from class jwo.utils.gui.JWDialogue
addDialogueListener, closedown, getContentPane, isChanged, removeDialogueListener, setFullBackground
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, dialogInit, getAccessibleContext, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Dialog
addNotify, dispose, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show
 
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, toBack, toFront
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

VectAppearanceBox

public VectAppearanceBox(GISFrame gisFrame,
                         float pointSize,
                         boolean pointFixed,
                         float lineWidth,
                         boolean lineFixed,
                         float trans,
                         Color boundColour,
                         int style,
                         boolean showLabels,
                         Color labelBgColour,
                         Color labelFgColour,
                         float labelSize)
Create a dialog allowing vector appearance to be changed.

Parameters:
gisFrame - GUI holding vector to be displayed.
pointFixed - Point size will remain fixed size with zooming if true.
lineWidth - Width of vector lines in pixels (can be fractional).
lineFixed - Line width will remain fixed size with zooming if true.
trans - Transparency scaled between 0 and 1 for polygon interiors.
boundColour - Boundary colour to use for polygons.
style - Style of rendinering. Either VectorMap.QUALITY or VectorMap.SPEED.
showLabels - Point lables shown if true.
labelBgColour - Label background colour.
labelFgColour - Lable foreground colour.
labelSize - Size of label text in font point units.
See Also:
VectorMap.QUALITY, VectorMap.SPEED
Method Detail

checkInput

public boolean checkInput()
Checks that line width value is appropriate.

Overrides:
checkInput in class JWDialogue
Returns:
True if input is valid.

itemStateChanged

public void itemStateChanged(ItemEvent event)
Responds to a checkbox item being changed by disabling non checked parameters.

Specified by:
itemStateChanged in interface ItemListener
Parameters:
event - Checkbox item that has changed.

getPointSize

public float getPointSize()
Reports the size of point symbols (in pixels) chosen by the user.

Returns:
Point size in pixels. Need not be a whole number.

isPointFixed

public boolean isPointFixed()
Reports whether point symbol size should be fixed as user zooms in/out.

Returns:
True if fixed size used.

getLineWidth

public float getLineWidth()
Reports the line width (in pixels) chosen by the user.

Returns:
Line width in pixels. Need not be a whole number.

isLineFixed

public boolean isLineFixed()
Reports whether line width should be fixed as user zooms in/out.

Returns:
True if fixed line width used.

getTransparency

public float getTransparency()
Reports the transparency of polygon interiors selected by user.

Returns:
Polygon interior transparancy (0-1).

getBoundaryColour

public Color getBoundaryColour()
Reports the colour to use for polygon boundaries.

Returns:
Polygon boundary colour, or null if vector attribute used to determine colour.

getLabelBackgroundColour

public Color getLabelBackgroundColour()
Reports the colour to use for label backgrounds.

Returns:
Label background colour.

getLabelForegroundColour

public Color getLabelForegroundColour()
Reports the colour to use for label foregrounds.

Returns:
Label foreground colour.

isShowLabels

public boolean isShowLabels()
Reports whether point lables are to be shown or not.

Returns:
True if point labels are to be shown.

getLabelSize

public float getLabelSize()
Reports the font size at which to display labels.

Returns:
Label font size (in point units).

getRenderingStyle

public int getRenderingStyle()
Reports the rendering style for all vectors.

Returns:
Rendering style for vector. Either SPEED or QUALITY.

actionPerformed

public void actionPerformed(ActionEvent event)
Responds to a press of the colour editor by bringing up a colour chooser and allowing the polygon boundary colour to be redefined.

Specified by:
actionPerformed in interface ActionListener
Parameters:
event - Action event associated with the button press.

stateChanged

public void stateChanged(ChangeEvent e)
Responds to a change in the font size slider by altering the size of the displayed text.

Specified by:
stateChanged in interface ChangeListener
Parameters:
e - Slider change event.


Copyright Jo Wood, 1996-2005, last modified, 11th March, 2005