view
Class DataCard

java.lang.Object
  extended by view.DataCard
All Implemented Interfaces:
Serializable

public class DataCard
extends Object
implements Serializable

A card consits of an VectorG plus an optional id and an activated flag. The key returned by getKey() is guaranteed to never be null, even if the data card was constructed with a null key, in which cas the position vector is used as the id. The activation flag is per default false, it can be used during plotting in a JDataCanvas.

See Also:
Serialized Form

Field Summary
private  boolean active
          If this data card is activated.
private static int id
           
private  Object key
          The key associated to this card.
private  VectorG point
          The data point in user space.
static String TAGGING
          A property named for data tagging with a data card's key.
 
Constructor Summary
DataCard(VectorG xy, Object id)
          Construct a new card.
DataCard(VectorG xy, Object id, boolean highlight)
          Construct a new card.
 
Method Summary
 boolean equals(Object that)
          Equal, if both fields are equal.
 Object getKey()
          Returns the object id.
 VectorG getPoint()
          Returns the point location.
 int hashCode()
          VectorG hash, if the key was unspecified in the beginning.
 boolean isActive()
          Returns the active flag.
static Object nextID()
           
 boolean setActive(boolean nuac)
          Sets the active flag.
 boolean toggleActive()
          Toggles the active flag, returns the new state.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

TAGGING

public static final String TAGGING
A property named for data tagging with a data card's key.

See Also:
Constant Field Values

point

private VectorG point
The data point in user space.


key

private Object key
The key associated to this card. Never null.


active

private boolean active
If this data card is activated.


id

private static int id
Constructor Detail

DataCard

public DataCard(VectorG xy,
                Object id)
Construct a new card. If the object id is null, we duplicate the input vector.


DataCard

public DataCard(VectorG xy,
                Object id,
                boolean highlight)
Construct a new card. If the object id is null, we duplicate the input vector.

Method Detail

nextID

public static Object nextID()

getPoint

public VectorG getPoint()
Returns the point location.


getKey

public Object getKey()
Returns the object id.


isActive

public boolean isActive()
Returns the active flag.


setActive

public boolean setActive(boolean nuac)
Sets the active flag. Returns the old value of the active flag.


toggleActive

public boolean toggleActive()
Toggles the active flag, returns the new state.


equals

public boolean equals(Object that)
Equal, if both fields are equal.

Overrides:
equals in class Object

hashCode

public int hashCode()
VectorG hash, if the key was unspecified in the beginning. Otherwise the hash of the key, as in the original construction.

Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object