JHotDraw 6.0b1

org.jhotdraw.contrib.html
Class HTMLContentProducer

java.lang.Object
  extended by org.jhotdraw.contrib.html.AbstractContentProducer
      extended by org.jhotdraw.contrib.html.FigureDataContentProducer
          extended by org.jhotdraw.contrib.html.AttributeFigureContentProducer
              extended by org.jhotdraw.contrib.html.HTMLContentProducer
All Implemented Interfaces:
java.io.Serializable, ContentProducer, Storable

public class HTMLContentProducer
extends AttributeFigureContentProducer
implements java.io.Serializable

HTMLContentProducer produces HTML suitable values and encoded strings for various types of values.
It can also transform values into their HTML equivalents, like for instance a mapping between font sizes in points and the HTML valid font size values.

See Also:
Serialized Form

Field Summary
protected static int[][] htmlFontSizeEquivalences
          Table of font size equivalents between points and HTML font sizes
 
Fields inherited from interface org.jhotdraw.contrib.html.ContentProducer
ENTITY_ARROW_MODE, ENTITY_FIGURE_HEIGHT, ENTITY_FIGURE_POSX, ENTITY_FIGURE_POSY, ENTITY_FIGURE_WIDTH, ENTITY_FILL_COLOR, ENTITY_FONT_NAME, ENTITY_FONT_SIZE, ENTITY_FONT_STYLE, ENTITY_FRAME_COLOR
 
Constructor Summary
HTMLContentProducer()
          Constructor for the HTMLContentProducer object
 
Method Summary
 java.lang.Object getContent(ContentProducerContext context, java.lang.String ctxAttrName, java.lang.Object ctxAttrValue)
          Gets the HTML content value for the requested attribute
 int getHTMLFontSizeEquivalent(int pointSize)
          Gets the hTMLFontSizeEquivalent attribute of the HTMLTextAreaFigure object
 
Methods inherited from class org.jhotdraw.contrib.html.AttributeFigureContentProducer
read, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

htmlFontSizeEquivalences

protected static final int[][] htmlFontSizeEquivalences
Table of font size equivalents between points and HTML font sizes

Constructor Detail

HTMLContentProducer

public HTMLContentProducer()
Constructor for the HTMLContentProducer object

Method Detail

getContent

public java.lang.Object getContent(ContentProducerContext context,
                                   java.lang.String ctxAttrName,
                                   java.lang.Object ctxAttrValue)
Gets the HTML content value for the requested attribute

Specified by:
getContent in interface ContentProducer
Overrides:
getContent in class AttributeFigureContentProducer
Parameters:
context - the calling client context
ctxAttrName - the attribute name (FontSize, etc...)
ctxAttrValue - the attribute value that led to the call to this
Returns:
The content value

getHTMLFontSizeEquivalent

public int getHTMLFontSizeEquivalent(int pointSize)
Gets the hTMLFontSizeEquivalent attribute of the HTMLTextAreaFigure object

Parameters:
pointSize - the font size in points
Returns:
The hTMLFontSizeEquivalent value

JHotDraw 6.0b1