org.askalon.graph.chart.viewer
Class StandardLegend

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.askalon.graph.chart.viewer.Legend
                      extended by org.askalon.graph.chart.viewer.StandardLegend
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, Cleanable
Direct Known Subclasses:
HierarchyLegend

public class StandardLegend
extends Legend

StandardLegend also called section legend displaying one line per legend. One can choose if checkbox and DoubleButton are displayed.

Author:
Georg Schild and Franz Endstrasser
See Also:
Serialized Form

Nested Class Summary
static class StandardLegend.ToAdd
          Like the static int values just a bit more modern.
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Field Summary
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
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
StandardLegend(SectionChart chart)
           
StandardLegend(String title, ActionListener listener, SectionChart chart)
           
StandardLegend(String title, SectionChart chart)
           
 
Method Summary
 void addEntry(String text, Icon[] icon, int section)
          Like addEntry(String) but with additional Icons
 void addEntry(String text, Icon[] icon, StandardLegend.ToAdd itemsToAdd, int pos)
          Like addEntry(String, Icon[], int) but the modern way.
 void addEntry(String text, Icon[] icon, StandardLegend.ToAdd itemsToAdd, int sliderPos, int pos)
           
 void addEntry(String text, int section)
          Add a new entry with text, checkbox and DoubleButton
 void addLegendListener(LegendListener ll)
          Adds an actionlistener to this legend.
 void cleanUp()
          Cleans references of the chart.
 String getEntryText(int entry)
           
 boolean isApplicable(Chart c)
           
 void removeAllEntries()
          remove all entries from this legend
 void removeEntry(int id)
           
 void removeLegendListener(LegendListener ll)
          remove a registered legend listener
 void setBackground(Color col)
           
 void setChoices(Object... args)
           
 void setDoubleButtonOrientation(boolean orientation)
           
 void setDoubleButtonOrientation(Constants.Orientation orientation)
           
 void setEntryCheckboxState(boolean state, int entry)
           
 void setEntryIcon(int entry, Icon... icon)
           
 void setEntrySliderPos(int pos, int entry)
           
 void setEntryText(String text, int entry)
           
 void setFont(Font font)
           
 void setFontColor(Color c)
           
 void setSelectedCheckBoxesEnabled(boolean enabled)
           
 
Methods inherited from class org.askalon.graph.chart.viewer.Legend
getTitle, setTitle
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StandardLegend

public StandardLegend(SectionChart chart)

StandardLegend

public StandardLegend(String title,
                      SectionChart chart)

StandardLegend

public StandardLegend(String title,
                      ActionListener listener,
                      SectionChart chart)
Method Detail

addEntry

public void addEntry(String text,
                     int section)
Add a new entry with text, checkbox and DoubleButton

Parameters:
text -
section -

addEntry

public void addEntry(String text,
                     Icon[] icon,
                     int section)
Like addEntry(String) but with additional Icons

Parameters:
text -
icon -
section -

setChoices

public void setChoices(Object... args)

addEntry

public void addEntry(String text,
                     Icon[] icon,
                     StandardLegend.ToAdd itemsToAdd,
                     int pos)
Like addEntry(String, Icon[], int) but the modern way.

Parameters:
text -
icon -
itemsToAdd -
pos -

addEntry

public void addEntry(String text,
                     Icon[] icon,
                     StandardLegend.ToAdd itemsToAdd,
                     int sliderPos,
                     int pos)

setEntryText

public void setEntryText(String text,
                         int entry)

setEntrySliderPos

public void setEntrySliderPos(int pos,
                              int entry)

setEntryIcon

public void setEntryIcon(int entry,
                         Icon... icon)

setEntryCheckboxState

public void setEntryCheckboxState(boolean state,
                                  int entry)

setDoubleButtonOrientation

public void setDoubleButtonOrientation(boolean orientation)

setDoubleButtonOrientation

public void setDoubleButtonOrientation(Constants.Orientation orientation)

setSelectedCheckBoxesEnabled

public void setSelectedCheckBoxesEnabled(boolean enabled)

getEntryText

public String getEntryText(int entry)

removeEntry

public void removeEntry(int id)

removeAllEntries

public void removeAllEntries()
remove all entries from this legend


setFont

public void setFont(Font font)
Overrides:
setFont in class JComponent
See Also:
JComponent.setFont(Font), Font

setBackground

public void setBackground(Color col)
Overrides:
setBackground in class JComponent
See Also:
JComponent.setBackground(Color), Color

setFontColor

public void setFontColor(Color c)

addLegendListener

public void addLegendListener(LegendListener ll)
Adds an actionlistener to this legend.

Parameters:
ll - the listener to add

removeLegendListener

public void removeLegendListener(LegendListener ll)
remove a registered legend listener

Parameters:
ll - the listener to be removed

cleanUp

public void cleanUp()
Description copied from interface: Cleanable
Cleans references of the chart. Will usually be called by the finalize() Method of the chart.


isApplicable

public boolean isApplicable(Chart c)
Specified by:
isApplicable in class Legend


Part of:
Askalon_Logo
ASKALON Visualisation Diagrams