cage
Class GeneratorInfo

java.lang.Object
  extended by cage.GeneratorInfo
Direct Known Subclasses:
StaticGeneratorInfo

public abstract class GeneratorInfo
extends java.lang.Object

Abstract class that represents the settings for a CaGe generator.


Field Summary
static int ALL_EXPERT_MODES
          The all expert mode constant.
static int EMBED_EXPERT
          The embed expert mode constant.
static int GENERATOR_EXPERT
          The generator expert mode constant.
static int NO_EXPERT_MODE
          The no expert modes constant.
 
Constructor Summary
GeneratorInfo()
           
 
Method Summary
static int createExpertMode(int inclusion, int exclusion)
          Creates an expert mode that both stores the included modes as the explicitly excluded modes.
 boolean expertModeContains(int modes, boolean defaultIncluded)
          TODO
 boolean expertModeExcludes(int modes)
          Returns whether the current expert modes exclude the given modes.
 boolean expertModeIncludes(int modes)
          Returns whether the current expert modes include the given modes.
abstract  ElementRule getElementRule()
          Returns the ElementRule to be used for graphs from this generator.
abstract  Embedder getEmbedder()
          Returns the embedder to be used for this generator.
 int getExcludedExpertModes()
          Returns the excluded expert modes.
abstract  int getExpertMode()
          Returns the expert mode of this generator.
abstract  java.lang.String getFilename()
          Returns the filename of the output file.
abstract  java.lang.String[][] getGenerator()
          Returns the generator.
 java.lang.String getGeneratorName()
          Returns the name of the generator.
 int getIncludedExpertModes()
          Returns the included expert modes.
abstract  int getMaxFacesize()
          Returns the maximum size of a face in the graphs from this generator.
abstract  boolean isReembed2DEnabled()
          Returns whether the 2D embedding can be reembedded with another face as outer face.
abstract  void setEmbedder(Embedder embedder)
          Sets the embedder to be used for this generator.
abstract  void setGenerator(java.lang.String[][] generator)
          Sets the generator.
 void setGeneratorName(java.lang.String generatorName)
          Sets the name of the generator
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NO_EXPERT_MODE

public static final int NO_EXPERT_MODE
The no expert modes constant.

See Also:
Constant Field Values

GENERATOR_EXPERT

public static final int GENERATOR_EXPERT
The generator expert mode constant. This can be combined with the other expert mode constants (except NO_EXPERT_MODES) for mixed modes. This mode will make the exact generator command visible.

See Also:
Constant Field Values

EMBED_EXPERT

public static final int EMBED_EXPERT
The embed expert mode constant. This can be combined with the other expert mode constants (except NO_EXPERT_MODES) for mixed modes. This mode will make the exact embedder commands visible.

See Also:
Constant Field Values

ALL_EXPERT_MODES

public static final int ALL_EXPERT_MODES
The all expert mode constant. This is a combination of the GENERATOR_EXPERT and the EMBED_EXPERT mode.

See Also:
Constant Field Values
Constructor Detail

GeneratorInfo

public GeneratorInfo()
Method Detail

getGenerator

public abstract java.lang.String[][] getGenerator()
Returns the generator. This generator consists of a 2-dimensional array of Strings. Each array of Strings represents a command and the different options needed for this command. These commands and their options are then piped together in the order that the arrays are organized in the array of arrays.

Returns:
An array of arrays of Strings representing the generator.

setGenerator

public abstract void setGenerator(java.lang.String[][] generator)
Sets the generator. This generator consists of a 2-dimensional array of Strings. Each array of Strings represents a command and the different options needed for this command. These commands and their options are then piped together in the order that the arrays are organized in the array of arrays.

Parameters:
generator - An array of arrays of Strings representing the generator.

getEmbedder

public abstract Embedder getEmbedder()
Returns the embedder to be used for this generator.

Returns:
The embedder for this generator.

setEmbedder

public abstract void setEmbedder(Embedder embedder)
Sets the embedder to be used for this generator.

Parameters:
embedder - The embedder for this generator.
See Also:
EmbedFactory

getFilename

public abstract java.lang.String getFilename()
Returns the filename of the output file.

Returns:
The filename of the output file.

getMaxFacesize

public abstract int getMaxFacesize()
Returns the maximum size of a face in the graphs from this generator. This may be zero if the maximum size is unknown.

Returns:
The maximum size of a face in an outputted graph, or 0 if unknown.

isReembed2DEnabled

public abstract boolean isReembed2DEnabled()
Returns whether the 2D embedding can be reembedded with another face as outer face. This affects the TwoView viewer's ability to react to mouse clicks inside a face, asking for a new embedding in which this face becomes the exterior one.

Returns:
true if reembedding is enable and false in the other case

getElementRule

public abstract ElementRule getElementRule()
Returns the ElementRule to be used for graphs from this generator.

Returns:
An ElementRule object.

getExpertMode

public abstract int getExpertMode()
Returns the expert mode of this generator.

Returns:
the expert mode of this generator
See Also:
createExpertMode(int, int)

setGeneratorName

public void setGeneratorName(java.lang.String generatorName)
Sets the name of the generator

Parameters:
generatorName - The generator name.
See Also:
getGeneratorName()

getGeneratorName

public java.lang.String getGeneratorName()
Returns the name of the generator.

Returns:
The generator name.
See Also:
setGeneratorName(java.lang.String)

createExpertMode

public static int createExpertMode(int inclusion,
                                   int exclusion)
Creates an expert mode that both stores the included modes as the explicitly excluded modes.

Parameters:
inclusion -
exclusion -
Returns:
A new expert mode containing the requested inclusions and exclusions.

getIncludedExpertModes

public int getIncludedExpertModes()
Returns the included expert modes. The difference with getExpertMode() is that this method only returns the included modes and thus returns one of NO_EXPERT_MODE, GENERATOR_EXPERT, EMBED_EXPERT and ALL_EXPERT_MODES.

Returns:
NO_EXPERT_MODE, GENERATOR_EXPERT, EMBED_EXPERT or ALL_EXPERT_MODES, depending on which mode is set.

getExcludedExpertModes

public int getExcludedExpertModes()
Returns the excluded expert modes. This method returns one of NO_EXPERT_MODE, GENERATOR_EXPERT, EMBED_EXPERT and ALL_EXPERT_MODES. For this method to work correct and keep working correct an expert mode should be created using createExpertMode(int,int).

Returns:
NO_EXPERT_MODE, GENERATOR_EXPERT, EMBED_EXPERT or ALL_EXPERT_MODES, depending on which modes are excluded.

expertModeIncludes

public boolean expertModeIncludes(int modes)
Returns whether the current expert modes include the given modes.

Parameters:
modes - The modes which need to be tested.
Returns:
true if the current mode includes modes, false otherwise

expertModeExcludes

public boolean expertModeExcludes(int modes)
Returns whether the current expert modes exclude the given modes.

Parameters:
modes - The modes which need to be tested.
Returns:
true if the current mode excludes modes, false otherwise

expertModeContains

public boolean expertModeContains(int modes,
                                  boolean defaultIncluded)
TODO

Parameters:
modes -
defaultIncluded -
Returns:
true if the current mode contains modes, false otherwise