fi.hut.tml.xsmiles.mlfc.css.swing
Class CSSTextFormatter
java.lang.Object
fi.hut.tml.xsmiles.mlfc.css.swing.CSSTextFormatter
- All Implemented Interfaces:
- CSSTextFormatterInterface
- public class CSSTextFormatter
- extends java.lang.Object
- implements CSSTextFormatterInterface
Reads in a style string and formats a text component (font, color).
- Author:
- Kari Pihkala, Mikko Honkala
|
Field Summary |
protected org.w3c.dom.css.CSSStyleDeclaration |
cssStyle
|
|
Method Summary |
java.awt.Font |
deriveFont(java.awt.Font orig,
int style,
float size)
|
void |
formatComponent(java.awt.Component comp)
|
void |
formatComponent(javax.swing.JComponent comp)
|
java.awt.Font |
getFont()
Returns the Font accoring to the cssStyle variable. |
org.w3c.dom.css.CSSValue |
getProperty(java.lang.String property)
Returns the specified property's CSSValue. |
java.awt.Dimension |
getSize()
|
void |
setStyle(java.lang.String s)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
cssStyle
protected org.w3c.dom.css.CSSStyleDeclaration cssStyle
CSSTextFormatter
public CSSTextFormatter()
setStyle
public void setStyle(java.lang.String s)
- Specified by:
setStyle in interface CSSTextFormatterInterface
formatComponent
public void formatComponent(java.awt.Component comp)
- Specified by:
formatComponent in interface CSSTextFormatterInterface
formatComponent
public void formatComponent(javax.swing.JComponent comp)
getSize
public java.awt.Dimension getSize()
getProperty
public org.w3c.dom.css.CSSValue getProperty(java.lang.String property)
- Returns the specified property's CSSValue.
- Parameters:
property - The name of the property to return.
- Returns:
- The specified property's CSSValue.
getFont
public java.awt.Font getFont()
- Returns the Font accoring to the cssStyle variable.
- Returns:
- The Font that should be used when painting this element.
deriveFont
public java.awt.Font deriveFont(java.awt.Font orig,
int style,
float size)
X-Smiles 1.2