com.hdcookbook.grin.features.parts
Class SEImagePlacement
java.lang.Object
com.hdcookbook.grin.features.parts.SEImagePlacement
- All Implemented Interfaces:
- SEImageSeqPlacement
public class SEImagePlacement
- extends java.lang.Object
- implements SEImageSeqPlacement
This class represents an image_placement structure. This structure
determines the placement (x,y position, width and height) of an image,
or of an image sequence, or an image within an image sequence.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SEImagePlacement
public SEImagePlacement()
setScaleX
public void setScaleX(double scaleX)
getScaleX
public double getScaleX()
setScaleY
public void setScaleY(double scaleY)
getScaleY
public double getScaleY()
setX
public void setX(int x)
getX
public int getX()
setXAlign
public void setXAlign(SEImageSeqPlacement.HorizontalAlignment xAlign)
getXAlign
public SEImageSeqPlacement.HorizontalAlignment getXAlign()
setY
public void setY(int y)
getY
public int getY()
setYAlign
public void setYAlign(SEImageSeqPlacement.VerticalAlignment yAlign)
getYAlign
public SEImageSeqPlacement.VerticalAlignment getYAlign()
getImageSeqPlacementRects
public java.awt.Rectangle[] getImageSeqPlacementRects(java.lang.String[] images)
throws java.io.IOException
- Calculate the image placement rectangles for this placement when used
in an image_sequence
- Specified by:
getImageSeqPlacementRects
in interface SEImageSeqPlacement
- Throws:
java.io.IOException
- if reading an image fails, or if there is an
incompatible number of placements.
getImagePlacementRect
public java.awt.Rectangle getImagePlacementRect(java.lang.String imageFileName)
throws java.io.IOException
- Get the rectangle for this placement when used in a fixed_image
feature. This reqires reading and decoding the image passed in,
to get the width and height.
In keeping with the Graphics.draw() method that takes dx1, dx2 etc.,
the resulting rectangle's x position will be one past the right edge
if the width is negative, and the y position will be one past the
bottom edge if the height is negative. That is, it will be set up
so you can call
g.draw(..., r.x, r.y, r.x+r.width, r.y+r.height, ...)
.
- Throws:
java.io.IOException
- If there's a problem reading the image file