edu.cs.ai.kreator.control.config
Class ConfigurationObject

java.lang.Object
  extended by edu.cs.ai.kreator.control.config.ConfigurationObject
Direct Known Subclasses:
ConfigurationCategory, ConfigurationOption

public abstract class ConfigurationObject
extends java.lang.Object

This abstract class is the common ancestor for configuration category and configuration option and comprises of common methods and attributes.

Author:
Matthias Thimm

Field Summary
static int IS_EDITABLE
          Static constant for a configuration object to be editable.
static int IS_INVISIBLE
          Static constant for a configuration object to be invisible.
static int IS_NOT_EDITABLE
          Static constant for a configuration object to be not editable.
static int IS_VISIBLE
          Static constant for a configuration object to be visible.
static java.lang.String PATHCAPTION_DELIMITER
          The delimiter used for path captions.
static java.lang.String PATHID_DELIMITER
          The delimiter used for path ids.
 
Constructor Summary
protected ConfigurationObject()
          Standard constructor for compatibility.
  ConfigurationObject(java.lang.String id, java.lang.String caption, java.lang.String description)
          Creates a new configuration object with the given caption and id, that is both visible and editable and has no parent.
  ConfigurationObject(java.lang.String id, java.lang.String caption, java.lang.String description, int visible, int editable)
          Creates a new configuration object with the given id, caption, the given visibility, the given editibility, and no parent.
 
Method Summary
 java.lang.String getCaption()
          Returns the caption of this configuration object.
 java.lang.String getDescription()
          Returns the description of this configuration object.
 java.lang.String getId()
          Returns the id of this configuration object.
 ConfigurationCategory getParent()
          Returns the parent of this configuration object.
 java.lang.String getPathCaption()
          Returns the full quantified path caption of this configuration object, e.g., it returns "Cat 1 -> Cat 2 -> Cat 3" if this configuration object is "Cat 1", its parent is "Cat 2", "Cat 2"'s parent is "Cat 1", and "Cat 1" has no parent.
 java.lang.String getPathId()
          Returns the full quantified path id of this configuration object, e.g., it returns "A.B.C" if this configuration object is "C", its parent is "B", "B"'s parent is "A", and "A" has no parent.
 boolean hasParent()
          Checks whether this configuration object has a parent.
 boolean isEditable()
          Checks whether this configuration object is editable.
 boolean isVisible()
          Checks whether this configuration object is visible.
protected  void setParent(ConfigurationCategory parent)
          Sets the parent configuration category of this configuration object.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

IS_VISIBLE

public static final int IS_VISIBLE
Static constant for a configuration object to be visible.

See Also:
Constant Field Values

IS_INVISIBLE

public static final int IS_INVISIBLE
Static constant for a configuration object to be invisible.

See Also:
Constant Field Values

IS_EDITABLE

public static final int IS_EDITABLE
Static constant for a configuration object to be editable.

See Also:
Constant Field Values

IS_NOT_EDITABLE

public static final int IS_NOT_EDITABLE
Static constant for a configuration object to be not editable.

See Also:
Constant Field Values

PATHID_DELIMITER

public static final java.lang.String PATHID_DELIMITER
The delimiter used for path ids.

See Also:
Constant Field Values

PATHCAPTION_DELIMITER

public static final java.lang.String PATHCAPTION_DELIMITER
The delimiter used for path captions.

See Also:
Constant Field Values
Constructor Detail

ConfigurationObject

protected ConfigurationObject()
Standard constructor for compatibility. Never call directly.


ConfigurationObject

public ConfigurationObject(java.lang.String id,
                           java.lang.String caption,
                           java.lang.String description)
Creates a new configuration object with the given caption and id, that is both visible and editable and has no parent.

Parameters:
id - The id of this configuration object.
description - The description of this configuration object.
caption - The caption of this configuration object

ConfigurationObject

public ConfigurationObject(java.lang.String id,
                           java.lang.String caption,
                           java.lang.String description,
                           int visible,
                           int editable)
Creates a new configuration object with the given id, caption, the given visibility, the given editibility, and no parent.

Parameters:
id - The id of this configuration object.
caption - The caption of this configuration object.
description - The description of this configuration object.
visible - whether this configuration object is visible (one of ConfigurationObject.IS_VISIBLE, ConfigurationObject.IS_INVISIBLE).
editable - whether this configuration object is editable (one of ConfigurationObject.IS_EDITABLE, ConfigurationObject.IS_NOT_EDITABLE).
Method Detail

setParent

protected void setParent(ConfigurationCategory parent)
Sets the parent configuration category of this configuration object.

Parameters:
parent - a configuration category.

getPathId

public java.lang.String getPathId()
Returns the full quantified path id of this configuration object, e.g., it returns "A.B.C" if this configuration object is "C", its parent is "B", "B"'s parent is "A", and "A" has no parent.

Returns:
the path if of this configuration object.

getPathCaption

public java.lang.String getPathCaption()
Returns the full quantified path caption of this configuration object, e.g., it returns "Cat 1 -> Cat 2 -> Cat 3" if this configuration object is "Cat 1", its parent is "Cat 2", "Cat 2"'s parent is "Cat 1", and "Cat 1" has no parent.

Returns:
the path if of this configuration object.

getId

public java.lang.String getId()
Returns the id of this configuration object.

Returns:
the id of this configuration object.

getCaption

public java.lang.String getCaption()
Returns the caption of this configuration object.

Returns:
the caption of this configuration object.

getDescription

public java.lang.String getDescription()
Returns the description of this configuration object.

Returns:
the description of this configuration object.

getParent

public ConfigurationCategory getParent()
Returns the parent of this configuration object.

Returns:
the parent of this configuration object.

isVisible

public boolean isVisible()
Checks whether this configuration object is visible.

Returns:
"TRUE" if this configuration object is visible, "FALSE" otherwise.

isEditable

public boolean isEditable()
Checks whether this configuration object is editable.

Returns:
"TRUE" if this configuration object is editable, "FALSE" otherwise.

hasParent

public boolean hasParent()
Checks whether this configuration object has a parent.

Returns:
the parent of this configuration object.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object