facets.facet.app
Class FacetDialogSurface

java.lang.Object
  extended by facets.util.Tracer
      extended by facets.core.app.DialogSurface
          extended by facets.facet.app.FacetDialogSurface
All Implemented Interfaces:
SSurface, Notifiable, Titled
Direct Known Subclasses:
FacetDialogSurface.MultiPaged

public abstract class FacetDialogSurface
extends DialogSurface

DialogSurface with attached FacetFactory.

Declared abstract to enable use of classname in values keys.


Nested Class Summary
static class FacetDialogSurface.MultiPaged
          FacetDialogSurface for multi-page dialogs.
 
Nested classes/interfaces inherited from class facets.core.app.DialogSurface
DialogSurface.Contenter, DialogSurface.ContentRoot, DialogSurface.DialogActions
 
Field Summary
protected  FacetFactory ff
           
static int MULTI_AREA_PAGES
           
static int MULTI_AREA_TREE
           
 
Fields inherited from class facets.core.app.DialogSurface
app, AT_NOT_SET, TRIMMINGS_TAB, TRIMMINGS_TREE
 
Constructor Summary
FacetDialogSurface(FacetAppSurface app, DialogHost host, java.lang.String title, DialogSurface.DialogActions actions, DialogSurface.Contenter[] contents)
           
 
Method Summary
 void addExtensionPanel(SFacet panel, boolean atSide)
           
protected  void attachPageFacet(SAreaTarget panel)
          Attach a suitable facet to this page area.
protected  void attachSurfaceRootFacets(SAreaTarget root)
          Attach suitable facets to the dialog area root and its children.
static java.awt.Point calculateSmartDialogAt(java.awt.Dimension box, SHost host)
           
 SHost host()
           
 void hostWindowDismissed(java.awt.Rectangle closingBounds, double factor)
           
 boolean isResizable()
           
protected  SAreaTarget[] newContentPages(DialogSurface.Contenter[] contents, SAreaTarget[] contentRoots)
          Create at least one dialog page.
protected  SFacet newControlButtons(STargeter link)
          Create facet managing the top-level dialog control buttons.
static Dialogs.Surfacer newDefaultPagedSurfacer(DialogSurface.Contenter[] apps, DialogSurface.Contenter[] debugs)
          Convenience method for creating a paged dialog controlled by a tree or list view.
static Dialogs.Surfacer newDefaultTabbedSurfacer()
          Convenience method for creating a tabbed dialog.
protected  SFacet newExtras(AreaTargeter targeter)
           
protected  SView newPagesTreeView(TypedNode[] treeNodes)
          Create a view for the page tree.
protected static TypedNode newPageTreeNode(SAreaTarget page, TypedNode... children)
          Creates a node for a page selection tree.
protected  TypedNode[] newPageTreeNodes(SAreaTarget[] pages)
          Creates the top-level children of a page selection tree.
 void notify(Notice notice)
          Overrides superclass method.
 java.awt.Rectangle scaledLaunchBounds(double factor)
           
 AreaTargeter surfaceRootTargeter()
           
 java.lang.String title()
          Return human-readable identifying text.
protected  void traceOutput(java.lang.String msg)
          Outputs complete trace messages to console or elsewhere.
 
Methods inherited from class facets.core.app.DialogSurface
buildRetargeted, contents, contentsKey, contentsMatch, dismissHostWindow, findDialogTrigger, findRootArea, getLaunchBounds, hostWindowDismissed, isMultiPage, persistBoundsState, replaceContents
 
Methods inherited from class facets.util.Tracer
trace, trace, trace, trace, trace, traceDebug, traceDebug, traceObjectText, traceOutputWithClass
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface facets.core.superficial.app.SSurface
host, surfaceRootTargeter
 
Methods inherited from interface facets.util.Titled
title
 

Field Detail

ff

protected final FacetFactory ff

MULTI_AREA_TREE

public static final int MULTI_AREA_TREE
See Also:
Constant Field Values

MULTI_AREA_PAGES

public static final int MULTI_AREA_PAGES
See Also:
Constant Field Values
Constructor Detail

FacetDialogSurface

public FacetDialogSurface(FacetAppSurface app,
                          DialogHost host,
                          java.lang.String title,
                          DialogSurface.DialogActions actions,
                          DialogSurface.Contenter[] contents)
Method Detail

attachSurfaceRootFacets

protected void attachSurfaceRootFacets(SAreaTarget root)
Attach suitable facets to the dialog area root and its children.

Parameters:
root - contains either a single page area returned by newContentPages(DialogSurface.Contenter[], SAreaTarget[]) or viewer and switching areas managing multiple page areas

attachPageFacet

protected final void attachPageFacet(SAreaTarget panel)
Attach a suitable facet to this page area.

Parameters:
panel - was returned by newContentPages(DialogSurface.Contenter[], SAreaTarget[]) and will not itself be a content root.

newControlButtons

protected final SFacet newControlButtons(STargeter link)
Create facet managing the top-level dialog control buttons.

Parameters:
link - will match the elements returned by lazyTriggerGroup()
Returns:
a SFacet[] with at least one member

scaledLaunchBounds

public final java.awt.Rectangle scaledLaunchBounds(double factor)

hostWindowDismissed

public final void hostWindowDismissed(java.awt.Rectangle closingBounds,
                                      double factor)

isResizable

public boolean isResizable()

addExtensionPanel

public void addExtensionPanel(SFacet panel,
                              boolean atSide)

notify

public void notify(Notice notice)
Overrides superclass method.

Notices with Notifying.Impact.FLASH are ignored

Specified by:
notify in interface Notifiable
Overrides:
notify in class DialogSurface

newExtras

protected SFacet newExtras(AreaTargeter targeter)

traceOutput

protected void traceOutput(java.lang.String msg)
Description copied from class: Tracer
Outputs complete trace messages to console or elsewhere.

Default prepends helpful classname to message.

Overrides:
traceOutput in class Tracer
Parameters:
msg - passed from one of the public methods

newDefaultTabbedSurfacer

public static Dialogs.Surfacer newDefaultTabbedSurfacer()
Convenience method for creating a tabbed dialog.

Returns:
Dialogs.Surfacer that will created an appropriate FacetDialogSurface

newDefaultPagedSurfacer

public static Dialogs.Surfacer newDefaultPagedSurfacer(DialogSurface.Contenter[] apps,
                                                       DialogSurface.Contenter[] debugs)
Convenience method for creating a paged dialog controlled by a tree or list view.

Parameters:
apps - contenters creating pages to appear directly under the tree root
debugs - contenters creating pages to appear under a child root created from the first member which must be titled FacetPreferences.TITLE_HEADER
Returns:
Dialogs.Surfacer that will create a FacetDialogSurface with a private implementation of DialogPages.newPageTreeNodes(SAreaTarget[]) creating an appropriate tree.

calculateSmartDialogAt

public static java.awt.Point calculateSmartDialogAt(java.awt.Dimension box,
                                                    SHost host)

newContentPages

protected SAreaTarget[] newContentPages(DialogSurface.Contenter[] contents,
                                        SAreaTarget[] contentRoots)
Create at least one dialog page.

Where the implementation returns a multi-member array,

The default implementation defines a single-page dialog by returning a single-member array containing:

Parameters:
contents - passed during construction or to DialogSurface.replaceContents(DialogSurface.Contenter[]); may be queried for additional information such as page titles
contentRoots - were created from contents
Returns:
an SAreaTarget[] with at least one member

newPageTreeNodes

protected TypedNode[] newPageTreeNodes(SAreaTarget[] pages)
Creates the top-level children of a page selection tree.

Children created will be passed to newPagesTreeView(TypedNode[]) which should be reimplemented to define a viewer for the tree.

The default implementation returns an array constructed from panelAreas using newPageTreeNode(SAreaTarget,TypedNode[]) and suitable for a list viewer; this method can also be used to created more complex trees.

Parameters:
pages - were returned from newContentPages(DialogSurface.Contenter[], SAreaTarget[])

newPagesTreeView

protected SView newPagesTreeView(TypedNode[] treeNodes)
Create a view for the page tree.

The SView returned should define a suitable viewer for the tree defined by treeNodes, which were returned by newPageTreeNodes(SAreaTarget[]).

Default implementation is an invalid stub.

Parameters:
treeNodes - will have at least two members

surfaceRootTargeter

public final AreaTargeter surfaceRootTargeter()

title

public final java.lang.String title()
Description copied from interface: Titled
Return human-readable identifying text.

Specified by:
title in interface Titled
Returns:
non-null, non-empty string with no structural whitespace

newPageTreeNode

protected static final TypedNode newPageTreeNode(SAreaTarget page,
                                                 TypedNode... children)
Creates a node for a page selection tree.

The node returned will

Parameters:
page - should be an area tree defining the layout of a dialog page
children - to appear in a tree viewer below the node created; themselves created using this method

host

public final SHost host()