FileDocCategorySizeDatePackage
HSSFShape.javaAPI DocApache Poi 3.0.16109Mon Jan 01 12:39:36 GMT 2007org.apache.poi.hssf.usermodel

HSSFShape

public abstract class HSSFShape extends Object
An abstract shape.
author
Glen Stampoultzis (glens at apache.org)

Fields Summary
public static final int
LINEWIDTH_ONE_PT
public static final int
LINEWIDTH_DEFAULT
public static final int
LINESTYLE_SOLID
public static final int
LINESTYLE_DASHSYS
public static final int
LINESTYLE_DOTSYS
public static final int
LINESTYLE_DASHDOTSYS
public static final int
LINESTYLE_DASHDOTDOTSYS
public static final int
LINESTYLE_DOTGEL
public static final int
LINESTYLE_DASHGEL
public static final int
LINESTYLE_LONGDASHGEL
public static final int
LINESTYLE_DASHDOTGEL
public static final int
LINESTYLE_LONGDASHDOTGEL
public static final int
LINESTYLE_LONGDASHDOTDOTGEL
public static final int
LINESTYLE_NONE
HSSFShape
parent
HSSFAnchor
anchor
int
lineStyleColor
int
fillColor
int
lineWidth
int
lineStyle
boolean
noFill
Constructors Summary
HSSFShape(HSSFShape parent, HSSFAnchor anchor)
Create a new shape with the specified parent and anchor.


                   
         
    
        this.parent = parent;
        this.anchor = anchor;
    
Methods Summary
public intcountOfAllChildren()
Count of all children and their childrens children.

        return 1;
    
public org.apache.poi.hssf.usermodel.HSSFAnchorgetAnchor()

return
the anchor that is used by this shape.

        return anchor;
    
public intgetFillColor()
The color used to fill this shape.

        return fillColor;
    
public intgetLineStyle()

return
One of the constants in LINESTYLE_*

        return lineStyle;
    
public intgetLineStyleColor()
The color applied to the lines of this shape.

        return lineStyleColor;
    
public intgetLineWidth()

return
returns with width of the line in EMUs. 12700 = 1 pt.

        return lineWidth;
    
public org.apache.poi.hssf.usermodel.HSSFShapegetParent()
Gets the parent shape.

        return parent;
    
public booleanisNoFill()

return
true if this shape is not filled with a color.

        return noFill;
    
public voidsetAnchor(org.apache.poi.hssf.usermodel.HSSFAnchor anchor)
Sets a particular anchor. A top-level shape must have an anchor of HSSFClientAnchor. A child anchor must have an anchor of HSSFChildAnchor

param
anchor the anchor to use.
throws
IllegalArgumentException when the wrong anchor is used for this particular shape.
see
HSSFChildAnchor
see
HSSFClientAnchor

        if ( parent == null )
        {
            if ( anchor instanceof HSSFChildAnchor )
                throw new IllegalArgumentException( "Must use client anchors for shapes directly attached to sheet." );
        }
        else
        {
            if ( anchor instanceof HSSFClientAnchor )
                throw new IllegalArgumentException( "Must use child anchors for shapes attached to groups." );
        }

        this.anchor = anchor;
    
public voidsetFillColor(int red, int green, int blue)
The color used to fill this shape.

        this.fillColor = ((blue) << 16) | ((green) << 8) | red;
    
public voidsetFillColor(int fillColor)
The color used to fill this shape.

        this.fillColor = fillColor;
    
public voidsetLineStyle(int lineStyle)
Sets the line style.

param
lineStyle One of the constants in LINESTYLE_*

        this.lineStyle = lineStyle;
    
public voidsetLineStyleColor(int lineStyleColor)
The color applied to the lines of this shape.

        this.lineStyleColor = lineStyleColor;
    
public voidsetLineStyleColor(int red, int green, int blue)
The color applied to the lines of this shape.

        this.lineStyleColor = ((blue) << 16) | ((green) << 8) | red;
    
public voidsetLineWidth(int lineWidth)
Sets the width of the line. 12700 = 1 pt.

param
lineWidth width in EMU's. 12700EMU's = 1 pt
see
HSSFShape#LINEWIDTH_ONE_PT

        this.lineWidth = lineWidth;
    
public voidsetNoFill(boolean noFill)
Sets whether this shape is filled or transparent.

        this.noFill = noFill;