org.onemind.swingweb.templaterender.helper
Class AwtCssEncoder

java.lang.Object
  extended byorg.onemind.swingweb.templaterender.helper.AwtCssEncoder

public class AwtCssEncoder
extends java.lang.Object

For encoding component style

Author:
TiongHiang Lee (thlee@onemindsoft.org)

Constructor Summary
AwtCssEncoder()
          Constructor
 
Method Summary
 java.lang.StringBuffer encodeColor(org.onemind.commons.java.html.css.Css.Attr attr, java.awt.Color clr, java.lang.StringBuffer sb)
          Encode the color
 java.lang.StringBuffer encodeCssAttr(org.onemind.commons.java.html.css.Css.Attr attr, org.onemind.commons.java.html.css.Css.AttrValue value, java.lang.StringBuffer sb)
          Encode the css attr
 java.lang.StringBuffer encodeCssAttr(org.onemind.commons.java.html.css.Css.Attr attr, java.lang.String value, org.onemind.commons.java.html.css.Css.AttrUnit unit, java.lang.StringBuffer sb)
          Encode the css field and value
 java.lang.StringBuffer encodeCssAttr(org.onemind.commons.java.html.css.Css.Attr attr, java.lang.String value, java.lang.StringBuffer sb)
          Encode the css field and value
 void encodeDimension(java.awt.Dimension d, java.lang.StringBuffer sb)
          Encode the dimension
 void encodeFont(java.awt.Font font, java.lang.StringBuffer sb)
          Encode the font style
 java.lang.StringBuffer encodeFontSize(int i, java.lang.StringBuffer sb)
          Encode the css field and value
 void encodeHeight(double height, java.lang.StringBuffer sb)
          encode the height
 void encodeWidth(double width, java.lang.StringBuffer sb)
          encode the width
protected  java.lang.String toHex(java.awt.Color clr)
          To hex color string
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AwtCssEncoder

public AwtCssEncoder()
Constructor

Method Detail

encodeColor

public java.lang.StringBuffer encodeColor(org.onemind.commons.java.html.css.Css.Attr attr,
                                          java.awt.Color clr,
                                          java.lang.StringBuffer sb)
Encode the color

Parameters:
attr - the css attribute
clr - the color
sb - the buffer
Returns:
the buffer

encodeCssAttr

public java.lang.StringBuffer encodeCssAttr(org.onemind.commons.java.html.css.Css.Attr attr,
                                            org.onemind.commons.java.html.css.Css.AttrValue value,
                                            java.lang.StringBuffer sb)
Encode the css attr

Parameters:
attr - the attribute
value - the value
sb - the StringBuffer
Returns:
the buffer

encodeCssAttr

public java.lang.StringBuffer encodeCssAttr(org.onemind.commons.java.html.css.Css.Attr attr,
                                            java.lang.String value,
                                            java.lang.StringBuffer sb)
Encode the css field and value

Parameters:
attr - the attribute
value - the value
sb - the StringBuffer
Returns:
the buffer

encodeFontSize

public java.lang.StringBuffer encodeFontSize(int i,
                                             java.lang.StringBuffer sb)
Encode the css field and value

Parameters:
i - the font size
sb - the StringBuffer
Returns:
the buffer

encodeCssAttr

public java.lang.StringBuffer encodeCssAttr(org.onemind.commons.java.html.css.Css.Attr attr,
                                            java.lang.String value,
                                            org.onemind.commons.java.html.css.Css.AttrUnit unit,
                                            java.lang.StringBuffer sb)
Encode the css field and value

Parameters:
attr - the attribute
value - the value
unit - the unit
sb - the StringBuffer
Returns:
the buffer

toHex

protected java.lang.String toHex(java.awt.Color clr)
To hex color string

Parameters:
clr - the color
Returns:
the string

encodeFont

public void encodeFont(java.awt.Font font,
                       java.lang.StringBuffer sb)
Encode the font style

Parameters:
font - the font
sb - the string buffer

encodeWidth

public void encodeWidth(double width,
                        java.lang.StringBuffer sb)
encode the width

Parameters:
width - the width
sb - the buffer

encodeHeight

public void encodeHeight(double height,
                         java.lang.StringBuffer sb)
encode the height

Parameters:
height - the height
sb - the buffer

encodeDimension

public void encodeDimension(java.awt.Dimension d,
                            java.lang.StringBuffer sb)
Encode the dimension

Parameters:
d - the dimension
sb - the encoded dimension


Copyright © 2004-2007 . All Rights Reserved.