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.EditPropertyListenerNested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanelNested 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.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields inherited from class hec.gfx2d.G2dComponent
_parent, _popupMenu, BOTTOM, LEFT, RIGHT, TOPFields 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
ConstructorsConstructorDescriptionDefault ConstructorLegendPanel(G2dPanel p, int layout) LegendPanel(G2dPanel p, LegendPanelProp prop) LegendPanel(G2dPanel p, LegendPanelProp prop, int layout) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddViewport(Viewport view) protected DefaultJPanel[]voidvoideditProperties(int tabIndex) voidgetLegendItem(G2dObject g2dObject) getLegendItem(G2dObject g2dObject, int curveNum) intGet 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.intReturns a tool tip text for the given mouse location.booleanobjectPopupMenu(LocalPt pt, int modifiers) booleanobjectSelect(LocalPt pt, int modifiers) voidPaints the contents of the panel.voidRebuilds the legned based on the properties.voidRefreshes the legend items so they represent what is in the plotsvoidsetBounds(int x, int y, int width, int height) voidvoidsetLayout(int layout) Sets the layout of this container to be vertical or horizontal.voidsetLegendPosistion(int legendPosition) Deprecated.voidsetLegendPosition(int legendPosition) voidsetProperties(LegendPanelProp prop) voidMethods inherited from class hec.gfx2d.G2dComponent
createPopupMenu, getAlignment, getG2dPanel, getMouseAdapter, getPreferredSize, getPreferredSizeLocal, paintComponent, paintGfx, paintGfx, pointerOver, setG2dPanel, setMouseAdapter, setMouseAdapter, setPreferredSizeProviderMethods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUIMethods 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, updateMethods 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, 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:G2dComponentPaints the contents of the panel.- Overrides:
paintin classG2dComponent
-
objectSelect
-
objectPopupMenu
- Overrides:
objectPopupMenuin 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:
getToolTipTextin classG2dComponent
-
setProperties
-
getProperties
-
setBounds
-
setBounds
public void setBounds(int x, int y, int width, int height) -
editProperties
public void editProperties()- Overrides:
editPropertiesin classG2dComponent
-
editProperties
public void editProperties(int tabIndex) -
buildPropertiesPanel
-