|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.pietschy.command.face.Face
public class Face
The face class holds all the visiual information about a Command. Faces are identified
by a context that defines where the face is relevant. The context may be any non empty
string but are usually the defaults defined by DEFAULT, BUTTON,
TOOLBAR, MENU, HTML, POPUP TOOLBAR_POPUP,
and HTML_POPUP.
Faces are then used by the current FaceRenderer to configure the appearance
of buttons created with the context of this face.
Defaults.setFaceRenderer(FaceRenderer),
Command.createButton(String),
Command.createMenuItem(String)| Field Summary | |
|---|---|
static java.lang.String |
BUTTON
Button context |
static java.lang.String |
DEFAULT
Default context |
static java.lang.String |
HTML
HTML context |
static java.lang.String |
HTML_POPUP
HTML popup context |
static java.lang.String |
MENU
Menu context |
static char |
MNEMONIC_MARKER
|
(package private) com.pietschy.command.face.Face.ParentListener |
parentListener
|
static java.lang.String |
POPUP
Popup menu context |
static java.lang.String |
TOOLBAR
Toolbar context |
static java.lang.String |
TOOLBAR_POPUP
Toolbar popup context |
| Constructor Summary | |
|---|---|
Face(java.lang.String context)
Constructs a new empty face with the specified context. |
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener)
Adds a property change listener for all properties of the face. |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Adds a property change listener to the face. |
Face |
clone()
Creates a clone of this face. |
(package private) AttributeValue |
createAttributeValue(Attribute attr)
Creates the attribute for the specified attribute name. |
javax.swing.KeyStroke |
getAccelerator()
Gets the accelerator of the face. |
AttributeValue |
getAttribute(Attribute attr)
Gets the specified attribute, lazily creating it if it doesn't already exit. |
(package private) java.util.EnumMap<Attribute,AttributeValue> |
getAttributeMap()
Exposed for unit test purposes. |
(package private) java.lang.Object |
getAttributeValue(Attribute attr)
Gets the value of the specified attribute. |
java.lang.String |
getClientProperty(java.lang.String name)
Gets the value of the specified client property. |
java.lang.String |
getClientProperty(java.lang.String name,
java.lang.String defaultValue)
Gets the value of the specified client property, or returns the specified default value if it doesn't exist. |
java.util.Set<java.lang.String> |
getClientPropertyNames()
Gets the client property names of this face. |
java.lang.String |
getContext()
Gets the context of this face. |
java.lang.String |
getDescription()
Gets the description attriubte of the face. |
javax.swing.Icon |
getDisabledIcon()
Gets the disabled icon for the face. |
java.lang.String |
getExtendsContext()
Gets the face context that this face extends. |
java.lang.Integer |
getHorizontalTextPosition()
Gets the horizontal text position of this face. |
javax.swing.Icon |
getIcon()
Gets the main icon for the face. |
java.lang.Integer |
getIconTextGap()
Gets the icon text gap of the face, or null if it hasn't been configured. |
java.lang.String |
getLongDescription()
Gets the long description attribute of the face. |
java.lang.Integer |
getMnemonic()
Gets the mnemonic of the face. |
java.lang.Integer |
getMnemonicIndex()
Gets the mnemonic index of the face. |
(package private) Face |
getParent()
Gets this parent face. |
(package private) java.lang.Object |
getParentValue(Attribute attr)
Gets the inherited value of the specified attribute name. |
(package private) java.beans.PropertyChangeSupport |
getPcs()
|
javax.swing.Icon |
getPressedIcon()
Gets the pressed icon for the face. |
javax.swing.Icon |
getRolloverIcon()
Gets the rollover icon for the face. |
javax.swing.Icon |
getRolloverSelectedIcon()
Gets the rollover selected icon for the face. |
javax.swing.Icon |
getSelectedIcon()
Gets the selected icon for the face. |
java.lang.String |
getText()
Returns the Test as displayed by attachments of this command. |
java.lang.Integer |
getVerticalTextPosition()
Gets the vertical text position of this face. |
void |
putClientProperty(java.lang.String name,
java.lang.String value)
Sets the value of the specified client property. |
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener)
Removes a property change listener from all properties of the face. |
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Removes a property change listener from the face. |
void |
setAccelerator(javax.swing.KeyStroke accelerator)
Sets accelerator of the face. |
void |
setAcceleratorInherited(boolean inherited)
Configures if the value is inherited when null. |
void |
setDescription(java.lang.String description)
Sets the description attribute of the face. |
void |
setDescriptionInherited(boolean inherited)
Configures if the value is inherited when null. |
void |
setDisabledIcon(javax.swing.Icon icon)
Sets the disabled icon of the face. |
void |
setDisabledIconInherited(boolean inherited)
Configures if the value is inherited when null. |
void |
setExtendsContext(java.lang.String extendsContext)
Sets the context this face extends. |
void |
setHorizontalTextPosition(java.lang.Integer position)
Sets the horizontal position for the text on this face. |
void |
setHorizontalTextPositionInherited(boolean inherited)
Configures if the value is inherited when null. |
void |
setIcon(javax.swing.Icon icon)
Sets the main icon of the face. |
void |
setIconInherited(boolean inherited)
Configures if the value is inherited when null. |
void |
setIconTextGap(java.lang.Integer gap)
Sets the icon text gap of the face. |
void |
setIconTextGapInherited(boolean inherited)
Configures if the value is inherited when null. |
void |
setLongDescription(java.lang.String description)
Sets the long description attribute of the face. |
void |
setLongDescriptionInherited(boolean inherited)
Configures if the value is inherited when null. |
void |
setMnemonic(java.lang.Integer mnemonic)
Sets the mnemonic of the face. |
void |
setMnemonicIndex(java.lang.Integer index)
Sets the mnemonic index the face. |
void |
setMnemonicIndexInherited(boolean inherited)
Configures if the value is inherited when null. |
void |
setMnemonicInherited(boolean inherited)
Configures if the value is inherited when null. |
(package private) void |
setParent(Face parent)
Sets this faces parent. |
void |
setPressedIcon(javax.swing.Icon icon)
Sets the pressed icon of the face. |
void |
setPressedIconInherited(boolean inherited)
Configures if the value is inherited when null. |
void |
setRolloverIcon(javax.swing.Icon icon)
Sets the rollover icon of the face. |
void |
setRolloverIconInherited(boolean inherited)
Configures if the value is inherited when null. |
void |
setRolloverSelectedIcon(javax.swing.Icon icon)
Sets the rollover selected icon of the face. |
void |
setRolloverSelectedIconInherited(boolean inherited)
Configures if the value is inherited when null. |
void |
setSelectedIcon(javax.swing.Icon icon)
Sets the selected icon of the face. |
void |
setSelectedIconInherited(boolean inherited)
Configures if the value is inherited when null. |
void |
setText(java.lang.String text)
Sets the text for the face. |
void |
setTextInherited(boolean textInherited)
Configures if the text is inherited if the value is null. |
void |
setVerticalTextPosition(java.lang.Integer integer)
Sets the vertical text position. |
void |
setVerticalTextPositionInherited(boolean inherited)
Configures if the value is inherited when null. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final char MNEMONIC_MARKER
public static final java.lang.String DEFAULT
public static final java.lang.String BUTTON
public static final java.lang.String MENU
public static final java.lang.String POPUP
public static final java.lang.String TOOLBAR
public static final java.lang.String TOOLBAR_POPUP
public static final java.lang.String HTML
public static final java.lang.String HTML_POPUP
com.pietschy.command.face.Face.ParentListener parentListener
| Constructor Detail |
|---|
public Face(java.lang.String context)
context - the context of this face. Typically "default", "button", "menu" etc| Method Detail |
|---|
public Face clone()
clone in class java.lang.Objectjava.beans.PropertyChangeSupport getPcs()
public java.lang.String getContext()
public java.lang.String getExtendsContext()
null.
null if
this face doesn't extend another.public void setExtendsContext(java.lang.String extendsContext)
extendsContext - the context this face extends, or null if
this face doesn't extend another.Face getParent()
void setParent(Face parent)
public AttributeValue getAttribute(Attribute attr)
attr - the Attribute.
AttributeValue createAttributeValue(Attribute attr)
DescriptionAttributeValue values for the description
and longDescriptoin attributes.
attr -
java.lang.Object getAttributeValue(Attribute attr)
attr - the attribute name
java.util.EnumMap<Attribute,AttributeValue> getAttributeMap()
java.lang.Object getParentValue(Attribute attr)
attr - the attribute.
public void putClientProperty(java.lang.String name,
java.lang.String value)
name - the client property name.value - the client property value.public java.lang.String getClientProperty(java.lang.String name)
name - the property name.
public java.lang.String getClientProperty(java.lang.String name,
java.lang.String defaultValue)
name - the property namedefaultValue - the value to return if the property isn't defined.
public java.util.Set<java.lang.String> getClientPropertyNames()
public java.lang.String getText()
public void setText(java.lang.String text)
text - the new string for the face.public void setTextInherited(boolean textInherited)
null.
textInherited - true to inherit from the parent face, false
otherwise.public java.lang.Integer getHorizontalTextPosition()
verticalPosition has
been configured as the vertical position on button is only useful if the horizontal position is
set to SwingConstants.CENTER.
getVerticalTextPosition()public void setHorizontalTextPosition(java.lang.Integer position)
position - the horizontal position of the text.getHorizontalTextPosition()public void setHorizontalTextPositionInherited(boolean inherited)
null.
inherited - true to inherit from the parent
face, false otherwise.public java.lang.Integer getVerticalTextPosition()
horizontalTextPosition
being ignored.
getVerticalTextPosition()public void setVerticalTextPosition(java.lang.Integer integer)
AbstractButton.setVerticalTextPosition(int).
Configuring this value will result in
the horizontalTextPosition
being ignored.
integer - the vertical text position of the face.public void setVerticalTextPositionInherited(boolean inherited)
null.
inherited - true to inherit from the parent
face, false otherwise.public java.lang.Integer getIconTextGap()
public void setIconTextGap(java.lang.Integer gap)
gap - the icon text gap of the face, or null to inherit
or clear the value.public void setIconTextGapInherited(boolean inherited)
null.
inherited - true to inherit from the parent
face, false otherwise.public javax.swing.Icon getIcon()
public void setIcon(javax.swing.Icon icon)
icon - the icon of the face, or null to inherit
or clear the value.public void setIconInherited(boolean inherited)
null.
inherited - true to inherit from the parent
face, false otherwise.public javax.swing.Icon getSelectedIcon()
public void setSelectedIcon(javax.swing.Icon icon)
icon - the selected icon of the face, or null to inherit
or clear the value.public void setSelectedIconInherited(boolean inherited)
null.
inherited - true to inherit from the parent
face, false otherwise.public javax.swing.Icon getRolloverIcon()
public void setRolloverIcon(javax.swing.Icon icon)
icon - the rollover icon of the face, or null to inherit
or clear the value.public void setRolloverIconInherited(boolean inherited)
null.
inherited - true to inherit from the parent
face, false otherwise.public javax.swing.Icon getRolloverSelectedIcon()
public void setRolloverSelectedIcon(javax.swing.Icon icon)
icon - the rollover selected icon of the face, or null to inherit
or clear the value.public void setRolloverSelectedIconInherited(boolean inherited)
null.
inherited - true to inherit from the parent
face, false otherwise.public javax.swing.Icon getPressedIcon()
public void setPressedIcon(javax.swing.Icon icon)
icon - the pressed icon of the face, or null to inherit
or clear the value.public void setPressedIconInherited(boolean inherited)
null.
inherited - true to inherit from the parent
face, false otherwise.public javax.swing.Icon getDisabledIcon()
public void setDisabledIcon(javax.swing.Icon icon)
icon - the disabled icon of the face, or null to inherit
or clear the value.public void setDisabledIconInherited(boolean inherited)
null.
inherited - true to inherit from the parent
face, false otherwise.public java.lang.Integer getMnemonic()
public void setMnemonic(java.lang.Integer mnemonic)
setMnemonicIndex(Integer) is specified.
mnemonic - the mnemonic of the face, or null to inherit
or clear the value.public void setMnemonicInherited(boolean inherited)
null. If specified
this value will be used in preference to getMnemonic().
inherited - true to inherit from the parent
face, false otherwise.public java.lang.Integer getMnemonicIndex()
public void setMnemonicIndex(java.lang.Integer index)
index - the mnemonic index of the face, or null to inherit
or clear the value.public void setMnemonicIndexInherited(boolean inherited)
null.
inherited - true to inherit from the parent
face, false otherwise.public javax.swing.KeyStroke getAccelerator()
public void setAccelerator(javax.swing.KeyStroke accelerator)
accelerator - the accelerator of the face, or null to inherit
or clear the value.public void setAcceleratorInherited(boolean inherited)
null.
inherited - true to inherit from the parent
face, false otherwise.public java.lang.String getDescription()
public void setDescription(java.lang.String description)
$text" and "$accelerator" will be replaced with
the text and accelerator values of the face.
face.setDescription("my accelerator is $accelerator");
description - the description attribute of the face, or null to inherit
or clear the value.public void setDescriptionInherited(boolean inherited)
null.
inherited - true to inherit from the parent
face, false otherwise.public java.lang.String getLongDescription()
public void setLongDescription(java.lang.String description)
$text" and "$accelerator" will be replaced with
the text and accelerator values of the face.
face.setLongDescription("my accelerator is $accelerator");
description - the long description attribute of the face, or null to inherit
or clear the value.public void setLongDescriptionInherited(boolean inherited)
null.
inherited - true to inherit from the parent
face, false otherwise.
public void addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
propertyName - the property to observe.listener - the listener.
public void removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
propertyName - the property being observed.listener - the listener to remove.public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - the listener.public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
listener - the listener.public java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||