JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util.legend
Class JCMultiColLegend

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--com.klg.jclass.util.legend.JCLegend
                          |
                          +--com.klg.jclass.util.legend.JCGridLegend
                                |
                                +--com.klg.jclass.util.legend.JCMultiColLegend
All Implemented Interfaces:
Changeable, ImageObserver, MenuContainer, Serializable

public class JCMultiColLegend
extends JCGridLegend

JCMultiColLegend manages and renders a grid-based legend that can have multiple columns. It extends JCGridLegend, rearranging the position of legend items within the legend vector and relying on JCGridLegend's functionality to position and draw legend items. JCMultiColLegend assumes that the legend vector contains a number of group vectors, with the title of each group being the first item in each group vector.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  int actualNumColumns
           
protected  int actualNumRows
           
protected  int numColumns
           
protected  int numRows
           
 
Fields inherited from class com.klg.jclass.util.legend.JCGridLegend
colWidths, groupGap, insideItemGap, itemGap, marginGap, rowFirstLineHeights, rowHeights, strWidths, symWidths
 
Fields inherited from class com.klg.jclass.util.legend.JCLegend
anchor, ascent, BOX, BOX_PLAIN, cachedFont, cachedVertical, cellRendererPane, changed, changedFlag, CUSTOM_ALL, CUSTOM_SYMBOL, descent, EAST, EASTWEST_MASK, HORIZONTAL, IMAGE, IMAGE_OUTLINED, imageMapInfo, legendItems, legendPopulator, legendRenderer, LINE, locale, NONE, NORTH, NORTHEAST, NORTHSOUTH_MASK, NORTHWEST, orientation, preferredSize, ps, SOUTH, SOUTHEAST, SOUTHWEST, symbolSize, textRend, updateParent, VERTICAL, WEST
 
Fields inherited from class javax.swing.JComponent
accessibleContext, 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
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface com.klg.jclass.util.Changeable
BASIC_CHANGE_MASK, LAYOUT, NO_CHANGE, NOTIFY_PARENT_LAYOUT, RECALC, REDRAW
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JCMultiColLegend()
           
 
Method Summary
protected  void calcActualNumRowsAndColumns()
          Calculate the actual number of rows and columns from either the set row and column variables or, if they've been set to default, from the number of legend items associated with this legend.
protected  void calcActualNumRowsAndColumns(boolean vertical, int numGroups, int numLinesPerGroup)
          Calculate the actual number of rows and columns from either the passed number of groups and lines per group or, if they're default values, from the number of legend items associated with this legend.
 void contractItemList(List destList, List sourceList, List itemList, int sourceIndex)
          Removes a group from the legend vector, moving its contents to another group.
 int getActualNumColumns()
          Gets the actual number of columns used in this legend.
 int getActualNumRows()
          Gets the actual number of rows used in this legend.
 int getNumColumns()
          Gets the number of columns set for this legend.
 int getNumRows()
          Gets the number of rows set for this legend.
 Dimension layoutLegend(List itemList, boolean vertical, Font useFont)
          layoutLegend overrides JCGridLegend's layoutLegend().
 void setNumColumns(int columns)
          Sets the number of columns in this legend.
 void setNumRows(int rows)
          Sets the number of rows in this legend.
 
Methods inherited from class com.klg.jclass.util.legend.JCGridLegend
calcLegendSize, fillSizeArrays, getGroupGap, getInsideItemGap, getItemGap, getMarginGap, layoutLegendItems, positionItemSymbol, positionItemText, setGroupGap, setInsideItemGap, setItemGap, setMarginGap
 
Methods inherited from class com.klg.jclass.util.legend.JCLegend
checkAnchor, drawLegendItem, getAnchor, getCellRendererPane, getChanged, getChanged, getDrawingArea, getDrawingArea, getGraphics, getImageMapInfo, getLegendItems, getLegendPopulator, getLegendRenderer, getOrientation, getPreferredSize, getSymbolSize, getTextRenderer, isBatched, isChanged, isChanged, isTitleItem, paintComponent, pick, recalc, setAnchor, setChanged, setChanged, setGraphics, setImageMapInfo, setLegendPopulator, setLegendRenderer, setLocale, setOrientation, setPreferredSize, setUpLegendVariables, updateParent
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

numRows

protected int numRows

numColumns

protected int numColumns

actualNumRows

protected int actualNumRows

actualNumColumns

protected int actualNumColumns
Constructor Detail

JCMultiColLegend

public JCMultiColLegend()
Method Detail

setNumRows

public void setNumRows(int rows)
Sets the number of rows in this legend. If less than or equal to 0 (the default), the number of rows will be set automatically. Setting 1 row in a vertical column will cause the title item (if existing) to be included in the same row as the other legend items.

Parameters:
rows - the number of rows to use

getNumRows

public int getNumRows()
Gets the number of rows set for this legend. If less than or equal to 0 (the default), the number of rows is set automatically.

Returns:
the value set to be the number of rows in the legend

setNumColumns

public void setNumColumns(int columns)
Sets the number of columns in this legend. If less than or equal to 0 (the default), the number is set automatically. Setting 1 column in a horizontal column will cause the title item (if existing) to be included in the same column as all of the other legend items.

Parameters:
columns - the number of columns to use

getNumColumns

public int getNumColumns()
Gets the number of columns set for this legend. If less than or equal to zero (the default), the number of columns is set automatically.

Returns:
the value set to be the number of columns in the legend

getActualNumRows

public int getActualNumRows()
Gets the actual number of rows used in this legend.

Returns:
the actual number of rows used in this legend

getActualNumColumns

public int getActualNumColumns()
Gets the actual number of columns used in this legend.

Returns:
the actual number of columns used in this legend

layoutLegend

public Dimension layoutLegend(List itemList,
                              boolean vertical,
                              Font useFont)
layoutLegend overrides JCGridLegend's layoutLegend(). layoutLegend manipulates the legend vector so that the items are in the order you specify. It calls JCGridLegend's layoutLegend() to do the layout.

Overrides:
layoutLegend in class JCGridLegend
Parameters:
itemList - the legend vector of groups and legend items
vertical - true for a vertical legend; false for a horizontal legend
useFont - the font for the legend
Returns:
size of legend returned from JCGridLegend's layoutLegend()

calcActualNumRowsAndColumns

protected void calcActualNumRowsAndColumns()
Calculate the actual number of rows and columns from either the set row and column variables or, if they've been set to default, from the number of legend items associated with this legend.


calcActualNumRowsAndColumns

protected void calcActualNumRowsAndColumns(boolean vertical,
                                           int numGroups,
                                           int numLinesPerGroup)
Calculate the actual number of rows and columns from either the passed number of groups and lines per group or, if they're default values, from the number of legend items associated with this legend.


contractItemList

public void contractItemList(List destList,
                             List sourceList,
                             List itemList,
                             int sourceIndex)
Removes a group from the legend vector, moving its contents to another group.

Parameters:
destList - the destination group vector
sourceList - the source group vector
itemList - the legend vector
sourceIndex - the index of the sourceList group within the legend vector

Copyright © 2004 Quest Software Inc..
All rights reserved.