|
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.JComponent javax.swing.AbstractButton javax.swing.JToggleButton javax.swing.JCheckBox com.jidesoft.swing.TristateCheckBox com.jidesoft.swing.NullTristateCheckBox
public class NullTristateCheckBox
This is part of the null-components. A null component doesn't have foreground, background or font value set. In the
other words, the foreground, background and font value of null-component are null. But this doesn't mean
getBackground(), getForeground() or getFont() will return null. According to Component.getBackground()
, Component.getForeground()
and Component.getFont()
, if the value is null, it will get the value from its parent. In the other words, if
you add a null-component to JPanel, you can use JPanel to control the background, foreground and font of this
null-component. The feature is very helpful if you want to make sure all components in a JPanel has the same
background, foreground or font.
public class NullXxxComponent extends XxxComponent {
// invoke clearAttribute() in all the constructors
public void setFont(Font font) {
if (font instanceof FontUIResource) {
return;
}
super.setFont(font);
}
public void setBackground(Color bg) {
if (bg instanceof ColorUIResource) {
return;
}
super.setBackground(bg);
}
public void setForeground(Color fg) {
if (fg instanceof ColorUIResource) {
return;
}
super.setForeground(fg);
}
private void clearAttribute() {
setFont(null);
setBackground(null);
// do not do this for JButton since JButton always paints button
// content background. So it'd better to leave the foreground alone
setForeground(null);
}
}
NullButton
,
NullCheckBox
,
NullJideButton
,
NullLabel
,
NullRadioButton
,
NullPanel
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JCheckBox |
---|
JCheckBox.AccessibleJCheckBox |
Nested classes/interfaces inherited from class javax.swing.JToggleButton |
---|
JToggleButton.AccessibleJToggleButton, JToggleButton.ToggleButtonModel |
Nested classes/interfaces inherited from class javax.swing.AbstractButton |
---|
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
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 |
---|
Fields inherited from class com.jidesoft.swing.TristateCheckBox |
---|
STATE_MIXED, STATE_SELECTED, STATE_UNSELECTED |
Fields inherited from class javax.swing.JCheckBox |
---|
BORDER_PAINTED_FLAT_CHANGED_PROPERTY |
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 javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
NullTristateCheckBox()
|
|
NullTristateCheckBox(String text)
|
|
NullTristateCheckBox(String text,
Icon icon)
|
Method Summary | |
---|---|
void |
setBackground(Color bg)
|
void |
setFont(Font font)
|
void |
setForeground(Color fg)
|
Methods inherited from class com.jidesoft.swing.TristateCheckBox |
---|
actionPerformed, adjustMixedIcon, createButtonModel, getState, init, isMixed, restoreMixedIcon, setMixed, setSelected, setState, stateUpdated, updateUI |
Methods inherited from class javax.swing.JCheckBox |
---|
getAccessibleContext, getUIClassID, isBorderPaintedFlat, paramString, setBorderPaintedFlat |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NullTristateCheckBox()
public NullTristateCheckBox(String text)
public NullTristateCheckBox(String text, Icon icon)
Method Detail |
---|
public void setFont(Font font)
setFont
in class JComponent
public void setBackground(Color bg)
setBackground
in class JComponent
public void setForeground(Color fg)
setForeground
in class JComponent
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |