Package hec.gfx2d
Class LegendPanel
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
hec.gfx2d.G2dComponent
hec.gfx2d.LegendPanel
- All Implemented Interfaces:
G2dToolbarListener
,ImageObserver
,MenuContainer
,Serializable
,Accessible
The primary container for 2d graphic displays.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class hec.gfx2d.G2dComponent
G2dComponent.DefaultPreferredSizeProvider, G2dComponent.EditPropertyListener
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
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
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
Fields inherited from class hec.gfx2d.G2dComponent
_parent, _popupMenu, BOTTOM, LEFT, RIGHT, TOP
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
ConstructorsConstructorDescriptionDefault ConstructorLegendPanel
(G2dPanel p, int layout) LegendPanel
(G2dPanel p, LegendPanelProp prop) LegendPanel
(G2dPanel p, LegendPanelProp prop, int layout) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addViewport
(Viewport view) protected DefaultJPanel[]
void
void
editProperties
(int tabIndex) void
getLegendItem
(G2dObject g2dObject) getLegendItem
(G2dObject g2dObject, int curveNum) int
Get the number of items in the legend.getLegendLabel
(int index) Get the G2dLabel of the legend item at the specified index.getLegendLabel
(String name) Returns the G2dLabel of the legend item with the specified name.getLegendLabel
(String name, int curveNumber) Returns the G2dLabel of the legend item with the specified name for the specified curve number.int
Returns a tool tip text for the given mouse location.boolean
objectPopupMenu
(LocalPt pt, int modifiers) boolean
objectSelect
(LocalPt pt, int modifiers) void
Paints the contents of the panel.void
Rebuilds the legned based on the properties.void
Refreshes the legend items so they represent what is in the plotsvoid
setBounds
(int x, int y, int width, int height) void
void
setLayout
(int layout) Sets the layout of this container to be vertical or horizontal.void
setLegendPosistion
(int legendPosition) Deprecated.void
setLegendPosition
(int legendPosition) void
setProperties
(LegendPanelProp prop) void
Methods inherited from class hec.gfx2d.G2dComponent
createPopupMenu, getAlignment, getG2dPanel, getMouseAdapter, getPreferredSize, getPreferredSizeLocal, paintComponent, paintGfx, paintGfx, pointerOver, setG2dPanel, setMouseAdapter, setMouseAdapter, setPreferredSizeProvider
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, 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, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, 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, 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, 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, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Field Details
-
VERTICAL_LAYOUT
public static final int VERTICAL_LAYOUT- See Also:
-
HORIZONTAL_LAYOUT
public static final int HORIZONTAL_LAYOUT- See Also:
-
SEPARATE_WINDOW
public static final int SEPARATE_WINDOW- See Also:
-
SEPERATE_WINDOW
public static final int SEPERATE_WINDOW- See Also:
-
VIEWPORT_LEGEND_UPPER_LEFT
public static final int VIEWPORT_LEGEND_UPPER_LEFT- See Also:
-
VIEWPORT_LEGEND_UPPER_RIGHT
public static final int VIEWPORT_LEGEND_UPPER_RIGHT- See Also:
-
-
Constructor Details
-
LegendPanel
Default Constructor- Parameters:
p
-
-
LegendPanel
-
LegendPanel
-
LegendPanel
-
-
Method Details
-
setLayout
public void setLayout(int layout) Sets the layout of this container to be vertical or horizontal. Sub components are added to the panel accordingly. This is different from the setLayout(LayoutManager) which set the layout manager i.e. GridBagLayout. The Legend used the layout manager to set the components in a vertical or horizontal fashion. -
setLegendPosition
public void setLegendPosition(int legendPosition) -
setLegendPosistion
Deprecated. -
getLegendPosition
public int getLegendPosition() -
getTitleLabel
-
getLeftLabel
-
getRightLabel
-
getLegendItem
-
getLegendItem
-
addViewport
-
refreshLegendItems
public void refreshLegendItems()Refreshes the legend items so they represent what is in the plots -
fillGlyphVector
public void fillGlyphVector() -
rebuildall
public void rebuildall()Rebuilds the legned based on the properties. -
getLegendLabel
Returns the G2dLabel of the legend item with the specified name.- Parameters:
name
- The name (default label text) of the legend item.- Returns:
- The G2dLabel of the matching legend item.
-
getLegendLabel
Returns the G2dLabel of the legend item with the specified name for the specified curve number.- Parameters:
name
- The name (default label text) of the legend item.curveNumber
- The number of the curve to set- Returns:
- The G2dLabel of the matching legend item.
-
getLegendItemCount
public int getLegendItemCount()Get the number of items in the legend.- Returns:
- the number of items in the legend
-
getLegendLabel
Get the G2dLabel of the legend item at the specified index.- Parameters:
index
- the index to retrieve- Returns:
- the number of items in the legend, null if index is out of bounds
-
paint
Description copied from class:G2dComponent
Paints the contents of the panel.- Overrides:
paint
in classG2dComponent
-
objectSelect
-
objectPopupMenu
- Overrides:
objectPopupMenu
in classG2dComponent
-
setTitle
-
getToolTipText
Returns a tool tip text for the given mouse location. In this method we loop over the glyphs and see if they ha ve any tool tips. The first one that has one is returned;- Overrides:
getToolTipText
in classG2dComponent
-
setProperties
-
getProperties
-
setBounds
-
setBounds
public void setBounds(int x, int y, int width, int height) -
editProperties
public void editProperties()- Overrides:
editProperties
in classG2dComponent
-
editProperties
public void editProperties(int tabIndex) -
buildPropertiesPanel
-