edu.neu.ccs.gui
Class PaintableSequenceComposite

java.lang.Object
  extended byedu.neu.ccs.gui.AbstractPaintable
      extended byedu.neu.ccs.gui.PaintableSequenceComposite
All Implemented Interfaces:
JPTConstants, Paintable, SupportsPropertyChange, SwingConstants
Direct Known Subclasses:
MultiLineTextPaintable, PaintBar

public class PaintableSequenceComposite
extends AbstractPaintable

The class PaintableSequenceComposite is a base class for the construction of Paintable classes. Although the class is not abstract, nothing useful can be done with it directly.

A derived class can control exactly what is inserted into the internal PaintableSequence via the protected access method getPaintableSequence() but this sequence is not visible to a public caller. Thus, all features of a PaintableSequence are available to a derived class without public exposure of this implementation.

In 2.3.5, the class was refactored to be consistent with the new Paintable interface and the new AbstractPaintable class.

In 2.4.0, this class was updated to be consistent with refinements to the Paintable interface.

In 2.6.0, this class was refactored to directly extend AbstractPaintable. This implementation is much easier and also has the advantages of the Tile wrapper class, namely, this class maintains mutator data independent of the internal paintable sequence. This turned out to be critical in the definition of a new derived class MultiLineTextPaintable. In effect, this class is now a wrapper class similar to Tile but what is wrapped is an internal paintable sequence not a paintable supplied by the caller.

Since the internal paintable sequence is not available to a normal caller, this class provides methods to permit the caller to set or get the background paint and background tile of that sequence. This may be useful for certain effects.

Since:
2.3.2
Version:
2.6.0
See Also:
Tile, MultiLineTextPaintable

Field Summary
private  PaintableSequence sequence
          The internal paintable sequence.
 
Fields inherited from class edu.neu.ccs.gui.AbstractPaintable
SET_BACKGROUND_PAINT, SET_BACKGROUND_TILE
 
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, SHIFT_PAINTABLE
 
Fields inherited from interface edu.neu.ccs.util.JPTConstants
ABOVE, ALIGNMENT, BELOW, BOTTOM_LEFT, BOTTOM_RIGHT, DEFAULT, FONT, INPUT_PROPERTIES, MANDATORY, OPTIONAL, ORIENTATION, TOP_LEFT, TOP_RIGHT, VALUE
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Constructor Summary
PaintableSequenceComposite()
           
 
Method Summary
 void clearBothInnerBackgrounds()
          Clears both the background paint and the background tile of the internal paintable sequence.
 void clearInnerBackgroundPaint()
          Clears the background paint of the internal paintable sequence.
 void clearInnerBackgroundTile()
          Clears the background tile of the internal paintable sequence.
 XRect getActualBounds2D()
          Implements getActualBounds2D on this object by calling getBounds2D on the internal paintable sequence.
 Paint getInnerBackgroundPaint()
          Gets the background paint of the internal paintable sequence.
 Paintable getInnerBackgroundTile()
          Gets the background tile of the internal paintable sequence.
protected  PaintableSequence getPaintableSequence()
          Returns the internal paintable sequence for use by a derived class.
 boolean originalContains(double x, double y)
          Implements originalContains on this object by calling contains on the internal paintable sequence.
 void originalPaint(Graphics g)
          Implements originalPaint on this object by calling paint on the internal paintable sequence.
 void setInnerBackgroundPaint(Paint paint)
          Sets the background paint of the internal paintable sequence.
 void setInnerBackgroundTile(Object object)
          Sets the background tile of the internal paintable sequence.
 
Methods inherited from class edu.neu.ccs.gui.AbstractPaintable
addForwardingListener, addPostMutation, addPostMutation, addPreMutation, addPreMutation, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListeners, addPropertyChangeListeners, affinetransform, applyOpacity, clearBackgroundPaint, clearBackgroundTile, clearBothBackgrounds, contains, contains, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundPaint, getBackgroundTile, getBounds2D, getCenter, getCorner, getDefaultBounds2D, getDefaultCenter, getDefaultOriginalBounds2D, getDefaultOriginalCenter, getForwardingListener, getMutator, getMutatorInverse, getOpacity, getOriginalBounds2D, getOriginalCenter, getPreparedGraphics2D, getPropertyChangeListeners, getPropertyChangeListeners, glide, glidereflect, hasListeners, hreflect, isVisible, lineartransform, makeSnapshot, move, move, moveCenterTo, moveCenterTo, moveCornerTo, moveCornerTo, mutate, mutate, originalContains, paint, paintAsTiles, paintAsTiles, paintAsTiles, paintAt, paintAt, paintAt, paintAt, possiblyContains, reflect, removeAndAddForwardingListener, removeForwardingListener, removePropertyChangeListener, removePropertyChangeListener, rotate, scale, scale, setBackgroundPaint, setBackgroundTile, setDefaultBounds2D, setDefaultCenter, setDefaultOriginalBounds2D, setDefaultOriginalCenter, setMutator, setMutator, setOpacity, setVisible, shear, vreflect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sequence

private PaintableSequence sequence
The internal paintable sequence.

Constructor Detail

PaintableSequenceComposite

public PaintableSequenceComposite()
Method Detail

getPaintableSequence

protected PaintableSequence getPaintableSequence()

Returns the internal paintable sequence for use by a derived class.

Returns:
the internal paintable sequence

originalPaint

public void originalPaint(Graphics g)

Implements originalPaint on this object by calling paint on the internal paintable sequence.

Specified by:
originalPaint in interface Paintable
Specified by:
originalPaint in class AbstractPaintable
Parameters:
g - the graphics context on which to paint

getActualBounds2D

public XRect getActualBounds2D()

Implements getActualBounds2D on this object by calling getBounds2D on the internal paintable sequence.

Specified by:
getActualBounds2D in interface Paintable
Specified by:
getActualBounds2D in class AbstractPaintable

originalContains

public boolean originalContains(double x,
                                double y)

Implements originalContains on this object by calling contains on the internal paintable sequence.

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

setInnerBackgroundPaint

public void setInnerBackgroundPaint(Paint paint)

Sets the background paint of the internal paintable sequence.

Parameters:
paint - the inner background paint to set

getInnerBackgroundPaint

public Paint getInnerBackgroundPaint()

Gets the background paint of the internal paintable sequence.


clearInnerBackgroundPaint

public void clearInnerBackgroundPaint()

Clears the background paint of the internal paintable sequence.


setInnerBackgroundTile

public void setInnerBackgroundTile(Object object)

Sets the background tile of the internal paintable sequence.

The object passed should be a paintable or be convertible to a paintable via the method ComponentFactory.makePaintable.

Parameters:
object - the background tile object

getInnerBackgroundTile

public Paintable getInnerBackgroundTile()

Gets the background tile of the internal paintable sequence.


clearInnerBackgroundTile

public void clearInnerBackgroundTile()

Clears the background tile of the internal paintable sequence.


clearBothInnerBackgrounds

public void clearBothInnerBackgrounds()

Clears both the background paint and the background tile of the internal paintable sequence.