fr.esrf.tangoatk.widget.util.jdraw
Class JDValueProgram

java.lang.Object
  extended by fr.esrf.tangoatk.widget.util.jdraw.JDValueProgram

public class JDValueProgram
extends java.lang.Object

A class to handle dynamic value program.


Field Summary
static int BOOLEAN_TYPE
           
static int COLOR_TYPE
           
static int INTEGER_TYPE
           
static int MAP_BY_VALUE
          Map object value to value defined by a correspondence table.
static int MAP_LINEAR
          Linear map of object value.
static int MAP_REMAP
          Remap value to coordinates of the peer JDObject.
 
Constructor Summary
JDValueProgram(int type)
          Contruct a dynamic value program.
JDValueProgram(JDFileLoader f)
           
 
Method Summary
 void addNewEntry()
          Add a new entry to the corespondance table.
 boolean getBooleanMappingAt(int idx)
           
 java.awt.Color getColorMappingAt(int idx)
           
 java.lang.String getCompleteValue(int idx)
           
 boolean getDefaultBooleanMapping()
           
 java.awt.Color getDefaultColorMapping()
           
 int getDefaultIntegerMapping()
           
 java.lang.String getDefaultMapping()
          Return a string representation of the default value, (correspondance table)
 int getEntryNumber()
          Return number of entries in the correspondance table.
 int getIntegerMappingAt(int idx)
           
 java.lang.String getMapping(int idx)
           
 int getMaxLinearMapping()
           
 int getMinLinearMapping()
           
 int getMode()
           
 int getType()
           
 java.lang.String getValue(int idx)
           
 void removeEntry(int idx)
          Remove the entry in the correspondance table at the specified index.
 void saveObject(java.io.FileWriter f, java.lang.String decal)
           
 boolean setDefaultMapping(java.lang.String v)
          Sets the default value.
 boolean setMappingAt(int idx, java.lang.String v)
           
 void setMaxLinearValue(int max)
           
 void setMinLinearValue(int min)
           
 boolean setMode(int m)
          Sets the mode of this program.
 boolean setValueAt(int idx, java.lang.String v)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MAP_BY_VALUE

public static final int MAP_BY_VALUE
Map object value to value defined by a correspondence table.

See Also:
Constant Field Values

MAP_LINEAR

public static final int MAP_LINEAR
Linear map of object value. (only for INTEGER)

See Also:
Constant Field Values

MAP_REMAP

public static final int MAP_REMAP
Remap value to coordinates of the peer JDObject. (only for INTEGER)

See Also:
Constant Field Values

INTEGER_TYPE

public static final int INTEGER_TYPE
See Also:
Constant Field Values

COLOR_TYPE

public static final int COLOR_TYPE
See Also:
Constant Field Values

BOOLEAN_TYPE

public static final int BOOLEAN_TYPE
See Also:
Constant Field Values
Constructor Detail

JDValueProgram

public JDValueProgram(int type)
Contruct a dynamic value program.

Parameters:
type - Type of data.
See Also:
INTEGER_TYPE, COLOR_TYPE, BOOLEAN_TYPE

JDValueProgram

public JDValueProgram(JDFileLoader f)
               throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getType

public int getType()

setMode

public boolean setMode(int m)
Sets the mode of this program.

Parameters:
m - Mode to be set
Returns:
true only if this mode if allowed for the data type.
See Also:
MAP_BY_VALUE, MAP_LINEAR, MAP_REMAP

getMode

public int getMode()

addNewEntry

public void addNewEntry()
Add a new entry to the corespondance table.


removeEntry

public void removeEntry(int idx)
Remove the entry in the correspondance table at the specified index.


getEntryNumber

public int getEntryNumber()
Return number of entries in the correspondance table.


getDefaultMapping

public java.lang.String getDefaultMapping()
Return a string representation of the default value, (correspondance table)


setDefaultMapping

public boolean setDefaultMapping(java.lang.String v)
Sets the default value.


getDefaultColorMapping

public java.awt.Color getDefaultColorMapping()

getDefaultBooleanMapping

public boolean getDefaultBooleanMapping()

getDefaultIntegerMapping

public int getDefaultIntegerMapping()

getValue

public java.lang.String getValue(int idx)

getCompleteValue

public java.lang.String getCompleteValue(int idx)

setValueAt

public boolean setValueAt(int idx,
                          java.lang.String v)

getMapping

public java.lang.String getMapping(int idx)

setMappingAt

public boolean setMappingAt(int idx,
                            java.lang.String v)

getColorMappingAt

public java.awt.Color getColorMappingAt(int idx)

getBooleanMappingAt

public boolean getBooleanMappingAt(int idx)

getIntegerMappingAt

public int getIntegerMappingAt(int idx)

getMinLinearMapping

public int getMinLinearMapping()

getMaxLinearMapping

public int getMaxLinearMapping()

setMinLinearValue

public void setMinLinearValue(int min)

setMaxLinearValue

public void setMaxLinearValue(int max)

saveObject

public void saveObject(java.io.FileWriter f,
                       java.lang.String decal)
                throws java.io.IOException
Throws:
java.io.IOException