com.guiseframework.component
Interface Component

All Superinterfaces:
DepictedObject, Displayable, InfoModel, LabelModel, Model, PresentationModel, com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable
All Known Subinterfaces:
ActionControl, ActionValueControl<V>, ApplicationFrame, ArrangeContainer, Box, ButtonControl, CardContainer, CardControl, CompositeComponent, Container, ContainerControl, ContentComponent, Control, DialogFrame<V>, EditComponent, FlyoverFrame, Frame, HeadingComponent, ImageComponent, InputFocusableComponent, InputFocusGroupComponent, LabelComponent, LabelDisplayableComponent, LayoutComponent, LayoutControl, LinkControl, ListSelectControl<V>, Menu, ModalComponent<M>, ModalFrame<R>, ModalNavigationPanel<R>, OptionDialogFrame<O>, Panel, PendingImageComponent, SelectActionControl, SelectButtonControl, SelectControl<V>, SelectLinkControl, ToolButtonControl, URFResourceAlterationComponent, ValueControl<V>, ValuedComponent<V>, Widget
All Known Implementing Classes:
AboutPanel, AbstractActionControl, AbstractActionValueControl, AbstractApplicationFrame, AbstractArrayCompositeComponent, AbstractBooleanSelectActionControl, AbstractBox, AbstractButtonControl, AbstractCardPanel, AbstractComponent, AbstractCompositeComponent, AbstractCompositeStateComponent, AbstractCompositeStateControl, AbstractContainer, AbstractContainerControl, AbstractContainerValueControl, AbstractControl, AbstractDialogFrame, AbstractEditComponentTextControl, AbstractEditValueControl, AbstractEditValuePanel, AbstractEnumCompositeComponent, AbstractFlyoverFrame, AbstractFrame, AbstractImageComponent, AbstractLabel, AbstractLayoutComponent, AbstractLayoutControl, AbstractLayoutValueControl, AbstractLinkControl, AbstractListCompositeComponent, AbstractListSelectContainerControl, AbstractListSelectControl, AbstractMenu, AbstractModalFrame, AbstractModalNavigationPanel, AbstractMultipleCompositeComponent, AbstractOptionDialogFrame, AbstractPanel, AbstractSelectActionControl, AbstractSelectActionValueControl, AbstractSequenceTaskPanel, AbstractSingleCompositeComponent, AbstractTextControl, AbstractValueControl, AbstractValuedPanel, AccordionMenu, ArrangePanel, AuthorizeUsersPanel, AutoNavigationPathBreadcrumbLinkPanel, BookDescriptionPanel, BookmarksPanel, BooleanSelectButton, BooleanSelectLink, BooleanSelectToolButton, BooleanValueControlSelectControl, BusyPanel, Button, CalendarControl, CalendarDialogFrame, CalendarsPanel, CardPanel, CardTabControl, CheckControl, DateTimeControl, DateTimeFieldsControl, DefaultApplicationFrame, DefaultDialogFrame, DefaultFlyoverFrame, DefaultFrame, DefaultModalFrame, DefaultModalNavigationPanel, DiagnosticPanel, DropDetailsPanel, DropMenu, EditComponentLabelControl, EditComponentTextControl, EditUserPanel, EditUsersPanel, EventWizardPanel, EventWizardPanel.BusinessAddressPanel, EventWizardPanel.BusinessNamePanel, EventWizardPanel.EventNamePanel, EventWizardPanel.PersonalAgePanel, EventWizardPanel.PersonalEmailPanel, EventWizardPanel.PersonalNamePanel, EventWizardPanel2, Flash, GenerateContentPanel, GroupPanel, Heading, HeadingLink, HelloUserPanel, HelloWorldPanel, HomePanel, HomePanel.TestFrame, Image, ImageActionControl, ImageBooleanSelectActionControl, ImageOpacityPanel, InternationalizationPanel, Label, LayoutPanel, Link, ListControl, LoginPanel, MarmotPanel, MenusPanel, Message, MessageOptionDialogFrame, MultiplicationTablePanel, NamePanel, NavigationPathBreadcrumbLinkPanel, NotificationOptionDialogFrame, PasswordAuthenticationPanel, PendingImage, PendingImageActionControl, Picture, PlatformFileUploadPanel, ResourceCollectControl, ResourceImportControl, RestrictedPanel, RichTextEditPanel, ScrollControl, SectionPanel, SelectableLabel, SelectButton, SelectLink, SequenceCardPanel, SliderControl, SpinnerControl, TabbedPanel, TabContainerControl, TabControl, Table, Table.DefaultCellMessage, TabsPanel, TaskStateSelectLink, TemperatureConversionPanel, TemperatureConversionPanel2, TextBox, TextControl, TextSearchPanel, Toolbar, ToolButton, TreeControl, URFProcessPanel, ValueSelectButton, ValueSelectLink

public interface Component
extends DepictedObject, PresentationModel, InfoModel

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.

Author:
Garret Wilson

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.ui.PresentationModel
BACKGROUND_COLOR_PROPERTY, BORDER_LINE_FAR_COLOR_PROPERTY, BORDER_LINE_FAR_EXTENT_PROPERTY, BORDER_LINE_FAR_STYLE_PROPERTY, BORDER_LINE_NEAR_COLOR_PROPERTY, BORDER_LINE_NEAR_EXTENT_PROPERTY, BORDER_LINE_NEAR_STYLE_PROPERTY, BORDER_PAGE_FAR_COLOR_PROPERTY, BORDER_PAGE_FAR_EXTENT_PROPERTY, BORDER_PAGE_FAR_STYLE_PROPERTY, BORDER_PAGE_NEAR_COLOR_PROPERTY, BORDER_PAGE_NEAR_EXTENT_PROPERTY, BORDER_PAGE_NEAR_STYLE_PROPERTY, CORNER_LINE_FAR_PAGE_FAR_ARC_SIZE_PROPERTY, CORNER_LINE_FAR_PAGE_NEAR_ARC_SIZE_PROPERTY, CORNER_LINE_NEAR_PAGE_FAR_ARC_SIZE_PROPERTY, CORNER_LINE_NEAR_PAGE_NEAR_ARC_SIZE_PROPERTY, CURSOR_PROPERTY, FONT_FAMILIES_PROPERTY, FONT_SIZE_PROPERTY, FONT_STYLE_PROPERTY, FONT_WEIGHT_BOLD, FONT_WEIGHT_NORMAL, FONT_WEIGHT_PROPERTY, LABEL_FONT_FAMILIES_PROPERTY, LABEL_FONT_SIZE_PROPERTY, LABEL_FONT_STYLE_PROPERTY, LABEL_FONT_WEIGHT_PROPERTY, LABEL_TEXT_COLOR_PROPERTY, LINE_EXTENT_PROPERTY, MARGIN_LINE_FAR_EXTENT_PROPERTY, MARGIN_LINE_NEAR_EXTENT_PROPERTY, MARGIN_PAGE_FAR_EXTENT_PROPERTY, MARGIN_PAGE_NEAR_EXTENT_PROPERTY, OPACITY_PROPERTY, PADDING_LINE_FAR_EXTENT_PROPERTY, PADDING_LINE_NEAR_EXTENT_PROPERTY, PADDING_PAGE_FAR_EXTENT_PROPERTY, PADDING_PAGE_NEAR_EXTENT_PROPERTY, PAGE_EXTENT_PROPERTY, ROUNDED_CORNER_ARC_SIZE, STYLE_ID_PROPERTY, TEXT_COLOR_PROPERTY, TOOLTIP_ENABLED_PROPERTY, VISIBLE_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.
<A extends CompositeComponent>
A
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.ui.PresentationModel
BorderLineFarColor, BorderLineFarExtent, BorderLineFarStyle, BorderLineNearColor, BorderLineNearExtent, BorderLineNearStyle, BorderPageFarColor, BorderPageFarExtent, BorderPageFarStyle, BorderPageNearColor, BorderPageNearExtent, BorderPageNearStyle, getBackgroundColor, getBorderColor, getBorderExtent, getBorderStyle, getCornerArcSize, getCornerLineFarPageFarArcSize, getCornerLineFarPageNearArcSize, getCornerLineNearPageFarArcSize, getCornerLineNearPageNearArcSize, getCursor, getExtent, getFontFamilies, getFontSize, getFontStyle, getFontWeight, getLabelFontFamilies, getLabelFontSize, getLabelFontStyle, getLabelFontWeight, getLabelTextColor, getLineExtent, getMarginExtent, getMarginLineFarExtent, getMarginLineNearExtent, getMarginPageFarExtent, getMarginPageNearExtent, getOpacity, getPaddingExtent, getPaddingLineFarExtent, getPaddingLineNearExtent, getPaddingPageFarExtent, getPaddingPageNearExtent, getPageExtent, getSession, getStyleID, getTextColor, isDisplayed, isTooltipEnabled, isVisible, setBackgroundColor, setBorderColor, setBorderColor, setBorderExtent, setBorderExtent, setBorderLineFarColor, setBorderLineFarExtent, setBorderLineFarStyle, setBorderLineNearColor, setBorderLineNearExtent, setBorderLineNearStyle, setBorderPageFarColor, setBorderPageFarExtent, setBorderPageFarStyle, setBorderPageNearColor, setBorderPageNearExtent, setBorderPageNearStyle, setBorderStyle, setBorderStyle, setCornerArcSize, setCornerArcSize, setCornerLineFarPageFarArcSize, setCornerLineFarPageNearArcSize, setCornerLineNearPageFarArcSize, setCornerLineNearPageNearArcSize, setCursor, setDisplayed, setExtent, setFontFamilies, setFontSize, setFontStyle, setFontWeight, setLabelFontFamilies, setLabelFontSize, setLabelFontStyle, setLabelFontWeight, setLabelTextColor, setLineExtent, setMarginExtent, setMarginExtent, setMarginLineFarExtent, setMarginLineNearExtent, setMarginPageFarExtent, setMarginPageNearExtent, setOpacity, setPaddingExtent, setPaddingExtent, setPaddingLineFarExtent, setPaddingLineNearExtent, setPaddingPageFarExtent, setPaddingPageNearExtent, setPageExtent, setStyleID, setTextColor, setTooltipEnabled, setVisible
 
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

BOOKMARK_ENABLED_PROPERTY

static final java.lang.String BOOKMARK_ENABLED_PROPERTY
The bound property of whether the component has bookmarks enabled.


CONSTRAINTS_PROPERTY

static final java.lang.String CONSTRAINTS_PROPERTY
The bound property of the layout constraints.


DRAG_ENABLED_PROPERTY

static final java.lang.String DRAG_ENABLED_PROPERTY
The bound property of whether the component has dragging enabled.


DROP_ENABLED_PROPERTY

static final java.lang.String DROP_ENABLED_PROPERTY
The bound property of whether the component has dropping enabled.


FLYOVER_ENABLED_PROPERTY

static final java.lang.String FLYOVER_ENABLED_PROPERTY
The bound property of whether the component has flyovers enabled.


FLYOVER_STRATEGY_PROPERTY

static final java.lang.String FLYOVER_STRATEGY_PROPERTY
The bound property of the strategy controlling flyovers.


INPUT_STRATEGY_PROPERTY

static final java.lang.String INPUT_STRATEGY_PROPERTY
The input strategy bound property.


NAME_PROPERTY

static final java.lang.String NAME_PROPERTY
The bound property of the component name.


NOTIFICATION_PROPERTY

static final java.lang.String NOTIFICATION_PROPERTY
The bound property of the notification.


ORIENTATION_PROPERTY

static final java.lang.String ORIENTATION_PROPERTY
The orientation bound property.


THEME_APPLIED_PROPERTY

static final java.lang.String THEME_APPLIED_PROPERTY
The bound property of whether a theme has been applied to this object.


VALID_PROPERTY

static final java.lang.String VALID_PROPERTY
The valid bound property.

Method Detail

getDepictor

Depictor<? extends Component> getDepictor()
Specified by:
getDepictor in interface DepictedObject
Returns:
The depictor for this component.

addPreferenceProperty

void addPreferenceProperty(java.lang.String propertyName)
Adds a property to be saved and loaded as a preference.

Parameters:
propertyName - The property to store as a preference.
See Also:
loadPreferences(boolean), savePreferences(boolean)

isPreferenceProperty

boolean isPreferenceProperty(java.lang.String propertyName)
Determines whether the given property is saved and loaded as a preference.

Parameters:
propertyName - The property to determine if it is stored as a preference.
Returns:
true if the given property is saved and loaded as a preference.
See Also:
loadPreferences(boolean), savePreferences(boolean)

getPreferenceProperties

java.lang.Iterable<java.lang.String> getPreferenceProperties()
Returns all properties stored as preferences.

Returns:
An iterable of all properties saved and loaded as preferences.
See Also:
loadPreferences(boolean), savePreferences(boolean)

removePreferenceProperty

void removePreferenceProperty(java.lang.String propertyName)
Removes a property from being saved and loaded as preferences.

Parameters:
propertyName - The property that should no longer be stored as a preference.
See Also:
loadPreferences(boolean), savePreferences(boolean)

getName

java.lang.String getName()
Returns:
The name of the component, not guaranteed to be unique (but guaranteed not to be the empty string) and useful only for searching for components within a component sub-hierarchy, or null if the component has no name.

setName

void setName(java.lang.String newName)
Sets the name of the component. This is a bound property.

Parameters:
newName - The new name of the component, or null if the component should have no name.
Throws:
java.lang.IllegalArgumentException - if the given name is the empty string.
See Also:
NAME_PROPERTY

getConstraints

Constraints getConstraints()
Returns:
The layout constraints describing individual component layout information, or null if no constraints have been specified for this component.

setConstraints

void setConstraints(Constraints newConstraints)
Sets the layout constraints of this component. This is a bound property.

Parameters:
newConstraints - The layout constraints describing individual component layout information, or null if no constraints have been specified for this component.
See Also:
CONSTRAINTS_PROPERTY

getInputStrategy

InputStrategy getInputStrategy()
Returns:
The strategy for processing input, or null if this component has no input strategy.

setInputStrategy

void setInputStrategy(InputStrategy newInputStrategy)
Sets the strategy for processing input. This is a bound property.

Parameters:
newInputStrategy - The new strategy for processing input, or null if this component is to have no input strategy.
See Also:
INPUT_STRATEGY_PROPERTY

getNotification

Notification getNotification()
Returns:
The notification associated with the component, or null if no notification is associated with this component.

setNotification

void setNotification(Notification newNotification)
Sets the component notification. This is a bound property. The notification is also fired as a NotificationEvent on this component if a new notification is given. Parents are expected to refire the notification event up the hierarchy.

Parameters:
newNotification - The notification for the component, or null if no notification is associated with this component.
See Also:
NOTIFICATION_PROPERTY

getOrientation

Orientation getOrientation()
Returns this component's requested orientation. To resolve the orientation up the hierarchy, getComponentOrientation() should be used.

Returns:
The internationalization orientation of the component's contents, or null if the default orientation should be used.
See Also:
getComponentOrientation()

getComponentOrientation

Orientation getComponentOrientation()
Determines the internationalization orientation of the component's contents. This method returns the local orientation value, if there is one. If there is no orientation specified for this component, the request is deferred to this component's parent. If there is no parent component, a default orientation is retrieved from the current session.

Returns:
The internationalization orientation of the component's contents.
See Also:
getOrientation(), GuiseSession.getOrientation()

setOrientation

void setOrientation(Orientation newOrientation)
Sets the orientation. This is a bound property

Parameters:
newOrientation - The new internationalization orientation of the component's contents, or null if default orientation should be determined based upon the session's locale.
See Also:
ORIENTATION_PROPERTY

getParent

CompositeComponent getParent()
Returns:
The parent of this component, or null if this component does not have a parent.

getAncestor

<A extends CompositeComponent> A getAncestor(java.lang.Class<A> ancestorClass)
Retrieves the first ancestor of the given type.

Type Parameters:
A - The type of ancestor component requested.
Parameters:
ancestorClass - The class of ancestor component requested.
Returns:
The first ancestor component of the given type, or null if this component has no such ancestor.

setParent

void setParent(CompositeComponent newParent)
Sets the parent of this component. This method is managed by containers, and normally should not be called by applications. A component cannot be given a parent if it already has a parent. A component's parent cannot be removed if that parent is a container and this component is still a child of that container. A container's parent cannot be set to a container unless that container already recognizes this component as one of its children. If a component is given the same parent it already has, no action occurs.

Parameters:
newParent - The new parent for this component, or null if this component is being removed from a parent.
Throws:
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.
See Also:
Container.add(Component), Container#remove(Component)

isDragEnabled

boolean isDragEnabled()
Returns:
Whether the component has dragging enabled.

setDragEnabled

void setDragEnabled(boolean newDragEnabled)
Sets whether the component has dragging enabled. This is a bound property of type Boolean.

Parameters:
newDragEnabled - true if the component should allow dragging, else false.
See Also:
DRAG_ENABLED_PROPERTY

isDropEnabled

boolean isDropEnabled()
Returns:
Whether the component has dropping enabled.

setDropEnabled

void setDropEnabled(boolean newDropEnabled)
Sets whether the component has dropping enabled. This is a bound property of type Boolean.

Parameters:
newDropEnabled - true if the component should allow dropping, else false.
See Also:
DROP_ENABLED_PROPERTY

isFlyoverEnabled

boolean isFlyoverEnabled()
Returns:
Whether flyovers are enabled for this component.

setFlyoverEnabled

void setFlyoverEnabled(boolean newFlyoverEnabled)
Sets whether flyovers are enabled for this component. Flyovers contain information from the component model's "description" property. This is a bound property of type Boolean.

Parameters:
newFlyoverEnabled - true if the component should display flyovers, else false.
See Also:
Model#getDescription(), FLYOVER_ENABLED_PROPERTY

getFlyoverStrategy

Component.FlyoverStrategy<?> getFlyoverStrategy()
Returns:
The installed flyover strategy, or null if there is no flyover strategy installed.

setFlyoverStrategy

void setFlyoverStrategy(Component.FlyoverStrategy<?> newFlyoverStrategy)
Sets the strategy for controlling flyovers. The flyover strategy will be registered as a mouse listener for this component. This is a bound property.

Parameters:
newFlyoverStrategy - The new flyover strategy, or null if there is no flyover strategy installed.
See Also:
FLYOVER_STRATEGY_PROPERTY

isThemeApplied

boolean isThemeApplied()
Returns:
Whether a theme has been applied to this component.

setThemeApplied

void setThemeApplied(boolean newThemeApplied)
Sets whether a theme has been applied to this component. This is a bound property of type Boolean.

Parameters:
newThemeApplied - true if a theme has been applied to this component, else false.
See Also:
THEME_APPLIED_PROPERTY

addExportStrategy

void addExportStrategy(ExportStrategy<?> exportStrategy)
Adds an export strategy to the component. The export strategy will take precedence over any compatible export strategy previously added.

Parameters:
exportStrategy - The export strategy to add.

removeExportStrategy

void removeExportStrategy(ExportStrategy<?> exportStrategy)
Removes an export strategy from the component.

Parameters:
exportStrategy - The export strategy to remove.

exportTransfer

Transferable<?> exportTransfer()
Exports data from the component. Each export strategy, from last to first added, will be asked to export data, until one is successful.

Specified by:
exportTransfer in interface DepictedObject
Returns:
The object to be transferred, or null if no data can be transferred.

addImportStrategy

void addImportStrategy(ImportStrategy<?> importStrategy)
Adds an import strategy to the component. The import strategy will take prececence over any compatible import strategy previously added.

Parameters:
importStrategy - The importstrategy to add.

removeImportStrategy

void removeImportStrategy(ImportStrategy<?> importStrategy)
Removes an import strategy from the component.

Parameters:
importStrategy - The import strategy to remove.

importTransfer

boolean importTransfer(Transferable<?> transferable)
Imports data to the component. Each import strategy, from last to first added, will be asked to import data, until one is successful.

Parameters:
transferable - The object to be transferred.
Returns:
true if the given object was be imported.

initialize

void initialize()
Initializes the component after construction. This method can only be called once during the life of a component. Subclasses should call this version.

Throws:
java.lang.IllegalStateException - if this method has already been called.

isValid

boolean isValid()
Returns:
Whether the state of the component and all child components represents valid user input.

validate

boolean validate()
Validates the user input of this component and all child components. The component will be updated with error information.

Returns:
The current state of isValid() as a convenience.

getTheme

Theme getTheme()
               throws java.io.IOException
Returns the theme to apply to this component. If there is no theme to this component, the parent theme will be returned.

Returns:
The theme to apply to this component.
Throws:
java.io.IOException - if there is an error loading the theme.

resetTheme

void resetTheme()
Resets this object's theme. This method sets to 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.

See Also:
setThemeApplied(boolean)

updateTheme

void updateTheme()
                 throws java.io.IOException
Updates this object's theme. This method checks whether a theme has been applied to this object. If a theme has not been applied to this object this method calls 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.

Throws:
java.io.IOException - if there was an error loading or applying a theme.
See Also:
isThemeApplied(), applyTheme()

applyTheme

void applyTheme()
                throws java.io.IOException
Applies the theme to this object. Themes are only applied of the application is themed. This method may be overridden to effectively override theme settings by ensuring the state of important properties after the theme has been set. If the theme is successfully applied, this method updates the theme applied status.

Throws:
java.io.IOException - if there was an error loading or applying a theme.
See Also:
GuiseApplication.isThemed(), getTheme(), applyTheme(Theme), setThemeApplied(boolean)

applyTheme

void applyTheme(Theme theme)
Applies a theme and its parents to this object. The theme's rules will be applied to this object and any related objects. Theme application occurs unconditionally, regardless of whether themes have been applied to this component before. There is normally no need to call this method directly by applications.

Parameters:
theme - The theme to apply to the object.

loadPreferences

void loadPreferences(boolean includeDescendants)
                     throws java.io.IOException
Loads the preferences for this component and optionally any descendant components. Any preferences returned from getPreferenceProperties() will be loaded automatically.

Parameters:
includeDescendants - true if preferences of any descendant components should also be loaded, else false.
Throws:
java.io.IOException - if there is an error loading preferences.

savePreferences

void savePreferences(boolean includeDescendants)
                     throws java.io.IOException
Saves the preferences for this component and optionally any descendant components. Any preferences returned from getPreferenceProperties() will be saved automatically.

Parameters:
includeDescendants - true if preferences of any descendant components should also be saved, else false.
Throws:
java.io.IOException - if there is an error saving preferences.

dispatchInputEvent

void dispatchInputEvent(InputEvent inputEvent)
Dispatches an input event to this component and all child components, if any. If this is a 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.

Parameters:
inputEvent - The input event to dispatch.
Throws:
java.lang.NullPointerException - if the given event is null.
See Also:
TargetedEvent, FocusedInputEvent, InputEvent.isConsumed(), fireInputEvent(InputEvent), getInputStrategy(), InputStrategy.input(Input)

fireInputEvent

void fireInputEvent(InputEvent inputEvent)
Fire the given even to all registered listeners, if any. If the event is consumed further processing should cease.

Parameters:
inputEvent - The input event to fire.
Throws:
java.lang.NullPointerException - if the given event is null.
See Also:
InputEvent.isConsumed()

addCommandListener

void addCommandListener(CommandListener commandListener)
Adds a command listener.

Parameters:
commandListener - The command listener to add.

removeCommandListener

void removeCommandListener(CommandListener commandListener)
Removes a command listener.

Parameters:
commandListener - The command listener to remove.

hasCommandListeners

boolean hasCommandListeners()
Returns:
true if there is one or more command listeners registered.

addKeyListener

void addKeyListener(KeyboardListener keyListener)
Adds a key listener.

Parameters:
keyListener - The key listener to add.

removeKeyListener

void removeKeyListener(KeyboardListener keyListener)
Removes a key listener.

Parameters:
keyListener - The key listener to remove.

hasKeyListeners

boolean hasKeyListeners()
Returns:
true if there is one or more key listeners registered.

addMouseListener

void addMouseListener(MouseListener mouseListener)
Adds a mouse listener.

Parameters:
mouseListener - The mouse listener to add.

removeMouseListener

void removeMouseListener(MouseListener mouseListener)
Removes a mouse listener.

Parameters:
mouseListener - The mouse listener to remove.

hasMouseListeners

boolean hasMouseListeners()
Returns:
true if there is one or more mouse listeners registered.

addNotificationListener

void addNotificationListener(NotificationListener notificationListener)
Adds a notification listener.

Parameters:
notificationListener - The notification listener to add.

removeNotificationListener

void removeNotificationListener(NotificationListener notificationListener)
Removes a notification listener.

Parameters:
notificationListener - The notification listener to remove.

notify

void notify(Notification notification)
Notifies the user of the given notification information. The notification is stored in this component using setNotification(Notification), which fires appropriate notification events. This method calls GuiseSession#notify(Notification).

Parameters:
notification - The notification information to relay.


Copyright © 2005-2010 GlobalMentor, Inc. All Rights Reserved.