java.lang.Object
org.graffiti.attributes.AbstractAttribute
org.graffiti.attributes.StringAttribute
de.ipk_gatersleben.ag_nw.graffiti.plugins.editcomponents.cluster_colors.ClusterColorAttribute
All Implemented Interfaces:
Attribute, DeepCopy, Displayable

public class ClusterColorAttribute
extends StringAttribute
All StringAttributes with the name id "chart_colors" will be converted into a ChartColorAttribute (see ChartAttributePlugin, where the mapping information from id to class type is initialized.
Author:
Christian Klukas (c) 2004 IPK-Gatersleben
Recent revisions:
2.7.0 Cluster recolouring.
  • Field Details

    • attributeName

      public static String attributeName
    • attributeFolder

      public static String attributeFolder
    • desc

      public static String desc
  • Constructor Details

    • ClusterColorAttribute

      public ClusterColorAttribute()
    • ClusterColorAttribute

      public ClusterColorAttribute​(String id)
    • ClusterColorAttribute

      public ClusterColorAttribute​(String id, String value)
  • Method Details

    • setDefaultValue

      public void setDefaultValue()
      Description copied from interface: Attribute
      The attribute's value is set so that its getValue() method will not return null.
      Specified by:
      setDefaultValue in interface Attribute
      Overrides:
      setDefaultValue in class StringAttribute
      See Also:
      Attribute.setDefaultValue()
    • setString

      public void setString​(String value)
      Description copied from class: StringAttribute
      Sets the value of this object. The ListenerManager is informed by the method setValue().
      Overrides:
      setString in class StringAttribute
      Parameters:
      value - the new value of this object.
    • getString

      public String getString()
      Description copied from class: StringAttribute
      Returns the value of this object.
      Overrides:
      getString in class StringAttribute
      Returns:
      the value of this object.
    • getValue

      public Object getValue()
      Description copied from class: StringAttribute
      Returns the value of this attribute, i.e. contained Sting object.
      Specified by:
      getValue in interface Attribute
      Specified by:
      getValue in interface Displayable
      Overrides:
      getValue in class StringAttribute
      Returns:
      the value of the attribute, i.e. contained String object.
    • copy

      public Object copy()
      Description copied from class: StringAttribute
      Returns a deep copy of this instance.
      Specified by:
      copy in interface DeepCopy
      Overrides:
      copy in class StringAttribute
      Returns:
      a deep copy of this instance.
    • toString

      public String toString​(int n)
      Description copied from interface: Attribute
      Returns a string representation prepended by n spaces of this attribute.
      Specified by:
      toString in interface Attribute
      Overrides:
      toString in class StringAttribute
      Returns:
      DOCUMENT ME!
      See Also:
      Attribute.toString(int)
    • toXMLString

      public String toXMLString()
      Description copied from interface: Displayable
      Returns a well-formed XML string representing the Displayable. The Displayable should be reconstructable via this representation. Therefore it must at least include the type of Displayable (classname) and a representation of its value. PROBABLE FUTURE DESIGN: The Displayables themselves will provide a method to reconstruct their value from the XML representation they provided.
      Specified by:
      toXMLString in interface Displayable
      Overrides:
      toXMLString in class StringAttribute
      Returns:
      string holding an XML representation of this Displayable
      See Also:
      Displayable.toXMLString()
    • getClusterColors

      public ArrayList<Color> getClusterColors()
    • getClusterOutlineColors

      public ArrayList<Color> getClusterOutlineColors()
    • getClusterColor

      public Color getClusterColor​(int clusterID)
    • getClusterOutlineColor

      public Color getClusterOutlineColor​(int clusterID)
    • updateClusterList

      public void updateClusterList​(Collection<String> clusterNames)
      Must be called on an existing ClusterColorAttribute to update the cluster information. Clusters will be recoloured given there is a change, because there is no reasonable mapping of additional colours to the existing (unknown) colour model. Given there is no change, cluster colours won't be modified.
      Parameters:
      clusterNames -
    • getDefinedClusterColorCount

      public int getDefinedClusterColorCount()
    • setClusterColor

      public void setClusterColor​(int clusterID, Color color)
    • setClusterOutlineColor

      public void setClusterOutlineColor​(int clusterID, Color color)
    • getDefaultValue

      public static ClusterColorAttribute getDefaultValue​(int clusterSize)
    • getDefaultValue

      public static ClusterColorAttribute getDefaultValue​(Collection<String> clusterNames)