org.ceryle.ui.graph
Class Composer

java.lang.Object
  extended by org.ceryle.ui.graph.Composer

public class Composer
extends Object

An processor class for to extract the spatial structure from a graph, and from this organize the composition of the selected Occurrences of those Topics into an XHTML document.

Since:
JDK1.4
Version:
$Id: Composer.java,v 3.12 2007-06-20 01:28:21 altheim Exp $
Author:
Murray Altheim

Field Summary
static int BIT_divmark
          Bitwise composer settings.
static int BIT_docfoot
          Bitwise composer settings.
static int BIT_dochead
          Bitwise composer settings.
static int BIT_doctoc
          Bitwise composer settings.
static int BIT_fragment
          Bitwise composer settings.
static int BIT_none
          Bitwise composer settings.
static int BIT_sectfoot
          Bitwise composer settings.
static int BIT_secthead
          Bitwise composer settings.
static int BIT_sectnums
          Bitwise composer settings.
static int BIT_secttoc
          Bitwise composer settings.
static int BIT_separate
          Bitwise composer settings.
protected  ColorLookupTable m_clut
          The current color lookup table (CLUT).
protected static int m_fuzzyX
          A value based on a ratio of a graph grid cell size, used in calculating horizontal fuzziness.
protected static int m_fuzzyY
          A value based on the vertical height of a TNode, used in calculating vertical fuzziness.
static String m_idPfx
          A String used as the prefix of auto-generated IDs.
 int m_sortMode
           
protected  org.ceryle.ui.graph.Composer.TNodeLoc m_topleft
          The top-left TNodeLoc of the graph, the starting position for traversal.
static int m_topLevel
          Top level heading level.
static String NL
           
protected  ProjectView pv
           
static int settings
          Bitwise composer settings.
static int SORT_X
           
static int SORT_XY
           
static int SORT_Y
           
static int STATUS_COMPLETE
           
static int STATUS_FAIL
           
static int STATUS_LOCATED
           
static int STATUS_LOCATING
           
static int STATUS_NONE
           
static int STATUS_OPENED
           
static int STATUS_OPENING
           
static int STATUS_PREPARED
           
static int STATUS_PREPARING
           
static int STATUS_WARN
           
static int STATUS_WRITING
           
static int STATUS_WRITTEN
           
static String stylesheetSystemId
           
protected  TMLayoutPanel tmlp
           
 
Constructor Summary
Composer(ProjectView pview, TMLayoutPanel tmlpanel)
          Constructor for a Composer, with the String identifier for the datatype supported by this Composer.
 
Method Summary
 void addCompositor(Topic topic)
          Adds a new Compositor provided with its Topic.
 void classify()
          Classify the visible nodes of the current graph.
 void compose()
          Compose and write the composed document to a file by calling the Compositors to deliver their Readers in sequence.
protected static boolean fuzzyXEq(int x1, int x2)
          Returns true if the two x values are within the horizontal fuzzy limits of being equal, calculated on the graph grid square size.
protected static boolean fuzzyYEq(int y1, int y2)
          Returns true if the two y values are within the vertical fuzzy limits of being equal, generally plus or minus the height of a graph node.
 boolean getSetting(int setting)
          Returns the specific bitwise composer setting as a boolean value.
 Color getStatusColor(int n)
          Returns the Color corresponding to the status number.
 String getStatusName(int n)
          Returns the name (description) corresponding to the status number.
 void prepare()
          Prepare the current Compositors', enabling their Readers.
 void processSequence()
          Compose a document based on the existing node sequence.
 void refresh()
          Refreshes the UI according to the current status.
 void setSetting(int setting, boolean value)
          Set the specific bitwise composer setting to the boolean value.
 void statusChanged(Compositor comp)
          Invoked to indicate a change in status of and by the provided Compositor.
protected  void writeDocTOC(Writer out)
          Write the document-level table of contents.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BIT_none

public static final int BIT_none
Bitwise composer settings.

See Also:
Constant Field Values

BIT_separate

public static final int BIT_separate
Bitwise composer settings.

See Also:
Constant Field Values

BIT_dochead

public static final int BIT_dochead
Bitwise composer settings.

See Also:
Constant Field Values

BIT_docfoot

public static final int BIT_docfoot
Bitwise composer settings.

See Also:
Constant Field Values

BIT_doctoc

public static final int BIT_doctoc
Bitwise composer settings.

See Also:
Constant Field Values

BIT_secthead

public static final int BIT_secthead
Bitwise composer settings.

See Also:
Constant Field Values

BIT_sectfoot

public static final int BIT_sectfoot
Bitwise composer settings.

See Also:
Constant Field Values

BIT_secttoc

public static final int BIT_secttoc
Bitwise composer settings.

See Also:
Constant Field Values

BIT_divmark

public static final int BIT_divmark
Bitwise composer settings.

See Also:
Constant Field Values

BIT_sectnums

public static final int BIT_sectnums
Bitwise composer settings.

See Also:
Constant Field Values

BIT_fragment

public static final int BIT_fragment
Bitwise composer settings.

See Also:
Constant Field Values

STATUS_FAIL

public static final int STATUS_FAIL
See Also:
Constant Field Values

STATUS_WARN

public static final int STATUS_WARN
See Also:
Constant Field Values

STATUS_NONE

public static final int STATUS_NONE
See Also:
Constant Field Values

STATUS_LOCATING

public static final int STATUS_LOCATING
See Also:
Constant Field Values

STATUS_LOCATED

public static final int STATUS_LOCATED
See Also:
Constant Field Values

STATUS_OPENING

public static final int STATUS_OPENING
See Also:
Constant Field Values

STATUS_OPENED

public static final int STATUS_OPENED
See Also:
Constant Field Values

STATUS_PREPARING

public static final int STATUS_PREPARING
See Also:
Constant Field Values

STATUS_PREPARED

public static final int STATUS_PREPARED
See Also:
Constant Field Values

STATUS_WRITING

public static final int STATUS_WRITING
See Also:
Constant Field Values

STATUS_WRITTEN

public static final int STATUS_WRITTEN
See Also:
Constant Field Values

STATUS_COMPLETE

public static final int STATUS_COMPLETE
See Also:
Constant Field Values

m_topLevel

public static int m_topLevel
Top level heading level. Default is 1, as in "<h1>".


m_idPfx

public static String m_idPfx
A String used as the prefix of auto-generated IDs.


m_fuzzyX

protected static int m_fuzzyX
A value based on a ratio of a graph grid cell size, used in calculating horizontal fuzziness.


m_fuzzyY

protected static int m_fuzzyY
A value based on the vertical height of a TNode, used in calculating vertical fuzziness.


m_topleft

protected org.ceryle.ui.graph.Composer.TNodeLoc m_topleft
The top-left TNodeLoc of the graph, the starting position for traversal.


settings

public static int settings
Bitwise composer settings.


m_clut

protected ColorLookupTable m_clut
The current color lookup table (CLUT).


tmlp

protected TMLayoutPanel tmlp

pv

protected ProjectView pv

NL

public static final String NL

stylesheetSystemId

public static String stylesheetSystemId

SORT_XY

public static final int SORT_XY
See Also:
Constant Field Values

SORT_X

public static final int SORT_X
See Also:
Constant Field Values

SORT_Y

public static final int SORT_Y
See Also:
Constant Field Values

m_sortMode

public int m_sortMode
Constructor Detail

Composer

public Composer(ProjectView pview,
                TMLayoutPanel tmlpanel)
Constructor for a Composer, with the String identifier for the datatype supported by this Composer. The string is used as the ID of a card within a cardlayout as well. Note that this abstract class does not set a LayoutManager for the JPanel.

Parameters:
pview - the parent ProjectView
tmlpanel - the TMLayoutPanel this Composer supports
Method Detail

setSetting

public void setSetting(int setting,
                       boolean value)
Set the specific bitwise composer setting to the boolean value.


getSetting

public boolean getSetting(int setting)
Returns the specific bitwise composer setting as a boolean value.


processSequence

public void processSequence()
Compose a document based on the existing node sequence.


addCompositor

public void addCompositor(Topic topic)
Adds a new Compositor provided with its Topic.


refresh

public void refresh()
Refreshes the UI according to the current status.


statusChanged

public void statusChanged(Compositor comp)
Invoked to indicate a change in status of and by the provided Compositor. The int value is one of the Composer.STATUS_* values.


getStatusColor

public Color getStatusColor(int n)
Returns the Color corresponding to the status number. These begin with 0.


getStatusName

public String getStatusName(int n)
Returns the name (description) corresponding to the status number.


prepare

public void prepare()
Prepare the current Compositors', enabling their Readers.


compose

public void compose()
Compose and write the composed document to a file by calling the Compositors to deliver their Readers in sequence. This also saves the current composer settings (though this is not stored to disk at this time, only the internal settings document).


writeDocTOC

protected void writeDocTOC(Writer out)
                    throws IOException
Write the document-level table of contents.

Throws:
IOException

classify

public void classify()
Classify the visible nodes of the current graph.


fuzzyXEq

protected static boolean fuzzyXEq(int x1,
                                  int x2)
Returns true if the two x values are within the horizontal fuzzy limits of being equal, calculated on the graph grid square size.


fuzzyYEq

protected static boolean fuzzyYEq(int y1,
                                  int y2)
Returns true if the two y values are within the vertical fuzzy limits of being equal, generally plus or minus the height of a graph node.



The Ceryle Project. Copyright ©2001-2007 Murray Altheim, All Rights Reserved. See LICENSE included with distribution.