|
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.JButton com.jidesoft.swing.JideButton com.jidesoft.swing.NullJideButton
public class NullJideButton
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
,
NullPanel
,
NullLabel
,
NullRadioButton
,
NullTristateCheckBox
,
Serialized FormNested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JButton |
---|
JButton.AccessibleJButton |
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.JideButton |
---|
CLIENT_PROPERTY_HIDE_POPUPMENU, PROPERTY_ALWAYS_SHOW_HYPERLINK |
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 com.jidesoft.swing.Alignable |
---|
PROPERTY_ORIENTATION |
Fields inherited from interface com.jidesoft.swing.ButtonStyle |
---|
BUTTON_STYLE_PROPERTY, CLIENT_PROPERTY_SEGMENT_POSITION, FLAT_STYLE, HYPERLINK_STYLE, SEGMENT_POSITION_FIRST, SEGMENT_POSITION_LAST, SEGMENT_POSITION_MIDDLE, SEGMENT_POSITION_ONLY, TOOLBAR_STYLE, TOOLBOX_STYLE |
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 | |
---|---|
NullJideButton()
|
|
NullJideButton(Action a)
|
|
NullJideButton(Icon icon)
|
|
NullJideButton(String text)
|
|
NullJideButton(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.JideButton |
---|
getBackgroundOfState, getButtonStyle, getDefaultForeground, getForegroundOfState, getOrientation, getUIClassID, isAlwaysShowHyperlink, setAlwaysShowHyperlink, setBackgroundOfState, setButtonStyle, setDefaultForeground, setForegroundOfState, setIcon, setOrientation, setRolloverEnabled, setText, supportHorizontalOrientation, supportVerticalOrientation, updateUI |
Methods inherited from class javax.swing.JButton |
---|
getAccessibleContext, isDefaultButton, isDefaultCapable, paramString, removeNotify, setDefaultCapable |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.jidesoft.swing.AlignmentSupport |
---|
getHorizontalAlignment, getVerticalAlignment, setHorizontalAlignment, setVerticalAlignment |
Constructor Detail |
---|
public NullJideButton()
public NullJideButton(Icon icon)
public NullJideButton(String text)
public NullJideButton(Action a)
public NullJideButton(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 |