cz.zcu.fav.kiv.editor.beans.properties
Class UnitAttr

java.lang.Object
  extended by java.util.Observable
      extended by cz.zcu.fav.kiv.editor.beans.types.Unit
          extended by cz.zcu.fav.kiv.editor.beans.properties.UnitAttr
All Implemented Interfaces:
java.lang.Cloneable

public class UnitAttr
extends Unit

The UnitAttr class represents a unit of attribute type.

Version:
1.0, 05/2007
Author:
Marta Vaclavikova

Field Summary
protected  Attribute attribute
          The reference to the attribute of the unit
protected  java.lang.String temporaryValue
          The temporary value of the attribute unit
 
Fields inherited from class cz.zcu.fav.kiv.editor.beans.types.Unit
defaultValue, value, valueList
 
Constructor Summary
UnitAttr(java.util.List<java.lang.String> unitList)
           
UnitAttr(java.lang.String value, java.util.List<java.lang.String> unitList)
          Initializes a newly created UnitAttr with the specified value and predefined units.
 
Method Summary
 void changeValue(java.lang.String value)
          Sets the new value of unit and marks its attribute as chosen.
 void setAttribute(Attribute attribute)
           
 void setDefault()
          Sets the default and temporary value of the unit.
 void setValuesFromTemporary()
          Sets values of the unit after its temporary value.
 void updateValue()
          Sets the new temporary value of unit.
 
Methods inherited from class cz.zcu.fav.kiv.editor.beans.types.Unit
assignDefaultFromValue, clone, getDefaultValue, getValue, getValueList, setDefaultValue, setValue, setValueList
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

temporaryValue

protected java.lang.String temporaryValue
The temporary value of the attribute unit


attribute

protected Attribute attribute
The reference to the attribute of the unit

Constructor Detail

UnitAttr

public UnitAttr(java.lang.String value,
                java.util.List<java.lang.String> unitList)
Initializes a newly created UnitAttr with the specified value and predefined units. The value argument is the value of the unit. The unitList is a list of predefined units.

Parameters:
value - a value of the unit.
unitList - a list of predefined units.

UnitAttr

public UnitAttr(java.util.List<java.lang.String> unitList)
Method Detail

changeValue

public void changeValue(java.lang.String value)
Sets the new value of unit and marks its attribute as chosen.

Specified by:
changeValue in class Unit
Parameters:
value - a new value of the unit.

updateValue

public void updateValue()
Sets the new temporary value of unit.

Specified by:
updateValue in class Unit

setValuesFromTemporary

public void setValuesFromTemporary()
Sets values of the unit after its temporary value.


setAttribute

public void setAttribute(Attribute attribute)

setDefault

public void setDefault()
Sets the default and temporary value of the unit.

Overrides:
setDefault in class Unit