Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.modama.gui.viewer.lookuptable
Class LUTProperties  view LUTProperties download LUTProperties.java

java.lang.Object
  extended byorg.modama.ModelStates
      extended byorg.modama.Model
          extended byorg.modama.gui.viewer.lookuptable.LUTProperties
All Implemented Interfaces:
java.lang.Cloneable, java.util.EventListener, java.beans.PropertyChangeListener

public class LUTProperties
extends org.modama.Model
implements java.beans.PropertyChangeListener, java.lang.Cloneable

a collection of spots from which a lut can be rendered by the LUTFactory


Field Summary
protected  java.util.List spots
          the spots, since we will have insert spots in the middle take a linkedlist
 
Fields inherited from class org.modama.Model
changeAgent, EVENT_FIRED, state
 
Fields inherited from class org.modama.ModelStates
CREATED, DELETED, MODIFIED, SAVED
 
Constructor Summary
LUTProperties()
           
 
Method Summary
 void addSpot(Spot newspot)
          adds a spot to the spotcollection, keeps the collection ordered
 java.awt.Color calcColor(double index)
          calculates a colorvalue by interpolation.
first searches the next spot to the right an left, then interpolates the colors
 java.lang.Object clone()
          This method may be called to create a new copy of the Object.
 int getSpotNumber()
          gets the number of spots
 java.util.List getSpots()
          gets the collection of spots
!! you should not change this collection
protected  java.awt.Color interpolate(java.awt.Color c1, java.awt.Color c2, double weight)
          mixes the two colors
 boolean load(java.io.InputStream stream)
          uses the XMLDecoder to load the object from an inputstream
 void load(LUTProperties props)
           
 void propertyChange(java.beans.PropertyChangeEvent evt)
          we are interested in changing positions, we have to assure that the spotlist stays sorted
 void removeSpot(Spot spot)
          removes a spot
!! this method asumes that spot belongs to the spotlist, it does not test it
 boolean save(java.io.OutputStream stream)
          uses the XMLEncoder to save the object
 void setSpots(java.util.List spots)
          sets a new list of spots
 
Methods inherited from class org.modama.Model
addPropertyChangeListener, addPropertyChangeListener, fire, fire, fire, getState, removePropertyChangeListener, removePropertyChangeListener, setState
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

spots

protected java.util.List spots
the spots, since we will have insert spots in the middle take a linkedlist

Constructor Detail

LUTProperties

public LUTProperties()
Method Detail

addSpot

public void addSpot(Spot newspot)
adds a spot to the spotcollection, keeps the collection ordered


removeSpot

public void removeSpot(Spot spot)
removes a spot
!! this method asumes that spot belongs to the spotlist, it does not test it


getSpotNumber

public int getSpotNumber()
gets the number of spots


getSpots

public java.util.List getSpots()
gets the collection of spots
!! you should not change this collection


setSpots

public void setSpots(java.util.List spots)
sets a new list of spots


save

public boolean save(java.io.OutputStream stream)
uses the XMLEncoder to save the object


propertyChange

public void propertyChange(java.beans.PropertyChangeEvent evt)
we are interested in changing positions, we have to assure that the spotlist stays sorted

Specified by:
propertyChange in interface java.beans.PropertyChangeListener

load

public boolean load(java.io.InputStream stream)
uses the XMLDecoder to load the object from an inputstream


load

public void load(LUTProperties props)

calcColor

public java.awt.Color calcColor(double index)
calculates a colorvalue by interpolation.
first searches the next spot to the right an left, then interpolates the colors


interpolate

protected java.awt.Color interpolate(java.awt.Color c1,
                                     java.awt.Color c2,
                                     double weight)
mixes the two colors


clone

public java.lang.Object clone()
Description copied from class: java.lang.Object
This method may be called to create a new copy of the Object. The typical behavior is as follows:
  • o == o.clone() is false
  • o.getClass() == o.clone().getClass() is true
  • o.equals(o) is true

However, these are not strict requirements, and may be violated if necessary. Of the three requirements, the last is the most commonly violated, particularly if the subclass does not override Object.equals(Object)>Object.equals(Object) 55 .

If the Object you call clone() on does not implement java.lang.Cloneable (which is a placeholder interface), then a CloneNotSupportedException is thrown. Notice that Object does not implement Cloneable; this method exists as a convenience for subclasses that do.

Object's implementation of clone allocates space for the new Object using the correct class, without calling any constructors, and then fills in all of the new field values with the old field values. Thus, it is a shallow copy. However, subclasses are permitted to make a deep copy.

All array types implement Cloneable, and override this method as follows (it should never fail):

 public Object clone()
 {
   try
     {
       super.clone();
     }
   catch (CloneNotSupportedException e)
     {
       throw new InternalError(e.getMessage());
     }
 }