JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.swing
Class JCTreeTable.SwitchRenderer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--com.klg.jclass.util.swing.JCSortableTable.SortableHeaderRenderer
                                |
                                +--com.klg.jclass.swing.JCTreeTable.SwitchRenderer
All Implemented Interfaces:
Accessible, ImageObserver, JCSortableTable.SortableColumnHeader, MenuContainer, Serializable, TableCellRenderer
Enclosing class:
JCTreeTable

protected class JCTreeTable.SwitchRenderer
extends JCSortableTable.SortableHeaderRenderer
implements TableCellRenderer, JCSortableTable.SortableColumnHeader

Renderer used to draw the tree<-->table switch icon in the tree column header.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
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  Icon icon
           
protected  boolean initialized
           
protected  JButton switchButton
           
protected  int switchPolicy
           
 
Fields inherited from class com.klg.jclass.util.swing.JCSortableTable.SortableHeaderRenderer
brace, currentLayoutLeft, label, sortButton, sortIcon
 
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 java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JCTreeTable.SwitchRenderer()
          Constructor.
JCTreeTable.SwitchRenderer(int switchPolicy)
          Constructor that specifies switchPolicy.
JCTreeTable.SwitchRenderer(int switchPolicy, boolean orientationLeft)
          Constructor that specifies switchPolicy and whether the renderer is oriented leftToRight.
 
Method Summary
protected  JButton getSwitchButton()
          Return the switch button.
 void reLayout(boolean orientationLeft)
          Remove all components and add the components back in based on their availability and the table's component orientation.
protected  void setProperties(JTable table)
          Set properties on the header renderer component based on the table header.
 void setSwitchIcon(Icon icon)
          Set the icon to switch between TREE and TABLE views.
 void setSwitchPolicy(int switchPolicy)
          Sets the switchPolicy variable which determines whether or not to allow view switching.
 void setView(int view)
          Sets the view for this renderer.
 
Methods inherited from class com.klg.jclass.util.swing.JCSortableTable.SortableHeaderRenderer
getTableCellRendererComponent, isCurrentLayoutLeft, setSortIcon
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
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, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, 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, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
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, setLocale, 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
 
Methods inherited from interface javax.swing.table.TableCellRenderer
getTableCellRendererComponent
 
Methods inherited from interface com.klg.jclass.util.swing.JCSortableTable.SortableColumnHeader
setSortIcon
 

Field Detail

switchPolicy

protected int switchPolicy

switchButton

protected JButton switchButton

icon

protected Icon icon

initialized

protected boolean initialized
Constructor Detail

JCTreeTable.SwitchRenderer

public JCTreeTable.SwitchRenderer()
Constructor. Creates button, separator, and label, and sets up the layout.


JCTreeTable.SwitchRenderer

public JCTreeTable.SwitchRenderer(int switchPolicy)
Constructor that specifies switchPolicy.

Parameters:
switchPolicy - The switchPolicy to use.

JCTreeTable.SwitchRenderer

public JCTreeTable.SwitchRenderer(int switchPolicy,
                                  boolean orientationLeft)
Constructor that specifies switchPolicy and whether the renderer is oriented leftToRight.

Parameters:
switchPolicy - The switchPolicy to use.
orientationLeft - If true, the renderer is oriented leftToRight.
Method Detail

setView

public void setView(int view)
Sets the view for this renderer. Valid values are TREE or TABLE.

Parameters:
view - The new view for this renderer; must be one of TREE or TABLE.

setSwitchPolicy

public void setSwitchPolicy(int switchPolicy)
Sets the switchPolicy variable which determines whether or not to allow view switching.

Parameters:
switchPolicy - The new switchPolicy

setSwitchIcon

public void setSwitchIcon(Icon icon)
Set the icon to switch between TREE and TABLE views.

Parameters:
icon - The new switch icon. Must not be null.

getSwitchButton

protected JButton getSwitchButton()
Return the switch button.

Returns:
The switch button.

setProperties

protected void setProperties(JTable table)
Set properties on the header renderer component based on the table header.

Overrides:
setProperties in class JCSortableTable.SortableHeaderRenderer
Parameters:
table - The table whose header is used to set the properties.

reLayout

public void reLayout(boolean orientationLeft)
Remove all components and add the components back in based on their availability and the table's component orientation.

Overrides:
reLayout in class JCSortableTable.SortableHeaderRenderer
Parameters:
orientationLeft - If true, layout in left to right orientation.

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