org.ascape.runtime.swing
Class ViewFrameBridge

java.lang.Object
  extended by org.ascape.runtime.swing.ViewFrameBridge
All Implemented Interfaces:
java.io.Serializable

public class ViewFrameBridge
extends java.lang.Object
implements java.io.Serializable

A class allowing Frame, JFrame, and JInternalFrame to be used interchangebly, and providing general support for frame management. This class also ends up mediating and centralizing all swing/non-swong deployment issues. All Swing related userEnvironment calls are sent to this class so that all swing functionality can be removed in one place. This will change once the majority of browsers support Swing.

Since:
1.2
Version:
3.0
Author:
Miles Parker
See Also:
Serialized Form

Constructor Summary
ViewFrameBridge()
          Construct a frame bridge.
ViewFrameBridge(ComponentView view)
          Construct a frame bridge.
ViewFrameBridge(ComponentView[] views)
          Construct a frame bridge.
 
Method Summary
 void dispose()
          Closes and frees the bridges frames, saving any relevant information.
 java.awt.Container getContentPane()
          Returns the contentPane object for the frame.
 java.awt.Container getFrameImp()
          Returns the actual frame implementation.
 int getGridBorderSize()
          Gets the grid border size.
 javax.swing.JScrollPane getScrollPanel()
          Gets the scroll panel.
 java.lang.String getTitle()
          Gets the title of the frame.
 java.awt.Component getViewPanel()
          Gets the view panel.
 ComponentView[] getViews()
          Returns the views displayed in this window.
 javax.swing.JToolBar getViewToolbar()
          Gets the view toolbar.
 javax.swing.Action getZoomInAction()
          Gets the zoom in action.
 javax.swing.Action getZoomOutAction()
          Gets the zoom out action.
 void iconUpdated()
          Should be called when the view has updated itself in a way that changes icon.
 boolean isAgentView()
          Checks if is agent view.
 boolean isLockZoomToFrame()
          Checks if is lock zoom to frame.
 boolean isVisible()
          Is the frame currently visible?.
protected  void onFrameDispose()
          Called whenever the bridged frames are disposed.
 void pack()
          Packs the delegate frame.
 void setDefaultCloseOperation(int closeOp)
          Sets the default close operation.
 void setGridBorderSize(int gridBorderSize)
          Sets the grid border size.
 void setLockZoomToFrame(boolean lockZoomToFrame)
          Sets the lock zoom to frame.
 void setTitle(java.lang.String title)
          Sets the title for this frame to the specified string.
 void setView(ComponentView view)
          Sets the view to display in this window.
 void setViews(ComponentView[] views)
          Sets the view to display in this window.
 void setVisible(boolean b)
          Makes the frame visible or invisible.
 void toFront()
          Brings the frame to the front.
 java.lang.String toString()
          Returns a string represenetation of the view frame.
 void viewDeserialized()
          This view has just been deserailized.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ViewFrameBridge

public ViewFrameBridge()
Construct a frame bridge.


ViewFrameBridge

public ViewFrameBridge(ComponentView[] views)
Construct a frame bridge.

Parameters:
views - the views

ViewFrameBridge

public ViewFrameBridge(ComponentView view)
Construct a frame bridge.

Parameters:
view - the view
Method Detail

setDefaultCloseOperation

public void setDefaultCloseOperation(int closeOp)
Sets the default close operation.

Parameters:
closeOp - the new default close operation

setViews

public void setViews(ComponentView[] views)
Sets the view to display in this window. Sets the size to the view preferred size plus the window insets size. Sets the component's view frame to this. Gives the window a random loation on the user's (primary?) monitor.

Parameters:
views - the views

viewDeserialized

public void viewDeserialized()
This view has just been deserailized. Called by the framework.


iconUpdated

public void iconUpdated()
Should be called when the view has updated itself in a way that changes icon.


toFront

public void toFront()
Brings the frame to the front.


onFrameDispose

protected void onFrameDispose()
Called whenever the bridged frames are disposed.


pack

public void pack()
Packs the delegate frame.


dispose

public void dispose()
Closes and frees the bridges frames, saving any relevant information.


toString

public java.lang.String toString()
Returns a string represenetation of the view frame.

Overrides:
toString in class java.lang.Object
Returns:
the string

getGridBorderSize

public int getGridBorderSize()
Gets the grid border size.

Returns:
the grid border size

setGridBorderSize

public void setGridBorderSize(int gridBorderSize)
Sets the grid border size.

Parameters:
gridBorderSize - the new grid border size

setView

public void setView(ComponentView view)
Sets the view to display in this window. Sets the size to the view preferred size plus the window insets size. Sets the component's view frame to this. Gives the window a random loation on the user's (primary?) monitor.

Parameters:
view - the view

getViews

public ComponentView[] getViews()
Returns the views displayed in this window.

Returns:
the views

getViewPanel

public java.awt.Component getViewPanel()
Gets the view panel.

Returns:
the view panel

getFrameImp

public java.awt.Container getFrameImp()
Returns the actual frame implementation. Use sparingly, and only if you know the view context you will be using!

Returns:
the frame imp

getContentPane

public java.awt.Container getContentPane()
Returns the contentPane object for the frame. (In the case of Frame, will return the Frame itself.)

Returns:
the content pane

getTitle

public java.lang.String getTitle()
Gets the title of the frame. The title is displayed in the frame's border.

Returns:
the title

setTitle

public void setTitle(java.lang.String title)
Sets the title for this frame to the specified string.

Parameters:
title - the title to be displayed in the frame's border

setVisible

public void setVisible(boolean b)
Makes the frame visible or invisible.

Parameters:
b - true if frame should be made visible, false if frame should be hidden

isVisible

public boolean isVisible()
Is the frame currently visible?.

Returns:
true, if is visible

isAgentView

public boolean isAgentView()
Checks if is agent view.

Returns:
true, if is agent view

getViewToolbar

public javax.swing.JToolBar getViewToolbar()
Gets the view toolbar.

Returns:
the view toolbar

isLockZoomToFrame

public boolean isLockZoomToFrame()
Checks if is lock zoom to frame.

Returns:
true, if is lock zoom to frame

setLockZoomToFrame

public void setLockZoomToFrame(boolean lockZoomToFrame)
Sets the lock zoom to frame.

Parameters:
lockZoomToFrame - the new lock zoom to frame

getZoomInAction

public javax.swing.Action getZoomInAction()
Gets the zoom in action.

Returns:
the zoom in action

getZoomOutAction

public javax.swing.Action getZoomOutAction()
Gets the zoom out action.

Returns:
the zoom out action

getScrollPanel

public javax.swing.JScrollPane getScrollPanel()
Gets the scroll panel.

Returns:
the scroll panel


Copyright © 1998-2008 The Brookings Institution, NuTech Solutions, Metascape, LLC All Rights Reserved.