visual.statik.described
Class Content

java.lang.Object
  extended by visual.statik.AbstractTransformableContent
      extended by visual.statik.described.Content
All Implemented Interfaces:
SimpleContent, TransformableContent

public class Content
extends AbstractTransformableContent
implements TransformableContent

Described visual content that knows how to render and transform itself

See Also:
"The Design and Implementation of Multimedia Software © 2011"

Field Summary
 
Fields inherited from class visual.statik.AbstractTransformableContent
angle, relocated, rerotated, rescaled, x, xRotation, xScale, y, yRotation, yScale
 
Constructor Summary
Content()
          Default Constructor
Content(java.awt.Shape shape, java.awt.Color color, java.awt.Paint paint, java.awt.Stroke stroke)
          Explicit Value Constructor
 
Method Summary
 java.awt.geom.Rectangle2D getBounds2D(boolean transformed)
          Returns a high precision bounding box of the Content either before or after it is transformed
 java.awt.Color getColor()
          Get the stroke Color
 java.awt.Paint getPaint()
          Get the fill Paint
 java.awt.geom.PathIterator getPathIterator(boolean transformed)
          Get a PathIterator
 java.awt.Stroke getStroke()
          Get the Stroke
 void render(java.awt.Graphics g)
          Render this described visual content
 void setColor(java.awt.Color color)
          Set the Color to use for stroking
 void setPaint(java.awt.Paint paint)
          Set the Paint to use for filling
 void setShape(java.awt.Shape shape)
          Set the Shape
 void setStroke(java.awt.Stroke stroke)
          Set the Stroke to use
 
Methods inherited from class visual.statik.AbstractTransformableContent
getAffineTransform, getBounds2D, isTransformationRequired, setLocation, setRotation, setScale, setScale, setTransformationRequired
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface visual.statik.TransformableContent
setLocation, setRotation, setScale
 

Constructor Detail

Content

public Content()
Default Constructor


Content

public Content(java.awt.Shape shape,
               java.awt.Color color,
               java.awt.Paint paint,
               java.awt.Stroke stroke)
Explicit Value Constructor

Parameters:
shape - The Shape
color - The Color to stroke with (or null for no stroke)
paint - The Paint to fill with (or null for no fill)
stroke - The Stroke (or null for the default)
Method Detail

getBounds2D

public java.awt.geom.Rectangle2D getBounds2D(boolean transformed)
Returns a high precision bounding box of the Content either before or after it is transformed

Specified by:
getBounds2D in interface TransformableContent
Specified by:
getBounds2D in class AbstractTransformableContent
Parameters:
transformed - true to get the BB of the transformed content
Returns:
The bounding box

getColor

public java.awt.Color getColor()
Get the stroke Color

Returns:
The stroke Color

getPaint

public java.awt.Paint getPaint()
Get the fill Paint

Returns:
The Paint

getPathIterator

public java.awt.geom.PathIterator getPathIterator(boolean transformed)
Get a PathIterator

Parameters:
transformed - true to get the transformed version
Returns:
The PathIterator

getStroke

public java.awt.Stroke getStroke()
Get the Stroke

Returns:
The Stroke

render

public void render(java.awt.Graphics g)
Render this described visual content

Specified by:
render in interface SimpleContent
Parameters:
g - The rendering engine to use

setColor

public void setColor(java.awt.Color color)
Set the Color to use for stroking

Parameters:
color - The Color to use (or null to prevent stroking)

setPaint

public void setPaint(java.awt.Paint paint)
Set the Paint to use for filling

Parameters:
paint - The Paint to use (or null to prevent filling)

setShape

public void setShape(java.awt.Shape shape)
Set the Shape

Parameters:
shape - The Shape (or null to render nothing)

setStroke

public void setStroke(java.awt.Stroke stroke)
Set the Stroke to use

Parameters:
stroke - The Stroke to use (or null to use the default)


Design and Implementation of Multimedia Software, Jones and Bartlett Publishers