diva.canvas.demo
Class WarpImageFigure

java.lang.Object
  extended by diva.canvas.AbstractFigure
      extended by diva.canvas.demo.WarpImageFigure
All Implemented Interfaces:
CanvasComponent, Figure, VisibleComponent, UserObjectContainer

public class WarpImageFigure
extends AbstractFigure

Warps a image on a CubicCurve2D flattened path.

Version:
$Revision: 1.7 $
Author:
John Reekie

Constructor Summary
WarpImageFigure(Image img)
           
 
Method Summary
 Shape getShape()
          Get the outline shape of this figure.
 void paint(Graphics2D g2)
          Paint the figure.
 void reset(int w, int h)
           
 void step(int w, int h)
           
 void transform(AffineTransform t)
          Transform the figure with the supplied transform.
 void translate(double dx, double dy)
          Move the figure the indicated distance.
 
Methods inherited from class diva.canvas.AbstractFigure
contains, getBounds, getInteractor, getLayer, getOrigin, getParent, getToolTipText, getTransformContext, getUserObject, hit, intersects, isVisible, paint, repaint, repaint, setInteractor, setParent, setToolTipText, setUserObject, setVisible
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WarpImageFigure

public WarpImageFigure(Image img)
Method Detail

reset

public void reset(int w,
                  int h)

step

public void step(int w,
                 int h)

paint

public void paint(Graphics2D g2)
Description copied from class: AbstractFigure
Paint the figure. This is an abstract method. Implementing subclasses should note that the graphics context may already have a current transform, so if this figure needs to perform a transform, it must be cascaded with the current transform and the transform restored at the end of this method. The graphics context may also contain a clip region, so any clipping must be done with the intersection of the current clip and the clip desired by this method. and the clip restored. Other state in the graphics context, such as the stroke and fill, do not need to be preserved.

Specified by:
paint in interface VisibleComponent
Specified by:
paint in class AbstractFigure

getShape

public Shape getShape()
Description copied from class: AbstractFigure
Get the outline shape of this figure. The outline shape is used for things like highlighting. This is an abstract method, provided here since a number of other concrete methods use it.

Specified by:
getShape in interface Figure
Specified by:
getShape in class AbstractFigure

transform

public void transform(AffineTransform t)
Description copied from class: AbstractFigure
Transform the figure with the supplied transform. This can be used to perform arbitrary translation, scaling, shearing, and rotation operations.

Specified by:
transform in interface Figure
Specified by:
transform in class AbstractFigure

translate

public void translate(double dx,
                      double dy)
Description copied from class: AbstractFigure
Move the figure the indicated distance. The default implementation uses the transform method, so most subclasses can probably implement this more efficiently.

Specified by:
translate in interface Figure
Overrides:
translate in class AbstractFigure


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.