com.arctorus.documents
Class Shape

java.lang.Object
  extended by com.arctorus.documents.Shape
Direct Known Subclasses:
Picture

public class Shape
extends java.lang.Object

Shape on a page, e.g. line, ellipse, rectangle, picture.
Use static methods from ShapeFactory class to create new shapes.

See Also:
ShapeFactory

Method Summary
static com.arctorus.documents.CustomShape createCustomShape()
          Create and return new custom shape.
static Shape createEllipse()
          Create and return new ellipse shape.
static Shape createLine()
          Create and return new line shape.
static Picture createPicture()
          Create and return new picture shape.
static Shape createRectangle()
          Create and return new rectangle shape.
 AdjustmentList getAdjustmentList()
          Return adjustments of a shape.
 java.awt.geom.Rectangle2D getBounds()
          Get bounds of a shape.
 FillFormat getFillFormat()
          Get fill style of a shape.
 Hyperlink getHyperlink()
          Get hyperlink for a shape.
 java.awt.geom.Point2D getLowerRightPoint()
          Get lower right point of shape bounds.
 int getRotation()
          Get rotation angle (degree) of a shape.
 ShapeType getShapeType()
          Get type of a shape.
 StrokeFormat getStrokeFormat()
          Get style of lines used to draw a shape.
 TextBox getTextBox()
          Get text box of a shape.
 java.awt.geom.Point2D getUpperLeftPoint()
          Get upper left point of shape bounds.
 boolean hasHyperlink()
          Determines whether a shape has a hyperlink.
 boolean isProtected()
          Get whether a shape is protected against selecting and modifying.
 boolean isReflectVertically()
          Get whether a shape is reflected vertically.
 void setBounds(java.awt.geom.Rectangle2D bounds)
          Set bounds of a shape.
 void setFillFormat(FillFormat fillFormat)
          Set fill style of a shape.
 void setHyperlink(Hyperlink hyperlink)
          Set hyperlink for a shape.
 void setProtected(boolean isProtected)
          Set whether a shape is protected against selecting and modifying.
 void setReflectVertically(boolean isReflectVertically)
          Set whether a shape is reflected vertically.
 void setRotation(int rotation)
          Set rotation angle (degree) of a shape.
 void setStrokeFormat(StrokeFormat strokeFormat)
          Set style of lines used to draw a shape.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTextBox

public TextBox getTextBox()
Get text box of a shape.


getShapeType

public ShapeType getShapeType()
Get type of a shape.


getRotation

public int getRotation()
Get rotation angle (degree) of a shape.


setRotation

public void setRotation(int rotation)
Set rotation angle (degree) of a shape.

Parameters:
rotation - new rotation angle (degree).

getStrokeFormat

public StrokeFormat getStrokeFormat()
Get style of lines used to draw a shape.


setStrokeFormat

public void setStrokeFormat(StrokeFormat strokeFormat)
Set style of lines used to draw a shape.

Parameters:
strokeFormat - new line style. if strokeFormat is null then it will not change anything.

getFillFormat

public FillFormat getFillFormat()
Get fill style of a shape.


setFillFormat

public void setFillFormat(FillFormat fillFormat)
Set fill style of a shape.

Parameters:
fillFormat - new fill style. if fillFormat is null then it will not change anything.

hasHyperlink

public boolean hasHyperlink()
Determines whether a shape has a hyperlink.


getHyperlink

public Hyperlink getHyperlink()
Get hyperlink for a shape. Hyperlink.NULL if hyperlink is not set.


setHyperlink

public void setHyperlink(Hyperlink hyperlink)
Set hyperlink for a shape.

Parameters:
hyperlink - new hyperlink. if hyperlink is null then it will not change anything.

isReflectVertically

public boolean isReflectVertically()
Get whether a shape is reflected vertically.


setReflectVertically

public void setReflectVertically(boolean isReflectVertically)
Set whether a shape is reflected vertically.

Parameters:
isReflectVertically - true to reflect the shape.

getBounds

public java.awt.geom.Rectangle2D getBounds()
Get bounds of a shape.


setBounds

public void setBounds(java.awt.geom.Rectangle2D bounds)
Set bounds of a shape.

Parameters:
bounds - new shape bounds. if bounds is null then it will not change anything.

createRectangle

public static Shape createRectangle()
Create and return new rectangle shape.


createEllipse

public static Shape createEllipse()
Create and return new ellipse shape.


createLine

public static Shape createLine()
Create and return new line shape.


createCustomShape

public static com.arctorus.documents.CustomShape createCustomShape()
Create and return new custom shape.


createPicture

public static Picture createPicture()
Create and return new picture shape.


isProtected

public boolean isProtected()
Get whether a shape is protected against selecting and modifying.


setProtected

public void setProtected(boolean isProtected)
Set whether a shape is protected against selecting and modifying.

Parameters:
isProtected - true to protect a shape.

getUpperLeftPoint

public java.awt.geom.Point2D getUpperLeftPoint()
Get upper left point of shape bounds. If isReflectVertically() returns true then gets the lower left point.


getLowerRightPoint

public java.awt.geom.Point2D getLowerRightPoint()
Get lower right point of shape bounds. If isReflectVertically() returns true then gets the upper right point.


getAdjustmentList

public AdjustmentList getAdjustmentList()
Return adjustments of a shape. AdjustmentList.NULL if a shape doesn't have adjustments.