edu.neu.ccs.gui
Class MutatableWrapper

java.lang.Object
  |
  +--edu.neu.ccs.gui.AbstractPaintable
        |
        +--edu.neu.ccs.gui.AbstractMutatablePaintable
              |
              +--edu.neu.ccs.gui.MutatableWrapper
All Implemented Interfaces:
MutatablePaintable, Paintable, SupportsPropertyChange

public class MutatableWrapper
extends AbstractMutatablePaintable

The class MutatableWrapper will wrap a Paintable object to obtain an object that implements SupportsPropertyChange.

In 2.3.5, the interface MutatablePaintable was merged into the interface Paintable. Hence the primary reason for the existence of this class no longer holds.

The class remains to avoid breaking existing code but its code has been modified to take into account the new structure of AbstractPaintable Certain methods that used to be in this class are obtained by inheritance.

The related class, Tile, has been introduced to provide a wrapper class for the purpose of replicating a paintable multiple times. This class is simpler because it makes no reference to the obsolete interfaces and classes.

Since:
2.3

Field Summary
 
Fields inherited from interface edu.neu.ccs.gui.Paintable
REMOVE_PAINTABLE, SET_CLIPPING_SHAPE, SET_DEFAULT_BOUNDS2D, SET_DEFAULT_CENTER, SET_DEFAULT_ORIGINAL_BOUNDS2D, SET_DEFAULT_ORIGINAL_CENTER, SET_MUTATOR, SET_OPACITY, SET_PAINTABLE, SET_VISIBLE
 
Constructor Summary
MutatableWrapper()
          Deprecated. The constructor that leaves the paintable unspecified.
MutatableWrapper(Paintable paintable)
          Deprecated. The constructor to specify the paintable to be wrapped.
MutatableWrapper(Paintable paintable, AffineTransform mutator)
          Deprecated. The constructor to specify the paintable to be wrapped and the initial mutator.
 
Method Summary
 Rectangle2D getActualBounds2D()
          Deprecated. Returns the actual bounds of this wrapper or null if the wrapper is effectively empty.
 Paintable getPaintable()
          Deprecated. Returns the wrapped paintable.
 boolean originalContains(double x, double y)
          Deprecated. Tests if a point specified by coordinates is inside the original paintable without mutation.
 void originalPaint(Graphics g)
          Deprecated. Paints onto a Graphics context using information from this object but without the use of the mutator transform.
 void setPaintable(Paintable paintable)
          Deprecated. Sets the paintable to be wrapped.
 
Methods inherited from class edu.neu.ccs.gui.AbstractPaintable
addForwardingListener, addPostMutation, addPostMutation, addPreMutation, addPreMutation, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListeners, addPropertyChangeListeners, affinetransform, applyOpacity, contains, contains, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBounds2D, getCenter, getCorner, getDefaultBounds2D, getDefaultCenter, getDefaultOriginalBounds2D, getDefaultOriginalCenter, getForwardingListener, getMutator, getMutatorInverse, getOpacity, getOriginalBounds2D, getOriginalCenter, getPreparedGraphics2D, getPropertyChangeListeners, getPropertyChangeListeners, glide, glidereflect, hasListeners, hreflect, isVisible, lineartransform, move, move, moveCenterTo, moveCenterTo, moveCornerTo, moveCornerTo, originalContains, paint, paintAt, paintAt, paintAt, paintAt, possiblyContains, reflect, removeAndAddForwardingListener, removeForwardingListener, removePropertyChangeListener, removePropertyChangeListener, rotate, scale, scale, setDefaultBounds2D, setDefaultCenter, setDefaultOriginalBounds2D, setDefaultOriginalCenter, setMutator, setOpacity, setVisible, shear, vreflect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.neu.ccs.gui.Paintable
addPostMutation, addPostMutation, addPreMutation, addPreMutation, affinetransform, applyOpacity, contains, contains, getBounds2D, getCenter, getCorner, getDefaultBounds2D, getDefaultCenter, getDefaultOriginalBounds2D, getDefaultOriginalCenter, getMutator, getMutatorInverse, getOpacity, getOriginalBounds2D, getOriginalCenter, getPreparedGraphics2D, glide, glidereflect, hreflect, isVisible, lineartransform, move, move, moveCenterTo, moveCenterTo, moveCornerTo, moveCornerTo, originalContains, paint, paintAt, paintAt, paintAt, paintAt, reflect, rotate, scale, scale, setDefaultBounds2D, setDefaultCenter, setDefaultOriginalBounds2D, setDefaultOriginalCenter, setMutator, setOpacity, setVisible, shear, vreflect
 

Constructor Detail

MutatableWrapper

public MutatableWrapper()
Deprecated. 
The constructor that leaves the paintable unspecified.

See Also:
MutatableWrapper(Paintable), MutatableWrapper(Paintable, AffineTransform)

MutatableWrapper

public MutatableWrapper(Paintable paintable)
Deprecated. 
The constructor to specify the paintable to be wrapped.

Parameters:
paintable - the paintable to be wrapped
See Also:
MutatableWrapper(), MutatableWrapper(Paintable, AffineTransform)

MutatableWrapper

public MutatableWrapper(Paintable paintable,
                        AffineTransform mutator)
Deprecated. 
The constructor to specify the paintable to be wrapped and the initial mutator.

Parameters:
paintable - the paintable to be wrapped
mutator - the initial mutator
See Also:
MutatableWrapper(), MutatableWrapper(Paintable)
Method Detail

setPaintable

public final void setPaintable(Paintable paintable)
Deprecated. 

Sets the paintable to be wrapped.

The paintable may be set to null to eliminate the paintable. This object will then paint nothing.

Fires property change: SET_PAINTABLE.

Parameters:
paintable - the paintable to be wrapped
See Also:
getPaintable()

getPaintable

public final Paintable getPaintable()
Deprecated. 
Returns the wrapped paintable.

Returns:
the wrapped paintable
See Also:
setPaintable(Paintable)

originalPaint

public final void originalPaint(Graphics g)
Deprecated. 

Paints onto a Graphics context using information from this object but without the use of the mutator transform.

Specified by:
originalPaint in interface Paintable
Specified by:
originalPaint in class AbstractPaintable
Parameters:
g - the graphics context on which to paint
See Also:
AbstractPaintable.getPreparedGraphics2D(Graphics)

getActualBounds2D

public final Rectangle2D getActualBounds2D()
Deprecated. 

Returns the actual bounds of this wrapper or null if the wrapper is effectively empty.

If the internal paintable is non-null, then returns a copy of the 2-dimensional bounds of the internal paintable prior to any mutation of this object.

Since the internal paintable may have a mutation or defaults this method calls getBounds2D on the internal paintable. Hence any mutation or defaults set for the internal paintable are respected.

Specified by:
getActualBounds2D in interface Paintable
Specified by:
getActualBounds2D in class AbstractPaintable
Returns:
a copy of the 2-dimensional bounds of the original paintable
See Also:
AbstractPaintable.getBounds2D()

originalContains

public final boolean originalContains(double x,
                                      double y)
Deprecated. 

Tests if a point specified by coordinates is inside the original paintable without mutation.

Specified by:
originalContains in interface Paintable
Specified by:
originalContains in class AbstractPaintable
Parameters:
x - the x-coordinate of the point
y - the y-coordinate of the point
Returns:
whether or not a specified point is inside the original paintable