| java.lang.Object org.openlaszlo.iv.flash.api.FlashItem org.openlaszlo.iv.flash.api.FlashObject org.openlaszlo.iv.flash.api.FlashDef org.openlaszlo.iv.flash.api.shape.MorphShape
MorphShape | final public class MorphShape extends FlashDef (Code) | | MorphShape.
The DefineMorphShape tag defines the start and end states of a morph sequence.
A morph object does not use previously defined shapes, it is considered a special
type of shape with only one character ID. A morph object should be displayed with
the PlaceObject2 tag, where the ratio field specifies how far the morph has progressed.
StartBounds defines the bounding-box of the shape at the start of the morph,
and EndBounds defines the bounding-box at the end of the morph
MorphFillStyles contains an array interleaved fill styles for the start and end shapes.
The fill style for the start shape is followed the corresponding fill style for the end shape.
Similarly, MorphLineStyles contains an array of interleaved line styles.
The StartEdges array specifies the edges for the start shape, and the style change records for
both shapes. Because the StyleChangeRecords must be the same for the start and end shapes,
they are defined only in the StartEdges array. The EndEdges array specifies the edges for
the end shape, and contains no style change records. The number of edges specified in StartEdges
must equal the number of edges in EndEdges.
Note: Strictly speaking MoveTo records fall into the category of StyleChangeRecords,
however they should be included in both the StartEdges and EndEdges arrays.
It is possible for an edge to change type over the course of a morph sequence.
A straight edge can become a curved edge and vice versa. In this case, think of
both edges as curved. A straight edge can be easily represented as a curve,
by placing the off-curve (control) point at the mid-point of the straight edge,
and the on-curve (anchor) point at the end of the straight edge.
The calculation is as follows:
CurveControlDelta.x = StraightDelta.x / 2;
CurveControlDelta.y = StraightDelta.y / 2;
CurveAnchorDelta.x = StraightDelta.x / 2;
CurveAnchorDelta.y = StraightDelta.y / 2;
author: Dmitry Skavish See Also: Shape |
Method Summary | |
public int | addFillStyle(MorphFillStyle fillStyle) Adds specified fill style to the array of shape styles. | public int | addLineStyle(MorphLineStyle lineStyle) | public void | collectDeps(DepsCollector dc) | protected FlashItem | copyInto(FlashItem item, ScriptCopier copier) | public void | drawAWTPathIteratorEnd(java.awt.geom.PathIterator pi) | public void | drawAWTPathIteratorStart(java.awt.geom.PathIterator pi) | public void | drawAWTShapeEnd(java.awt.Shape shape) | public void | drawAWTShapeEnd(java.awt.Shape shape, AffineTransform matrix) | public void | drawAWTShapeStart(java.awt.Shape shape) | public void | drawAWTShapeStart(java.awt.Shape shape, AffineTransform matrix) | public void | drawCurveEnd(int ax1, int ay1, int cx, int cy, int ax2, int ay2) | public void | drawCurveEnd(Point2D anchor1, Point2D control, Point2D anchor2) | public void | drawCurveStart(int ax1, int ay1, int cx, int cy, int ax2, int ay2) Draws curve record.
All coordinates are in twixels. | public void | drawCurveStart(Point2D anchor1, Point2D control, Point2D anchor2) Draws curve record.
All coordinates are in twixels. | public void | drawCurveToEnd(int cx, int cy, int ax, int ay) | public void | drawCurveToStart(int cx, int cy, int ax, int ay) Draws curve record.
All coordinates are in twixels. | public void | drawLineEnd(int x1, int y1, int x2, int y2) | public void | drawLineEnd(Point2D p0, Point2D p1) | public void | drawLineStart(int x1, int y1, int x2, int y2) Draws a straight line specified by two points. | public void | drawLineStart(Point2D p0, Point2D p1) Draws a straight line specified by two points. | public void | drawLineToEnd(int x, int y) | public void | drawLineToEnd(Point2D p1) | public void | drawLineToStart(int x, int y) Draws a straight line from current position to the specified one.
All coordinates are in twixels. | public void | drawLineToStart(Point2D p1) Draws a straight line from current position to the specified one.
All coordinates are in twixels. | public void | drawRectangleEnd(int x, int y, int width, int height) | public void | drawRectangleEnd(Rectangle2D r) | public void | drawRectangleStart(int x, int y, int width, int height) Draws a rectangle specified by its top-left corner and width and height
All coordinates are in twixels. | public void | drawRectangleStart(Rectangle2D r) Draws a rectangle specified by
java.awt.geom.Rectangle2D
All coordinates are in twixels. | public Rectangle2D | getBounds() | public Rectangle2D | getBoundsEnd() | public Rectangle2D | getBoundsStart() | public FlashItem | getCopy(ScriptCopier copier) | public MorphFillStyle | getFillStyle0() | public int | getFillStyle0Index() | public MorphFillStyle | getFillStyle1() | public int | getFillStyle1Index() | public MorphLineStyle | getLineStyle() | public int | getLineStyleIndex() | public ShapeRecords | getShapeRecordsEnd() | public ShapeRecords | getShapeRecordsStart() | public MorphShapeStyles | getShapeStyles() | protected StyleChangeRecord | getStyleChange() | public int | getTag() | public boolean | isConstant() | public void | movePenToEnd(int x, int y) | public void | movePenToEnd(Point2D p) | public void | movePenToStart(int x, int y) Moves pen to the specified position.
All coordinates are ABSOLUTE and are in twixels. | public void | movePenToStart(Point2D p) | public static MorphShape | parse(Parser p) | public void | printContent(PrintStream out, String indent) | public void | setBoundsEnd(Rectangle2D bounds) Sets bounding box for end shape. | public void | setBoundsEnd(int x, int y, int width, int height) Sets bounding box for end shape. | public void | setBoundsStart(Rectangle2D bounds) Sets bounding box for start shape. | public void | setBoundsStart(int x, int y, int width, int height) Sets bounding box for start shape. | public int | setFillStyle0(MorphFillStyle fillStyle) Sets specified fillstyle as current fillstyle0. | public void | setFillStyle0(int fillStyle) Sets current fillstyle0 by its index in shapestyle array. | public int | setFillStyle1(MorphFillStyle fillStyle) Sets specified fillstyle as current fillstyle1. | public void | setFillStyle1(int fillStyle) Sets current fillstyle1 by its index in shapestyle array. | public int | setLineStyle(MorphLineStyle lineStyle) Sets specified linestyle as current linestyle. | public void | setLineStyle(int lineStyle) Sets current linestyle by its index in shapestyle array. | public void | write(FlashOutput main) |
MorphShape | public MorphShape()(Code) | | Creates new empty morph shape
|
addFillStyle | public int addFillStyle(MorphFillStyle fillStyle)(Code) | | Adds specified fill style to the array of shape styles.
Parameters: fillStyle - specified fill style index of added fill style in the array |
addLineStyle | public int addLineStyle(MorphLineStyle lineStyle)(Code) | | Adds specified line style to the array of shape styles
Parameters: lineStyle - specified line style index of added line style in the array |
drawAWTPathIteratorStart | public void drawAWTPathIteratorStart(java.awt.geom.PathIterator pi)(Code) | | Draw AWT PathIterator
All coordinates are in twixels!
Parameters: pi - AWT PathIterator |
drawAWTShapeStart | public void drawAWTShapeStart(java.awt.Shape shape)(Code) | | Draw AWT Shape
All shape coordinates are in twixels!
Parameters: shape - AWT shape |
drawAWTShapeStart | public void drawAWTShapeStart(java.awt.Shape shape, AffineTransform matrix)(Code) | | Draw AWT Shape
All shape coordinates are in twixels!
Parameters: shape - AWT shape |
drawCurveEnd | public void drawCurveEnd(int ax1, int ay1, int cx, int cy, int ax2, int ay2)(Code) | | |
drawCurveStart | public void drawCurveStart(int ax1, int ay1, int cx, int cy, int ax2, int ay2)(Code) | | Draws curve record.
All coordinates are in twixels.
Parameters: ax1 - X anchor point 1 Parameters: ay1 - Y anchor point 1 Parameters: cx - X control point Parameters: cy - Y control point Parameters: ax2 - X anchor point 2 Parameters: ay2 - Y anchor point 2 |
drawCurveStart | public void drawCurveStart(Point2D anchor1, Point2D control, Point2D anchor2)(Code) | | Draws curve record.
All coordinates are in twixels.
Parameters: anchor0 - first anchor point Parameters: control - control point Parameters: anchor1 - second anchor point |
drawCurveToEnd | public void drawCurveToEnd(int cx, int cy, int ax, int ay)(Code) | | |
drawCurveToStart | public void drawCurveToStart(int cx, int cy, int ax, int ay)(Code) | | Draws curve record.
All coordinates are in twixels.
Parameters: cx - X control point Parameters: cy - Y control point Parameters: ax - X anchor point Parameters: ay - Y anchor point |
drawLineEnd | public void drawLineEnd(int x1, int y1, int x2, int y2)(Code) | | |
drawLineStart | public void drawLineStart(int x1, int y1, int x2, int y2)(Code) | | Draws a straight line specified by two points.
All coordinates are in twixels.
Parameters: x1 - X of the beginning of the line Parameters: y1 - Y of the beginning of the line Parameters: x2 - X of the end of the line Parameters: y2 - Y of the end of the line |
drawLineStart | public void drawLineStart(Point2D p0, Point2D p1)(Code) | | Draws a straight line specified by two points.
All coordinates are in twixels.
Parameters: p0 - first point Parameters: p1 - second point |
drawLineToEnd | public void drawLineToEnd(int x, int y)(Code) | | |
drawLineToStart | public void drawLineToStart(int x, int y)(Code) | | Draws a straight line from current position to the specified one.
All coordinates are in twixels.
Parameters: x - X of end of line Parameters: y - Y of end of line |
drawLineToStart | public void drawLineToStart(Point2D p1)(Code) | | Draws a straight line from current position to the specified one.
All coordinates are in twixels.
Parameters: p1 - end of line |
drawRectangleEnd | public void drawRectangleEnd(int x, int y, int width, int height)(Code) | | |
drawRectangleStart | public void drawRectangleStart(int x, int y, int width, int height)(Code) | | Draws a rectangle specified by its top-left corner and width and height
All coordinates are in twixels.
Parameters: x - x coordinates of top-left corner of the rectangle Parameters: y - y coordinates of top-left corner of the rectangle Parameters: width - width of the rectangle Parameters: height - height of the rectangle |
getBoundsEnd | public Rectangle2D getBoundsEnd()(Code) | | Returns MorphShape end shape bounds
shape bounds |
getBoundsStart | public Rectangle2D getBoundsStart()(Code) | | Returns MorphShape start shape bounds
shape bounds |
getFillStyle0 | public MorphFillStyle getFillStyle0()(Code) | | Returns current fill style 0
currently used fill style 0 |
getFillStyle0Index | public int getFillStyle0Index()(Code) | | Returns index of current fill style 0
index of currently used fill style 0 |
getFillStyle1 | public MorphFillStyle getFillStyle1()(Code) | | Returns current fill style 1
currently used fill style 1 |
getFillStyle1Index | public int getFillStyle1Index()(Code) | | Returns index of current fill style 1
index of currently used fill style 1 |
getLineStyle | public MorphLineStyle getLineStyle()(Code) | | Returns current line style
currently used line style |
getLineStyleIndex | public int getLineStyleIndex()(Code) | | Returns index of current line style
index of currently used line style |
getShapeRecordsEnd | public ShapeRecords getShapeRecordsEnd()(Code) | | Returns end shape records
object representing array of shape records |
getShapeRecordsStart | public ShapeRecords getShapeRecordsStart()(Code) | | Returns start shape records
object representing array of shape records |
getShapeStyles | public MorphShapeStyles getShapeStyles()(Code) | | Returns shape styles
object representing array of shape styles |
getTag | public int getTag()(Code) | | |
isConstant | public boolean isConstant()(Code) | | |
movePenToEnd | public void movePenToEnd(int x, int y)(Code) | | |
movePenToStart | public void movePenToStart(int x, int y)(Code) | | Moves pen to the specified position.
All coordinates are ABSOLUTE and are in twixels.
Parameters: x - new current X Parameters: y - new current Y |
movePenToStart | public void movePenToStart(Point2D p)(Code) | | Moves pen to the specified point.
All coordinates are ABSOLUTE and are in twixels!
Parameters: p - new pen position |
setBoundsEnd | public void setBoundsEnd(Rectangle2D bounds)(Code) | | Sets bounding box for end shape.
Parameters: bounds - new bounding box |
setBoundsEnd | public void setBoundsEnd(int x, int y, int width, int height)(Code) | | Sets bounding box for end shape.
|
setBoundsStart | public void setBoundsStart(Rectangle2D bounds)(Code) | | Sets bounding box for start shape.
Parameters: bounds - new bounding box |
setBoundsStart | public void setBoundsStart(int x, int y, int width, int height)(Code) | | Sets bounding box for start shape.
|
setFillStyle0 | public int setFillStyle0(MorphFillStyle fillStyle)(Code) | | Sets specified fillstyle as current fillstyle0.
If the specified fillstyle is not in the shapestyle array
then it's added, if it's already there it's reused.
Parameters: fillStyle - specified fillstyle index of specified fillstyle in the shapestyle array |
setFillStyle0 | public void setFillStyle0(int fillStyle)(Code) | | Sets current fillstyle0 by its index in shapestyle array.
Parameters: fillStyle - index of fillstyle in shapestyle array to be set as current fillstyle0 |
setFillStyle1 | public int setFillStyle1(MorphFillStyle fillStyle)(Code) | | Sets specified fillstyle as current fillstyle1.
If the specified fillstyle is not in the shapestyle array
then it's added, if it's already there it's reused.
Parameters: fillStyle - specified fillstyle index of specified fillstyle in the shapestyle array |
setFillStyle1 | public void setFillStyle1(int fillStyle)(Code) | | Sets current fillstyle1 by its index in shapestyle array.
Parameters: fillStyle - index of fillstyle in shapestyle array to be set as current fillstyle1 |
setLineStyle | public int setLineStyle(MorphLineStyle lineStyle)(Code) | | Sets specified linestyle as current linestyle.
If the specified linestyle is not in the shapestyle array
then it's added, if it's already there it's reused.
Parameters: lineStyle - specified linestyle index of specified linestyle in the shapestyle array |
setLineStyle | public void setLineStyle(int lineStyle)(Code) | | Sets current linestyle by its index in shapestyle array.
Parameters: lineStyle - index of linestyle in shapestyle array to be set as current linestyle |
|
|