net.nexttext.property
Class PVectorListProperty

java.lang.Object
  extended by net.nexttext.property.Property
      extended by net.nexttext.property.PVectorListProperty
All Implemented Interfaces:
java.lang.Cloneable, PropertyChangeListener

public class PVectorListProperty
extends Property
implements PropertyChangeListener

A property for list of PVectors.

This class is half way between a list of PVectorProperties and a Property containing a list of PVectors, so is is not fully consistent with the other property classes. To make it consistent it would need these changes:


Constructor Summary
PVectorListProperty()
          Default constructor.
 
Method Summary
 void add(int position, processing.core.PVector v1)
          Adds a PVectorProperty object at the specified position in the list.
 void add(int position, PVectorProperty v1)
          Adds a PVectorProperty object at the specified position in the list.
 void add(processing.core.PVector v1)
          Add a PVector object to the list.
 void add(PVectorProperty v1)
          Adds a PVectorProperty object to the list.
 void clear()
          Clears out the content of the list
 PVectorListProperty clone()
          Get a new property with the same values as this one.
 processing.core.PVector get(int position)
          Returns the PVector object at the specified position in the list.
 java.util.Iterator<PVectorProperty> iterator()
          Returns an iterator for the list of PVectorProperty objects.
 void propertyChanged(Property pc)
          For interface PropertyChangeListener, called when one of the properties in the list changes.
 void reset()
          Resets each PVectorProperty in the list to its original value.
 int size()
          Returns the number of PVectorProperty objects contained in this list.
 java.lang.String toString()
           
 
Methods inherited from class net.nexttext.property.Property
addChangeListener, getName, setName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PVectorListProperty

public PVectorListProperty()
Default constructor. Creates an empty PVectorListProperty.

Method Detail

add

public void add(processing.core.PVector v1)
Add a PVector object to the list.

This will automatically convert the PVector to a PVectorProperty.


add

public void add(PVectorProperty v1)
Adds a PVectorProperty object to the list.


add

public void add(int position,
                processing.core.PVector v1)
Adds a PVectorProperty object at the specified position in the list.


add

public void add(int position,
                PVectorProperty v1)
Adds a PVectorProperty object at the specified position in the list.


get

public processing.core.PVector get(int position)
Returns the PVector object at the specified position in the list.


reset

public void reset()
Resets each PVectorProperty in the list to its original value.

Specified by:
reset in class Property

clear

public void clear()
Clears out the content of the list


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

iterator

public java.util.Iterator<PVectorProperty> iterator()
Returns an iterator for the list of PVectorProperty objects.

Don't use this iterator to remove items from the list, since this won't trigger the necessary PropertyChangeEvents. If you need to remove points, write a remove method for this class, and call that.


size

public int size()
Returns the number of PVectorProperty objects contained in this list.


propertyChanged

public void propertyChanged(Property pc)
For interface PropertyChangeListener, called when one of the properties in the list changes.

Specified by:
propertyChanged in interface PropertyChangeListener

clone

public PVectorListProperty clone()
Description copied from class: Property
Get a new property with the same values as this one.

The name is copied because that's what makes it a Property and not just a value.

PropertyChangeListeners are not copied to the new Property.

Overrides:
clone in class Property