gdl.config
Class SwitchConfigSet

java.lang.Object
  extended by gdl.config.SwitchConfigSet

public class SwitchConfigSet
extends java.lang.Object

Stores one set of attribute value pairs, either a color, or a size attribute. The handling of such attributes works as follows: In the configuration part of the source XML, size and color attributes are defined as of type switchConversion, containing several switchConversionRules, each holding an attribute value and the integer value it gets mapped to. for size attributes, these values are directly used as pixel values.

Author:
Martin Suntinger

Constructor Summary
SwitchConfigSet(java.lang.String attributeId, java.lang.String displayName, int type)
           
 
Method Summary
 void addValuePair(java.lang.String attributeValue, java.lang.String displayName, int mappedValue)
          Adds an entry to the current switch config set, consisting von the attribute value, a display name and the mapped value for the attribute value
 java.lang.String getAttributeId()
           
 java.lang.String getAttributeValue(int index)
           
 java.lang.String getDisplayName()
           
 java.lang.String getDisplayName(int index)
           
 int getMappedValue(java.lang.String attributeValue)
           
 int getSize()
           
 int getType()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwitchConfigSet

public SwitchConfigSet(java.lang.String attributeId,
                       java.lang.String displayName,
                       int type)
Parameters:
attributeId - - the unique name of the attribute the config set is for
displayName - - the name that is displayed in the attribute rule selector (gui)
type - - 0=size attribute, 1=color attribute
Method Detail

addValuePair

public void addValuePair(java.lang.String attributeValue,
                         java.lang.String displayName,
                         int mappedValue)
Adds an entry to the current switch config set, consisting von the attribute value, a display name and the mapped value for the attribute value

Parameters:
attributeValue - the attribute value
displayName - the display name used in the gui and for legends
mappedValue - the integer value the attribute will get mapped to

getMappedValue

public int getMappedValue(java.lang.String attributeValue)
Parameters:
attributeValue - the value of the attribute you want to map
Returns:
the integer value the attribute gets mapped to, according to the specification in the configuration part of the xml

getAttributeId

public java.lang.String getAttributeId()
Returns:
the attribute id of the config set (which is the XML attributes the rule applies to)

getDisplayName

public java.lang.String getDisplayName()
Returns:
the displayname of the attribute the rule applies for

getType

public int getType()
Returns:
the type of the switch config set: 0= a size config set, 1= a color config set

getSize

public int getSize()
Returns:
the amount of attributes within this config set

getDisplayName

public java.lang.String getDisplayName(int index)
Parameters:
index - the index of the attribute
Returns:
the display name of one specific attribute (accessed by the index)

getAttributeValue

public java.lang.String getAttributeValue(int index)
Parameters:
index - the index of the attribute
Returns:
one specific attribute value (accessed by the index)