edu.neu.ccs.gui
Class BaseShape

java.lang.Object
  |
  +--edu.neu.ccs.gui.BaseShape
All Implemented Interfaces:
Shape, SupportsPropertyChange
Direct Known Subclasses:
AutomaticShape, TweakableShape

public class BaseShape
extends Object
implements Shape, SupportsPropertyChange

Class BaseShape encapsulates a Shape defined using vertex and tangent data.

Specifically, BaseShape encapsulates:

A BaseShape is parametrized by three additional settings:

Class BaseShape contains the common code and data for the derived classes AutomaticShape and TweakableShape.

Class BaseShape may not be instantiated directly since it does not have a public constructor.

Since:
2.3

Field Summary
static String REMOVE_SHAPE_DATA
          Bound property name to clear/remove all vertex and tangent data.
static String SET_CLOSURE_MODE
          Bound property name for set closure mode.
static String SET_PATH_STRATEGY
          Bound property name for set path strategy.
static String SET_WINDING_RULE
          Bound property name for set winding rule.
protected  float[][] tangent
          The tangent data of the shape.
protected  float[][] vertex
          The vertex data of the shape.
 
Constructor Summary
protected BaseShape()
          The default constructor with an empty shape.
 
Method Summary
 void addForwardingListener(Object object)
          Add the forwarding listener as a property change listener for the given object if the object supports property change.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Add a PropertyChangeListener to the listener list.
 void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Add a PropertyChangeListener to the listener list for a specific property.
 void addPropertyChangeListeners(PropertyChangeListener[] listeners)
          Add all items in the given PropertyChangeListener array to the listener list.
 void addPropertyChangeListeners(String propertyName, PropertyChangeListener[] listeners)
          Add all items in the given PropertyChangeListener array to the listener list for a specific property.
 boolean contains(double x, double y)
          Tests if the specified coordinates are inside the boundary of the Shape.
 boolean contains(double x, double y, double w, double h)
          Tests if the interior of the Shape entirely contains the specified rectangular area.
 boolean contains(Point2D p)
          Tests if a specified Point2D is inside the boundary of the Shape.
 boolean contains(Rectangle2D r)
          Tests if the interior of the Shape entirely contains the specified rectangular area.
 void firePropertyChange(PropertyChangeEvent evt)
          Fire an existing PropertyChangeEvent to any registered listeners.
 void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
          Report a bound property update to any registered listeners.
 void firePropertyChange(String propertyName, byte oldValue, byte newValue)
          Report a bound property update to any registered listeners.
 void firePropertyChange(String propertyName, char oldValue, char newValue)
          Report a bound property update to any registered listeners.
 void firePropertyChange(String propertyName, double oldValue, double newValue)
          Report a bound property update to any registered listeners.
 void firePropertyChange(String propertyName, float oldValue, float newValue)
          Report a bound property update to any registered listeners.
 void firePropertyChange(String propertyName, int oldValue, int newValue)
          Report a bound property update to any registered listeners.
 void firePropertyChange(String propertyName, long oldValue, long newValue)
          Report a bound property update to any registered listeners.
 void firePropertyChange(String propertyName, Object oldValue, Object newValue)
          Report a bound property update to any registered listeners.
 void firePropertyChange(String propertyName, short oldValue, short newValue)
          Report a bound property update to any registered listeners.
 float[][] getBezierTangentSegmentData()
          Returns the Bezier tangent segment data corresponding to the vertex and tangent data.
 Rectangle getBounds()
          Returns an integer Rectangle that completely encloses the Shape.
 Rectangle2D getBounds2D()
          Returns a high precision and more accurate bounding box of the Shape than the getBounds method.
 float[][] getClosedBezierFrameData()
          Returns the closed Bezier frame data corresponding to the vertex and tangent data.
 ClosureMode getClosureMode()
          Get the closure mode.
 float[] getCubicCurvePoint(float t)
          Returns an array float[2] with the coordinates of a point on the cubic curve determined by the internal vertex and tangent data and the float parameter t.
 PropertyChangeForwardingListener getForwardingListener()
          Returns the PropertyChangeForwardingListener that will forward the property change events it receives to this object.
 float[][] getMergedVertexTangentData()
          Returns the deep merge of the vertex and tangent data.
 float[][] getOpenBezierFrameData()
          Returns the open Bezier frame data corresponding to the vertex and tangent data.
 GeneralPath getPath()
          Returns a copy of the GeneralPath that defines this Shape.
 PathIterator getPathIterator(AffineTransform at)
          Returns an iterator object that iterates along the Shape boundary and provides access to the geometry of the Shape outline.
 PathIterator getPathIterator(AffineTransform at, double flatness)
          Returns an iterator object that iterates along the Shape boundary and provides access to a flattened view of the Shape outline geometry.
 Path.Strategy getPathStrategy()
          Get the PathStrategy.
 float[] getPolygonPoint(float t)
          Returns an array float[2] with the coordinates of a point on the polygon determined by the internal vertex data and the float parameter t.
 PropertyChangeListener[] getPropertyChangeListeners()
          Returns an array of all listeners that were added to this object.
 PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
          Returns an array of all listeners that were added to this object and associated with the named property.
 float[][] getTangentData()
          Returns a copy of the tangent data.
 float[][] getVertexData()
          Returns a copy of the vertex data.
 WindingRule getWindingRule()
          Get the winding rule.
 boolean hasListeners(String propertyName)
          Check if there are any listeners for a specific property.
 boolean intersects(double x, double y, double w, double h)
          Tests if the interior of the Shape intersects the interior of a specified rectangular area.
 boolean intersects(Rectangle2D r)
          Tests if the interior of the Shape intersects the interior of a specified rectangular area.
 int length()
          Returns the common length N of the vertex and tangent data.
 TweakableShape makeBezierTangentSegments()
          Returns an open TweakableShape whose vertex and tangent data is a copy of the corresponding vertex and tangent data of this shape and whose Path.Strategy is Path.BEZIER_TANGENT_SEGMENTS.
 TweakableShape makeClosedBezierFrame()
          Returns a closed TweakableShape whose vertex data is the closed Bezier frame corresponding to the vertex and tangent data of this shape, whose tangent data is zero, and whose Path.Strategy is Path.POLYGON.
 TweakableShape makeOpenBezierFrame()
          Returns an open TweakableShape whose vertex data is the open Bezier frame corresponding to the vertex and tangent data of this shape, whose tangent data is zero, and whose Path.Strategy is Path.POLYGON.
protected  void makePath()
          Make the path for the shape using the internal vertex and tangent data and the path strategy, closure mode, and winding rule settings.
 TweakableShape makePolygonDots()
          Returns an open TweakableShape whose vertex data is a copy of the vertex data of this shape, whose tangent data is zero, and whose Path.Strategy is Path.POLYGON_DOTS.
 void removeAndAddForwardingListener(Object oldobject, Object newobject)
          Remove the forwarding listener as a property change listener for the old object if the old object supports property change and add the forwarding listener as a property change listener for the new object if the new object supports property change.
 void removeForwardingListener(Object object)
          Remove the forwarding listener as a property change listener for the given object if the object supports property change.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Remove a PropertyChangeListener from the listener list.
 void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
          Remove a PropertyChangeListener for a specific property.
 void removeShapeData()
          Removes all vertex and tangent data and makes a new path.
 void setClosureMode(ClosureMode closuremode)
          Sets the closure mode and makes a new path.
 void setPathStrategy(Path.Strategy pathstrategy)
          Sets the path strategy and makes a new path.
 void setWindingRule(WindingRule windingrule)
          Sets the winding rule and makes a new path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SET_PATH_STRATEGY

public static final String SET_PATH_STRATEGY
Bound property name for set path strategy.

See Also:
Constant Field Values

SET_CLOSURE_MODE

public static final String SET_CLOSURE_MODE
Bound property name for set closure mode.

See Also:
Constant Field Values

SET_WINDING_RULE

public static final String SET_WINDING_RULE
Bound property name for set winding rule.

See Also:
Constant Field Values

REMOVE_SHAPE_DATA

public static final String REMOVE_SHAPE_DATA
Bound property name to clear/remove all vertex and tangent data.

See Also:
Constant Field Values

vertex

protected float[][] vertex

The vertex data of the shape.

Derived classes must ensure that this member data is not null and that it has the form float[N][2].


tangent

protected float[][] tangent

The tangent data of the shape.

Derived classes must ensure that this member data is not null and that it has the form float[N][2] for the same N as in the vertex array.

Constructor Detail

BaseShape

protected BaseShape()

The default constructor with an empty shape.

The default settings are as follows:

Method Detail

makePolygonDots

public final TweakableShape makePolygonDots()
Returns an open TweakableShape whose vertex data is a copy of the vertex data of this shape, whose tangent data is zero, and whose Path.Strategy is Path.POLYGON_DOTS.


makeClosedBezierFrame

public final TweakableShape makeClosedBezierFrame()
Returns a closed TweakableShape whose vertex data is the closed Bezier frame corresponding to the vertex and tangent data of this shape, whose tangent data is zero, and whose Path.Strategy is Path.POLYGON.


makeOpenBezierFrame

public final TweakableShape makeOpenBezierFrame()
Returns an open TweakableShape whose vertex data is the open Bezier frame corresponding to the vertex and tangent data of this shape, whose tangent data is zero, and whose Path.Strategy is Path.POLYGON.


makeBezierTangentSegments

public final TweakableShape makeBezierTangentSegments()
Returns an open TweakableShape whose vertex and tangent data is a copy of the corresponding vertex and tangent data of this shape and whose Path.Strategy is Path.BEZIER_TANGENT_SEGMENTS.


length

public final int length()
Returns the common length N of the vertex and tangent data.


getVertexData

public final float[][] getVertexData()

Returns a copy of the vertex data.

The returned array will have the form float[N][2].

Returns:
a copy of the vertex data
See Also:
getTangentData(), getClosedBezierFrameData(), getOpenBezierFrameData(), getBezierTangentSegmentData(), getMergedVertexTangentData()

getTangentData

public final float[][] getTangentData()

Returns a copy of the tangent data.

The returned array will have the form float[N][2] for the same N as in the vertex data.

Returns:
a copy of the tangent data
See Also:
getVertexData(), getClosedBezierFrameData(), getOpenBezierFrameData(), getBezierTangentSegmentData(), getMergedVertexTangentData()

getPolygonPoint

public final float[] getPolygonPoint(float t)

Returns an array float[2] with the coordinates of a point on the polygon determined by the internal vertex data and the float parameter t.

Let N denote the length of the vertex data array.

If N == 0, return new float[2].

If N == 1 or if N > 1 and either t <= 0 or t >= N, return a copy of vertex[0].

Otherwise, let t = a + f where a is an integer and 0 <= f < 1. Let b = a+1 modulo N. Then, return the point:

Parameters:
t - the parameter that determines the point

getCubicCurvePoint

public final float[] getCubicCurvePoint(float t)

Returns an array float[2] with the coordinates of a point on the cubic curve determined by the internal vertex and tangent data and the float parameter t.

Let N denote the length of the vertex data array.

If N == 0, return new float[2].

If N == 1 or if N > 1 and either t <= 0 or t >= N, return a copy of vertex[0].

Otherwise, let t = a + f where a is an integer and 0 <= f < 1. Let b = a+1 modulo N. Then, return the point corresponding to the parameter f and the 4 Bezier control points given below.

Parameters:
t - the parameter that determines the point

getClosedBezierFrameData

public final float[][] getClosedBezierFrameData()

Returns the closed Bezier frame data corresponding to the vertex and tangent data.

If N is the common length of the vertex and tangent data then the returned array will have the form float[3*N][2].

Returns:
the Bezier frame data
See Also:
getVertexData(), getTangentData(), getOpenBezierFrameData(), getBezierTangentSegmentData(), getMergedVertexTangentData(), Path.closedBezierFrame(float[][], float[][])

getOpenBezierFrameData

public final float[][] getOpenBezierFrameData()

Returns the open Bezier frame data corresponding to the vertex and tangent data.

If N is the common length of the vertex and tangent data then if N is non-zero the returned array will have the form float[3*N-2][2] otherwise the returned array will have the form float[0][2].

Returns:
the Bezier frame data
See Also:
getVertexData(), getTangentData(), getClosedBezierFrameData(), getBezierTangentSegmentData(), getMergedVertexTangentData(), Path.openBezierFrame(float[][], float[][])

getBezierTangentSegmentData

public final float[][] getBezierTangentSegmentData()

Returns the Bezier tangent segment data corresponding to the vertex and tangent data.

If N is the common length of the vertex and tangent data then the returned array will have the form float[2*N][2].

Returns:
the Bezier frame data
See Also:
getVertexData(), getTangentData(), getClosedBezierFrameData(), getOpenBezierFrameData(), getMergedVertexTangentData(), Path.bezierTangentSegments(float[][], float[][])

getMergedVertexTangentData

public final float[][] getMergedVertexTangentData()

Returns the deep merge of the vertex and tangent data.

If N is the common length of the vertex and tangent data then the returned array will have the form float[N][4].

Returns:
the deep merge of the vertex and tangent data
See Also:
getVertexData(), getTangentData(), getClosedBezierFrameData(), getOpenBezierFrameData(), getBezierTangentSegmentData()

removeShapeData

public final void removeShapeData()

Removes all vertex and tangent data and makes a new path.

Fires property change: REMOVE_SHAPE_DATA.


setPathStrategy

public final void setPathStrategy(Path.Strategy pathstrategy)

Sets the path strategy and makes a new path.

Does nothing if its parameter is null.

Fires property change: SET_PATH_STRATEGY.

Parameters:
pathstrategy - the path strategy to set

getPathStrategy

public final Path.Strategy getPathStrategy()
Get the PathStrategy.

Returns:
the path strategy

setClosureMode

public final void setClosureMode(ClosureMode closuremode)

Sets the closure mode and makes a new path.

Does nothing if its parameter is null.

Fires property change: SET_CLOSURE_MODE.

Parameters:
closuremode - the closure mode to set

getClosureMode

public final ClosureMode getClosureMode()
Get the closure mode.

Returns:
the closure mode

setWindingRule

public final void setWindingRule(WindingRule windingrule)

Sets the winding rule and makes a new path.

Does nothing if its parameter is null.

Fires property change: SET_WINDING_RULE.

Parameters:
windingrule - the winding rule to set

getWindingRule

public final WindingRule getWindingRule()
Get the winding rule.

Returns:
the winding rule

getPath

public final GeneralPath getPath()
Returns a copy of the GeneralPath that defines this Shape.


makePath

protected final void makePath()
Make the path for the shape using the internal vertex and tangent data and the path strategy, closure mode, and winding rule settings.


contains

public final boolean contains(double x,
                              double y)
Tests if the specified coordinates are inside the boundary of the Shape.

Specified by:
contains in interface Shape
Parameters:
x - the x-coordinate of the position tested
y - the y-coordinate of the position tested

contains

public final boolean contains(Point2D p)
Tests if a specified Point2D is inside the boundary of the Shape.

Specified by:
contains in interface Shape
Parameters:
p - the position tested

contains

public final boolean contains(double x,
                              double y,
                              double w,
                              double h)

Tests if the interior of the Shape entirely contains the specified rectangular area. All coordinates that lie inside the rectangular area must lie within the Shape for the entire rectangular area to be considered contained within the Shape.

This method might conservatively return false when:

This means that this method might return false even though the Shape contains the rectangular area. The Area class can be used to perform more accurate computations of geometric intersection for any Shape object if a more precise answer is required.

Specified by:
contains in interface Shape
Parameters:
x - the x-coordinate of the rectangle's topleft corner
y - the y-coordinate of the rectangle's topleft corner
w - the rectangle's width
h - the rectangle's height

contains

public final boolean contains(Rectangle2D r)

Tests if the interior of the Shape entirely contains the specified rectangular area. All coordinates that lie inside the rectangular area must lie within the Shape for the entire rectangular area to be considered contained within the Shape.

This method might conservatively return false when:

This means that this method might return false even though the Shape contains the rectangular area. The Area class can be used to perform more accurate computations of geometric intersection for any Shape object if a more precise answer is required.

Specified by:
contains in interface Shape
Parameters:
r - the rectangle

intersects

public final boolean intersects(double x,
                                double y,
                                double w,
                                double h)

Tests if the interior of the Shape intersects the interior of a specified rectangular area. The rectangular area is considered to intersect the Shape if any point is contained in both the interior of the Shape and the specified rectangular area.

This method might conservatively return true when:

This means that this method might return true even though the rectangular area does not intersect the Shape. The Area class can be used to perform more accurate computations of geometric intersection for any Shape object if a more precise answer is required.

Specified by:
intersects in interface Shape
Parameters:
x - the x-coordinate of the rectangle's topleft corner
y - the y-coordinate of the rectangle's topleft corner
w - the rectangle's width
h - the rectangle's height

intersects

public final boolean intersects(Rectangle2D r)

Tests if the interior of the Shape intersects the interior of a specified rectangular area. The rectangular area is considered to intersect the Shape if any point is contained in both the interior of the Shape and the specified rectangular area.

This method might conservatively return true when:

This means that this method might return true even though the rectangular area does not intersect the Shape. The Area class can be used to perform more accurate computations of geometric intersection for any Shape object if a more precise answer is required.

Specified by:
intersects in interface Shape
Parameters:
r - the rectangle

getBounds

public final Rectangle getBounds()
Returns an integer Rectangle that completely encloses the Shape. Note that there is no guarantee that the returned Rectangle is the smallest bounding box that encloses the Shape, only that the Shape lies entirely within the indicated Rectangle. The returned Rectangle might also fail to completely enclose the Shape if the Shape overflows the limited range of the integer data type. The getBounds2D method generally returns a tighter bounding box due to its greater flexibility in representation.

Specified by:
getBounds in interface Shape

getBounds2D

public final Rectangle2D getBounds2D()
Returns a high precision and more accurate bounding box of the Shape than the getBounds method. Note that there is no guarantee that the returned Rectangle2D is the smallest bounding box that encloses the Shape, only that the Shape lies entirely within the indicated Rectangle2D. The bounding box returned by this method is usually tighter than that returned by the getBounds method and never fails due to overflow problems since the return value can be an instance of the Rectangle2D that uses double precision values to store the dimensions.

Specified by:
getBounds2D in interface Shape

getPathIterator

public final PathIterator getPathIterator(AffineTransform at)

Returns an iterator object that iterates along the Shape boundary and provides access to the geometry of the Shape outline.

If an optional AffineTransform is specified, the coordinates returned in the iteration are transformed accordingly.

Each call to this method returns a fresh PathIterator object that traverses the geometry of the Shape object independently from any other PathIterator objects in use at the same time.

Specified by:
getPathIterator in interface Shape
Parameters:
at - the optional transform to apply to the PathIterator

getPathIterator

public final PathIterator getPathIterator(AffineTransform at,
                                          double flatness)

Returns an iterator object that iterates along the Shape boundary and provides access to a flattened view of the Shape outline geometry.

Only SEG_MOVETO, SEG_LINETO, and SEG_CLOSE point types are returned by the iterator.

If an optional AffineTransform is specified, the coordinates returned in the iteration are transformed accordingly.

The amount of subdivision of the curved segments is controlled by the flatness parameter, which specifies the maximum distance that any point on the unflattened transformed curve can deviate from the returned flattened path segments. Note that a limit on the accuracy of the flattened path might be silently imposed, causing very small flattening parameters to be treated as larger values. This limit, if there is one, is defined by the particular implementation that is used.

Each call to this method returns a fresh PathIterator object that traverses the Shape object geometry independently from any other PathIterator objects in use at the same time.

Specified by:
getPathIterator in interface Shape
Parameters:
at - the optional transform to apply to the PathIterator
flatness - the flatness to use to simplify the PathIterator

addPropertyChangeListener

public final void addPropertyChangeListener(PropertyChangeListener listener)

Add a PropertyChangeListener to the listener list. The listener is registered for all properties.

Specified by:
addPropertyChangeListener in interface SupportsPropertyChange
Parameters:
listener - the PropertyChangeListener to be added

addPropertyChangeListener

public final void addPropertyChangeListener(String propertyName,
                                            PropertyChangeListener listener)

Add a PropertyChangeListener to the listener list for a specific property. The listener will be invoked only when a call on firePropertyChange names that specific property.

Specified by:
addPropertyChangeListener in interface SupportsPropertyChange
Parameters:
propertyName - the name of the property to listen on
listener - the PropertyChangeListener to be added

addPropertyChangeListeners

public void addPropertyChangeListeners(PropertyChangeListener[] listeners)

Add all items in the given PropertyChangeListener array to the listener list. These items are registered for all properties.

Specified by:
addPropertyChangeListeners in interface SupportsPropertyChange
Parameters:
listeners - the PropertyChangeListener array to be added

addPropertyChangeListeners

public void addPropertyChangeListeners(String propertyName,
                                       PropertyChangeListener[] listeners)

Add all items in the given PropertyChangeListener array to the listener list for a specific property. These items will be invoked only when a call on firePropertyChange names that specific property.

Specified by:
addPropertyChangeListeners in interface SupportsPropertyChange
Parameters:
listeners - the PropertyChangeListener array to be added

removePropertyChangeListener

public final void removePropertyChangeListener(PropertyChangeListener listener)

Remove a PropertyChangeListener from the listener list. This removes a PropertyChangeListener that was registered for all properties.

Specified by:
removePropertyChangeListener in interface SupportsPropertyChange
Parameters:
listener - the PropertyChangeListener to be removed

removePropertyChangeListener

public final void removePropertyChangeListener(String propertyName,
                                               PropertyChangeListener listener)

Remove a PropertyChangeListener for a specific property.

Specified by:
removePropertyChangeListener in interface SupportsPropertyChange
Parameters:
propertyName - the name of the property that was listened on
listener - the PropertyChangeListener to be removed

getPropertyChangeListeners

public final PropertyChangeListener[] getPropertyChangeListeners()

Returns an array of all listeners that were added to this object.

Specified by:
getPropertyChangeListeners in interface SupportsPropertyChange
Returns:
an array with all listeners

getPropertyChangeListeners

public final PropertyChangeListener[] getPropertyChangeListeners(String propertyName)

Returns an array of all listeners that were added to this object and associated with the named property.

Specified by:
getPropertyChangeListeners in interface SupportsPropertyChange
Parameters:
propertyName - the name of the property to seek
Returns:
an array with all listeners for the given named property

hasListeners

public final boolean hasListeners(String propertyName)

Check if there are any listeners for a specific property.

Specified by:
hasListeners in interface SupportsPropertyChange
Parameters:
propertyName - the name of the property to check
Returns:
whether or not there are any listeners for a specific property

firePropertyChange

public final void firePropertyChange(String propertyName,
                                     Object oldValue,
                                     Object newValue)

Report a bound property update to any registered listeners. No event is fired if the old and new values are equal and non-null.

Specified by:
firePropertyChange in interface SupportsPropertyChange
Parameters:
propertyName - the programmatic name of the property that was changed
oldValue - the old value of the property
newValue - the new value of the property

firePropertyChange

public final void firePropertyChange(String propertyName,
                                     boolean oldValue,
                                     boolean newValue)

Report a bound property update to any registered listeners. No event is fired if the old and new values are equal.

Specified by:
firePropertyChange in interface SupportsPropertyChange
Parameters:
propertyName - the programmatic name of the property that was changed
oldValue - the old value of the property
newValue - the new value of the property

firePropertyChange

public final void firePropertyChange(String propertyName,
                                     char oldValue,
                                     char newValue)

Report a bound property update to any registered listeners. No event is fired if the old and new values are equal.

Specified by:
firePropertyChange in interface SupportsPropertyChange
Parameters:
propertyName - the programmatic name of the property that was changed
oldValue - the old value of the property
newValue - the new value of the property

firePropertyChange

public final void firePropertyChange(String propertyName,
                                     byte oldValue,
                                     byte newValue)

Report a bound property update to any registered listeners. No event is fired if the old and new values are equal.

Specified by:
firePropertyChange in interface SupportsPropertyChange
Parameters:
propertyName - the programmatic name of the property that was changed
oldValue - the old value of the property
newValue - the new value of the property

firePropertyChange

public final void firePropertyChange(String propertyName,
                                     short oldValue,
                                     short newValue)

Report a bound property update to any registered listeners. No event is fired if the old and new values are equal.

Specified by:
firePropertyChange in interface SupportsPropertyChange
Parameters:
propertyName - the programmatic name of the property that was changed
oldValue - the old value of the property
newValue - the new value of the property

firePropertyChange

public final void firePropertyChange(String propertyName,
                                     int oldValue,
                                     int newValue)

Report a bound property update to any registered listeners. No event is fired if the old and new values are equal.

Specified by:
firePropertyChange in interface SupportsPropertyChange
Parameters:
propertyName - the programmatic name of the property that was changed
oldValue - the old value of the property
newValue - the new value of the property

firePropertyChange

public final void firePropertyChange(String propertyName,
                                     long oldValue,
                                     long newValue)

Report a bound property update to any registered listeners. No event is fired if the old and new values are equal.

Specified by:
firePropertyChange in interface SupportsPropertyChange
Parameters:
propertyName - the programmatic name of the property that was changed
oldValue - the old value of the property
newValue - the new value of the property

firePropertyChange

public final void firePropertyChange(String propertyName,
                                     float oldValue,
                                     float newValue)

Report a bound property update to any registered listeners. No event is fired if the old and new values are equal.

Specified by:
firePropertyChange in interface SupportsPropertyChange
Parameters:
propertyName - the programmatic name of the property that was changed
oldValue - the old value of the property
newValue - the new value of the property

firePropertyChange

public final void firePropertyChange(String propertyName,
                                     double oldValue,
                                     double newValue)

Report a bound property update to any registered listeners. No event is fired if the old and new values are equal.

Specified by:
firePropertyChange in interface SupportsPropertyChange
Parameters:
propertyName - the programmatic name of the property that was changed
oldValue - the old value of the property
newValue - the new value of the property

firePropertyChange

public final void firePropertyChange(PropertyChangeEvent evt)

Fire an existing PropertyChangeEvent to any registered listeners. No event is fired if the given event's old and new values are equal and non-null.

Specified by:
firePropertyChange in interface SupportsPropertyChange
Parameters:
evt - the PropertyChangeEvent object

getForwardingListener

public final PropertyChangeForwardingListener getForwardingListener()

Returns the PropertyChangeForwardingListener that will forward the property change events it receives to this object.

Specified by:
getForwardingListener in interface SupportsPropertyChange
Returns:
the forwarding listener

addForwardingListener

public final void addForwardingListener(Object object)
Add the forwarding listener as a property change listener for the given object if the object supports property change.

Specified by:
addForwardingListener in interface SupportsPropertyChange
Parameters:
object - the object that should add the forwarding listener

removeForwardingListener

public final void removeForwardingListener(Object object)
Remove the forwarding listener as a property change listener for the given object if the object supports property change.

Specified by:
removeForwardingListener in interface SupportsPropertyChange
Parameters:
object - the object that should remove the forwarding listener

removeAndAddForwardingListener

public final void removeAndAddForwardingListener(Object oldobject,
                                                 Object newobject)
Remove the forwarding listener as a property change listener for the old object if the old object supports property change and add the forwarding listener as a property change listener for the new object if the new object supports property change.

Specified by:
removeAndAddForwardingListener in interface SupportsPropertyChange
Parameters:
oldobject - the old object that should remove the forwarding listener
newobject - the new object that should add the forwarding listener