data
Class Cluster

java.lang.Object
  extended by data.Cluster
All Implemented Interfaces:
java.io.Serializable

public class Cluster
extends java.lang.Object
implements java.io.Serializable

A group of Designs that can be displayed in a userspecified different color or removed from the display altogether, irrespective of the Filter settings.

Clusters enable the user to regroup the designs in logical subsets. This achieved by storing a reference to a Cluster in the Design instance. Whenever the Design is asked to which Cluster it belongs, it returns this reference. The Cluster then provides the information whether it is active (which determines whether the design should be displayed) and, if so, in which color the Design is displayed.

See Also:
Serialized Form

Field Summary
private  boolean active
          Specifies whether Designs belonging to this Cluster should be displayed.
private  java.awt.Color activeDesignColor
          The color in which Designs belonging to this Cluster are displayed.
private  java.lang.String name
          The Cluster name.
(package private) static boolean printLog
          Flag to enable debug message printing for this class.
(package private) static long serialVersionUID
          The version tracking unique identifier for Serialization.
private  int uniqueIdentificationNumber
          The unique identification number for tracking purposes in the ClusterSet.
private  UserPreferences userPreferences
          The user preferences.
 
Constructor Summary
Cluster(UserPreferences userPreferences, java.lang.String name, int uniqueIdentificationNumber)
          Instantiates a new cluster.
 
Method Summary
 void copySettingsTo(Cluster cluster)
          Copies settings of this Cluster to a given Cluster.
 Cluster duplicate()
          Returns a duplicated instance of this Cluster for use in an editing Buffer.
 java.awt.Color getActiveDesignColor()
          Gets the color in which Designs belonging to this Cluster are displayed.
 java.lang.String getName()
          Gets the Cluster name.
 int getUniqueIdentificationNumber()
          Gets the unique identification number.
 UserPreferences getUserPreferences()
          Gets the user preferences.
 boolean isActive()
          Checks whether Designs belonging to this Cluster should be displayed
private  void log(java.lang.String message)
          Prints debug information to stdout when printLog is set to true.
 void setActive(boolean active)
          Specifies whether Designs belonging to this Cluster should be displayed
 void setActiveDesignColor(java.awt.Color activeDesignColor)
          Sets the color in which Designs belonging to this Cluster are displayed.
 void setName(java.lang.String name)
          Sets the Cluster name.
 void setUserPreferences(UserPreferences userPreferences)
          Sets the user preferences.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

static final long serialVersionUID
The version tracking unique identifier for Serialization.

See Also:
Constant Field Values

printLog

static final boolean printLog
Flag to enable debug message printing for this class.

See Also:
Constant Field Values

userPreferences

private UserPreferences userPreferences
The user preferences.


name

private java.lang.String name
The Cluster name.


activeDesignColor

private java.awt.Color activeDesignColor
The color in which Designs belonging to this Cluster are displayed.


active

private boolean active
Specifies whether Designs belonging to this Cluster should be displayed.


uniqueIdentificationNumber

private int uniqueIdentificationNumber
The unique identification number for tracking purposes in the ClusterSet.

Constructor Detail

Cluster

public Cluster(UserPreferences userPreferences,
               java.lang.String name,
               int uniqueIdentificationNumber)
Instantiates a new cluster.

Parameters:
userPreferences - the user preferences
name - the Cluster name
uniqueIdentificationNumber - the unique identification number
Method Detail

log

private void log(java.lang.String message)
Prints debug information to stdout when printLog is set to true.

Parameters:
message - the message

getActiveDesignColor

public java.awt.Color getActiveDesignColor()
Gets the color in which Designs belonging to this Cluster are displayed.

Returns:
the color in which Designs belonging to this Cluster are displayed.

setActiveDesignColor

public void setActiveDesignColor(java.awt.Color activeDesignColor)
Sets the color in which Designs belonging to this Cluster are displayed.

Parameters:
activeDesignColor - the new color in which Designs belonging to this Cluster are displayed.

getName

public java.lang.String getName()
Gets the Cluster name.

Returns:
the Cluster name

setName

public void setName(java.lang.String name)
Sets the Cluster name.

Parameters:
name - the new Cluster name

isActive

public boolean isActive()
Checks whether Designs belonging to this Cluster should be displayed

Returns:
true, if Designs belonging to this Cluster should be displayed

setActive

public void setActive(boolean active)
Specifies whether Designs belonging to this Cluster should be displayed

Parameters:
active - Specifies whether Designs belonging to this Cluster should be displayed

duplicate

public Cluster duplicate()
Returns a duplicated instance of this Cluster for use in an editing Buffer.

Returns:
the cluster
See Also:
ClusterSet

copySettingsTo

public void copySettingsTo(Cluster cluster)
Copies settings of this Cluster to a given Cluster.

Parameters:
cluster - the Cluster to which the settings of this Cluster should be copied.

getUserPreferences

public UserPreferences getUserPreferences()
Gets the user preferences.

Returns:
the user preferences

setUserPreferences

public void setUserPreferences(UserPreferences userPreferences)
Sets the user preferences.

Parameters:
userPreferences - the new user preferences

getUniqueIdentificationNumber

public int getUniqueIdentificationNumber()
Gets the unique identification number.

Returns:
the unique identification number