Interface Frame

All Superinterfaces:
Component, CompositeComponent, ContentComponent, DepictedObject, Displayable, InfoModel, InputFocusableComponent, InputFocusGroupComponent, LabelModel, ModalComponent<Frame.Mode>, Model, PresentationModel, com.globalmentor.beans.PropertyBindable, com.globalmentor.beans.PropertyConstrainable
All Known Subinterfaces:
ApplicationFrame, DialogFrame<V>, FlyoverFrame, ModalFrame<R>, OptionDialogFrame<O>
All Known Implementing Classes:
AbstractApplicationFrame, AbstractDialogFrame, AbstractFlyoverFrame, AbstractFrame, AbstractModalFrame, AbstractOptionDialogFrame, CalendarDialogFrame, DefaultApplicationFrame, DefaultDialogFrame, DefaultFlyoverFrame, DefaultFrame, DefaultModalFrame, MessageOptionDialogFrame, NotificationOptionDialogFrame

A root-level component such as a window or an HTML page. The frame's contents are specified using ContentComponent.setContent(Component).

The title is specified by the frame model's label.

A frame like other components is by default visible, but is not actually shown until its open(boolean) method is called.

A frame is a InputFocusGroupComponent, allowing descendant InputFocusableComponents to have the focus.

Author:
Garret Wilson
  • Field Details

    • CLOSE_ACTION_CONTROL_PROPERTY

      static final String CLOSE_ACTION_CONTROL_PROPERTY
      The close action control bound property.
    • MOVABLE_PROPERTY

      static final String MOVABLE_PROPERTY
      The bound property of whether the component is movable.
    • OPEN_EFFECT_PROPERTY

      static final String OPEN_EFFECT_PROPERTY
      The open effect bound property.
    • RESIZABLE_PROPERTY

      static final String RESIZABLE_PROPERTY
      The bound property of whether the frame can be resized.
    • STATE_PROPERTY

      static final String STATE_PROPERTY
      The bound state property.
    • TITLE_BACKGROUND_COLOR_PROPERTY

      static final String TITLE_BACKGROUND_COLOR_PROPERTY
      The bound property of the title background color.
    • TITLE_VISIBLE_PROPERTY

      static final String TITLE_VISIBLE_PROPERTY
      The bound property of whether the title bar is visible.
    • TOOLBAR_PROPERTY

      static final String TOOLBAR_PROPERTY
      The bound property of the frame toolbar.
  • Method Details

    • getState

      Frame.State getState()
      Returns:
      The state of the frame.
    • getMenu

      Menu getMenu()
      Returns:
      The frame menu, or null if this frame does not have a menu.
    • setMenu

      void setMenu(Menu newMenu)
      Sets the frame menu. This is a bound property.
      Parameters:
      newMenu - The frame menu, or null if this frame does not have a menu.
      See Also:
    • isModal

      boolean isModal()
      Returns:
      Whether the frame is modal if and when it is open.
    • setModal

      void setModal(boolean newModal)
      Sets whether the frame is modal if and when it is open. This is a bound property of type Boolean.
      Parameters:
      newModal - true if the frame should be modal, else false.
      See Also:
    • isMovable

      boolean isMovable()
      Returns:
      Whether the frame is movable.
    • setMovable

      void setMovable(boolean newMovable)
      Sets whether the frame is movable. This is a bound property of type Boolean.
      Parameters:
      newMovable - true if the frame should be movable, else false.
      See Also:
    • isResizable

      boolean isResizable()
      Returns:
      Whether the frame can be resized.
    • setResizable

      void setResizable(boolean newResizable)
      Sets whether the frame can be resized. This is a bound property of type Boolean.
      Parameters:
      newResizable - true if the frame can be resized, else false.
      See Also:
    • getRelatedComponent

      Component getRelatedComponent()
      Returns:
      The related component such as a popup source, or null if the frame is not related to another component.
    • setRelatedComponent

      void setRelatedComponent(Component newRelatedComponent)
      Sets the related component This is a bound property.
      Parameters:
      newRelatedComponent - The new related component, or null if the frame is not related to another component.
      See Also:
    • getTitleBackgroundColor

      Color getTitleBackgroundColor()
      Returns:
      The background color of the title, or null if no background color is specified for the title.
    • setTitleBackgroundColor

      void setTitleBackgroundColor(Color newTitleBackgroundColor)
      Sets the background color of the title. This is a bound property.
      Parameters:
      newTitleBackgroundColor - The background color of the title, or null if the default background color should be used.
      See Also:
    • isTitleVisible

      boolean isTitleVisible()
      Returns:
      Whether the title bar is visible.
    • setTitleVisible

      void setTitleVisible(boolean newTitleVisible)
      Sets whether the title bar is visible. This is a bound property of type Boolean.
      Parameters:
      newTitleVisible - true if the title bar should be visible, else false.
      See Also:
    • getToolbar

      Toolbar getToolbar()
      Returns:
      The frame toolbar, or null if this frame does not have a toolbar.
    • setToolbar

      void setToolbar(Toolbar newToolbar)
      Sets the frame toolbar. This is a bound property.
      Parameters:
      newToolbar - The frame toolbar, or null if this frame does not have a toolbar.
      See Also:
    • getOpenEffect

      Effect getOpenEffect()
      Returns:
      The effect used for opening the frame, or null if there is no open effect.
    • setOpenEffect

      void setOpenEffect(Effect newOpenEffect)
      Sets the effect used for opening the frame. This is a bound property.
      Parameters:
      newOpenEffect - The new effect used for opening the frame, or null if there should be no open effect.
      See Also:
    • getCloseActionPrototype

      ActionPrototype getCloseActionPrototype()
      Returns:
      The action prototype for closing the frame.
    • getCloseActionControl

      ActionControl getCloseActionControl()
      Returns:
      The action control for closing the frame, or null if this frame does not have a close action control.
    • setCloseActionControl

      void setCloseActionControl(ActionControl newCloseActionControl)
      Sets the action control for closing the frame. This is a bound property.
      Parameters:
      newCloseActionControl - The action control for closing the frame, or null if this frame does not have a close action control.
      See Also:
    • open

      void open()
      Opens the frame with the currently set modality. Opening the frame registers the frame with the application frame. If the frame is already open, no action occurs.
      See Also:
    • open

      void open(com.globalmentor.beans.GenericPropertyChangeListener<Frame.Mode> modeChangeListener)
      Opens the frame as modal and installs the given property change listener to listen for the mode changing. This is a convenience method that adds the ModalComponent.MODE_PROPERTY change listener using PropertyBindable.addPropertyChangeListener(String, PropertyChangeListener) and then calls open(boolean) with a value of true.
      Parameters:
      modeChangeListener - The mode property change listener to add.
      See Also:
    • open

      void open(boolean modal)
      Opens the frame, specifying modality. Opening the frame registers the frame with the session. If the frame is already open, no action occurs.
      Parameters:
      modal - true if the frame should be opened as a modal frame, else false.
      See Also:
    • canClose

      boolean canClose()
      Determines whether the frame should be allowed to close. This method is called from close().
      Returns:
      true if the frame should be allowed to close.
    • close

      void close()
      Closes the frame. Closing the frame unregisters the frame with the session. If the frame is already closed, no action occurs.
      See Also: