|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--gumbo.visualize.data.layout.WholeLayoutEngine
Abstract base class for layout engines that manage a whole layout and its view. The whole layout engine is responsible for laying out the parts in a whole using a particular style of layout. Initialization and display of the layout whole and its parts is the responsibility of the layout whole and parts. Includes support for controlling and animating the layout process in an application GUI.
View layout is distinct from that of the graphics technology (e.g. Swing layout manager) to avoid graphics dependencies, and to promote efficiency and specialization. Efficiency is gained by laying out the part views (typically a highly iterative process) without updating or realizing the display state of the corresponding graphic shapes until the layout is complete.
Nested Class Summary | |
static class |
WholeLayoutEngine.LayoutAction
A Swing action that calls a layout engine's doLayout(). |
Constructor Summary | |
WholeLayoutEngine(LayoutWholeView whole)
|
Method Summary | |
void |
doLayout()
Called by the client or system to update the whole view layout and show the result. |
protected void |
doLayoutWork()
Performs the whole view layout and display work for doLayout(). |
double |
getAnimationSpeed()
Gets the animation speed factor. |
int |
getDimensionality()
Gets the dimensionality of the layout. |
int[] |
getDimensionMap()
Maps layout order of precedence (layout space dimension) to graphic space dimension. |
int[] |
getDirectionMap()
Maps layout order of precedence (layout space dimension) to layout direction (+1, 0, -1). |
LayoutWholeView |
getLayoutWholeView()
Gets the whole layout view being managed by this engine. |
protected abstract void |
realizeDisplay()
Implemented by subclasses to show the results of the layout generated by realizeLayout(), by transfering the layout state to the part view graphics, and making any changes visible in the whole view graphic. |
protected abstract void |
realizeLayout()
Implemented by subclasses to perform the layout of the whole view's part views. |
void |
setAnimationSpeed(double speed)
Sets the animation speed factor, which scales the delay time between animation frames. |
void |
setDirections(int firstDir,
int secondDir,
int thirdDir)
Sets the layout direction in order of precedence (layout space). |
protected void |
showLayoutFrame(long frameTime)
If animation is enabled (see setAnimationSpeed()), shows the current layout using realizeDisplay() and then sleeps for the frame time multiplied by the animation speed factor. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public WholeLayoutEngine(LayoutWholeView whole)
whole
- The layout whole view managed by this layout engine.
Represents the input data model to be laid out and the whole view
used for display of the layout. The layout engine will never
modify the data model, but it may modify its view by adding
part views. Never null.Method Detail |
public LayoutWholeView getLayoutWholeView()
public void setDirections(int firstDir, int secondDir, int thirdDir)
firstDir
- Highest order layout direction (Layout.DIRECTION_???).secondDir
- Middle order layout direction (Layout.DIRECTION_???).thirdDir
- Lowest order layout direction (Layout.DIRECTION_???).
java.lang.IllegalStateException
- A precedence or dimension has not
been specified, a non-none direction occurs after a none one, or
the dimensionality is less than 1.public int getDimensionality()
public int[] getDimensionMap()
public int[] getDirectionMap()
public void setAnimationSpeed(double speed)
speed
- Speed factor. Defaults to 0.0, with animation disabled.public double getAnimationSpeed()
public void doLayout()
java.lang.IllegalStateException
- The whole is null. Use
setLayoutSpaceTransform() to set it.protected void doLayoutWork()
protected void showLayoutFrame(long frameTime)
frameTime
- The frame time (milliseconds). Zero if <0.protected abstract void realizeLayout()
protected abstract void realizeDisplay()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |