Java Doc for Shape.java in  » Ajax » Laszlo-4.0.10 » org » openlaszlo » iv » flash » api » shape » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Ajax » Laszlo 4.0.10 » org.openlaszlo.iv.flash.api.shape 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


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.Shape

Shape
final public class Shape extends FlashDef (Code)
Shape.

Shapes are defined by a list of edges called a path. A path may be closed - where the start and end of the path meet to close the figure, or open - where the path forms an open-ended stroke. A path may contain a mixture of straight edges, curved edges, and "pen up and move" commands. The latter allows multiple disconnected figures to be described by a single shape structure. (see MoveTo flag)

A fill style defines the appearance of an area enclosed by a path. Fill styles supported by SWF include a color, a gradient, or a bitmapped image.
A line style defines the appearance of the outline of a path. The line style may be a stroke of any thickness and color.

SWF format allows each edge to have its own line and fill style. This can have unpredictable results when fill styles change in the middle of a path.

Flash also supports two fill styles per edge, one for each side of the edge: FillStyle0 and FillStyle1. FillStyle0 should always be used first and then FillStyle1 if the shape is filled on both sides of the edge.

A shape is comprised of the following elements:

  • CharacterId - A 16-bit value that uniquely identifies this shape as a 'character' in the dictionary. The CharacterId can be referred to in control tags such as PlaceObject. Characters can be re-used and combined with other characters to make more complex shapes.
  • Bounding box - The rectangle that completely encloses the shape.
  • Fill style array - A list of all the fill styles used in a shape.
  • Line style array - A list of all the line styles used in a shape.
  • Shape-record array - A list of shape-records. Shape-records can define straight or curved edges, style changes, or move the drawing position.
Note: Line and fill styles are defined once only, and may be used (and re-used) by any of the edges in the shape.

Note that objects of this class will always be generated as DefineShape3 tags which means that all the colors used in the shape (in line and fillstyles) have to be AlphaColors!
author:
   Dmitry Skavish




Constructor Summary
public  Shape()
    

Method Summary
public  intaddFillStyle(FillStyle fillStyle)
     Adds specified fill style to the array of shape styles.
public  intaddLineStyle(LineStyle lineStyle)
    
public  voidcollectDeps(DepsCollector dc)
    
protected  FlashItemcopyInto(FlashItem item, ScriptCopier copier)
    
public  voiddraw(java.awt.Graphics2D g2)
    
public  voiddrawAWTPathIterator(java.awt.geom.PathIterator pi)
    
public  voiddrawAWTShape(java.awt.Shape shape)
    
public  voiddrawAWTShape(java.awt.Shape shape, AffineTransform matrix)
    
public  voiddrawCurve(int ax1, int ay1, int cx, int cy, int ax2, int ay2)
     Draws curve record.

All coordinates are in twixels.

public  voiddrawCurve(Point2D anchor1, Point2D control, Point2D anchor2)
     Draws curve record.

All coordinates are in twixels.

public  voiddrawCurveTo(int cx, int cy, int ax, int ay)
     Draws curve record.

All coordinates are in twixels.

public  voiddrawLine(int x1, int y1, int x2, int y2)
     Draws a straight line specified by two points.
public  voiddrawLine(Point2D p0, Point2D p1)
     Draws a straight line specified by two points.
public  voiddrawLineTo(int x, int y)
     Draws a straight line from current position to the specified one.

All coordinates are in twixels.

public  voiddrawLineTo(Point2D p1)
     Draws a straight line from current position to the specified one.

All coordinates are in twixels.

public  voiddrawRectangle(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  voiddrawRectangle(Rectangle2D r)
     Draws a rectangle specified by java.awt.geom.Rectangle2D

All coordinates are in twixels.

public  Rectangle2DgetBounds()
    
public  FlashItemgetCopy(ScriptCopier copier)
    
public  Point2DgetCurrentPos()
    
public  FillStylegetFillStyle0()
    
public  intgetFillStyle0Index()
    
public  FillStylegetFillStyle1()
    
public  intgetFillStyle1Index()
    
public  Point2DgetFirstPos()
    
public  LineStylegetLineStyle()
    
public  intgetLineStyleIndex()
    
public  ShapeRecordsgetShapeRecords()
    
public  ShapeStylesgetShapeStyles()
    
protected  StyleChangeRecordgetStyleChange()
    
public  intgetTag()
    
public  booleanisConstant()
    
public  booleanisWithAlpha()
    
public  voidmovePenTo(int x, int y)
     Moves pen to the specified position.

All coordinates are ABSOLUTE and are in twixels.

public  voidmovePenTo(Point2D p)
    
public static  ShapenewEmptyShape1()
    
public static  ShapenewShape1()
    
public static  ShapenewShape2()
    
public static  ShapenewShape3()
    
public static  ShapenewShape3(ShapeStyles styles, ShapeRecords records)
    
public  voidnewStyleBlock()
     Creates new style block

Each style block contains styles and records which use these styles.

public static  Shapeparse(Parser p)
    
public  voidprintContent(PrintStream out, String indent)
    
public  voidsetBounds(Rectangle2D bounds)
     Sets bounding box for this shape.
public  voidsetBounds(int x, int y, int width, int height)
     Sets bounding box for this shape.
public  intsetFillStyle0(FillStyle fillStyle)
     Sets specified fillstyle as current fillstyle0.
public  voidsetFillStyle0(int fillStyle)
     Sets current fillstyle0 by its index in shapestyle array.
public  intsetFillStyle1(FillStyle fillStyle)
     Sets specified fillstyle as current fillstyle1.
public  voidsetFillStyle1(int fillStyle)
     Sets current fillstyle1 by its index in shapestyle array.
public  intsetLineStyle(LineStyle lineStyle)
     Sets specified linestyle as current linestyle.
public  voidsetLineStyle(int lineStyle)
     Sets current linestyle by its index in shapestyle array.
public  voidwrite(FlashOutput main)
    


Constructor Detail
Shape
public Shape()(Code)
Creates new empty shape (Shape3 - all colors with alpha)




Method Detail
addFillStyle
public int addFillStyle(FillStyle fillStyle)(Code)
Adds specified fill style to the array of shape styles.

Note: colors used in the specified fillstyle have to be AlphaColors
Parameters:
  fillStyle - specified fill style index of added fill style in the array




addLineStyle
public int addLineStyle(LineStyle lineStyle)(Code)
Adds specified line style to the array of shape styles

Note: colors used in the specified linestyle have to be AlphaColors
Parameters:
  lineStyle - specified line style index of added line style in the array




collectDeps
public void collectDeps(DepsCollector dc)(Code)



copyInto
protected FlashItem copyInto(FlashItem item, ScriptCopier copier)(Code)



draw
public void draw(java.awt.Graphics2D g2)(Code)
Draws itself into specified graphics
Parameters:
  g - graphics object



drawAWTPathIterator
public void drawAWTPathIterator(java.awt.geom.PathIterator pi)(Code)
Draw AWT PathIterator

All coordinates are in twixels!
Parameters:
  pi - AWT PathIterator




drawAWTShape
public void drawAWTShape(java.awt.Shape shape)(Code)
Draw AWT Shape

All shape coordinates are in twixels!
Parameters:
  shape - AWT shape




drawAWTShape
public void drawAWTShape(java.awt.Shape shape, AffineTransform matrix)(Code)
Draw AWT Shape

All shape coordinates are in twixels!
Parameters:
  shape - AWT shape




drawCurve
public void drawCurve(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




drawCurve
public void drawCurve(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




drawCurveTo
public void drawCurveTo(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




drawLine
public void drawLine(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




drawLine
public void drawLine(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




drawLineTo
public void drawLineTo(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




drawLineTo
public void drawLineTo(Point2D p1)(Code)
Draws a straight line from current position to the specified one.

All coordinates are in twixels.
Parameters:
  p1 - end of line




drawRectangle
public void drawRectangle(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




drawRectangle
public void drawRectangle(Rectangle2D r)(Code)
Draws a rectangle specified by java.awt.geom.Rectangle2D

All coordinates are in twixels.
Parameters:
  r - specified rectangle




getBounds
public Rectangle2D getBounds()(Code)
Returns Shape bounds shape bounds



getCopy
public FlashItem getCopy(ScriptCopier copier)(Code)



getCurrentPos
public Point2D getCurrentPos()(Code)
Returns current pen position current pen position



getFillStyle0
public FillStyle 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 FillStyle 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



getFirstPos
public Point2D getFirstPos()(Code)
Returns first pen position (first moveTo) first pen position



getLineStyle
public LineStyle 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



getShapeRecords
public ShapeRecords getShapeRecords()(Code)
Returns shape records object representing array of shape records



getShapeStyles
public ShapeStyles getShapeStyles()(Code)
Returns shape styles object representing array of shape styles



getStyleChange
protected StyleChangeRecord getStyleChange()(Code)



getTag
public int getTag()(Code)



isConstant
public boolean isConstant()(Code)



isWithAlpha
public boolean isWithAlpha()(Code)



movePenTo
public void movePenTo(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




movePenTo
public void movePenTo(Point2D p)(Code)
Moves pen to the specified point.

All coordinates are ABSOLUTE and are in twixels!
Parameters:
  p - new pen position




newEmptyShape1
public static Shape newEmptyShape1()(Code)
Creates empty Shape (DEFINESHAPE tag) empty shape



newShape1
public static Shape newShape1()(Code)
Creates new Shape defined by tag DEFINESHAPE new Shape



newShape2
public static Shape newShape2()(Code)
Creates new Shape defined by tag DEFINESHAPE2 new Shape



newShape3
public static Shape newShape3()(Code)
Creates new Shape defined by tag DEFINESHAPE3 new Shape



newShape3
public static Shape newShape3(ShapeStyles styles, ShapeRecords records)(Code)
Creates new Shape3 from provided shape styles and records new Shape



newStyleBlock
public void newStyleBlock()(Code)
Creates new style block

Each style block contains styles and records which use these styles. Records cannot use styles from different style blocks. It means that after this call one cannot use styles (and style indexes) from previous style blocks.




parse
public static Shape parse(Parser p)(Code)
Parses Shape
Parameters:
  p - Parser parsed shape



printContent
public void printContent(PrintStream out, String indent)(Code)



setBounds
public void setBounds(Rectangle2D bounds)(Code)
Sets bounding box for this shape.
Parameters:
  bounds - new bounding box



setBounds
public void setBounds(int x, int y, int width, int height)(Code)
Sets bounding box for this shape.



setFillStyle0
public int setFillStyle0(FillStyle 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.

Note: colors used in the specified fillstyle have to be AlphaColors
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(FillStyle 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.

Note: colors used in the specified fillstyle have to be AlphaColors
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(LineStyle 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.

Note: color used in the specified linestyle has to be AlphaColor
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



write
public void write(FlashOutput main)(Code)



Methods inherited from org.openlaszlo.iv.flash.api.FlashDef
protected FlashItem copyInto(FlashItem item, ScriptCopier copier)(Code)(Java Doc)
public int getID()(Code)(Java Doc)
public String getName()(Code)(Java Doc)
public void setID(int id)(Code)(Java Doc)
public void setName(String name)(Code)(Java Doc)

Methods inherited from org.openlaszlo.iv.flash.api.FlashObject
protected boolean _isConstant()(Code)(Java Doc)
public void apply(Context context)(Code)(Java Doc)
public void collectDeps(DepsCollector dc)(Code)(Java Doc)
public void collectFonts(FontsCollector fc)(Code)(Java Doc)
protected FlashItem copyInto(FlashItem item, ScriptCopier copier)(Code)(Java Doc)
public void generate(FlashOutput fob, DepsCollector dc)(Code)(Java Doc)
public Rectangle2D getBounds()(Code)(Java Doc)
abstract public int getTag()(Code)(Java Doc)
public boolean isConstant()(Code)(Java Doc)
public boolean isProcessed()(Code)(Java Doc)
public void printContent(PrintStream out, String indent)(Code)(Java Doc)
public void process(FlashFile file, Context context) throws IVException(Code)(Java Doc)
protected void setConstant(boolean is_const)(Code)(Java Doc)
public void setProcessed()(Code)(Java Doc)

Methods inherited from org.openlaszlo.iv.flash.api.FlashItem
protected FlashItem copyInto(FlashItem item, ScriptCopier copier)(Code)(Java Doc)
public FlashItem getCopy(ScriptCopier copier)(Code)(Java Doc)
abstract public void printContent(PrintStream out, String indent)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
abstract public void write(FlashOutput fob)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.