|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.odftoolkit.simple.style.GraphicProperties
public class GraphicProperties
This class represents the graphic style settings. It provides methods to access borders and background styles. More functions will be added later.
This class is a corresponded high level class for element "style:graphic-properties". It provides methods to access the attributes and children of "style:graphic-properties".
Constructor Summary | |
---|---|
protected |
GraphicProperties(StyleGraphicPropertiesElement properties)
Create a paragraph style setting object, which has the association with an element "style:paragraph-properties". |
Method Summary | |
---|---|
Border |
getBorder()
Return the border setting for all four borders. |
Border |
getBottomBorder()
Return the border setting for the bottom border. |
static GraphicProperties |
getGraphicProperties(OdfStyleBase style)
Return an instance of GraphicProperties |
StyleTypeDefinitions.FrameHorizontalPosition |
getHorizontalPosition()
Return the horizontal position |
StyleTypeDefinitions.HorizontalRelative |
getHorizontalRelative()
Return the horizontal relative |
Border |
getLeftBorder()
Return the border setting for the left border. |
static GraphicProperties |
getOrCreateGraphicProperties(OdfStyleBase style)
Return an instance of GraphicProperties |
Border |
getRightBorder()
Return the border setting for the right border. |
Border |
getTopBorder()
Return the border setting for the top border. |
StyleTypeDefinitions.FrameVerticalPosition |
getVerticalPosition()
Return the vertical position |
StyleTypeDefinitions.VerticalRelative |
getVerticalRelative()
Return the vertical relative |
void |
setBorder(Border border)
Set the border definition for all four borders. |
void |
setBorders(StyleTypeDefinitions.CellBordersType bordersType,
Border border)
Set the border style. |
void |
setBottomBorder(Border border)
Set the border definition for the bottom border. |
void |
setFill(StyleTypeDefinitions.OdfDrawFill fillType,
Color color)
Set the fill style for a graphic object. |
void |
setHorizontalPosition(StyleTypeDefinitions.FrameHorizontalPosition horizontalPos)
Set the horizontal position |
void |
setHorizontalRelative(StyleTypeDefinitions.HorizontalRelative relative)
Set the horizontal relative |
void |
setLeftBorder(Border border)
Set the border definition for the left border. |
void |
setRightBorder(Border border)
Set the border definition for the right border. |
void |
setStroke(StyleTypeDefinitions.OdfDrawStroke stroke,
Color color,
String widthDesc,
String dashStyleName)
Set the style of stroke. |
void |
setStyleRunThrough(boolean isBackgroundObject)
Set whether the content of a graphic object is displayed in the background or foreground. |
void |
setTopBorder(Border border)
Set the border definition for the top border. |
void |
setVerticalPosition(StyleTypeDefinitions.FrameVerticalPosition verticalPos)
Set the vertical position |
void |
setVerticalRelative(StyleTypeDefinitions.VerticalRelative relative)
Set the vertical relative |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected GraphicProperties(StyleGraphicPropertiesElement properties)
properties
- - the element "style:paragraph-properties"Method Detail |
---|
public static GraphicProperties getOrCreateGraphicProperties(OdfStyleBase style)
GraphicProperties to represent the "style:graphic-properties" in a style element.
If there is no "style:graphic-properties" defined in the style element, a new "style:graphic-properties" element will be created.
- Parameters:
style
- - a style element
- Returns:
- an instance of
GraphicProperties
public static GraphicProperties getGraphicProperties(OdfStyleBase style)
GraphicProperties to represent the "style:graphic-properties" in a style element.
If there is no "style:graphic-properties" defined in the style element, null will be returned.
- Parameters:
style
- - a style element
- Returns:
- an instance of
GraphicProperties;Null if there is no
"style:graphic-properties" defined
public void setBorders(StyleTypeDefinitions.CellBordersType bordersType, Border border)
The first parameter bordersType
describes which borders you
want to apply the style to, e.g. up border, bottom border, left border,
right border, diagonal lines or four borders.
The border style information will be removed if the parameter
bordersType
is NONE.
bordersType
- - the type of the bordersborder
- - the border style descriptionpublic Border getBorder()
Null will be returned if there is no border setting for all four borders.
public Border getTopBorder()
Null will be returned if there is no border setting for the top border.
public Border getLeftBorder()
Null will be returned if there is no border setting for the left border.
public Border getRightBorder()
Null will be returned if there is no border setting for the right border.
public Border getBottomBorder()
Null will be returned if there is no border setting for the bottom border.
public void setBottomBorder(Border border)
If the parameter border
is null, the border definition for
the bottom border will be removed.
If the line type in the border definition is NONE, the border definition for the bottom border will be removed.
border
- - the border settingpublic void setTopBorder(Border border)
If the parameter border
is null, the border definition for
the top border will be removed.
If the line type in the border definition is NONE, the border definition for the top border will be removed.
border
- - the border settingpublic void setLeftBorder(Border border)
If the parameter border
is null, the border definition for
the left border will be removed.
If the line type in the border definition is NONE, the border definition for the left border will be removed.
border
- - the border settingpublic void setRightBorder(Border border)
If the parameter border
is null, the border definition for
the right border will be removed.
If the line type in the border definition is NONE, the border definition for the right border will be removed.
border
- - the border settingpublic void setBorder(Border border)
If the parameter border
is null, the border definition for
all four borders will be removed.
If the line type in the border definition is NONE, the border definition for all four borders will be removed.
border
- - the border settingpublic void setStroke(StyleTypeDefinitions.OdfDrawStroke stroke, Color color, String widthDesc, String dashStyleName)
There are three types of stroke: none, solid and dash.
If the stroke is NONE, there is no stroke around the frame.
If the stroke is SOLID, there is solid line around the frame. color and width need to be specified.
If the stroke is DASH, there is dash line around the frame. color, width and the style name of dash line need to be specified.
stroke
- the stroke typecolor
- the color of the strokewidthDesc
- the width description of the stroke, e.g. "0.01in"dashStyleName
- the dash style nameStyleTypeDefinitions.OdfDrawStroke
public void setFill(StyleTypeDefinitions.OdfDrawFill fillType, Color color)
This method supports 2 types of fill: none and solid.
If the fill type is NONE, the object is no filled at all.
If the fill type is SOLID, the drawing object is filled with the color specified by the second parameter.
fillType
- the fill style typecolor
- the specified colorpublic void setStyleRunThrough(boolean isBackgroundObject)
isBackgroundObject
- If true
, the graphic object is displayed in the
background.public void setHorizontalPosition(StyleTypeDefinitions.FrameHorizontalPosition horizontalPos)
horizontalPos
- the horizontal positionpublic void setHorizontalRelative(StyleTypeDefinitions.HorizontalRelative relative)
relative
- the horizontal relativepublic void setVerticalRelative(StyleTypeDefinitions.VerticalRelative relative)
relative
- the vertical relativepublic void setVerticalPosition(StyleTypeDefinitions.FrameVerticalPosition verticalPos)
verticalPos
- the vertical positionpublic StyleTypeDefinitions.FrameHorizontalPosition getHorizontalPosition()
public StyleTypeDefinitions.FrameVerticalPosition getVerticalPosition()
public StyleTypeDefinitions.VerticalRelative getVerticalRelative()
public StyleTypeDefinitions.HorizontalRelative getHorizontalRelative()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |