dsto.dfc.swing.panels
Class PanelManager.Panel

java.lang.Object
  extended by dsto.dfc.swing.panels.PanelManager.Panel
All Implemented Interfaces:
CommandSource, Iconic, Disposable
Enclosing class:
PanelManager

public class PanelManager.Panel
extends Object
implements CommandSource, Iconic, Disposable

A panel managed by the panel manager.


Field Summary
protected  ClientCommandViews commandViews
           
protected  Component component
          The visible component to be displayed by this Panel
protected  InternalFloatState externalFloatState
          the component is displayed in a native Frame in this state
protected  FixedFloatState fixedState
          the component is displayed in the tabbed pane in this state
protected  TitleShowPolicy hideTitle
           
protected  Icon icon
           
protected  InternalFloatState internalFloatState
          the component is displayed in a lightweight JFrame in this state
protected  boolean scrollable
           
protected  TitleShowPolicy showTitle
          Determines whether the Tab for this panel will display only an icon, (hideTitle) or and icon and a textual title (showTitle).
protected  FixedFloatState state
          represents the current active state of this Panel
 TitleShowPolicy titleDisplay
           
protected  List toolViews
           
 
Fields inherited from interface dsto.dfc.swing.icons.Iconic
NULL_ICON
 
Constructor Summary
protected PanelManager.Panel(Component component, String name, Icon icon, boolean showingName, boolean scrollable, int index)
           
 
Method Summary
 void addAllCommands()
          The panel's commands are merged with the client component's commands.
 ToolView addToolView(Component tool)
          Create a new tool view attached to the panel containing a component.
protected  boolean alreadyDisposed()
           
protected  void changeToolViewState(String newState)
           
 void close()
          Close (hide and remove) this panel.
 void dispose()
          Dispose of the object (unregister listeners, close open resources etc).
protected  void disposeToolViews()
           
protected  void extractCommandViewsFrom(Object commandSource)
           
 void fireFloatChangeEvent()
           
 boolean getChanged()
           
 CommandView getCommandView(String viewName)
          Get the command view instance for a given view name.
 Component getComponent()
           
 Command getDefaultCommand()
           
 String getFloating()
           
 Icon getIcon()
          The small (16x16) icon for the object.
 int getIndex()
           
 Icon getLargeIcon()
          The large (32x32) icon.
 PanelManager getManager()
           
 String getName()
          The human-readable name for the object.
 JScrollPane getTabPaneScrollPane()
           
protected  ToolView getToolViewAt(int index)
           
 int getToolViewCount()
          The number of tool views attached to this panel.
 boolean isActive()
           
 boolean isFixed()
           
 boolean isFloating()
           
protected  boolean isScrollable()
           
 boolean isShowingName()
           
 void makeUncloseable()
          Ensure this panel cannot be closed.
protected  void refreshTitles()
           
 void removeAllCommands()
           
 void removeToolView(ToolView toolView)
          Remove a tool view.
 void setActive(boolean active)
           
 void setChanged(boolean changed)
          Called when the component represented by this Panel has been logically edited or changed.
 void setComponent(Component component)
           
 void setFloating(String floatStatus)
          Set how the panel is displayed.
 void setName(String name)
           
 void setShowingName(boolean showingName)
          Set whether the panel name is displayed.
protected  void setTitleDisplay(boolean showingTitle)
           
protected  void setToolViewsActive(boolean active)
           
 void setVisible(boolean visible)
          Hide/show the panel.
protected  void showNextFixedPanelInTabPane()
           
 void switchCloseCommand(Command publishedCloseCommand)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

showTitle

protected TitleShowPolicy showTitle
Determines whether the Tab for this panel will display only an icon, (hideTitle) or and icon and a textual title (showTitle).


hideTitle

protected TitleShowPolicy hideTitle

titleDisplay

public TitleShowPolicy titleDisplay

scrollable

protected boolean scrollable

icon

protected Icon icon

component

protected Component component
The visible component to be displayed by this Panel


state

protected FixedFloatState state
represents the current active state of this Panel


fixedState

protected FixedFloatState fixedState
the component is displayed in the tabbed pane in this state


internalFloatState

protected InternalFloatState internalFloatState
the component is displayed in a lightweight JFrame in this state


externalFloatState

protected InternalFloatState externalFloatState
the component is displayed in a native Frame in this state


commandViews

protected ClientCommandViews commandViews

toolViews

protected List toolViews
Constructor Detail

PanelManager.Panel

protected PanelManager.Panel(Component component,
                             String name,
                             Icon icon,
                             boolean showingName,
                             boolean scrollable,
                             int index)
Method Detail

makeUncloseable

public void makeUncloseable()
Ensure this panel cannot be closed.


close

public void close()
Close (hide and remove) this panel.


setVisible

public void setVisible(boolean visible)
Hide/show the panel.


dispose

public void dispose()
Description copied from interface: Disposable
Dispose of the object (unregister listeners, close open resources etc). It should be safe to call this method more than once. Note for beans that support client event listeners: if there are listeners registered when this is called, this method should do nothing.

Specified by:
dispose in interface Disposable

alreadyDisposed

protected boolean alreadyDisposed()

getManager

public PanelManager getManager()

addToolView

public ToolView addToolView(Component tool)
Create a new tool view attached to the panel containing a component. Tool views appear in a floating window when the panel is active.


removeToolView

public void removeToolView(ToolView toolView)
Remove a tool view.

See Also:
addToolView(java.awt.Component)

getToolViewCount

public int getToolViewCount()
The number of tool views attached to this panel.


getCommandView

public CommandView getCommandView(String viewName)
Description copied from interface: CommandSource
Get the command view instance for a given view name.

Specified by:
getCommandView in interface CommandSource
Parameters:
viewName - The name of the view to be retrieved. Usually one of CommandView.MAIN_MENU_VIEW, CommandView.CONTEXT_MENU_VIEW or CommandView.TOOLBAR_VIEW, but custom views may be supported also.
Returns:
The command view instance or null if view is not defined.

getDefaultCommand

public Command getDefaultCommand()

refreshTitles

protected void refreshTitles()

getChanged

public boolean getChanged()

setChanged

public void setChanged(boolean changed)
Called when the component represented by this Panel has been logically edited or changed. Changed panels are shown with an asterisk next to their title.


setShowingName

public void setShowingName(boolean showingName)
Set whether the panel name is displayed.


setTitleDisplay

protected void setTitleDisplay(boolean showingTitle)

isShowingName

public boolean isShowingName()

setName

public void setName(String name)

getName

public String getName()
Description copied from interface: Iconic
The human-readable name for the object.

Specified by:
getName in interface Iconic

getIcon

public Icon getIcon()
Description copied from interface: Iconic
The small (16x16) icon for the object. May be null if no small icon is available.

Specified by:
getIcon in interface Iconic

getLargeIcon

public Icon getLargeIcon()
Description copied from interface: Iconic
The large (32x32) icon.

Specified by:
getLargeIcon in interface Iconic
Returns:
The large icon, or null if no large icon is available.

setComponent

public void setComponent(Component component)

getComponent

public Component getComponent()

extractCommandViewsFrom

protected void extractCommandViewsFrom(Object commandSource)

getIndex

public int getIndex()

isFloating

public boolean isFloating()

isFixed

public boolean isFixed()

fireFloatChangeEvent

public void fireFloatChangeEvent()

setFloating

public void setFloating(String floatStatus)
Set how the panel is displayed. One of FLOAT_EXTERNAL, FLOAT_INTERNAL or FIXED.


getFloating

public String getFloating()

addAllCommands

public void addAllCommands()
The panel's commands are merged with the client component's commands.


removeAllCommands

public void removeAllCommands()

switchCloseCommand

public void switchCloseCommand(Command publishedCloseCommand)

showNextFixedPanelInTabPane

protected void showNextFixedPanelInTabPane()

disposeToolViews

protected void disposeToolViews()

setToolViewsActive

protected void setToolViewsActive(boolean active)

changeToolViewState

protected void changeToolViewState(String newState)

getToolViewAt

protected ToolView getToolViewAt(int index)

setActive

public void setActive(boolean active)

isActive

public boolean isActive()

isScrollable

protected boolean isScrollable()

getTabPaneScrollPane

public JScrollPane getTabPaneScrollPane()


Copyright © 2008 Commonwealth of Australia