|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.CellRendererPane com.jidesoft.grid.CellRendererPaneEx com.jidesoft.grid.ExpandablePanel
public class ExpandablePanel
The component has a "+/-" button which can be used in TreeTable or other tables.
Since 2.9.4, we let this class to inherits Component instead of JComponent before. We have to do so to fix some painting issue. However, it may cause backward compatibility issue especially if you ever tried to cast this class to JComponent. For example, if you use Nimbus L&F, you may see a Class Cast Exception. Before Nimbus fix their issue, please overridepaintFocus(java.awt.Graphics)
to do nothing to work around.
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 Icon |
_expandedIcon
|
protected boolean |
_hasFocus
|
protected boolean |
_isSelected
|
protected Node |
_node
|
protected JTable |
_table
|
static int |
LEFT_MARGIN
|
static int |
TEXT_ICON_GAP
|
static boolean |
VERTICAL_CENTER_ALIGNMENT
|
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 | |
---|---|
ExpandablePanel(JTable table,
Component actualRenderer,
Icon expandedIcon,
Icon collapsedIcon,
Color disabledBackground,
Color disabledForeground)
Creates an ExpandablePanel. |
|
ExpandablePanel(JTable table,
Icon expandedIcon,
Icon collapsedIcon,
Color disabledBackground,
Color disabledForeground)
Creates an ExpandablePanel. |
Method Summary | |
---|---|
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. |
protected boolean |
isSynthIcon(Icon icon)
Checks if the icon is a SynthIcon. |
protected boolean |
isSynthIconClassName(String name)
Check if the class name is a SynthIcon class name. |
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 |
paintDecoration(Graphics g)
|
protected void |
paintFocus(Graphics g)
Paints the focus border. |
protected int |
paintIcon(Graphics g,
int start)
Paints icon if necessary. |
void |
setBackground(Color c)
|
void |
setFont(Font c)
|
void |
setForeground(Color 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.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int TEXT_ICON_GAP
public static final int LEFT_MARGIN
public static boolean VERTICAL_CENTER_ALIGNMENT
protected Node _node
protected JTable _table
protected Icon _expandedIcon
protected Icon _collapsedIcon
protected Color _disabledForeground
protected Color _disabledBackground
protected boolean _isSelected
protected boolean _hasFocus
Constructor Detail |
---|
public ExpandablePanel(JTable table, Icon expandedIcon, Icon collapsedIcon, Color disabledBackground, Color disabledForeground)
table
- the tableexpandedIcon
- the expanded iconcollapsedIcon
- the collapsed icondisabledBackground
- the disabled backgrounddisabledForeground
- the disabled foregroundpublic ExpandablePanel(JTable table, Component actualRenderer, Icon expandedIcon, Icon collapsedIcon, Color disabledBackground, Color disabledForeground)
table
- the tableactualRenderer
- the rendererexpandedIcon
- the expanded iconcollapsedIcon
- the collapsed icondisabledBackground
- the disabled backgrounddisabledForeground
- the disabled foregroundMethod Detail |
---|
protected void initComponents()
public void setNode(Node node)
node
- the nodepublic void paint(Graphics g)
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's 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.
paint
in class CellRendererPane
g
- the Graphics
object to protectpaint(java.awt.Graphics)
,
ComponentUI
protected int paintIcon(Graphics g, int start)
g
- the Graphics instancestart
- the start X offset to paint the icon
protected boolean isSynthIcon(Icon icon)
icon
- the icon
protected boolean isSynthIconClassName(String name)
name
- the class name to check
protected void paintFocus(Graphics g)
g
- the Graphics instanceprotected void paintBackground(Graphics g)
g
- the Graphics instanceprotected void paintDecoration(Graphics g)
public boolean isSelected()
public void setSelected(boolean selected)
selected
- the flagpublic boolean isHasFocus()
public void setHasFocus(boolean hasFocus)
hasFocus
- the flagpublic Dimension getMinimumSize()
getMinimumSize
in class Container
public Dimension getPreferredSize()
getPreferredSize
in class Container
public void setBackground(Color c)
setBackground
in class Component
public void setForeground(Color c)
setForeground
in class Component
public void setFont(Font c)
setFont
in class Container
public String getToolTipText(MouseEvent e)
getToolTipText
in class CellRendererPaneEx
e
- the mouse event
public boolean isExpandIconVisible(JTable table)
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |