public class IlvLegendItem extends JComponent
IlvLegend
.
It consists of a graphical symbol and a label describing the data
points that are displayed with the same style as this symbol.JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
IlvLegendItem(String label)
Creates a new
IlvLegendItem
with the specified label. |
Modifier and Type | Method and Description |
---|---|
protected void |
baseTextDirectionChanged()
This method is invoked when the effective base text direction has changed.
|
protected void |
componentOrientationChanged(ComponentOrientation oldOrientation,
ComponentOrientation newOrientation)
This method is invoked when the component orientation of this legend item
has changed.
|
protected void |
drawIntoHitmap(IlvChartHitmapDefinition definition,
IlvChartHitmapAccumulator accumulator)
Draws this item as an object into the hitmap.
|
void |
drawLabel(Graphics g,
Point2D center)
Draws the label part of the item.
|
void |
drawSymbol(Graphics g,
Rectangle symbolBounds)
Draws the symbol part of the item.
|
String |
getLabel()
Returns the label.
|
Dimension |
getLabelDimension()
Returns the dimension of the label part of the item.
|
IlvLegend |
getLegend()
Returns the legend associated with this item.
|
IlvIMapArea |
getMapArea(IlvIMapDefinition mapdef,
IlvIMapAttributes attrs)
Returns the image map area definition of this item as an
IlvIMapArea
instance. |
Dimension |
getMaximumSize()
Returns the maximum size.
|
Dimension |
getMinimumSize()
Returns the minimum size.
|
Dimension |
getPreferredSize()
Returns the preferred size.
|
int |
getResolvedBaseTextDirection()
Returns the resolved base text direction.
|
Border |
getTextBorder()
Returns the text border.
|
boolean |
isOpaqueText()
Returns whether the text is opaque.
|
protected void |
paintComponent(Graphics g)
Draws the item.
|
void |
setComponentOrientation(ComponentOrientation o)
Sets the component orientation of this legend item.
|
void |
setFont(Font font)
Sets the font of this item.
|
void |
setForeground(Color color)
Sets the text color of this item.
|
void |
setLabel(String label)
Sets a new label.
|
void |
setOpaqueText(boolean opaque)
Sets whether the text is opaque.
|
void |
setTextBorder(Border border)
Sets the text border.
|
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, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
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
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, getPeer, 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, resize, resize, setBounds, setBounds, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public IlvLegendItem(String label)
IlvLegendItem
with the specified label.public final IlvLegend getLegend()
public void setComponentOrientation(ComponentOrientation o)
setComponentOrientation
in class Component
protected void componentOrientationChanged(ComponentOrientation oldOrientation, ComponentOrientation newOrientation)
oldOrientation
- The component orientation before the change.newOrientation
- The component orientation after the change.Component.getComponentOrientation()
,
setComponentOrientation(ComponentOrientation)
public int getResolvedBaseTextDirection()
The base text direction influences the display of text strings that are composed of segments that are read from left to right as well as of segments that are read from right to left. It determines the order of these segments.
IlvBidiUtil.CONTEXTUAL_DIRECTION
,
IlvBidiUtil.LEFT_TO_RIGHT
,
IlvBidiUtil.RIGHT_TO_LEFT
.protected void baseTextDirectionChanged()
getResolvedBaseTextDirection()
has
changed, orgetComponentOrientation()
has changed
and the value of getResolvedBaseTextDirection()
is
IlvBidiUtil.CONTEXTUAL_DIRECTION
.public final String getLabel()
public void setLabel(String label)
public void setFont(Font font)
setFont
in class JComponent
public void setForeground(Color color)
setForeground
in class JComponent
public Border getTextBorder()
public void setTextBorder(Border border)
public boolean isOpaqueText()
public void setOpaqueText(boolean opaque)
protected void paintComponent(Graphics g)
paintComponent
in class JComponent
public void drawSymbol(Graphics g, Rectangle symbolBounds)
This default implementation does nothing. Subclasses should override this method.
public void drawLabel(Graphics g, Point2D center)
public Dimension getLabelDimension()
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
public Dimension getMaximumSize()
getMaximumSize
in class JComponent
public Dimension getMinimumSize()
getMinimumSize
in class JComponent
public IlvIMapArea getMapArea(IlvIMapDefinition mapdef, IlvIMapAttributes attrs)
IlvIMapArea
instance.IlvIMapArea
protected void drawIntoHitmap(IlvChartHitmapDefinition definition, IlvChartHitmapAccumulator accumulator)
definition
- The specification how to construct the hitmap.accumulator
- The object that accumulates objects in the hitmap.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.