gdl.config
Class RangeConfigSet

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

public class RangeConfigSet
extends java.lang.Object

RangeConfigSets offer a data structure to manage Value Range settings that are mapped to a pixelvalue between 5 and 40 that can be displayed (for node sizes) on a canvas. The handling of range config sets works like this: in the configuration part of the xml you specify a size attribute as typeOf directValueRange, with a min and a max value. These values determine the range of values that may occur as attribute values within the source file. When parsing the configuration part, a rangeConfigSet is initialised with this min and max value. afterwards, when drawing the nodes on the canvas, the rangeconfig set is used to map the node size to displayable dimensions between 5 and 40 pixels.

Author:
Martin Suntinger

Constructor Summary
RangeConfigSet(java.lang.String attributeId, java.lang.String displayName)
           
 
Method Summary
 java.lang.String getAttributeId()
           
 java.lang.String getDisplayName()
           
 long getMappedValue(int attributeValue)
          This method maps a "raw" attribte value to a displayable mapped value, accoring to the min and max values of the config set.
 int getMax()
           
 int getMin()
           
 int getType()
           
 void setMax(int max)
           
 void setMin(int min)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RangeConfigSet

public RangeConfigSet(java.lang.String attributeId,
                      java.lang.String displayName)
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)
Method Detail

getMappedValue

public long getMappedValue(int attributeValue)
This method maps a "raw" attribte value to a displayable mapped value, accoring to the min and max values of the config set.

Parameters:
attributeValue - the value that is specified for the attribute (in the XML)
Returns:
mappedValue a Size Value between 5 and 40 pixels that can be displayed

getAttributeId

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

getDisplayName

public java.lang.String getDisplayName()
Returns:
the displayname of the current config set, which may probably be more descriptive that the actual attribute name

getMax

public int getMax()
Returns:
the maximum attribute value that can be set for attributes the rule applies to

setMax

public void setMax(int max)
Parameters:
max - the maximum attribute value that can be set for attributes the rule applies to

getMin

public int getMin()
Returns:
the minimum attribute value that can be set for attributes the rule applies to

setMin

public void setMin(int min)
Parameters:
min - the minimum attribute value that can be set for attributes the rule applies to

getType

public int getType()
Returns:
the type of config set this is. for a RangeConfig set, this will be 0, SwitchConfigSets are of type 1