org.gicentre.treemappa
Class TreeMapProperties

java.lang.Object
  extended by org.gicentre.treemappa.TreeMapProperties

public class TreeMapProperties
extends java.lang.Object

Provides a persistent store of all treeMappa configuration options such as layout, text colours etc. This can be instantiated at run time, saved to and loaded from a file and passed to a TreeMappa object.

Version:
3.0, 23rd March, 2011.
Author:
Jo Wood, giCentre.

Constructor Summary
TreeMapProperties()
          Creates a default set of treeMappa properties.
 
Method Summary
 java.lang.String[] getAlignments()
          Provides a set of ordered alignment settings for each level of the treemap hierarchy.
 boolean getAllowVerticalLabels()
          Reports whether or not labels can have vertical text.
 java.awt.Color getBorderColour()
          Provides the colour used to display borders
 double[] getBorders()
          Provides a set of ordered border width settings for each level of the treemap hierarchy.
 float[] getBranchMaxTextSizes()
          Provides a set of ordered maximum branch text size settings for each level of the treemap hierarchy.
 java.awt.Color[] getBranchTextColours()
          Provides a set of ordered branch text colour settings for each level of the treemap hierarchy.
 java.lang.String[] getBranchTextFonts()
          Provides a set of ordered branch text font names for each level of the treemap hierarchy.
 float[] getBranchVectorWidths()
          Provides a set of ordered vector width settings for each level of the treemap hierarchy.
 java.lang.String getConfigFileName()
          Provides the name of the file used to save this configuration or null if not to be saved.
 java.lang.String getCTableFileName()
          Provides the name of the file used for the treemap colour table.
 java.lang.String getFileType()
          Provides the file type used for defining the hierarchy.
 double getHeight()
          Provides the height of the treemap in pixels.
 java.lang.String getImageFileName()
          Provides the name of the file used for image output.
 java.lang.String getInFileName()
          Provides the name of the file used for defining the hierarchy.
 boolean getIsTransparent()
          Reports whether or not transparency should be used when constructing the treemap graphic.
 boolean getIsVerbose()
          Reports whether or not verbose reporting of progress is required.
 boolean getLabelBranches()
          Reports whether or not branches are to be labelled.
 boolean getLabelLeaves()
          Reports whether or not leaves are to be labelled.
 java.lang.String[] getLayouts()
          Provides a set of ordered layout settings for each level of the treemap hierarchy.
 float getLeafMaxTextSize()
          Provides the maximum leaf text size pixels.
 java.awt.Color getLeafTextColour()
          Provides the colour used to display leaf labels.
 java.lang.String getLeafTextFont()
          Provides the name of the font used to display leaf labels.
 float getLeafVectorWidth()
          Provides the width of leaf displacement vectors in pixels.
 float getMutation()
          Provides the mutation index that controls the degree of colour mutation when using evolutionary colour scheme.
 java.lang.String getOutFileName()
          Provides the name of the file used for treemap coordinate output.
 int getRandColourLevel()
          Provides the level at which random colour mutation should occur when using an evolutionary colour scheme.
 long getSeed()
          Provides the random seed when using an evolutionary colour scheme.
 boolean getShowArrowHead()
          Reports whether or not arrow heads are to be drawn on displacement vectors.
 boolean[] getShowBranchDisplacements()
          Provides a set of branch displacement display settings for each level of the treemap hierarchy.
 boolean getShowLeafDisplacement()
          Reports whether or not leaf displacement vectors are to be drawn.
 boolean getShowStatistics()
          Reports whether or not treemap statistics are to be reported.
 boolean getShowTreeView()
          Reports whether or not a collapsable tree view is to be shown.
 boolean getTextOnly()
          Reports whether or not text only output is required.
 boolean getUseLabels()
          Reports whether or not labels are used to define the treemap hierarchy.
 double getWidth()
          Provides the width of the treemap in pixels.
 boolean load(java.io.InputStream inStream)
          Loads a set of treemappa configuration options from an XML file from the given input stream.
 boolean load(java.lang.String fileName)
          Loads a set of treemappa configuration options from an XML file with the given name.
 boolean save(java.lang.String fileName)
          Saves these treeMappa properties to an XML file with the given name.
 boolean setParameter(java.lang.String key, java.lang.String value)
          Sets the given property with the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeMapProperties

public TreeMapProperties()
Creates a default set of treeMappa properties.

Method Detail

setParameter

public boolean setParameter(java.lang.String key,
                            java.lang.String value)
Sets the given property with the given value. All values are treated as strings even if they represent numeric or boolean parameters. Values are case-insensitive with the exception of file names and text labels.

Parameters:
key - Parameter whose value is to be set.
value - Value of parameter.
Returns:
True if the parameter and its value are valid.

save

public boolean save(java.lang.String fileName)
Saves these treeMappa properties to an XML file with the given name.

Parameters:
fileName - Name of XML file to store the treemappa configuration options.
Returns:
True if properties saved without problems.

load

public boolean load(java.lang.String fileName)
Loads a set of treemappa configuration options from an XML file with the given name. The options all have defaults so the configuration file need only contain non-default options.

Parameters:
fileName - Name of XML file from which to retrieve the treemappa configuration.
Returns:
True if configuration file loaded without problems.

load

public boolean load(java.io.InputStream inStream)
Loads a set of treemappa configuration options from an XML file from the given input stream. The options all have defaults so the configuration file need only contain non-default options.

Parameters:
inStream - Input stream containing the XML file from which to retrieve the treemappa configuration.
Returns:
True if configuration file loaded without problems.

getTextOnly

public boolean getTextOnly()
Reports whether or not text only output is required.

Returns:
True if only text output is to be used.

getShowArrowHead

public boolean getShowArrowHead()
Reports whether or not arrow heads are to be drawn on displacement vectors.

Returns:
True if arrow heads are to be drawn on displacement vectors.

getShowLeafDisplacement

public boolean getShowLeafDisplacement()
Reports whether or not leaf displacement vectors are to be drawn.

Returns:
True if leaf displacement vectors are to be drawn.

getIsVerbose

public boolean getIsVerbose()
Reports whether or not verbose reporting of progress is required.

Returns:
True if verbose progress reports are requested.

getShowStatistics

public boolean getShowStatistics()
Reports whether or not treemap statistics are to be reported.

Returns:
True if treemap statistics are to be reported.

getShowTreeView

public boolean getShowTreeView()
Reports whether or not a collapsable tree view is to be shown.

Returns:
True if a collapsable tree view is to be shown.

getLabelLeaves

public boolean getLabelLeaves()
Reports whether or not leaves are to be labelled.

Returns:
True if leaves are to have labels.

getLabelBranches

public boolean getLabelBranches()
Reports whether or not branches are to be labelled.

Returns:
True if branches are to have labels.

getAllowVerticalLabels

public boolean getAllowVerticalLabels()
Reports whether or not labels can have vertical text.

Returns:
True if labels can have vertical text when inside tall thin rectangles.

getIsTransparent

public boolean getIsTransparent()
Reports whether or not transparency should be used when constructing the treemap graphic.

Returns:
True transparency is used in rendering graphics.

getUseLabels

public boolean getUseLabels()
Reports whether or not labels are used to define the treemap hierarchy.

Returns:
True if labels are used to define the treemap hierarchy.

getRandColourLevel

public int getRandColourLevel()
Provides the level at which random colour mutation should occur when using an evolutionary colour scheme.

Returns:
Hierarchy level at which random colour mutation can occur.

getSeed

public long getSeed()
Provides the random seed when using an evolutionary colour scheme. If the seed is not zero, the same random colours will be used on subsequent renderings of the same treemap data. The particular colours will be dependent on that seed value. If zero, a different random sequence is used each time.

Returns:
Hierarchy level at which random colour mutation can occur.

getLeafTextColour

public java.awt.Color getLeafTextColour()
Provides the colour used to display leaf labels.

Returns:
Colour used to display leaf labels.

getLeafTextFont

public java.lang.String getLeafTextFont()
Provides the name of the font used to display leaf labels.

Returns:
Font used to display leaf labels.

getBorderColour

public java.awt.Color getBorderColour()
Provides the colour used to display borders

Returns:
Colour used to display borders.

getWidth

public double getWidth()
Provides the width of the treemap in pixels.

Returns:
Width of the treemap in pixels.

getHeight

public double getHeight()
Provides the height of the treemap in pixels.

Returns:
Height of the treemap in pixels.

getLeafVectorWidth

public float getLeafVectorWidth()
Provides the width of leaf displacement vectors in pixels.

Returns:
Width of the leaf displacement vectors in pixels.

getLeafMaxTextSize

public float getLeafMaxTextSize()
Provides the maximum leaf text size pixels.

Returns:
Maximum leaf text size in pixels.

getMutation

public float getMutation()
Provides the mutation index that controls the degree of colour mutation when using evolutionary colour scheme.

Returns:
Mutation index between 0 (inherits parent colour exactly) and 1 (independent of parent colour).

getFileType

public java.lang.String getFileType()
Provides the file type used for defining the hierarchy.

Returns:
Type of file format used to represent hierarchy.

getInFileName

public java.lang.String getInFileName()
Provides the name of the file used for defining the hierarchy.

Returns:
Name of file used to represent hierarchy.

getOutFileName

public java.lang.String getOutFileName()
Provides the name of the file used for treemap coordinate output.

Returns:
Name of file used for coordinates output or null if not defined.

getImageFileName

public java.lang.String getImageFileName()
Provides the name of the file used for image output.

Returns:
Name of file used for image output or null if not defined.

getCTableFileName

public java.lang.String getCTableFileName()
Provides the name of the file used for the treemap colour table.

Returns:
Name of file used for the treemap colour table or null if not defined.

getConfigFileName

public java.lang.String getConfigFileName()
Provides the name of the file used to save this configuration or null if not to be saved. Note that unlike all other properties, this option is never itself saved to disk.

Returns:
Name of file used for saving configuration options or null if not defined.

getLayouts

public java.lang.String[] getLayouts()
Provides a set of ordered layout settings for each level of the treemap hierarchy.

Returns:
Ordered collection of layout settings.

getAlignments

public java.lang.String[] getAlignments()
Provides a set of ordered alignment settings for each level of the treemap hierarchy.

Returns:
Ordered collection of alignment settings.

getBorders

public double[] getBorders()
Provides a set of ordered border width settings for each level of the treemap hierarchy.

Returns:
Ordered collection of border width settings.

getBranchMaxTextSizes

public float[] getBranchMaxTextSizes()
Provides a set of ordered maximum branch text size settings for each level of the treemap hierarchy.

Returns:
Ordered collection of maximum branch text size settings.

getBranchTextColours

public java.awt.Color[] getBranchTextColours()
Provides a set of ordered branch text colour settings for each level of the treemap hierarchy.

Returns:
Ordered collection of branch text colour settings.

getBranchTextFonts

public java.lang.String[] getBranchTextFonts()
Provides a set of ordered branch text font names for each level of the treemap hierarchy.

Returns:
Ordered collection of branch text font names.

getBranchVectorWidths

public float[] getBranchVectorWidths()
Provides a set of ordered vector width settings for each level of the treemap hierarchy.

Returns:
Ordered collection of vector width settings.

getShowBranchDisplacements

public boolean[] getShowBranchDisplacements()
Provides a set of branch displacement display settings for each level of the treemap hierarchy.

Returns:
Ordered collection of branch displacement display settings.


treeMappa V.3.0.1, API documentation generated 4th April, 2011