org.apache.poi.hslf.model
Class SimpleShape

java.lang.Object
  extended by org.apache.poi.hslf.model.Shape
      extended by org.apache.poi.hslf.model.SimpleShape
Direct Known Subclasses:
AutoShape, Line, Picture, TextBox

public class SimpleShape
extends Shape

An abstract simple (non-group) shape. This is the parent class for all primitive shapes like Line, Rectangle, etc.

Author:
Yegor Kozlov

Field Summary
 
Fields inherited from class org.apache.poi.hslf.model.Shape
_escherContainer, _parent, _sheet, EMU_PER_CENTIMETER, EMU_PER_INCH, EMU_PER_POINT, logger, MASTER_DPI, PIXEL_DPI, POINT_DPI
 
Constructor Summary
protected SimpleShape(EscherContainerRecord escherRecord, Shape parent)
          Create a SimpleShape object and initialize it from the supplied Record container.
 
Method Summary
protected  EscherContainerRecord createSpContainer(boolean isChild)
          Create a new Shape
 java.awt.Color getFillColor()
          The color used to fill this shape.
 java.awt.Color getLineColor()
           
 int getLineDashing()
          Gets line dashing.
 int getLineStyle()
          Returns line style.
 double getLineWidth()
          Returns width of the line in in points
 void setFillColor(java.awt.Color color)
          The color used to fill this shape.
 void setLineColor(java.awt.Color color)
          Sets the color of line
 void setLineDashing(int pen)
          Sets line dashing.
 void setLineStyle(int style)
          Sets line style.
 void setLineWidth(double width)
          Sets the width of line in in points
 
Methods inherited from class org.apache.poi.hslf.model.Shape
afterInsert, getAnchor, getColor, getEscherChild, getEscherProperty, getFill, getHyperlink, getParent, getShapeName, getShapeType, getSheet, getSpContainer, moveTo, setAnchor, setEscherProperty, setShapeType, setSheet
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleShape

protected SimpleShape(EscherContainerRecord escherRecord,
                      Shape parent)
Create a SimpleShape object and initialize it from the supplied Record container.

Parameters:
escherRecord - EscherSpContainer container which holds information about this shape
parent - the parent of the shape
Method Detail

createSpContainer

protected EscherContainerRecord createSpContainer(boolean isChild)
Create a new Shape

Specified by:
createSpContainer in class Shape
Parameters:
isChild - true if the Line is inside a group, false otherwise
Returns:
the record container which holds this shape

getLineWidth

public double getLineWidth()
Returns width of the line in in points


setLineWidth

public void setLineWidth(double width)
Sets the width of line in in points

Parameters:
width - the width of line in in points

setLineColor

public void setLineColor(java.awt.Color color)
Sets the color of line

Parameters:
color - new color of the line

getLineColor

public java.awt.Color getLineColor()
Returns:
color of the line. If color is not set returns java.awt.Color.black

getLineDashing

public int getLineDashing()
Gets line dashing. One of the PEN_* constants defined in this class.

Returns:
dashing of the line.

setLineDashing

public void setLineDashing(int pen)
Sets line dashing. One of the PEN_* constants defined in this class.

Parameters:
pen - new style of the line.

setLineStyle

public void setLineStyle(int style)
Sets line style. One of the constants defined in this class.

Parameters:
style - new style of the line.

getLineStyle

public int getLineStyle()
Returns line style. One of the constants defined in this class.

Returns:
style of the line.

getFillColor

public java.awt.Color getFillColor()
The color used to fill this shape.


setFillColor

public void setFillColor(java.awt.Color color)
The color used to fill this shape.

Parameters:
color - the background color


Copyright 2008 The Apache Software Foundation or its licensors, as applicable.