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.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategyNested classes/interfaces inherited from interface hec.map.LegendItem
LegendItem.LegendLocation -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanprotected intThe height of the legend item.protected StringThe title of the legend.protected intThe width of the legend item.protected intThe x position of the component in the parent's coordinate system.protected intThe y position of the component in the parent's coordinate system.protected static final intFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidThis method is the entry point for drawing.voiddrawBorder(Graphics g2) intReturns the current height of this component.intgetWidth()Returns the current width of this component.booleanisDirty()voidvoidsetLegendTitle(String title) voidsetLocation(int x, int y) Moves this component to a new location.voidsetSize(int width, int height) Resizes this component so that it has widthwidthand 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, updateUIMethods 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, validateTreeMethods 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:
getPreferredSizein interfaceLegendItem- Overrides:
getPreferredSizein classJComponent
-
getLegendTitle
-
drawBorder
-
setSize
public void setSize(int width, int height) Resizes this component so that it has widthwidthand heightheight.- Specified by:
setSizein interfaceLegendItem- Overrides:
setSizein 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:LegendItemMoves this component to a new location. The top-left corner of the new location is specified by pointp. Pointpis given in the parent's coordinate space.- Specified by:
setLocationin interfaceLegendItem- Overrides:
setLocationin 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:
setBoundsin interfaceLegendItem- Overrides:
setBoundsin 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:
drawin interfaceLegendItem- Parameters:
g- Graphics
-
getHeight
public int getHeight()Returns the current height of this component.- Overrides:
getHeightin classJComponent- Returns:
- the current height of this component
-
getWidth
public int getWidth()Returns the current width of this component.- Overrides:
getWidthin classJComponent- Returns:
- the current width of this component
-
getPreferredLocation
- Specified by:
getPreferredLocationin interfaceLegendItem
-