creamtec.webcream.rendering.html
Class ColorFontMap

java.lang.Object
  extended by creamtec.webcream.rendering.html.ColorFontMap

public class ColorFontMap
extends java.lang.Object

Helper class that appends formatting such as colors and fonts for a component if the component formatting is different from the Swing default.


Constructor Summary
ColorFontMap()
           
 
Method Summary
static void appendHexColor(java.lang.StringBuffer buffer, java.awt.Color color)
          Appends the hex representation of the Java color to the given string buffer.
static void appendHexValue(java.lang.StringBuffer buffer, int i)
          Appends a hex value of the integer to the string buffer
static java.lang.String getComponentKnownClassName(java.awt.Component comp)
          Returns the known AWT/Swing class name of the component.
static java.lang.String getComponentStyle(HTMLPage page, java.awt.Component comp)
          Returns an HTML representation of the component formatting properties as they should appear in "style" property
static java.lang.String getContainerStyle(HTMLPage page, java.awt.Component comp)
          Returns the container formatting properties such as the background color
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorFontMap

public ColorFontMap()
Method Detail

getComponentStyle

public static java.lang.String getComponentStyle(HTMLPage page,
                                                 java.awt.Component comp)
Returns an HTML representation of the component formatting properties as they should appear in "style" property

Parameters:
page - HTML Page
comp - Component
Returns:
style string

getContainerStyle

public static java.lang.String getContainerStyle(HTMLPage page,
                                                 java.awt.Component comp)
Returns the container formatting properties such as the background color

Parameters:
page - HTMLPage
comp - Component
Returns:
String

appendHexColor

public static void appendHexColor(java.lang.StringBuffer buffer,
                                  java.awt.Color color)
Appends the hex representation of the Java color to the given string buffer. For instance the red color would be appended as FF0000

Parameters:
buffer - StringBuffer
color - Color

appendHexValue

public static void appendHexValue(java.lang.StringBuffer buffer,
                                  int i)
Appends a hex value of the integer to the string buffer

Parameters:
buffer - StringBuffer
i - integer

getComponentKnownClassName

public static java.lang.String getComponentKnownClassName(java.awt.Component comp)
Returns the known AWT/Swing class name of the component. This is useful to determine the base class name of the components derived from Swing components.

Parameters:
comp - Component
Returns:
String


Copyright © 2000-2006 CreamTec LLC. All Rights Reserved.