|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Component
Base interface for all Guise components.
Each component must provide either a Guise session constructor; or a Guise session and string ID constructor.
Any component may contain other components, but only a Container allows for custom addition and removal of child components.
A component takes up space regardless of whether it is set to be visible using PresentationModel.setVisible(boolean).
PresentationModel.setDisplayed(boolean) determines whether the component is displayed at all. If a component is not displayed, it takes up no space.
If a component is not displayed, it is not visible regardless of whether it is set to be visible.
If a developer must hide sensitive data, the developer should remove the component from its parent container altogether.
For widest platform support the general #ROUNDED_CORNER_RADIUS_EXTENT constant should be used whenever possible when requesting rounded corners.
| Nested Class Summary | |
|---|---|
static interface |
Component.FlyoverStrategy<S extends Component>
A strategy for showing and hiding flyovers in response to mouse events. |
| Field Summary | |
|---|---|
static java.lang.String |
BOOKMARK_ENABLED_PROPERTY
The bound property of whether the component has bookmarks enabled. |
static java.lang.String |
CONSTRAINTS_PROPERTY
The bound property of the layout constraints. |
static java.lang.String |
DRAG_ENABLED_PROPERTY
The bound property of whether the component has dragging enabled. |
static java.lang.String |
DROP_ENABLED_PROPERTY
The bound property of whether the component has dropping enabled. |
static java.lang.String |
FLYOVER_ENABLED_PROPERTY
The bound property of whether the component has flyovers enabled. |
static java.lang.String |
FLYOVER_STRATEGY_PROPERTY
The bound property of the strategy controlling flyovers. |
static java.lang.String |
INPUT_STRATEGY_PROPERTY
The input strategy bound property. |
static java.lang.String |
NAME_PROPERTY
The bound property of the component name. |
static java.lang.String |
NOTIFICATION_PROPERTY
The bound property of the notification. |
static java.lang.String |
ORIENTATION_PROPERTY
The orientation bound property. |
static java.lang.String |
THEME_APPLIED_PROPERTY
The bound property of whether a theme has been applied to this object. |
static java.lang.String |
VALID_PROPERTY
The valid bound 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 |
| 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 |
dispatchInputEvent(InputEvent inputEvent)
Dispatches an input event to this component and all child components, if any. |
|
Transferable<?> |
exportTransfer()
Exports data from the component. |
|
void |
fireInputEvent(InputEvent inputEvent)
Fire the given even to all registered listeners, if any. |
|
|
getAncestor(java.lang.Class<A> ancestorClass)
Retrieves the first ancestor of the given type. |
|
Orientation |
getComponentOrientation()
Determines the internationalization orientation of the component's contents. |
|
Constraints |
getConstraints()
|
|
Depictor<? extends Component> |
getDepictor()
|
|
Component.FlyoverStrategy<?> |
getFlyoverStrategy()
|
|
InputStrategy |
getInputStrategy()
|
|
java.lang.String |
getName()
|
|
Notification |
getNotification()
|
|
Orientation |
getOrientation()
Returns this component's requested orientation. |
|
CompositeComponent |
getParent()
|
|
java.lang.Iterable<java.lang.String> |
getPreferenceProperties()
Returns all properties stored as preferences. |
|
Theme |
getTheme()
Returns the theme to apply to this component. |
|
boolean |
hasCommandListeners()
|
|
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()
|
|
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 |
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. |
|
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 |
setInputStrategy(InputStrategy newInputStrategy)
Sets the strategy for processing input. |
|
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. |
|
void |
updateTheme()
Updates this object's theme. |
|
boolean |
validate()
Validates the user input of this component and all child components. |
|
| Methods inherited from interface com.guiseframework.platform.DepictedObject |
|---|
depict, getDepictID, getSession, processEvent |
| Methods inherited from interface com.guiseframework.model.InfoModel |
|---|
getDescription, getDescriptionContentType, getInfo, getInfoContentType, setDescription, setDescriptionContentType, setInfo, setInfoContentType |
| Methods inherited from interface com.guiseframework.model.LabelModel |
|---|
getGlyphURI, getLabel, getLabelContentType, setGlyphURI, setLabel, setLabelContentType |
| 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 |
| Field Detail |
|---|
static final java.lang.String BOOKMARK_ENABLED_PROPERTY
static final java.lang.String CONSTRAINTS_PROPERTY
static final java.lang.String DRAG_ENABLED_PROPERTY
static final java.lang.String DROP_ENABLED_PROPERTY
static final java.lang.String FLYOVER_ENABLED_PROPERTY
static final java.lang.String FLYOVER_STRATEGY_PROPERTY
static final java.lang.String INPUT_STRATEGY_PROPERTY
static final java.lang.String NAME_PROPERTY
static final java.lang.String NOTIFICATION_PROPERTY
static final java.lang.String ORIENTATION_PROPERTY
static final java.lang.String THEME_APPLIED_PROPERTY
static final java.lang.String VALID_PROPERTY
| Method Detail |
|---|
Depictor<? extends Component> getDepictor()
getDepictor in interface DepictedObjectvoid addPreferenceProperty(java.lang.String propertyName)
propertyName - The property to store as a preference.loadPreferences(boolean),
savePreferences(boolean)boolean isPreferenceProperty(java.lang.String propertyName)
propertyName - 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)java.lang.Iterable<java.lang.String> getPreferenceProperties()
loadPreferences(boolean),
savePreferences(boolean)void removePreferenceProperty(java.lang.String propertyName)
propertyName - The property that should no longer be stored as a preference.loadPreferences(boolean),
savePreferences(boolean)java.lang.String getName()
null if the component has no name.void setName(java.lang.String newName)
newName - 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.NAME_PROPERTYConstraints getConstraints()
null if no constraints have been specified for this component.void setConstraints(Constraints newConstraints)
newConstraints - The layout constraints describing individual component layout information, or null if no constraints have been specified for this component.CONSTRAINTS_PROPERTYInputStrategy getInputStrategy()
null if this component has no input strategy.void setInputStrategy(InputStrategy newInputStrategy)
newInputStrategy - The new strategy for processing input, or null if this component is to have no input strategy.INPUT_STRATEGY_PROPERTYNotification getNotification()
null if no notification is associated with this component.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.
newNotification - The notification for the component, or null if no notification is associated with this component.NOTIFICATION_PROPERTYOrientation getOrientation()
getComponentOrientation() should be used.
null if the default orientation should be used.getComponentOrientation()Orientation getComponentOrientation()
getOrientation(),
GuiseSession.getOrientation()void setOrientation(Orientation newOrientation)
newOrientation - The new internationalization orientation of the component's contents, or null if default orientation should be determined based upon the session's locale.ORIENTATION_PROPERTYCompositeComponent getParent()
null if this component does not have a parent.<A extends CompositeComponent> A getAncestor(java.lang.Class<A> ancestorClass)
A - The type of ancestor component requested.ancestorClass - The class of ancestor component requested.
null if this component has no such ancestor.void setParent(CompositeComponent newParent)
newParent - 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)boolean isDragEnabled()
void setDragEnabled(boolean newDragEnabled)
Boolean.
newDragEnabled - true if the component should allow dragging, else false.DRAG_ENABLED_PROPERTYboolean isDropEnabled()
void setDropEnabled(boolean newDropEnabled)
Boolean.
newDropEnabled - true if the component should allow dropping, else false.DROP_ENABLED_PROPERTYboolean isFlyoverEnabled()
void setFlyoverEnabled(boolean newFlyoverEnabled)
Boolean.
newFlyoverEnabled - true if the component should display flyovers, else false.Model#getDescription(),
FLYOVER_ENABLED_PROPERTYComponent.FlyoverStrategy<?> getFlyoverStrategy()
null if there is no flyover strategy installed.void setFlyoverStrategy(Component.FlyoverStrategy<?> newFlyoverStrategy)
newFlyoverStrategy - The new flyover strategy, or null if there is no flyover strategy installed.FLYOVER_STRATEGY_PROPERTYboolean isThemeApplied()
void setThemeApplied(boolean newThemeApplied)
Boolean.
newThemeApplied - true if a theme has been applied to this component, else false.THEME_APPLIED_PROPERTYvoid addExportStrategy(ExportStrategy<?> exportStrategy)
exportStrategy - The export strategy to add.void removeExportStrategy(ExportStrategy<?> exportStrategy)
exportStrategy - The export strategy to remove.Transferable<?> exportTransfer()
exportTransfer in interface DepictedObjectnull if no data can be transferred.void addImportStrategy(ImportStrategy<?> importStrategy)
importStrategy - The importstrategy to add.void removeImportStrategy(ImportStrategy<?> importStrategy)
importStrategy - The import strategy to remove.boolean importTransfer(Transferable<?> transferable)
transferable - The object to be transferred.
true if the given object was be imported.void initialize()
java.lang.IllegalStateException - if this method has already been called.boolean isValid()
boolean validate()
isValid() as a convenience.
Theme getTheme()
throws java.io.IOException
java.io.IOException - if there is an error loading the theme.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.
setThemeApplied(boolean)
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.
java.io.IOException - if there was an error loading or applying a theme.isThemeApplied(),
applyTheme()
void applyTheme()
throws java.io.IOException
java.io.IOException - if there was an error loading or applying a theme.GuiseApplication.isThemed(),
getTheme(),
applyTheme(Theme),
setThemeApplied(boolean)void applyTheme(Theme theme)
theme - The theme to apply to the object.
void loadPreferences(boolean includeDescendants)
throws java.io.IOException
getPreferenceProperties() will be loaded automatically.
includeDescendants - true if preferences of any descendant components should also be loaded, else false.
java.io.IOException - if there is an error loading preferences.
void savePreferences(boolean includeDescendants)
throws java.io.IOException
getPreferenceProperties() will be saved automatically.
includeDescendants - true if preferences of any descendant components should also be saved, else false.
java.io.IOException - if there is an error saving preferences.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.
inputEvent - The input event to dispatch.
java.lang.NullPointerException - if the given event is null.TargetedEvent,
FocusedInputEvent,
InputEvent.isConsumed(),
fireInputEvent(InputEvent),
getInputStrategy(),
InputStrategy.input(Input)void fireInputEvent(InputEvent inputEvent)
inputEvent - The input event to fire.
java.lang.NullPointerException - if the given event is null.InputEvent.isConsumed()void addCommandListener(CommandListener commandListener)
commandListener - The command listener to add.void removeCommandListener(CommandListener commandListener)
commandListener - The command listener to remove.boolean hasCommandListeners()
true if there is one or more command listeners registered.void addKeyListener(KeyboardListener keyListener)
keyListener - The key listener to add.void removeKeyListener(KeyboardListener keyListener)
keyListener - The key listener to remove.boolean hasKeyListeners()
true if there is one or more key listeners registered.void addMouseListener(MouseListener mouseListener)
mouseListener - The mouse listener to add.void removeMouseListener(MouseListener mouseListener)
mouseListener - The mouse listener to remove.boolean hasMouseListeners()
true if there is one or more mouse listeners registered.void addNotificationListener(NotificationListener notificationListener)
notificationListener - The notification listener to add.void removeNotificationListener(NotificationListener notificationListener)
notificationListener - The notification listener to remove.void notify(Notification notification)
setNotification(Notification), which fires appropriate notification events.
This method calls GuiseSession#notify(Notification).
notification - The notification information to relay.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||