JClass 4.5.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

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

Inner classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Field Summary
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, cachedFont, cachedVertical, cellRendererPane, changed, changedFlag, CUSTOM_ALL, CUSTOM_SYMBOL, descent, EAST, EASTWEST_MASK, HORIZONTAL, IMAGE, IMAGE_OUTLINED, legendItems, legendPopulator, legendRenderer, 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
 
Constructor Summary
JCMultiColLegend()
           
 
Method Summary
 void contractItemList(List destList, List sourceList, List itemList, int sourceIndex)
          Remove a group from the legend vector, moving its contents to another group.
 int getNumColumns()
          Gets the 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
drawLegendItem, getAnchor, getCellRendererPane, getChanged, getChanged, getDrawingArea, getDrawingArea, getGraphics, getLegendPopulator, getLegendRenderer, getOrientation, getPreferredSize, getSymbolSize, getTextRenderer, isBatched, isChanged, isChanged, isTitleItem, paintComponent, pick, recalc, setAnchor, setChanged, setChanged, setGraphics, setLegendPopulator, setLegendRenderer, setOrientation, setPreferredSize, updateParent
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getHeight, getInsets, getInsets, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getUIClassID, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, processComponentKeyEvent, processFocusEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setUI, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setCursor, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hide, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
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
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 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.

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 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().
Since:
JClass 4.0K for Java 2. If you are using JClass 4.0J, which is based on JDK 1.1, this method's parameter must be a com.sun.java.util.collections.List.

contractItemList

public void contractItemList(List destList,
                             List sourceList,
                             List itemList,
                             int sourceIndex)
Remove 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.
Since:
JClass 4.0K for Java 2. If you are using JClass 4.0J, which is based on JDK 1.1, this method's parameters must be a com.sun.java.util.collections.List.

Copyright© 1999-2000 KL Group Inc.
All rights reserved.