org.eu.sk.zero.acd
Class Component

java.lang.Object
  |
  +--org.eu.sk.zero.acd.Component
Direct Known Subclasses:
Area, Edge, Node

public abstract class Component
extends Object

Superclass for all components - nodes, edges and areas.

Version:
$Id: Component.java,v 1.8 2003/04/10 16:00:08 robo Exp $

Field Summary
protected  int id
          Numerical id of the component.
protected  org.eu.sk.zero.acd.ComponentType type
          Type of this component.
 
Constructor Summary
Component(org.eu.sk.zero.acd.ComponentType t)
          Construct a component of the given type.
 
Method Summary
 void addValue(org.eu.sk.zero.acd.Value val)
          This is only called by the application.
 void deselect()
          Deselect this component
 String getId()
          Returns the numeric id of the component.
 org.eu.sk.zero.acd.ComponentType getType()
          Returns the type of the component.
 void hide()
          Hides the component.
 boolean isError()
          Gets the error status of this component.
 boolean isHidden()
          Gets the hidden status of the component.
 boolean isSelected()
          Check selection status of this component
 void select()
          Select this component
 void setError(boolean err)
          Sets the error status of this component.
 void show()
          Unhides the component.
 String toString()
          Returns a string representation of this object.
 org.eu.sk.zero.acd.Value value(int id)
          Returns value of the component by its type id
 org.eu.sk.zero.acd.Value value(String vn)
          Returns value of the component by its name
 Iterator valueIterator()
          Allows browsing all values of the component
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

type

protected org.eu.sk.zero.acd.ComponentType type
Type of this component.

See Also:
ComponentType

id

protected int id
Numerical id of the component. Used for serialization.

Constructor Detail

Component

public Component(org.eu.sk.zero.acd.ComponentType t)
Construct a component of the given type. This is never called directly. Construct objects of subclasses instead.

Method Detail

addValue

public void addValue(org.eu.sk.zero.acd.Value val)
This is only called by the application. After constructing the component, all appropriate values are already constructed.


valueIterator

public Iterator valueIterator()
Allows browsing all values of the component


toString

public String toString()
Returns a string representation of this object. The string representation is taken from the first value of the component. The first value of components should be something as a "name"

Overrides:
toString in class Object
See Also:
Values

getId

public String getId()
Returns the numeric id of the component.


getType

public org.eu.sk.zero.acd.ComponentType getType()
Returns the type of the component.


value

public org.eu.sk.zero.acd.Value value(String vn)
Returns value of the component by its name


value

public org.eu.sk.zero.acd.Value value(int id)
Returns value of the component by its type id


select

public void select()
Select this component


deselect

public void deselect()
Deselect this component


isSelected

public boolean isSelected()
Check selection status of this component


setError

public void setError(boolean err)
Sets the error status of this component.


isError

public boolean isError()
Gets the error status of this component.


hide

public void hide()
Hides the component.


show

public void show()
Unhides the component.


isHidden

public boolean isHidden()
Gets the hidden status of the component.