org.odftoolkit.simple.draw
Class FrameStyleHandler

java.lang.Object
  extended by org.odftoolkit.simple.style.DefaultStyleHandler
      extended by org.odftoolkit.simple.draw.FrameStyleHandler

public class FrameStyleHandler
extends DefaultStyleHandler

This class provides functions to handle the style of a frame.

Since:
0.5

Field Summary
 
Fields inherited from class org.odftoolkit.simple.style.DefaultStyleHandler
isUseDefaultStyle, mDocument, mFamilyProperties, mGraphicProperties, mOdfElement, mParagraphProperties, mStyleElement, mTableCellProperties, mTableProperties, mTextProperties, mWritableGraphicProperties, mWritableParagraphProperties, mWritableStyleElement, mWritableTableCellProperties, mWritableTableProperties, mWritableTextProperties
 
Constructor Summary
FrameStyleHandler(Frame frame)
           
 
Method Summary
 StyleTypeDefinitions.FrameHorizontalPosition getHorizontalPosition()
          Return the horizontal position
 StyleTypeDefinitions.HorizontalRelative getHorizontalRelative()
          Return the horizontal relative
 StyleTypeDefinitions.FrameVerticalPosition getVerticalPosition()
          Return the vertical position
 StyleTypeDefinitions.VerticalRelative getVerticalRelative()
          Return the vertical relative
 void setAchorType(StyleTypeDefinitions.AnchorType achorType)
          Set how a frame is bound to a text document.
 void setBackgroundColor(Color color)
          Set the background color of this frame.
 void setBackgroundFrame(boolean isBackgroundFrame)
          Set whether the content of a frame is displayed in the background or foreground.
 void setBorders(Border border, StyleTypeDefinitions.CellBordersType bordersType)
          Set the border style of this cell.
 void setHorizontalPosition(StyleTypeDefinitions.FrameHorizontalPosition horizontalPos)
          Set the horizontal position
 void setHorizontalRelative(StyleTypeDefinitions.HorizontalRelative relative)
          Set the horizontal relative
 void setStroke(StyleTypeDefinitions.OdfDrawStroke stroke, Color color, String widthDesc, String dashStyleName)
          Set the style of stroke.
 void setVerticalPosition(StyleTypeDefinitions.FrameVerticalPosition verticalPos)
          Set the vertical position
 void setVerticalRelative(StyleTypeDefinitions.VerticalRelative relative)
          Set the vertical relative
 
Methods inherited from class org.odftoolkit.simple.style.DefaultStyleHandler
getGraphicPropertiesForRead, getGraphicPropertiesForWrite, getParagraphPropertiesForRead, getParagraphPropertiesForWrite, getReadableStyleElementByName, getStyleElementForRead, getStyleElementForWrite, getTableCellPropertiesForRead, getTableCellPropertiesForWrite, getTablePropertiesForRead, getTablePropertiesForWrite, getTextPropertiesForRead, getTextPropertiesForWrite, getUsedStyleName, getWritableStyleElementByName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FrameStyleHandler

public FrameStyleHandler(Frame frame)
Method Detail

setBorders

public void setBorders(Border border,
                       StyleTypeDefinitions.CellBordersType bordersType)
Set the border style of this cell. You can set the border style for a single border or a border collection.

The second 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.

Parameters:
border - - the border style description
bordersType - - the type of the borders

setStroke

public void setStroke(StyleTypeDefinitions.OdfDrawStroke stroke,
                      Color color,
                      String widthDesc,
                      String dashStyleName)
Set the style of stroke.

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.

Parameters:
stroke - - the stroke type
color - - the color of the stroke
widthDesc - - the width description of the stroke, e.g. "0.01in"
dashStyleName - - the dash style name
See Also:
StyleTypeDefinitions.OdfDrawStroke

setBackgroundColor

public void setBackgroundColor(Color color)
Set the background color of this frame.

If the parameter is null, there will be no background color defined for this frame. The old setting of background color will be removed.

Parameters:
color - - the background color to be set

setBackgroundFrame

public void setBackgroundFrame(boolean isBackgroundFrame)
Set whether the content of a frame is displayed in the background or foreground. If it's displayed in the background, the content wouldn't be selected or moved.

Parameters:
isBackgroundFrame - If true, the frame is displayed in the background.
Since:
0.5.5

setAchorType

public void setAchorType(StyleTypeDefinitions.AnchorType achorType)
Set how a frame is bound to a text document. Default position relative and alignment will be set.

If the document is not text document, nothing will happen.

Parameters:
achorType - - the point at which a frame is bound to a text document

setHorizontalPosition

public void setHorizontalPosition(StyleTypeDefinitions.FrameHorizontalPosition horizontalPos)
Set the horizontal position

Parameters:
horizontalPos - - the horizontal position

setHorizontalRelative

public void setHorizontalRelative(StyleTypeDefinitions.HorizontalRelative relative)
Set the horizontal relative

Parameters:
relative - - the horizontal relative

setVerticalRelative

public void setVerticalRelative(StyleTypeDefinitions.VerticalRelative relative)
Set the vertical relative

Parameters:
relative - - the vertical relative

setVerticalPosition

public void setVerticalPosition(StyleTypeDefinitions.FrameVerticalPosition verticalPos)
Set the vertical position

Parameters:
verticalPos - - the vertical position

getHorizontalPosition

public StyleTypeDefinitions.FrameHorizontalPosition getHorizontalPosition()
Return the horizontal position

Returns:
the horizontal position

getVerticalPosition

public StyleTypeDefinitions.FrameVerticalPosition getVerticalPosition()
Return the vertical position

Returns:
the vertical position

getVerticalRelative

public StyleTypeDefinitions.VerticalRelative getVerticalRelative()
Return the vertical relative

Returns:
the vertical relative

getHorizontalRelative

public StyleTypeDefinitions.HorizontalRelative getHorizontalRelative()
Return the horizontal relative

Returns:
the horizontal relative


Copyright © 2010-2017 The Apache Software Foundation. All Rights Reserved.