JIDE 3.5.15

com.jidesoft.grid
Class TreeExpandablePanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.CellRendererPane
              extended by com.jidesoft.grid.CellRendererPaneEx
                  extended by com.jidesoft.grid.TreeExpandablePanel
All Implemented Interfaces:
RendererWrapper, ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
MarginExpandablePanel

public class TreeExpandablePanel
extends CellRendererPaneEx

The component used by TreeTableCellRenderer which has a "+/-" button.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.CellRendererPane
CellRendererPane.AccessibleCellRendererPane
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  Icon _collapsedIcon
           
protected  Color _disabledBackground
           
protected  Color _disabledForeground
           
protected  ExpandableCell _expandableCell
           
protected  Icon _expandedIcon
           
protected  boolean _hasFocus
           
protected  int _indent
           
protected  boolean _isSelected
           
protected  Color _lineColor
           
protected  boolean _lineTypeDashed
           
protected  Node _node
           
protected  boolean _paintLeafNodeLines
           
protected  boolean _paintLines
           
protected  boolean _respectRendererPreferredSize
           
protected  boolean _showRootHandles
           
protected  JTable _table
           
static int CELL_HEIGHT
           
static int LEFT_MARGIN
           
static int TEXT_ICON_GAP
           
 
Fields inherited from class com.jidesoft.grid.CellRendererPaneEx
_actualRenderer
 
Fields inherited from class javax.swing.CellRendererPane
accessibleContext
 
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
TreeExpandablePanel(JTable table)
           
TreeExpandablePanel(JTable table, Icon expandedIcon, Icon collapsedIcon, Color disabledBackground, Color disabledForeground)
          Deprecated. use TreeExpandablePanel(javax.swing.JTable) instead
 
Method Summary
 int getColumnWidth()
           
 Dimension getMinimumSize()
           
 Dimension getPreferredSize()
           
 String getToolTipText(MouseEvent e)
          Delegates getTooltipText to actual renderer.
protected  void initComponents()
           
 boolean isExpandIconVisible(JTable table)
           
 boolean isHasFocus()
          Checks if expandable panel has focus.
 boolean isSelected()
          Checks if the expandable panel is selected.
 void paint(Graphics g)
          Calls the UI delegate's paint method, if the UI delegate is non-null.
protected  void paintBackground(Graphics g)
          Paints the background.
protected  void paintFocus(Graphics g)
          Paints the focus border.
 void setColumnWidth(int columnWidth)
           
 void setEnabled(boolean enabled)
           
 void setExpandableCell(ExpandableCell expandableCell)
          ExpandableCell is the data used by ExpandablePanel.
 void setFont(Font c)
           
 void setHasFocus(boolean hasFocus)
          Sets the expandable panel focus attribute.
 void setNode(Node node)
          ExpandableCell is the data used by ExpandablePanel.
 void setSelected(boolean selected)
          Sets the expandable panel selected/
 
Methods inherited from class com.jidesoft.grid.CellRendererPaneEx
getActualRenderer, getBorder, isPaintBackground, paintBorder, setActualRenderer, setPaintBackground
 
Methods inherited from class javax.swing.CellRendererPane
addImpl, getAccessibleContext, invalidate, paintComponent, paintComponent, paintComponent, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMousePosition, insets, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, 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

TEXT_ICON_GAP

public static final int TEXT_ICON_GAP
See Also:
Constant Field Values

LEFT_MARGIN

public static final int LEFT_MARGIN
See Also:
Constant Field Values

CELL_HEIGHT

public static final int CELL_HEIGHT
See Also:
Constant Field Values

_expandableCell

protected ExpandableCell _expandableCell

_node

protected Node _node

_table

protected JTable _table

_expandedIcon

protected Icon _expandedIcon

_collapsedIcon

protected Icon _collapsedIcon

_disabledForeground

protected Color _disabledForeground

_disabledBackground

protected Color _disabledBackground

_paintLines

protected boolean _paintLines

_showRootHandles

protected boolean _showRootHandles

_respectRendererPreferredSize

protected boolean _respectRendererPreferredSize

_paintLeafNodeLines

protected boolean _paintLeafNodeLines

_lineTypeDashed

protected boolean _lineTypeDashed

_lineColor

protected Color _lineColor

_indent

protected int _indent

_isSelected

protected boolean _isSelected

_hasFocus

protected boolean _hasFocus
Constructor Detail

TreeExpandablePanel

public TreeExpandablePanel(JTable table)

TreeExpandablePanel

@Deprecated
public TreeExpandablePanel(JTable table,
                                      Icon expandedIcon,
                                      Icon collapsedIcon,
                                      Color disabledBackground,
                                      Color disabledForeground)
Deprecated. use TreeExpandablePanel(javax.swing.JTable) instead

Creates an ExpandablePanel.

Parameters:
table - the table
expandedIcon - the expanded icon
collapsedIcon - the collapsed icon
disabledBackground - the disabled background
disabledForeground - the disabled foreground
Method Detail

initComponents

protected void initComponents()

setEnabled

public void setEnabled(boolean enabled)
Overrides:
setEnabled in class Component

setExpandableCell

public void setExpandableCell(ExpandableCell expandableCell)
ExpandableCell is the data used by ExpandablePanel. ExpandableCell provides attributes such as expandable, level, name etc which is useful when painting the expandable panel. In the case of PropertyTable component, Property itself is an instance of ExpandableCell.

Parameters:
expandableCell - the expandable cell

setNode

public void setNode(Node node)
ExpandableCell is the data used by ExpandablePanel. ExpandableCell provides attributes such as expandable, level, name etc which is useful when painting the expandable panel. In the case of PropertyTable component, Property itself is an instance of ExpandableCell.

Parameters:
node - the node

paint

public void paint(Graphics g)
Calls the UI delegate's paint method, if the UI delegate is non-null. We pass the delegate a copy of the Graphics object to protect the rest of the paint code from irrevocable changes (for example, Graphics.translate).

If you override this in a subclass you should not make permanent changes to the passed in Graphics. For example, you should not alter the clip Rectangle or modify the transform. If you need to do these operations you may find it easier to create a new Graphics from the passed in Graphics and manipulate it. Further, if you do not invoker super implementation you must honor the opaque property, that is if this component is opaque, you must completely fill in the background in a non-opaque color. If you do not honor the opaque property you will likely see visual artifacts.

Overrides:
paint in class CellRendererPane
Parameters:
g - the Graphics object to protect
See Also:
paint(java.awt.Graphics), ComponentUI

paintFocus

protected void paintFocus(Graphics g)
Paints the focus border.

Parameters:
g - the Graphics instace

paintBackground

protected void paintBackground(Graphics g)
Paints the background.

Parameters:
g - the Graphics instance

isSelected

public boolean isSelected()
Checks if the expandable panel is selected.

Returns:
true if it is selected.

setSelected

public void setSelected(boolean selected)
Sets the expandable panel selected/

Parameters:
selected - the flag indicating if the expandable panel is selected

isHasFocus

public boolean isHasFocus()
Checks if expandable panel has focus.

Returns:
true if it has focus.

setHasFocus

public void setHasFocus(boolean hasFocus)
Sets the expandable panel focus attribute.

Parameters:
hasFocus - the flag indicating if the expandable panel has focus

getMinimumSize

public Dimension getMinimumSize()
Overrides:
getMinimumSize in class Container

getColumnWidth

public int getColumnWidth()

setColumnWidth

public void setColumnWidth(int columnWidth)

getPreferredSize

public Dimension getPreferredSize()
Overrides:
getPreferredSize in class Container

setFont

public void setFont(Font c)
Overrides:
setFont in class Container

getToolTipText

public String getToolTipText(MouseEvent e)
Delegates getTooltipText to actual renderer.

Overrides:
getToolTipText in class CellRendererPaneEx
Parameters:
e - the mouse event
Returns:
the tooltip of actual renderer

isExpandIconVisible

public boolean isExpandIconVisible(JTable table)

JIDE 3.5.15