org.odftoolkit.simple.text
Class ParagraphStyleHandler

java.lang.Object
  extended by org.odftoolkit.simple.style.DefaultStyleHandler
      extended by org.odftoolkit.simple.text.ParagraphStyleHandler

public class ParagraphStyleHandler
extends DefaultStyleHandler

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

This class provides functions to handle the font settings, text alignment settings and so on.

Since:
0.6.5

Field Summary
 
Fields inherited from class org.odftoolkit.simple.style.DefaultStyleHandler
isUseDefaultStyle, mDocument, mFamilyProperties, mGraphicProperties, mOdfElement, mStyleElement, mTableCellProperties, mTableProperties, mWritableGraphicProperties, mWritableStyleElement, mWritableTableCellProperties, mWritableTableProperties
 
Method Summary
 String getCountry(Document.ScriptType type)
          Return the country information for a specific script type
 Font getFont(Document.ScriptType type)
          Return the font definition for a specific script type.
 StyleTypeDefinitions.HorizontalAlignmentType getHorizontalAlignment()
          Return the horizontal alignment.
 String getLanguage(Document.ScriptType type)
          Return the language information for a specific script type
 void setCountry(String country, Document.ScriptType type)
          Set the country information for a specific script type
 void setFont(Font font)
          Set the font definition.
 void setFont(Font font, Locale language)
          Set the font definition.
 void setHorizontalAlignment(StyleTypeDefinitions.HorizontalAlignmentType alignType)
          Set the horizontal alignment.
 void setLanguage(String language, Document.ScriptType type)
          Set the language information for a specific script type
 
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
 

Method Detail

getCountry

public String getCountry(Document.ScriptType type)
Return the country information for a specific script type

The country information in its parent style and default style will be taken into considered.

Null will be returned if there is no country information for this script type.

Parameters:
type - - script type
Returns:
the country information for a specific script type

getFont

public Font getFont(Document.ScriptType type)
Return the font definition for a specific script type.

The font definition in its parent style and default style will be taken into considered.

A default font definition will be returned if there is no font definition for this script type at all.

Parameters:
type - - script type
Returns:
the font definition for a specific script type

getLanguage

public String getLanguage(Document.ScriptType type)
Return the language information for a specific script type

The language definition in its parent style and default style will be taken into considered.

Null will be returned if there is no language information for this script type at all.

Parameters:
type - - script type
Returns:
the language information for a specific script type

setCountry

public void setCountry(String country,
                       Document.ScriptType type)
Set the country information for a specific script type

The consistency between country and script type is not verified.

If the parameter country is null, the country information for this script type will be removed.

Parameters:
country - - the country information
type - - script type
See Also:
TextProperties.setCountry(String, Document.ScriptType), Document.ScriptType

setFont

public void setFont(Font font)
Set the font definition. The locale information in font definition will be used to justify the script type.

If the parameter font is null, nothing will be happened.

Parameters:
font - font definition

setFont

public void setFont(Font font,
                    Locale language)
Set the font definition. The locale information in font definition will be used to justify the script type.

If the parameter font is null, nothing will be happened.

Parameters:
font - font definition

setLanguage

public void setLanguage(String language,
                        Document.ScriptType type)
Set the language information for a specific script type

If the parameter language is null, the language information for this script type will be removed.

Parameters:
language - - the language information
type - - script type

setHorizontalAlignment

public void setHorizontalAlignment(StyleTypeDefinitions.HorizontalAlignmentType alignType)
Set the horizontal alignment.

If the parameter alignType is null, the horizontal alignment setting will be removed.

Parameters:
alignType - the horizontal alignment

getHorizontalAlignment

public StyleTypeDefinitions.HorizontalAlignmentType getHorizontalAlignment()
Return the horizontal alignment.

The horizontal alignment in its parent style and default style will be taken into considered.

HorizontalAlignmentType.DEFAULT will be returned if there is no horizontal alignment setting.

Returns:
the horizontal alignment; null if there is no horizontal alignment setting.


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