cz.zcu.fav.kiv.editor.beans.types
Class Type

java.lang.Object
  extended by java.util.Observable
      extended by cz.zcu.fav.kiv.editor.beans.types.Type
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
TypeAttr, TypeParam

public abstract class Type
extends java.util.Observable
implements java.lang.Cloneable

The Type class represents a parent for types of all elements.

Version:
1.0, 05/2007
Author:
Marta Vaclavikova

Field Summary
protected  DefaultType defaultValue
          The default value of the type
protected  TypeEnum name
          The name of the type
protected  Unit unit
          The unit of the type
protected  java.lang.String value
          The value of the type
 
Constructor Summary
Type()
          Initializes a newly created emptyType.
Type(TypeEnum name)
           
 
Method Summary
 void assignDefaultFromValue()
          Assigns the default value same as value.
abstract  void changeValue(java.lang.String value)
          Sets the new value of the type without notifying of graphics items.
 java.lang.Object clone()
           
 DefaultType getDefaultValue()
           
 java.lang.String getKeyFromValue(java.lang.String value)
          Returns the key for input value it it is contained in the list of predefined values.
 TypeEnum getName()
           
abstract  java.lang.String getOwnerName()
          Return the name of the owner element - parameter or attribute.
 Unit getUnit()
           
 java.lang.String getValue()
           
 java.util.Map<java.lang.String,java.lang.String> getValueList()
           
 void setDefault()
          Sets the default value of the type and its unit.
 void setDefaultValue(DefaultType defaultValue)
           
 void setLoadedValue(java.lang.String value)
          Assigns the new loaded value (from file, template).
 void setName(TypeEnum name)
           
 void setUnit(Unit unit)
           
 void setValue(java.lang.String value)
           
 void setValueList(java.util.Map<java.lang.String,java.lang.String> values)
           
abstract  void updateValue()
          Sets the new value of the type with notifying of graphics items.
 
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

name

protected TypeEnum name
The name of the type


defaultValue

protected DefaultType defaultValue
The default value of the type


value

protected java.lang.String value
The value of the type


unit

protected Unit unit
The unit of the type

Constructor Detail

Type

public Type()
Initializes a newly created emptyType.


Type

public Type(TypeEnum name)
Method Detail

setUnit

public void setUnit(Unit unit)

setDefaultValue

public void setDefaultValue(DefaultType defaultValue)

setName

public void setName(TypeEnum name)

getValue

public java.lang.String getValue()

updateValue

public abstract void updateValue()
Sets the new value of the type with notifying of graphics items.


changeValue

public abstract void changeValue(java.lang.String value)
Sets the new value of the type without notifying of graphics items.

Parameters:
value - a new value of the type.

getValueList

public java.util.Map<java.lang.String,java.lang.String> getValueList()

setValueList

public void setValueList(java.util.Map<java.lang.String,java.lang.String> values)

getKeyFromValue

public java.lang.String getKeyFromValue(java.lang.String value)
Returns the key for input value it it is contained in the list of predefined values.

Parameters:
value - a value of the searched value contained in the list of predefined values.
Returns:
a key belonging to the input value contained in the list of predefined values.

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

setDefault

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


getUnit

public Unit getUnit()

getDefaultValue

public DefaultType getDefaultValue()

getName

public TypeEnum getName()

setLoadedValue

public void setLoadedValue(java.lang.String value)
                    throws ParserException
Assigns the new loaded value (from file, template).

Parameters:
value - the new type value.
Throws:
ParserException - if the value is invalid.

setValue

public void setValue(java.lang.String value)

assignDefaultFromValue

public void assignDefaultFromValue()
Assigns the default value same as value.


getOwnerName

public abstract java.lang.String getOwnerName()
Return the name of the owner element - parameter or attribute.