|
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.NullCheckBox
public class NullCheckBox
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
,
NullPanel
,
NullJideButton
,
NullLabel
,
NullRadioButton
,
NullTristateCheckBox
,
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 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 | |
---|---|
NullCheckBox()
|
|
NullCheckBox(Action a)
|
|
NullCheckBox(Icon icon)
|
|
NullCheckBox(Icon icon,
boolean selected)
|
|
NullCheckBox(String text)
|
|
NullCheckBox(String text,
boolean selected)
|
|
NullCheckBox(String text,
Icon icon)
|
|
NullCheckBox(String text,
Icon icon,
boolean selected)
|
Method Summary | |
---|---|
void |
setBackground(Color bg)
|
void |
setFont(Font font)
|
void |
setForeground(Color fg)
|
Methods inherited from class javax.swing.JCheckBox |
---|
getAccessibleContext, getUIClassID, isBorderPaintedFlat, paramString, setBorderPaintedFlat, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public NullCheckBox()
public NullCheckBox(Icon icon)
public NullCheckBox(Icon icon, boolean selected)
public NullCheckBox(String text)
public NullCheckBox(Action a)
public NullCheckBox(String text, boolean selected)
public NullCheckBox(String text, Icon icon)
public NullCheckBox(String text, Icon icon, boolean selected)
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 |