facets.facet
Class AreaFacets

java.lang.Object
  extended by facets.util.Tracer
      extended by facets.facet.AreaFacets

public final class AreaFacets
extends Tracer

Sub-factory for viewer, area and surface facets.

AreaFacets provides a range of methods to create and attach viewer facets and their containing area facets to members of the area target tree.


Nested Class Summary
 class AreaFacets.PaneFacets
           
 
Field Summary
static Shade COLOR_DESKTOP
           
static java.lang.String KEY_DESKTOP_MAXIMUM
           
static java.lang.String KEY_DESKTOP_NO_SCALE
           
static java.lang.String PAGES_SHARED
           
static java.lang.String PAGES_SINGLE
           
static int PANE_ACTIVE
          Pane layout constant
static int PANE_ACTIVE_MAXIMISE
          Pane layout constant
static int PANE_ACTIVE_RESTORE
          Pane layout constant
static int PANE_DIALOG
          Pane layout constant
static java.lang.String PANE_FLIP
          State storage key element
static java.lang.String PANE_KEY_ASK
          State storage key element
static java.lang.String PANE_KEY_DEFAULT
          State storage key element
static java.lang.String PANE_KEY_FLIP
          State storage key element
static java.lang.String PANE_KEY_SPLITS
          State storage key element
static java.lang.String PANE_KEY_TAB_AND_HIDE
          State storage key element
static int PANE_LAST
          Pane layout constant
static int PANE_LAYOUT
          Pane layout constant
static int PANE_LEFT
          Pane layout constant
static int PANE_LOWER
          Pane layout constant
static java.lang.String PANE_RESET
          State storage key element
static int PANE_RIGHT
          Pane layout constant
static int PANE_SHOW
          Pane layout constant
static int PANE_SPLIT_HORIZONTAL
          Pane layout constant
static int PANE_SPLIT_VERTICAL
          Pane layout constant
static int PANE_UPPER
          Pane layout constant
static NumberPolicy SASH_SPLIT_POLICY
           
static java.lang.String STATE_NODE_AREA
          State storage key element
static java.lang.String TABLE_KEY_COLUMNS
          State storage key element
static int TARGET_DESKTOP_SCALE
           
static int TARGET_DESKTOP_TILE
           
static java.lang.String TITLE_DESKTOP_SCALE
           
static java.lang.String TITLE_DESKTOP_TILE
           
 
Constructor Summary
AreaFacets(facets.facet.FacetsCore core, AppValues values)
           
 
Method Summary
 MountFacet appMultiContentFacet(ActionAppSurface app, SAreaTarget surfaceRoot, boolean desktop)
          Constructs the root facet of a multi-content application surface.
 void attachFacetArea(SFacet facet, SAreaTarget area)
           
 void attachViewerAreaPanes(SAreaTarget area, int splitAspect, ViewerAreaMaster vam)
          Convenience method that creates and lays out viewer areas.
 MountFacet mount(SAreaTarget area, java.lang.String hints)
          Attaches a MountFacet to the area passed.
 SFacet panes(SAreaTarget area, SFacet[] contents, java.lang.String title, java.lang.String hints, int aspect)
          Convenience method to define a pane set with a single root.
 SFacet panes(SAreaTarget area, SFacet[] contents, java.lang.String title, java.lang.String hints, int[][] codes, double[] splitDefaults, int[] tabAndHideDefaults, java.lang.String[] groups)
          Builds pane set based on a sashed mount.
 SFacet panes(SAreaTarget area, SFacet[] contents, java.lang.String title, java.lang.String hints, int[] layout, double[] splitDefaults, int[] tabAndHideDefaults)
          Convenience method to define a pane set with a single root.
 STarget panesGetTargets(SAreaTarget area)
           
 void panesValidateLayout(SAreaTarget area)
           
 MountFacet switchMount(SAreaTarget area)
          Create a programmatically switchable container for facets in an area tree.
 MountFacet tabs(SAreaTarget area, java.lang.String hints)
           
 SFacet viewerArea(SAreaTarget area, ViewerAreaMaster vam)
          Creates a viewer facet for the viewer frame contained by an area.
 SFacet[] viewerAreaChildren(SAreaTarget area, ViewerAreaMaster vam)
          Convenience method that creates viewers for an array of area children.
 SFacet viewerGrid(SAreaTarget area, ViewerAreaMaster vam)
           
 SFacet viewerTabs(SAreaTarget area, ViewerAreaMaster vam)
           
 
Methods inherited from class facets.util.Tracer
trace, trace, trace, trace, trace, traceDebug, traceDebug, traceObjectText, traceOutput, traceOutputWithClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COLOR_DESKTOP

public static final Shade COLOR_DESKTOP

SASH_SPLIT_POLICY

public static final NumberPolicy SASH_SPLIT_POLICY

PAGES_SINGLE

public static final java.lang.String PAGES_SINGLE
See Also:
Constant Field Values

PAGES_SHARED

public static final java.lang.String PAGES_SHARED
See Also:
Constant Field Values

TITLE_DESKTOP_TILE

public static final java.lang.String TITLE_DESKTOP_TILE
See Also:
Constant Field Values

TITLE_DESKTOP_SCALE

public static final java.lang.String TITLE_DESKTOP_SCALE
See Also:
Constant Field Values

KEY_DESKTOP_NO_SCALE

public static final java.lang.String KEY_DESKTOP_NO_SCALE
See Also:
Constant Field Values

KEY_DESKTOP_MAXIMUM

public static final java.lang.String KEY_DESKTOP_MAXIMUM
See Also:
Constant Field Values

TARGET_DESKTOP_TILE

public static final int TARGET_DESKTOP_TILE
See Also:
Constant Field Values

TARGET_DESKTOP_SCALE

public static final int TARGET_DESKTOP_SCALE
See Also:
Constant Field Values

PANE_LEFT

public static final int PANE_LEFT
Pane layout constant

See Also:
Constant Field Values

PANE_UPPER

public static final int PANE_UPPER
Pane layout constant

See Also:
Constant Field Values

PANE_RIGHT

public static final int PANE_RIGHT
Pane layout constant

See Also:
Constant Field Values

PANE_LOWER

public static final int PANE_LOWER
Pane layout constant

See Also:
Constant Field Values

PANE_SPLIT_VERTICAL

public static final int PANE_SPLIT_VERTICAL
Pane layout constant

See Also:
Constant Field Values

PANE_SPLIT_HORIZONTAL

public static final int PANE_SPLIT_HORIZONTAL
Pane layout constant

See Also:
Constant Field Values

PANE_LAYOUT

public static final int PANE_LAYOUT
Pane layout constant

See Also:
Constant Field Values

PANE_SHOW

public static final int PANE_SHOW
Pane layout constant

See Also:
Constant Field Values

PANE_ACTIVE

public static final int PANE_ACTIVE
Pane layout constant

See Also:
Constant Field Values

PANE_DIALOG

public static final int PANE_DIALOG
Pane layout constant

See Also:
Constant Field Values

PANE_LAST

public static final int PANE_LAST
Pane layout constant

See Also:
Constant Field Values

PANE_ACTIVE_MAXIMISE

public static final int PANE_ACTIVE_MAXIMISE
Pane layout constant

See Also:
Constant Field Values

PANE_ACTIVE_RESTORE

public static final int PANE_ACTIVE_RESTORE
Pane layout constant

See Also:
Constant Field Values

PANE_KEY_FLIP

public static final java.lang.String PANE_KEY_FLIP
State storage key element

See Also:
Constant Field Values

PANE_KEY_SPLITS

public static final java.lang.String PANE_KEY_SPLITS
State storage key element

See Also:
Constant Field Values

PANE_RESET

public static final java.lang.String PANE_RESET
State storage key element

See Also:
Constant Field Values

PANE_FLIP

public static final java.lang.String PANE_FLIP
State storage key element

See Also:
Constant Field Values

PANE_KEY_TAB_AND_HIDE

public static final java.lang.String PANE_KEY_TAB_AND_HIDE
State storage key element

See Also:
Constant Field Values

PANE_KEY_ASK

public static final java.lang.String PANE_KEY_ASK
State storage key element

See Also:
Constant Field Values

PANE_KEY_DEFAULT

public static final java.lang.String PANE_KEY_DEFAULT
State storage key element

See Also:
Constant Field Values

TABLE_KEY_COLUMNS

public static final java.lang.String TABLE_KEY_COLUMNS
State storage key element

See Also:
Constant Field Values

STATE_NODE_AREA

public static final java.lang.String STATE_NODE_AREA
State storage key element

See Also:
Constant Field Values
Constructor Detail

AreaFacets

public AreaFacets(facets.facet.FacetsCore core,
                  AppValues values)
Method Detail

panes

public SFacet panes(SAreaTarget area,
                    SFacet[] contents,
                    java.lang.String title,
                    java.lang.String hints,
                    int aspect)
Convenience method to define a pane set with a single root.

Duplicates panes(SAreaTarget, SFacet[], String, String, int[][], double[], int[], String[]) with constructed parameters.

Parameters:
aspect - one of PANE_SPLIT_HORIZONTAL or PANE_SPLIT_HORIZONTAL

panes

public SFacet panes(SAreaTarget area,
                    SFacet[] contents,
                    java.lang.String title,
                    java.lang.String hints,
                    int[] layout,
                    double[] splitDefaults,
                    int[] tabAndHideDefaults)
Convenience method to define a pane set with a single root.

Duplicates panes(SAreaTarget, SFacet[], String, String, int[][], double[], int[], String[]) with a single-member int[][].

Parameters:
layout - codes defining the layout of the single root

panes

public SFacet panes(SAreaTarget area,
                    SFacet[] contents,
                    java.lang.String title,
                    java.lang.String hints,
                    int[][] codes,
                    double[] splitDefaults,
                    int[] tabAndHideDefaults,
                    java.lang.String[] groups)
Builds pane set based on a sashed mount.

The mount is attached to area; the members of contents must be be attached to its children.

The int[] members of codes each define a layout as decribed below. Any int[] member after the first defines a layout within the next available child defined by the first.

Layouts are defined as follows using PANE_ and SPLIT_ constants:

Parameters:
area - holds the children
contents - are attached to the children
title - may be used as key to store sash state
hints - may be HINT_PANEL_HAS_TOOLS
codes - define a tree of sash splits using SASH_ constants as described above
splitDefaults - defines default weightings for each left/upper split pane
tabAndHideDefaults - panes to be hidden initially, preceded by root areas to set children in tabs
groups -
Returns:
the mount built

panesGetTargets

public STarget panesGetTargets(SAreaTarget area)

panesValidateLayout

public void panesValidateLayout(SAreaTarget area)

attachViewerAreaPanes

public void attachViewerAreaPanes(SAreaTarget area,
                                  int splitAspect,
                                  ViewerAreaMaster vam)
Convenience method that creates and lays out viewer areas.

Parameters:
area - containing at least one viewer area meeting the contract of ViewerContenter.newContentViewers
splitAspect - passed where required to panes(SAreaTarget, SFacet[], String, String, int)
vam - may be null in which case a default is constructed

viewerArea

public SFacet viewerArea(SAreaTarget area,
                         ViewerAreaMaster vam)
Creates a viewer facet for the viewer frame contained by an area.

The facet, with an avatar pane defined by vam, is attached to the ViewerTarget returned by SAreaTarget.activeFacet() in area.

The facet returned contains the viewer facet and is accessible as SAreaTarget.attachedFacet()in area; it manages the toolkit container of the avatar pane.


viewerAreaChildren

public SFacet[] viewerAreaChildren(SAreaTarget area,
                                   ViewerAreaMaster vam)
Convenience method that creates viewers for an array of area children.


attachFacetArea

public void attachFacetArea(SFacet facet,
                            SAreaTarget area)

viewerGrid

public SFacet viewerGrid(SAreaTarget area,
                         ViewerAreaMaster vam)

viewerTabs

public SFacet viewerTabs(SAreaTarget area,
                         ViewerAreaMaster vam)

mount

public MountFacet mount(SAreaTarget area,
                        java.lang.String hints)
Attaches a MountFacet to the area passed.

Returns:
the mount attached

tabs

public final MountFacet tabs(SAreaTarget area,
                             java.lang.String hints)

switchMount

public final MountFacet switchMount(SAreaTarget area)
Create a programmatically switchable container for facets in an area tree.

The container will be switchable programmatically but not within the GUI eg a card layout.

Parameters:
area - will have attached a MountFacet managing a container for those in turn managed by the SFacets attached to the FacetedTarget members of its IndexingTarget.indexableTargets().

appMultiContentFacet

public MountFacet appMultiContentFacet(ActionAppSurface app,
                                       SAreaTarget surfaceRoot,
                                       boolean desktop)
Constructs the root facet of a multi-content application surface.

If the widget kit has the capacity to do so, may construct this root as

Parameters:
app - the app
surfaceRoot - the surface root
desktop - requests that the root be created as an internal desktop, with internal windows attached to the children of surfaceRoot