com.guiseframework.component
Class AbstractApplicationFrame

java.lang.Object
  extended by com.globalmentor.beans.BoundPropertyObject
      extended by com.guiseframework.event.GuiseBoundPropertyObject
          extended by com.guiseframework.model.ui.AbstractPresentationModel
              extended by com.guiseframework.component.AbstractComponent
                  extended by com.guiseframework.component.AbstractCompositeComponent
                      extended by com.guiseframework.component.AbstractMultipleCompositeComponent
                          extended by com.guiseframework.component.AbstractArrayCompositeComponent
                              extended by com.guiseframework.component.AbstractEnumCompositeComponent<AbstractFrame.FrameComponent>
                                  extended by com.guiseframework.component.AbstractFrame
                                      extended by com.guiseframework.component.AbstractApplicationFrame
All Implemented Interfaces:
com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable, ApplicationFrame, Component, CompositeComponent, ContentComponent, Frame, InputFocusableComponent, InputFocusGroupComponent, ModalComponent<Frame.Mode>, Displayable, InfoModel, LabelModel, Model, PresentationModel, DepictedObject
Direct Known Subclasses:
DefaultApplicationFrame

public abstract class AbstractApplicationFrame
extends AbstractFrame
implements ApplicationFrame

Abstract implementation of an application frame.

This implementation binds the command ProcessCommand.CONTINUE to the key input Key.ENTER, as well as the command ProcessCommand.ABORT to the key input Key.ESCAPE.

Author:
Garret Wilson
See Also:
LayoutPanel

Nested Class Summary
 
Nested classes/interfaces inherited from class com.guiseframework.component.AbstractFrame
AbstractFrame.DefaultPrototypeProvider, AbstractFrame.FrameComponent
 
Nested classes/interfaces inherited from class com.guiseframework.component.AbstractComponent
AbstractComponent.AbstractFlyoverFrameStrategy<S extends Component>, AbstractComponent.AbstractFlyoverStrategy<S extends Component>, AbstractComponent.DefaultFlyoverStrategy<S extends Component>
 
Nested classes/interfaces inherited from interface com.guiseframework.component.Frame
Frame.Mode, Frame.State
 
Field Summary
static java.lang.String LABEL_SEPARATOR
          The delimiter to use when constructing the label from its various segments.
 
Fields inherited from class com.globalmentor.beans.BoundPropertyObject
NO_PROPERTY_CHANGE_LISTENERS, NO_VETOABLE_CHANGE_LISTENERS
 
Fields inherited from interface com.guiseframework.component.Frame
CLOSE_ACTION_CONTROL_PROPERTY, MENU_PROPERTY, MODAL_PROPERTY, MOVABLE_PROPERTY, OPEN_EFFECT_PROPERTY, RELATED_COMPONENT_PROPERTY, RESIZABLE_PROPERTY, STATE_PROPERTY, TITLE_BACKGROUND_COLOR_PROPERTY, TITLE_VISIBLE_PROPERTY, TOOLBAR_PROPERTY
 
Fields inherited from interface com.guiseframework.component.ContentComponent
CONTENT_PROPERTY
 
Fields inherited from interface com.guiseframework.component.ModalComponent
MODE_PROPERTY
 
Fields inherited from interface com.guiseframework.component.InputFocusGroupComponent
INPUT_FOCUS_STRATEGY_PROPERTY, INPUT_FOCUSED_COMPONENT_PROPERTY
 
Constructor Summary
AbstractApplicationFrame(Component component)
          Component constructor.
 
Method Summary
 void addChildFrame(Frame frame)
          Adds a frame to the list of child frames.
 boolean canClose()
          Determines whether the frame should be allowed to close.
protected abstract  java.lang.String getBasePlainLabel()
          Retrieves the plain-text base title to use when constructing a label.
 java.lang.Iterable<Frame> getChildFrames()
           
protected  java.util.List<Component> getChildList()
          Retrieves a list of all child components.
 boolean hasChildComponents()
          Determines whether this component has children.
 void removeChildFrame(Frame frame)
          Removes a frame from the list of child frames.
 void setContent(Component newContent)
          Sets the content child component.
protected  void updateLabel()
          Called when the content changes so that the label can be updated.
 
Methods inherited from class com.guiseframework.component.AbstractFrame
close, closeImpl, getCloseActionControl, getCloseActionPrototype, getContent, getInputFocusedComponent, getInputFocusStrategy, getMenu, getMode, getOpenEffect, getPrototypeProvisionStrategy, getRelatedComponent, getState, getTitleBackgroundColor, getToolbar, isModal, isMovable, isResizable, isTitleVisible, open, open, open, provideDefaultPrototypes, setCloseActionControl, setInputFocusedComponent, setInputFocusStrategy, setMenu, setModal, setMode, setMovable, setOpenEffect, setRelatedComponent, setResizable, setState, setTitleBackgroundColor, setTitleVisible, setToolbar, updateDefaultPrototypeProvisions, validate
 
Methods inherited from class com.guiseframework.component.AbstractEnumCompositeComponent
getComponent, setComponent
 
Methods inherited from class com.guiseframework.component.AbstractArrayCompositeComponent
getChildComponents, getComponent, setComponent
 
Methods inherited from class com.guiseframework.component.AbstractMultipleCompositeComponent
addComponent, removeComponent
 
Methods inherited from class com.guiseframework.component.AbstractCompositeComponent
addCompositeComponentListener, childComponentValidPropertyChanged, determineChildrenValid, determineValid, dispatchInputEvent, dispatchInputEvent, fireChildComponentAdded, fireChildComponentAdded, fireChildComponentRemoved, fireChildComponentRemoved, initializeChildComponent, loadPreferences, removeCompositeComponentListener, resetTheme, savePreferences, uninitializeChildComponent, updateTheme, validateChildren
 
Methods inherited from class com.guiseframework.component.AbstractComponent
addCommandListener, addExportStrategy, addImportStrategy, addKeyListener, addMouseListener, addNotificationListener, addPreferenceProperty, applyTheme, applyTheme, depict, equals, exportTransfer, fireInputEvent, fireNotified, fireNotified, getAncestor, getCommandListeners, getComponentByID, getComponentByName, getComponentOrientation, getConstraints, getDepictID, getDepictor, getDescription, getDescriptionContentType, getDirtyComponents, getDirtyComponents, getEventListenerManager, getFlyoverStrategy, getGlyphURI, getInfo, getInfoContentType, getInfoModel, getInputStrategy, getKeyListeners, getLabel, getLabelContentType, getMouseListeners, getName, getNotification, getNotifications, getNotifications, getOrientation, getParent, getPreferenceProperties, getRootComponent, getTheme, hasAncestor, hasCommandListeners, hashCode, hasKeyListeners, hasMouseListeners, importTransfer, initialize, isDragEnabled, isDropEnabled, isFlyoverEnabled, isPreferenceProperty, isThemeApplied, isValid, notify, processEvent, removeCommandListener, removeExportStrategy, removeImportStrategy, removeKeyListener, removeMouseListener, removeNotificationListener, removePreferenceProperty, setConstraints, setDepicted, setDescription, setDescriptionContentType, setDragEnabled, setDropEnabled, setFlyoverEnabled, setFlyoverStrategy, setGlyphURI, setInfo, setInfoContentType, setInputStrategy, setLabel, setLabelContentType, setName, setNotification, setOrientation, setParent, setThemeApplied, setValid, toString, update, updateValid
 
Methods inherited from class com.guiseframework.model.ui.AbstractPresentationModel
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, 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 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.component.Frame
close, getCloseActionControl, getCloseActionPrototype, getMenu, getOpenEffect, getRelatedComponent, getState, getTitleBackgroundColor, getToolbar, isModal, isMovable, isResizable, isTitleVisible, open, open, open, setCloseActionControl, setMenu, setModal, setMovable, setOpenEffect, setRelatedComponent, setResizable, setTitleBackgroundColor, setTitleVisible, setToolbar
 
Methods inherited from interface com.guiseframework.component.ContentComponent
getContent
 
Methods inherited from interface com.guiseframework.component.CompositeComponent
addCompositeComponentListener, getChildComponents, removeCompositeComponentListener
 
Methods inherited from interface com.guiseframework.component.ModalComponent
getMode, setMode
 
Methods inherited from interface com.guiseframework.component.InputFocusGroupComponent
getInputFocusedComponent, getInputFocusStrategy, setInputFocusedComponent, setInputFocusStrategy
 

Field Detail

LABEL_SEPARATOR

public static final java.lang.String LABEL_SEPARATOR
The delimiter to use when constructing the label from its various segments.

See Also:
Constant Field Values
Constructor Detail

AbstractApplicationFrame

public AbstractApplicationFrame(Component component)
Component constructor.

Parameters:
component - The single child component, or null if this frame should have no child component.
Method Detail

getChildFrames

public java.lang.Iterable<Frame> getChildFrames()
Specified by:
getChildFrames in interface ApplicationFrame
Returns:
An iterable to all child frames.

addChildFrame

public void addChildFrame(Frame frame)
Adds a frame to the list of child frames. This method should usually only be called by the frames themselves.

Specified by:
addChildFrame in interface ApplicationFrame
Parameters:
frame - The frame to add.
Throws:
java.lang.NullPointerException - if the given frame is null.
java.lang.IllegalArgumentException - if the given frame is this frame.

removeChildFrame

public void removeChildFrame(Frame frame)
Removes a frame from the list of child frames. This method should usually only be called by the frames themselves.

Specified by:
removeChildFrame in interface ApplicationFrame
Parameters:
frame - The frame to remove.
Throws:
java.lang.NullPointerException - if the given frame is null.
java.lang.IllegalArgumentException - if the given frame is the application frame.

setContent

public void setContent(Component newContent)
Sets the content child component. This is a bound property. This version updates the frame label by calling updateLabel().

Specified by:
setContent in interface ContentComponent
Overrides:
setContent in class AbstractFrame
Parameters:
newContent - The content child component, or null if this frame does not have a content child component.
See Also:
AbstractFrame.FrameComponent.CONTENT_COMPONENT, ContentComponent.CONTENT_PROPERTY

getBasePlainLabel

protected abstract java.lang.String getBasePlainLabel()
Retrieves the plain-text base title to use when constructing a label.

Returns:
A base plain-text string to use when constructing a label, or null if there is no base label.
See Also:
updateLabel()

updateLabel

protected void updateLabel()
Called when the content changes so that the label can be updated. This version sets the application frame label to match the label of the content, if any, prefixed with a base label, if any. If the label content type is not plain text, the base label is ignored.

See Also:
AbstractFrame.getContent(), getBasePlainLabel(), AbstractComponent.setLabel(String), AbstractComponent.setLabelContentType(ContentType)

canClose

public boolean canClose()
Determines whether the frame should be allowed to close. This implementation returns false. This method is called from AbstractFrame.close().

Specified by:
canClose in interface Frame
Overrides:
canClose in class AbstractFrame
Returns:
true if the frame should be allowed to close.

getChildList

protected java.util.List<Component> getChildList()
Retrieves a list of all child components. This version adds all this frame's child frames to the list.

Overrides:
getChildList in class AbstractArrayCompositeComponent
Returns:
A list of child components.
See Also:
getChildFrames()

hasChildComponents

public boolean hasChildComponents()
Determines whether this component has children. This version also checks to see whether there are child frames.

Specified by:
hasChildComponents in interface CompositeComponent
Overrides:
hasChildComponents in class AbstractArrayCompositeComponent
Returns:
Whether this component has children.
See Also:
getChildFrames()


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