|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.globalmentor.beans.BoundPropertyObject
com.guiseframework.event.GuiseBoundPropertyObject
com.guiseframework.model.ui.AbstractPresentationModel
com.guiseframework.component.AbstractComponent
public abstract class AbstractComponent
An abstract implementation of a component.
A component should never fire a property event directly. It should rather create a postponed event and queue that event with the session.
This implementation automatically handles postponed property change events when BoundPropertyObject.firePropertyChange(String, Object, Object) or a related method is called.
Property changes to a component's constraints are repeated with the component as the source and the constraints as the target.
| Nested Class Summary | |
|---|---|
static class |
AbstractComponent.AbstractFlyoverFrameStrategy<S extends Component>
An abstract flyover strategy that uses flyover frames. |
static class |
AbstractComponent.AbstractFlyoverStrategy<S extends Component>
An abstract implementation of a strategy for showing and hiding flyovers in response to mouse events. |
static class |
AbstractComponent.DefaultFlyoverStrategy<S extends Component>
The default strategy for showing and hiding flyovers in response to mouse events. |
| Nested classes/interfaces inherited from interface com.guiseframework.component.Component |
|---|
Component.FlyoverStrategy<S extends Component> |
| Field Summary |
|---|
| Fields inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS |
| Fields inherited from interface com.guiseframework.component.Component |
|---|
BOOKMARK_ENABLED_PROPERTY, CONSTRAINTS_PROPERTY, DRAG_ENABLED_PROPERTY, DROP_ENABLED_PROPERTY, FLYOVER_ENABLED_PROPERTY, FLYOVER_STRATEGY_PROPERTY, INPUT_STRATEGY_PROPERTY, NAME_PROPERTY, NOTIFICATION_PROPERTY, ORIENTATION_PROPERTY, THEME_APPLIED_PROPERTY, VALID_PROPERTY |
| Fields inherited from interface com.guiseframework.model.Displayable |
|---|
DISPLAYED_PROPERTY |
| Fields inherited from interface com.guiseframework.model.InfoModel |
|---|
DESCRIPTION_CONTENT_TYPE_PROPERTY, DESCRIPTION_PROPERTY, INFO_CONTENT_TYPE_PROPERTY, INFO_PROPERTY |
| Fields inherited from interface com.guiseframework.model.LabelModel |
|---|
GLYPH_URI_PROPERTY, LABEL_CONTENT_TYPE_PROPERTY, LABEL_PROPERTY |
| Fields inherited from interface com.guiseframework.model.Model |
|---|
PLAIN_TEXT_CONTENT_TYPE, XHTML_CONTENT_TYPE, XHTML_FRAGMENT_CONTENT_TYPE |
| Constructor Summary | |
|---|---|
AbstractComponent()
Default constructor. |
|
AbstractComponent(InfoModel infoModel)
Info model constructor. |
|
| Method Summary | ||
|---|---|---|
void |
addCommandListener(CommandListener commandListener)
Adds a command listener. |
|
void |
addExportStrategy(ExportStrategy<?> exportStrategy)
Adds an export strategy to the component. |
|
void |
addImportStrategy(ImportStrategy<?> importStrategy)
Adds an import strategy to the component. |
|
void |
addKeyListener(KeyboardListener keyListener)
Adds a key listener. |
|
void |
addMouseListener(MouseListener mouseListener)
Adds a mouse listener. |
|
void |
addNotificationListener(NotificationListener notificationListener)
Adds a notification listener. |
|
void |
addPreferenceProperty(java.lang.String propertyName)
Adds a property to be saved and loaded as a preference. |
|
void |
applyTheme()
Applies the theme to this object. |
|
void |
applyTheme(Theme theme)
Applies a theme and its parents to this object. |
|
void |
depict()
Updates the depiction of the object. |
|
protected boolean |
determineValid()
Checks the state of the component for validity. |
|
void |
dispatchInputEvent(InputEvent inputEvent)
Dispatches an input event to this component and all child components, if any. |
|
boolean |
equals(java.lang.Object object)
Indicates whether some other object is "equal to" this one. |
|
Transferable<?> |
exportTransfer()
Exports data from the component. |
|
void |
fireInputEvent(InputEvent inputEvent)
Fire the given even to all registered listeners, if any. |
|
protected void |
fireNotified(Notification notification)
Fires an event to all registered notification listeners with the new notification information. |
|
protected void |
fireNotified(NotificationEvent notificationEvent)
Fires an event to all registered notification listeners with the new notification information. |
|
|
getAncestor(java.lang.Class<A> ancestorClass)
Retrieves the first ancestor of the given type. |
|
protected java.lang.Iterable<CommandListener> |
getCommandListeners()
|
|
static Component |
getComponentByID(Component component,
long id)
Retrieves a component with the given ID. |
|
static Component |
getComponentByName(Component component,
java.lang.String name)
Retrieves a component with the given name. |
|
Orientation |
getComponentOrientation()
Determines the internationalization orientation of the component's contents. |
|
Constraints |
getConstraints()
|
|
long |
getDepictID()
|
|
Depictor<? extends Component> |
getDepictor()
|
|
java.lang.String |
getDescription()
|
|
com.globalmentor.net.ContentType |
getDescriptionContentType()
|
|
static java.util.List<Component> |
getDirtyComponents(Component component)
Retrieves all components that have views needing updated. |
|
static java.util.List<Component> |
getDirtyComponents(Component component,
java.util.List<Component> dirtyComponents)
Retrieves all components that have views needing updated. |
|
protected com.globalmentor.event.EventListenerManager |
getEventListenerManager()
|
|
Component.FlyoverStrategy<?> |
getFlyoverStrategy()
|
|
java.net.URI |
getGlyphURI()
|
|
java.lang.String |
getInfo()
|
|
com.globalmentor.net.ContentType |
getInfoContentType()
|
|
protected InfoModel |
getInfoModel()
|
|
InputStrategy |
getInputStrategy()
|
|
protected java.lang.Iterable<KeyboardListener> |
getKeyListeners()
|
|
java.lang.String |
getLabel()
|
|
com.globalmentor.net.ContentType |
getLabelContentType()
|
|
protected java.lang.Iterable<MouseListener> |
getMouseListeners()
|
|
java.lang.String |
getName()
|
|
Notification |
getNotification()
|
|
static java.util.List<Notification> |
getNotifications(Component component)
Retrieves the the notifications of all components in a hierarchy. |
|
protected static java.util.List<Notification> |
getNotifications(Component component,
java.util.List<Notification> notifications)
Retrieves the the notifications of all components in a hierarchy. |
|
Orientation |
getOrientation()
Returns this component's requested orientation. |
|
CompositeComponent |
getParent()
|
|
java.lang.Iterable<java.lang.String> |
getPreferenceProperties()
Returns all properties stored as preferences. |
|
static Component |
getRootComponent(Component component)
Determines the root parent of the given component. |
|
Theme |
getTheme()
Returns the theme to apply to this component. |
|
static boolean |
hasAncestor(Component component,
CompositeComponent ancestor)
Determines whether a component has a given component as its ancestor, not including the component itself. |
|
boolean |
hasCommandListeners()
|
|
int |
hashCode()
|
|
boolean |
hasKeyListeners()
|
|
boolean |
hasMouseListeners()
|
|
boolean |
importTransfer(Transferable<?> transferable)
Imports data to the component. |
|
void |
initialize()
Initializes the component after construction. |
|
boolean |
isDragEnabled()
|
|
boolean |
isDropEnabled()
|
|
boolean |
isFlyoverEnabled()
|
|
boolean |
isPreferenceProperty(java.lang.String propertyName)
Determines whether the given property is saved and loaded as a preference. |
|
boolean |
isThemeApplied()
|
|
boolean |
isValid()
Determines whether the state of the component and all child components represents valid user input. |
|
void |
loadPreferences(boolean includeDescendants)
Loads the preferences for this component and optionally any descendant components. |
|
void |
notify(Notification notification)
Notifies the user of the given notification information. |
|
void |
processEvent(PlatformEvent event)
Processes an event from the platform. |
|
void |
removeCommandListener(CommandListener commandListener)
Removes a command listener. |
|
void |
removeExportStrategy(ExportStrategy<?> exportStrategy)
Removes an export strategy from the component. |
|
void |
removeImportStrategy(ImportStrategy<?> importStrategy)
Removes an import strategy from the component. |
|
void |
removeKeyListener(KeyboardListener keyListener)
Removes a key listener. |
|
void |
removeMouseListener(MouseListener mouseListener)
Removes a mouse listener. |
|
void |
removeNotificationListener(NotificationListener notificationListener)
Removes a notification listener. |
|
void |
removePreferenceProperty(java.lang.String propertyName)
Removes a property from being saved and loaded as preferences. |
|
void |
resetTheme()
Resets this object's theme. |
|
void |
savePreferences(boolean includeDescendants)
Saves the preferences for this component and optionally any descendant components. |
|
void |
setConstraints(Constraints newConstraints)
Sets the layout constraints of this component. |
|
static void |
setDepicted(Component component,
boolean newUpdated)
Changes the updated status of the views of an entire component descendant hierarchy. |
|
void |
setDescription(java.lang.String newDescription)
Sets the description text, such as might appear in a flyover. |
|
void |
setDescriptionContentType(com.globalmentor.net.ContentType newDescriptionContentType)
Sets the content type of the description text. |
|
void |
setDragEnabled(boolean newDragEnabled)
Sets whether the component has dragging enabled. |
|
void |
setDropEnabled(boolean newDropEnabled)
Sets whether the component has dropping enabled. |
|
void |
setFlyoverEnabled(boolean newFlyoverEnabled)
Sets whether flyovers are enabled for this component. |
|
void |
setFlyoverStrategy(Component.FlyoverStrategy<?> newFlyoverStrategy)
Sets the strategy for controlling flyovers. |
|
void |
setGlyphURI(java.net.URI newLabelIcon)
Sets the URI of the icon. |
|
void |
setInfo(java.lang.String newInfo)
Sets the advisory information text, such as might appear in a tooltip. |
|
void |
setInfoContentType(com.globalmentor.net.ContentType newInfoContentType)
Sets the content type of the advisory information text. |
|
void |
setInputStrategy(InputStrategy newInputStrategy)
Sets the strategy for processing input. |
|
void |
setLabel(java.lang.String newLabelText)
Sets the text of the label. |
|
void |
setLabelContentType(com.globalmentor.net.ContentType newLabelTextContentType)
Sets the content type of the label text. |
|
void |
setName(java.lang.String newName)
Sets the name of the component. |
|
void |
setNotification(Notification newNotification)
Sets the component notification. |
|
void |
setOrientation(Orientation newOrientation)
Sets the orientation. |
|
void |
setParent(CompositeComponent newParent)
Sets the parent of this component. |
|
void |
setThemeApplied(boolean newThemeApplied)
Sets whether a theme has been applied to this component. |
|
protected void |
setValid(boolean newValid)
Sets whether the state of the component and all child components represents valid user input This is a bound property of type Boolean. |
|
java.lang.String |
toString()
|
|
protected void |
update()
Updates the condition of the component based upon the state. |
|
void |
updateTheme()
Updates this object's theme. |
|
protected void |
updateValid()
Rechecks user input validity of this component and all child components, and updates the valid state. |
|
boolean |
validate()
Validates the user input of this component and all child components. |
|
| Methods inherited from class com.guiseframework.event.GuiseBoundPropertyObject |
|---|
getSession |
| Methods inherited from class com.globalmentor.beans.BoundPropertyObject |
|---|
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, addVetoableChangeListener, createPostponedPropertyChangeEvent, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, fireVetoableChange, getForwardPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeSupport, getRepeatPropertyChangeListener, getRepeatVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, getVetoableChangeSupport, hasPropertyChangeListeners, hasVetoableChangeListeners, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, removeVetoableChangeListener |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.guiseframework.platform.DepictedObject |
|---|
getSession |
| Methods inherited from interface com.globalmentor.beans.PropertyBindable |
|---|
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, hasPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener |
| Methods inherited from interface com.globalmentor.beans.PropertyConstrainable |
|---|
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, hasVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener |
| Constructor Detail |
|---|
public AbstractComponent()
java.lang.IllegalStateException - if no controller is registered for this component type.
java.lang.IllegalStateException - if no view is registered for this component type.public AbstractComponent(InfoModel infoModel)
infoModel - The component info model.
java.lang.NullPointerException - if the given info model is null.
java.lang.IllegalStateException - if no depictor is registered for this component type.| Method Detail |
|---|
protected com.globalmentor.event.EventListenerManager getEventListenerManager()
public void addPreferenceProperty(java.lang.String propertyName)
addPreferenceProperty in interface ComponentpropertyName - The property to store as a preference.loadPreferences(boolean),
savePreferences(boolean)public boolean isPreferenceProperty(java.lang.String propertyName)
isPreferenceProperty in interface ComponentpropertyName - The property to determine if it is stored as a preference.
true if the given property is saved and loaded as a preference.loadPreferences(boolean),
savePreferences(boolean)public java.lang.Iterable<java.lang.String> getPreferenceProperties()
getPreferenceProperties in interface ComponentloadPreferences(boolean),
savePreferences(boolean)public void removePreferenceProperty(java.lang.String propertyName)
removePreferenceProperty in interface ComponentpropertyName - The property that should no longer be stored as a preference.loadPreferences(boolean),
savePreferences(boolean)protected InfoModel getInfoModel()
public java.lang.String getName()
getName in interface Componentnull if the component has no name.public void setName(java.lang.String newName)
setName in interface ComponentnewName - The new name of the component, or null if the component should have no name.
java.lang.IllegalArgumentException - if the given name is the empty string.Component.NAME_PROPERTYpublic java.net.URI getGlyphURI()
getGlyphURI in interface LabelModelnull if there is no icon URI.public void setGlyphURI(java.net.URI newLabelIcon)
URI.
setGlyphURI in interface LabelModelnewLabelIcon - The new URI of the icon, which may be a resource URI.LabelModel.GLYPH_URI_PROPERTYpublic java.lang.String getLabel()
getLabel in interface LabelModelnull if there is no label text.public void setLabel(java.lang.String newLabelText)
setLabel in interface LabelModelnewLabelText - The new text of the label, which may include a resource reference.LabelModel.LABEL_PROPERTYpublic com.globalmentor.net.ContentType getLabelContentType()
getLabelContentType in interface LabelModelpublic void setLabelContentType(com.globalmentor.net.ContentType newLabelTextContentType)
setLabelContentType in interface LabelModelnewLabelTextContentType - The new label text content type.
java.lang.NullPointerException - if the given content type is null.
java.lang.IllegalArgumentException - if the given content type is not a text content type.LabelModel.LABEL_CONTENT_TYPE_PROPERTYpublic java.lang.String getDescription()
getDescription in interface InfoModelnull if there is no description.public void setDescription(java.lang.String newDescription)
setDescription in interface InfoModelnewDescription - The new text of the description, such as might appear in a flyover.InfoModel.DESCRIPTION_PROPERTYpublic com.globalmentor.net.ContentType getDescriptionContentType()
getDescriptionContentType in interface InfoModelpublic void setDescriptionContentType(com.globalmentor.net.ContentType newDescriptionContentType)
setDescriptionContentType in interface InfoModelnewDescriptionContentType - The new description text content type.
java.lang.NullPointerException - if the given content type is null.
java.lang.IllegalArgumentException - if the given content type is not a text content type.InfoModel.DESCRIPTION_CONTENT_TYPE_PROPERTYpublic java.lang.String getInfo()
getInfo in interface InfoModelnull if there is no advisory information.public void setInfo(java.lang.String newInfo)
setInfo in interface InfoModelnewInfo - The new text of the advisory information, such as might appear in a tooltip.InfoModel.INFO_PROPERTYpublic com.globalmentor.net.ContentType getInfoContentType()
getInfoContentType in interface InfoModelpublic void setInfoContentType(com.globalmentor.net.ContentType newInfoContentType)
setInfoContentType in interface InfoModelnewInfoContentType - The new advisory information text content type.
java.lang.NullPointerException - if the given content type is null.
java.lang.IllegalArgumentException - if the given content type is not a text content type.InfoModel.INFO_CONTENT_TYPE_PROPERTYpublic Constraints getConstraints()
getConstraints in interface Componentnull if no constraints have been specified for this component.public void setConstraints(Constraints newConstraints)
setConstraints in interface ComponentnewConstraints - The layout constraints describing individual component layout information, or null if no constraints have been specified for this component.Component.CONSTRAINTS_PROPERTYpublic InputStrategy getInputStrategy()
getInputStrategy in interface Componentnull if this component has no input strategy.public void setInputStrategy(InputStrategy newInputStrategy)
setInputStrategy in interface ComponentnewInputStrategy - The new strategy for processing input, or null if this component is to have no input strategy.Component.INPUT_STRATEGY_PROPERTYpublic Notification getNotification()
getNotification in interface Componentnull if no notification is associated with this component.public void setNotification(Notification newNotification)
NotificationEvent on this component if a new notification is given.
Parents are expected to refire the notification event up the hierarchy.
setNotification in interface ComponentnewNotification - The notification for the component, or null if no notification is associated with this component.Component.NOTIFICATION_PROPERTYpublic boolean isValid()
isValid in interface Componentprotected void setValid(boolean newValid)
Boolean.
This implementation initializes the valid property if needed.
newValid - true if user input of this component and all child components should be considered validComponent.VALID_PROPERTYprotected void updateValid()
Component.VALID_PROPERTY.
setValid(boolean)protected boolean determineValid()
true.
true if the component and all children passes all validity tests, else false.public Depictor<? extends Component> getDepictor()
getDepictor in interface ComponentgetDepictor in interface DepictedObjectpublic void processEvent(PlatformEvent event)
processEvent in interface DepictedObjectevent - The event to be processed.
java.lang.IllegalArgumentException - if the given event is a relevant DepictEvent with a source of a different depicted object.getDepictor(),
Depictor.processEvent(PlatformEvent)
public void depict()
throws java.io.IOException
depict in interface DepictedObjectjava.io.IOException - if there is an error updating the depiction.getDepictor(),
Depictor.depict()public long getDepictID()
getDepictID in interface DepictedObjectpublic Orientation getOrientation()
getComponentOrientation() should be used.
getOrientation in interface Componentnull if the default orientation should be used.getComponentOrientation()public Orientation getComponentOrientation()
getComponentOrientation in interface ComponentgetOrientation(),
GuiseSession.getOrientation()public void setOrientation(Orientation newOrientation)
setOrientation in interface ComponentnewOrientation - The new internationalization orientation of the component's contents, or null if default orientation should be determined based upon the session's locale.Component.ORIENTATION_PROPERTYpublic CompositeComponent getParent()
getParent in interface Componentnull if this component does not have a parent.public <A extends CompositeComponent> A getAncestor(java.lang.Class<A> ancestorClass)
getAncestor in interface ComponentA - The type of ancestor component requested.ancestorClass - The class of ancestor component requested.
null if this component has no such ancestor.public void setParent(CompositeComponent newParent)
setParent in interface ComponentnewParent - The new parent for this component, or null if this component is being removed from a parent.
java.lang.IllegalStateException - if a parent is provided and this component already has a parent.
java.lang.IllegalStateException - if no parent is provided and this component's old parent is a container that still recognizes this component as its child.
java.lang.IllegalArgumentException - if a parent container is provided and the given parent container does not already recognize this component as its child.Container.add(Component),
Container#remove(Component)public boolean isDragEnabled()
isDragEnabled in interface Componentpublic void setDragEnabled(boolean newDragEnabled)
Boolean.
setDragEnabled in interface ComponentnewDragEnabled - true if the component should allow dragging, else false.Component.DRAG_ENABLED_PROPERTYpublic boolean isDropEnabled()
isDropEnabled in interface Componentpublic void setDropEnabled(boolean newDropEnabled)
Boolean.
setDropEnabled in interface ComponentnewDropEnabled - true if the component should allow dropping, else false.Component.DROP_ENABLED_PROPERTYpublic boolean isFlyoverEnabled()
isFlyoverEnabled in interface Componentpublic void setFlyoverEnabled(boolean newFlyoverEnabled)
Boolean.
setFlyoverEnabled in interface ComponentnewFlyoverEnabled - true if the component should display flyovers, else false.getDescription(),
Component.FLYOVER_ENABLED_PROPERTYpublic Component.FlyoverStrategy<?> getFlyoverStrategy()
getFlyoverStrategy in interface Componentnull if there is no flyover strategy installed.public void setFlyoverStrategy(Component.FlyoverStrategy<?> newFlyoverStrategy)
setFlyoverStrategy in interface ComponentnewFlyoverStrategy - The new flyover strategy, or null if there is no flyover strategy installed.Component.FLYOVER_STRATEGY_PROPERTYpublic boolean isThemeApplied()
isThemeApplied in interface Componentpublic void setThemeApplied(boolean newThemeApplied)
Boolean.
setThemeApplied in interface ComponentnewThemeApplied - true if a theme has been applied to this component, else false.Component.THEME_APPLIED_PROPERTYpublic void addExportStrategy(ExportStrategy<?> exportStrategy)
addExportStrategy in interface ComponentexportStrategy - The export strategy to add.public void removeExportStrategy(ExportStrategy<?> exportStrategy)
removeExportStrategy in interface ComponentexportStrategy - The export strategy to remove.public Transferable<?> exportTransfer()
exportTransfer in interface ComponentexportTransfer in interface DepictedObjectnull if no data can be transferred.public void addImportStrategy(ImportStrategy<?> importStrategy)
addImportStrategy in interface ComponentimportStrategy - The importstrategy to add.public void removeImportStrategy(ImportStrategy<?> importStrategy)
removeImportStrategy in interface ComponentimportStrategy - The import strategy to remove.public boolean importTransfer(Transferable<?> transferable)
importTransfer in interface Componenttransferable - The object to be transferred.
true if the given object was be imported.public void initialize()
initialize in interface Componentjava.lang.IllegalStateException - if this method has already been called.protected void update()
public boolean validate()
updateValid().
validate in interface ComponentisValid() as a convenience.public void dispatchInputEvent(InputEvent inputEvent)
FocusedInputEvent, the event will be directed towards the branch in which lies the focused component of any InputFocusGroupComponent ancestor of this component (or this component, if it is a focus group).
If this is instead a TargetedEvent, the event will be directed towards the branch in which lies the target component of the event.
Otherwise, the event will be dispatched to all child components.
Only after the event has been dispatched to any children will the event be fired to any event listeners and then passed to the installed input strategy, if any.
Once the event is consumed, no further processing takes place.
This version fires all events that are not consumed.
dispatchInputEvent in interface ComponentinputEvent - The input event to dispatch.
java.lang.NullPointerException - if the given event is null.TargetedEvent,
FocusedInputEvent,
InputEvent.isConsumed(),
fireInputEvent(InputEvent),
getInputStrategy(),
InputStrategy.input(Input)public void fireInputEvent(InputEvent inputEvent)
fireInputEvent in interface ComponentinputEvent - The input event to fire.
java.lang.NullPointerException - if the given event is null.InputEvent.isConsumed(),
CommandEvent,
KeyboardEvent,
MouseEvent
public Theme getTheme()
throws java.io.IOException
getTheme in interface Componentjava.io.IOException - if there is an error loading the theme.getParent(),
GuiseSession.getTheme()public void resetTheme()
false the state of whether a theme has been applied to this object.
This method is called for any child components resetting its own theme.
No new theme is actually loaded.
There is normally no need to override this method or to call this method directly by applications.
resetTheme in interface ComponentsetThemeApplied(boolean)
public void updateTheme()
throws java.io.IOException
applyTheme().
This method is called for any child components before applying the theme to the component itself,
to assure that child theme updates have already occured before theme updates occur for this component.
There is normally no need to override this method or to call this method directly by applications.
updateTheme in interface Componentjava.io.IOException - if there was an error loading or applying a theme.isThemeApplied(),
applyTheme()
public void applyTheme()
throws java.io.IOException
applyTheme in interface Componentjava.io.IOException - if there was an error loading or applying a theme.GuiseApplication.isThemed(),
getTheme(),
applyTheme(Theme),
setThemeApplied(boolean)public void applyTheme(Theme theme)
applyTheme in interface Componenttheme - The theme to apply to the object.
public void loadPreferences(boolean includeDescendants)
throws java.io.IOException
getPreferenceProperties() will be loaded automatically.
loadPreferences in interface ComponentincludeDescendants - true if preferences of any descendant components should also be loaded, else false.
java.io.IOException - if there is an error loading preferences.
public void savePreferences(boolean includeDescendants)
throws java.io.IOException
getPreferenceProperties() will be saved automatically.
savePreferences in interface ComponentincludeDescendants - true if preferences of any descendant components should also be saved, else false.
java.io.IOException - if there is an error saving preferences.public void addCommandListener(CommandListener commandListener)
addCommandListener in interface ComponentcommandListener - The command listener to add.public void removeCommandListener(CommandListener commandListener)
removeCommandListener in interface ComponentcommandListener - The command listener to remove.public boolean hasCommandListeners()
hasCommandListeners in interface Componenttrue if there is one or more command listeners registered.protected java.lang.Iterable<CommandListener> getCommandListeners()
public void addKeyListener(KeyboardListener keyListener)
addKeyListener in interface ComponentkeyListener - The key listener to add.public void removeKeyListener(KeyboardListener keyListener)
removeKeyListener in interface ComponentkeyListener - The key listener to remove.public boolean hasKeyListeners()
hasKeyListeners in interface Componenttrue if there is one or more key listeners registered.protected java.lang.Iterable<KeyboardListener> getKeyListeners()
public void addMouseListener(MouseListener mouseListener)
addMouseListener in interface ComponentmouseListener - The mouse listener to add.public void removeMouseListener(MouseListener mouseListener)
removeMouseListener in interface ComponentmouseListener - The mouse listener to remove.public boolean hasMouseListeners()
hasMouseListeners in interface Componenttrue if there is one or more mouse listeners registered.protected java.lang.Iterable<MouseListener> getMouseListeners()
public static Component getRootComponent(Component component)
component - The component for which the root should be found.
public static boolean hasAncestor(Component component,
CompositeComponent ancestor)
component - The component for which the potential ancestor should be checked.ancestor - The component to check as an ancestor.
true if the given ancestor component is its parent or one of its parent's parents.
java.lang.NullPointerException - if the given component and/or ancestor is null.
public static Component getComponentByID(Component component,
long id)
component - The component that should be checked, along with its descendants, for the given ID.
null if this component and all descendant components do not have the given ID.
public static Component getComponentByName(Component component,
java.lang.String name)
component - The component that should be checked, along with its descendants, for the given name.
null if this component and all descendant components do not have the given name.public static java.util.List<Component> getDirtyComponents(Component component)
component - The component that should be checked, along with its descendants, for out-of-date views.
public static java.util.List<Component> getDirtyComponents(Component component,
java.util.List<Component> dirtyComponents)
component - The component that should be checked, along with its descendants, for out-of-date views.dirtyComponents - The list that will be updated with more dirty components if any are found.
public static void setDepicted(Component component,
boolean newUpdated)
newUpdated - Whether the views of this component and all child components are up to date.public static java.util.List<Notification> getNotifications(Component component)
component - The component from which, along with its descendants, notifications should be retrieved.
protected static java.util.List<Notification> getNotifications(Component component,
java.util.List<Notification> notifications)
component - The component from which, along with its descendants, notifications should be retrieved.notifications - The list that will be updated with more dirty components if any are found.
public void addNotificationListener(NotificationListener notificationListener)
addNotificationListener in interface ComponentnotificationListener - The notification listener to add.public void removeNotificationListener(NotificationListener notificationListener)
removeNotificationListener in interface ComponentnotificationListener - The notification listener to remove.protected void fireNotified(Notification notification)
notification - The notification to send to the notification listeners.
java.lang.NullPointerException - if the given notification is null.NotificationListener,
NotificationEventprotected void fireNotified(NotificationEvent notificationEvent)
notificationEvent - The notification event to send to the notification listeners.
java.lang.NullPointerException - if the given notification event is null.NotificationListenerpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object object)
equals in class java.lang.Objectobject - The reference object with which to compare.
true if this object is equivalent to the given object.public java.lang.String toString()
toString in class java.lang.Objectpublic void notify(Notification notification)
setNotification(Notification), which fires appropriate notification events.
This method calls GuiseSession#notify(Notification).
notify in interface Componentnotification - The notification information to relay.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||