Package hec.map
Class AbstractLegendItem
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
hec.map.AbstractLegendItem
- All Implemented Interfaces:
LegendItem
,ImageObserver
,MenuContainer
,Serializable
- Direct Known Subclasses:
ColorContourLegendItem
Title: Hec Java Development
Description:
Copyright: Copyright (c) 2004
Company: Resource Management Assoc
- See Also:
-
Nested Class Summary
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
Nested classes/interfaces inherited from interface hec.map.LegendItem
LegendItem.LegendLocation
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected boolean
protected int
The height of the legend item.protected String
The title of the legend.protected int
The width of the legend item.protected int
The x position of the component in the parent's coordinate system.protected int
The y position of the component in the parent's coordinate system.protected static final int
Fields inherited from class javax.swing.JComponent
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
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
This method is the entry point for drawing.void
drawBorder
(Graphics g2) int
Returns the current height of this component.int
getWidth()
Returns the current width of this component.boolean
isDirty()
void
void
setLegendTitle
(String title) void
setLocation
(int x, int y) Moves this component to a new location.void
setSize
(int width, int height) Resizes this component so that it has widthwidth
and heightheight
.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, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, 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, updateUI
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, setLayout, 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, getAccessibleContext, 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, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, 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, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setMixingCutoutShape, setName, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
BORDER_WIDTH
protected static final int BORDER_WIDTH- See Also:
-
_x
protected int _xThe x position of the component in the parent's coordinate system. -
_y
protected int _yThe y position of the component in the parent's coordinate system. -
_width
protected int _widthThe width of the legend item. -
_height
protected int _heightThe height of the legend item. -
_legendTitle
The title of the legend. Provides a text description of this legend to differentiate it from other legends. -
_dirty
protected boolean _dirty
-
-
Constructor Details
-
AbstractLegendItem
public AbstractLegendItem()
-
-
Method Details
-
isDirty
public boolean isDirty() -
setLegendTitle
-
getPreferredSize
- Specified by:
getPreferredSize
in interfaceLegendItem
- Overrides:
getPreferredSize
in classJComponent
-
getLegendTitle
-
drawBorder
-
setSize
public void setSize(int width, int height) Resizes this component so that it has widthwidth
and heightheight
.- Specified by:
setSize
in interfaceLegendItem
- Overrides:
setSize
in classComponent
- Parameters:
width
- the new width of this component in pixelsheight
- the new height of this component in pixels- Since:
- JDK1.1
- See Also:
-
setLocation
public void setLocation(int x, int y) Description copied from interface:LegendItem
Moves this component to a new location. The top-left corner of the new location is specified by pointp
. Pointp
is given in the parent's coordinate space.- Specified by:
setLocation
in interfaceLegendItem
- Overrides:
setLocation
in classComponent
- Parameters:
x
- the point defining the top-left corner of the new location, given in the coordinate space of this component's parenty
- the point defining the top-left corner of the new location, given in the coordinate space of this component's parent- See Also:
-
setBounds
- Specified by:
setBounds
in interfaceLegendItem
- Overrides:
setBounds
in classComponent
-
draw
This method is the entry point for drawing. All drawing will be done to the graphics context passed in here as a parameter.- Specified by:
draw
in interfaceLegendItem
- Parameters:
g
- Graphics
-
getHeight
public int getHeight()Returns the current height of this component.- Overrides:
getHeight
in classJComponent
- Returns:
- the current height of this component
-
getWidth
public int getWidth()Returns the current width of this component.- Overrides:
getWidth
in classJComponent
- Returns:
- the current width of this component
-
getPreferredLocation
- Specified by:
getPreferredLocation
in interfaceLegendItem
-