|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.tensegrity.skeleton.swing.SwingFrameLayoutController
The SwingFrameLayoutController gathers all the logic behind
the ApplicationFrame layout of toolboxes and graphDocuments. Methods within
this class ensure that the global layout of the application and the
application itself (i.e. menu and toolbars) are kept in a valid state when
the ToggleLeftColumnCommand,ToggleRightColumnCommand
commands, and the menu items used in order to hide or show toolboxes are
used. Note that this controller also manages the application state when the
user closes the toolboxes using the top-right cross on their respective
panels.
It is recommanded to subclass this class in order to provide application
specific initial containers size values as well as specific resize weights
for the application's s. In
order to do so the following methods are provided:
JSplitPane
DEFAULT_MINIMUM_SIZE).
However, subclasses can override these values by means of the setupContainersMinimumSizes()
method.
It is also recommended to go through the JSplitPane's
class documentation for a better understanding of the resize weights.
| Field Summary | |
static java.awt.Dimension |
DEFAULT_MINIMUM_SIZE
This is the default minimum size for each container. |
static int |
SLIDE_PANEL_EAST
Public constants for layout positions/constraints. |
static int |
SLIDE_PANEL_NORTH_EAST
Public constants for layout positions/constraints. |
static int |
SLIDE_PANEL_NORTH_WEST
Public constants for layout positions/constraints. |
static int |
SLIDE_PANEL_SOUTH
Public constants for layout positions/constraints. |
static int |
SLIDE_PANEL_SOUTH_EAST
Public constants for layout positions/constraints. |
static int |
SLIDE_PANEL_SOUTH_WEST
Public constants for layout positions/constraints. |
static int |
SLIDE_PANEL_WEST
Public constants for layout positions/constraints. |
static double |
SPLITPANE_DEFAULT_RESIZE_WEIGHT
Constant defining the default resize weight for split panes |
static java.lang.String |
SPLITPANE_HORIZONTAL_BOTTOM_LEFT
Constant to be used by subclasses in .
|
static java.lang.String |
SPLITPANE_HORIZONTAL_BOTTOM_RIGHT
Constant to be used by subclasses in .
|
static java.lang.String |
SPLITPANE_HORIZONTAL_MIDDLE
Constant to be used by subclasses in .
|
static java.lang.String |
SPLITPANE_HORIZONTAL_TOP_LEFT
Constant to be used by subclasses in .
|
static java.lang.String |
SPLITPANE_HORIZONTAL_TOP_RIGHT
Constant to be used by subclasses in .
|
static java.lang.String |
SPLITPANE_VERTICAL_LEFT
Constant to be used by subclasses in .
|
static java.lang.String |
SPLITPANE_VERTICAL_RIGHT
Constant to be used by subclasses in .
|
| Constructor Summary | |
SwingFrameLayoutController(SwingApplicationFrame applicationFrame)
Creates a new SwingFrameLayoutController. |
|
| Method Summary | |
protected SwingApplicationFrame |
getApplicationFrame()
Returns the local instance. |
protected int |
getDefaultDividerSize()
Returns the split panes divider sizes depending on the current L&F. |
protected Container |
getEastContainer()
Returns the application specific East Container |
FrameLayoutSnapshot |
getFameLayoutSnapshot()
This method returns an instance of
which contains all the information required in order to re-build the
application frame layout the next time the application is started.
|
protected Container |
getNorthEastContainer()
Returns the application specific North East Container |
protected Container |
getNorthWestContainer()
Returns the application specific North West Container |
protected Container |
getSouthContainer()
Returns the application specific South Container |
protected Container |
getSouthEastContainer()
Returns the application specific South East Container |
protected Container |
getSouthWestContainer()
Returns the application specific South West Container |
protected Container |
getWestContainer()
Returns the application specific West Container |
boolean |
isLeftColumnVisible()
Returns true if the left column is visible, false otherwise |
boolean |
isRightColumnVisible()
Returns true if the right column is visible, false otherwise |
void |
restorePreferencesFrameLayout(FrameLayoutSnapshot snapshot)
This method sets up this
instance in such a way that the application frame will be layouted with
all the information contained into the passed .
|
protected void |
setDefaultEastContainer(Container defaultEastContainer)
Use this method in order to set the
which should act as a default container for the right column. |
protected void |
setDefaultWestContainer(Container defaultWestContainer)
Use this method in order to set the
which should act as a default container for the left column. |
protected void |
setupContainerInitialSize(Container container,
java.awt.Dimension size)
Method used in order to set a container's initial size. |
protected void |
setupContainerMinimumSize(Container container,
java.awt.Dimension size)
Method used in order to set a container's initial size. |
protected void |
setupContainersInitialSizes()
Method used in order to set containers initial sizes. |
protected void |
setupContainersMinimumSizes()
Method used in order to set containers minimum sizes. |
protected java.util.HashMap |
setupSplitPanesResizeWeights()
Method used in order to set up s
resize weights.
|
protected void |
showColumnSlidePanel(Container slidePanel,
boolean isLeftColumn)
Shows or hide the passed container depending on its current state. |
boolean |
showSlidePanel(Container containerInstance)
This method can be used in order to show or hide the passed ,
depending on its visible state. |
void |
showSlidePanel(int slidePanelIndex)
This method can be used in order to show or hide the
corresponding to the passed slidePanelIndex, depending
on its visible state. |
protected void |
showSouthSlidePanel(Container slidePanel)
Shows or hides the south container. |
void |
toggleLeftColumn()
Method called by the perform method of ToggleLeftColumnCommand |
void |
toggleRightColumn()
Method called by the perform method of ToggleLeftColumnCommand |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int SLIDE_PANEL_NORTH_WEST
public static final int SLIDE_PANEL_WEST
public static final int SLIDE_PANEL_SOUTH_WEST
public static final int SLIDE_PANEL_EAST
public static final int SLIDE_PANEL_SOUTH_EAST
public static final int SLIDE_PANEL_NORTH_EAST
public static final int SLIDE_PANEL_SOUTH
public static final java.awt.Dimension DEFAULT_MINIMUM_SIZE
setupContainersMinimumSizes()
for more information.
public static final double SPLITPANE_DEFAULT_RESIZE_WEIGHT
public static final java.lang.String SPLITPANE_VERTICAL_LEFT
setupSplitPanesResizeWeights().
Refer to this method's documentation for more information.
public static final java.lang.String SPLITPANE_VERTICAL_RIGHT
setupSplitPanesResizeWeights().
Refer to this method's documentation for more information.
public static final java.lang.String SPLITPANE_HORIZONTAL_TOP_LEFT
setupSplitPanesResizeWeights().
Refer to this method's documentation for more information.
public static final java.lang.String SPLITPANE_HORIZONTAL_BOTTOM_LEFT
setupSplitPanesResizeWeights().
Refer to this method's documentation for more information.
public static final java.lang.String SPLITPANE_HORIZONTAL_TOP_RIGHT
setupSplitPanesResizeWeights().
Refer to this method's documentation for more information.
public static final java.lang.String SPLITPANE_HORIZONTAL_BOTTOM_RIGHT
setupSplitPanesResizeWeights().
Refer to this method's documentation for more information.
public static final java.lang.String SPLITPANE_HORIZONTAL_MIDDLE
setupSplitPanesResizeWeights().
Refer to this method's documentation for more information.
| Constructor Detail |
public SwingFrameLayoutController(SwingApplicationFrame applicationFrame)
SwingFrameLayoutController.
applicationFrame - Application context for this controller.| Method Detail |
public final boolean isLeftColumnVisible()
public final boolean isRightColumnVisible()
public final boolean showSlidePanel(Container containerInstance)
This method can be used in order to show or hide the passed ,
depending on its visible state. It delegates its call to Container.
This method returns showSlidePanel(int)false if the passed container is not
registered as being on the left or on the right column.
containerInstance - the Container to show or hide.
false if the passed container is not registered
as being on the left or on the right column.public void showSlidePanel(int slidePanelIndex)
Container
corresponding to the passed slidePanelIndex, depending
on its visible state. It is called when the ShowSlidePanelAction action
is performed. The parameter must be one of:
SLIDE_PANEL_EAST
SLIDE_PANEL_NORTH_EAST
SLIDE_PANEL_NORTH_WEST
SLIDE_PANEL_SOUTH_EAST
SLIDE_PANEL_SOUTH_WEST
SLIDE_PANEL_WEST
slidePanelIndex - represents the panel to show or hide. Must be one of:
protected java.util.HashMap setupSplitPanesResizeWeights()
Method used in order to set up s
resize weights.
Override this method in order to configure application specific resize
weights for each split panes.
It is important when overriding this method to return a JSplitPane
for which items are HashMap s and the keys are:
Double
SPLITPANE_VERTICAL_LEFT
SPLITPANE_VERTICAL_RIGHT
SPLITPANE_HORIZONTAL_TOP_LEFT
SPLITPANE_HORIZONTAL_BOTTOM_LEFT
SPLITPANE_HORIZONTAL_TOP_RIGHT
SPLITPANE_HORIZONTAL_BOTTOM_RIGHT
SPLITPANE_VERTICAL_LEFT ==> 0
SPLITPANE_VERTICAL_RIGHT ==> 1
SPLITPANE_HORIZONTAL_TOP_LEFT ==> 0.5
SPLITPANE_HORIZONTAL_BOTTOM_LEFT ==> 0.5
SPLITPANE_HORIZONTAL_TOP_RIGHT ==> 0.5
SPLITPANE_HORIZONTAL_BOTTOM_RIGHT ==> 0.5
Double s for which the keys are:
SPLITPANE_VERTICAL_LEFT
SPLITPANE_VERTICAL_RIGHT
SPLITPANE_HORIZONTAL_TOP_LEFT
SPLITPANE_HORIZONTAL_BOTTOM_LEFT
SPLITPANE_HORIZONTAL_TOP_RIGHT
SPLITPANE_HORIZONTAL_BOTTOM_RIGHT
SPLITPANE_HORIZONTAL_MIDDLE
protected void setupContainersInitialSizes()
Method used in order to set containers initial sizes.
By default this method does nothing and is intended to be overriden
by subclasses.
Important
When overriding this method, subclasses should exclusively
use the method
in order to set up containers initial sizes.
Also, in order to avoid unexpected results, one should ensure that
containers of a same column are herein set up to have the same width.
setupContainerInitialSize(Container, Dimension)
protected void setupContainersMinimumSizes()
Method used in order to set containers minimum sizes.
By default this method does nothing and is intended to be overriden
by subclasses.
All containers' minimum sizes are by default set to DEFAULT_MINIMUM_SIZE.
This method can therefore be used to override this setting.
Important
When overriding this method, subclasses should exclusively
use the method
in order to set up containers initial sizes.
Also, in order to avoid unexpected results, one should ensure that
containers of a same column are herein set up to have the same minimum
size.
setupContainerMinimumSize(Container, Dimension)
protected final void setupContainerMinimumSize(Container container,
java.awt.Dimension size)
Method used in order to set a container's initial size. This method
should be used by subclasses in setupContainersMinimumSizes()
container - the containersize - the container's desired initial size
protected final void setupContainerInitialSize(Container container,
java.awt.Dimension size)
Method used in order to set a container's initial size. This method
should be used by subclasses in setupContainersInitialSizes()
container - the containersize - the container's desired initial sizepublic final void toggleLeftColumn()
com.tensegrity.component.orgchart.launch.commands.ToggleLeftColumnCommandprotected int getDefaultDividerSize()
public final void toggleRightColumn()
com.tensegrity.component.orgchart.launch.commands.ToggleLeftColumnCommand
protected final void showColumnSlidePanel(Container slidePanel,
boolean isLeftColumn)
Shows or hide the passed container depending on its current state.
slidePanel - the container to hide or showisLeftColumn - if true then the container is one the left column, otherwise
it is on the right columnprotected final Container getNorthEastContainer()
Returns the application specific North East Container
protected final Container getSouthContainer()
Returns the application specific South Container
protected final Container getSouthEastContainer()
Returns the application specific South East Container
protected final Container getEastContainer()
Returns the application specific East Container
protected final Container getNorthWestContainer()
Returns the application specific North West Container
protected final Container getWestContainer()
Returns the application specific West Container
protected final Container getSouthWestContainer()
Returns the application specific South West Container
protected final SwingApplicationFrame getApplicationFrame()
SwingApplicationFrame instance.
protected void setDefaultEastContainer(Container defaultEastContainer)
Container
which should act as a default container for the right column.
defaultEastContainer - The defaultEastContainer to set.protected void setDefaultWestContainer(Container defaultWestContainer)
Container
which should act as a default container for the left column.
defaultWestContainer - The defaultWestContainer to set.public final FrameLayoutSnapshot getFameLayoutSnapshot()
This method returns an instance of
which contains all the information required in order to re-build the
application frame layout the next time the application is started.
FrameLayoutSnapshot
FrameLayoutSnapshot which
contains all the information required in order to re-build the
application frame layout the next time the application is
started.public final void restorePreferencesFrameLayout(FrameLayoutSnapshot snapshot)
This method sets up this
instance in such a way that the application frame will be layouted with
all the information contained into the passed SwingFrameLayoutController.
FrameLayoutSnapshot
snapshot - FrameLayoutSnapshot instance
containing the information required to layout the application
frame as it was the last time the application was closed.protected final void showSouthSlidePanel(Container slidePanel)
Shows or hides the south container.
slidePanel - the south container to show or hide.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||