dsto.dfc.swing.panels
Class ToolView

java.lang.Object
  extended by dsto.dfc.util.BasicPropertyEventSource
      extended by dsto.dfc.swing.panels.ToolView
All Implemented Interfaces:
Copyable, JavaBean, PropertyEventSource, Serializable, Cloneable

public class ToolView
extends BasicPropertyEventSource

A floating tool view of a PanelManager.Panel. A tool view is an auxillary view to a PanelManager.Panel. Tool views are only displayed when their parent panel is active and the tool view is enabled. The state of the tool view depends on the state of it's PanelManager.Panel. If the Panel is FIXED or FLOAT_INTERNAL, the tool will be displayed in an internal frame. If the Panel is FLOAT_EXTERNAL, the tool is shown in a native window.

Version:
$Revision$
See Also:
PanelManager.Panel.addToolView(Component), Serialized Form

Field Summary
protected  Corner corner
           
static int DISPOSE_ON_CLOSE
           
protected  Frame externalFrameOwner
           
static int HIDE_ON_CLOSE
           
protected  int indentLevel
           
 FrameLike insideFrame
           
protected  JFrame internalFrameOwner
           
 FrameLike outsideFrame
           
protected  PanelManager.Panel panel
           
 String state
           
 FrameLike stateFrame
           
 Component tool
           
 
Constructor Summary
ToolView(PanelManager.Panel panel, Component tool, JFrame internalFrameOwner, Frame externalFrameOwner)
          Creates a new ToolView instance.
 
Method Summary
 void changeState(String newState)
          Normally called when the PanelManager.Panel that may have created the tool view changes state.
protected  FrameLike createInsideFrameIfNeeded()
           
protected  FrameLike createOutsideFrameIfNeeded()
           
protected  Corner defaultCorner()
           
 void dispose()
           
protected  boolean frameNotYetCreated(FrameLike frame)
           
 Icon getIcon()
           
 String getTitle()
           
protected  boolean isStandAlone()
           
protected  void letPanelDoDisposing(PanelManager.Panel tombstone)
           
 void putInCorner(Corner newCorner)
          Set the ToolView within a corner of it's parent frame.
 void putInCorner(Corner newCorner, int newIndentLevel)
          set the ToolView within a corner of it's parent frame.
protected  void resizeFramesToFitNewTool()
          The tool has changed, so resize both Frames to fit the new tool of the ToolView.
protected  void resizeFrameToFitNewTool(FrameLike frame)
           
protected  void setActive(boolean active)
          Normally called when the PanelManager.Panel that may have created the tool view becomes active.
 void setDefaultCloseOperation(int operation)
          Sets the default behaviour invoked when the ToolView is closed.
 void setIcon(Icon icon)
           
 void setTitle(String title)
           
 void setTool(Component newTool)
          Sets the content of the ToolView Frame.
 void setVisible(boolean visible)
          Toggle the visibility of the ToolView.
protected  void simpleDispose()
           
 
Methods inherited from class dsto.dfc.util.BasicPropertyEventSource
addPropertyChangeListener, clone, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeSource, removePropertyChangeListener, setPropertyChangeSource
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HIDE_ON_CLOSE

public static final int HIDE_ON_CLOSE
See Also:
Constant Field Values

DISPOSE_ON_CLOSE

public static final int DISPOSE_ON_CLOSE
See Also:
Constant Field Values

panel

protected PanelManager.Panel panel

outsideFrame

public FrameLike outsideFrame

insideFrame

public FrameLike insideFrame

stateFrame

public FrameLike stateFrame

internalFrameOwner

protected JFrame internalFrameOwner

externalFrameOwner

protected Frame externalFrameOwner

tool

public Component tool

corner

protected Corner corner

indentLevel

protected int indentLevel

state

public String state
Constructor Detail

ToolView

public ToolView(PanelManager.Panel panel,
                Component tool,
                JFrame internalFrameOwner,
                Frame externalFrameOwner)
Creates a new ToolView instance. Clients should use PanelManager.Panel.addToolView(java.awt.Component).

Parameters:
panel - The panel this view is associated with (null for standalone views).
tool - The component to go into the tool view frame.
internalFrameOwner - The owner of internal tool view frames.
externalFrameOwner - The owner of external tool view frames.
Method Detail

setTitle

public void setTitle(String title)

getTitle

public String getTitle()

setIcon

public void setIcon(Icon icon)

getIcon

public Icon getIcon()

putInCorner

public void putInCorner(Corner newCorner)
Set the ToolView within a corner of it's parent frame.

Parameters:
newCorner - the corner to put the tool view in.

setTool

public void setTool(Component newTool)
Sets the content of the ToolView Frame.

Parameters:
newTool - the component that will be shown in the frame.

setVisible

public void setVisible(boolean visible)
Toggle the visibility of the ToolView.

Parameters:
visible - if true the ToolView will be made visible & vice versa.

setDefaultCloseOperation

public void setDefaultCloseOperation(int operation)
Sets the default behaviour invoked when the ToolView is closed.

Parameters:
operation - the operation to invoke when the ToolView is closed.

resizeFramesToFitNewTool

protected void resizeFramesToFitNewTool()
The tool has changed, so resize both Frames to fit the new tool of the ToolView.


resizeFrameToFitNewTool

protected void resizeFrameToFitNewTool(FrameLike frame)

putInCorner

public void putInCorner(Corner newCorner,
                        int newIndentLevel)
set the ToolView within a corner of it's parent frame.

Parameters:
newCorner - the corner to put the tool view in.
newIndentLevel - how far to indent the toolview towards the center.

changeState

public void changeState(String newState)
Normally called when the PanelManager.Panel that may have created the tool view changes state.


dispose

public void dispose()

simpleDispose

protected void simpleDispose()

letPanelDoDisposing

protected void letPanelDoDisposing(PanelManager.Panel tombstone)

isStandAlone

protected boolean isStandAlone()

setActive

protected void setActive(boolean active)
Normally called when the PanelManager.Panel that may have created the tool view becomes active. shows the frame corresponding the the current state of the ToolView.


defaultCorner

protected Corner defaultCorner()

createOutsideFrameIfNeeded

protected FrameLike createOutsideFrameIfNeeded()

createInsideFrameIfNeeded

protected FrameLike createInsideFrameIfNeeded()

frameNotYetCreated

protected boolean frameNotYetCreated(FrameLike frame)


Copyright © 2008 Commonwealth of Australia