JHotDraw 6.0b1

org.jhotdraw.contrib.html
Class HTMLColorContentProducer

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

public class HTMLColorContentProducer
extends ColorContentProducer
implements java.io.Serializable

HTMLColorContentProducer produces RGB color HTML encoded strings.
Ex: Color.blue ==> #0000FF
Color.red ==> #FF00FF
It can either be specific if set for a specific color, or generic, encoding any color passed to the getContents method.

See Also:
Serialized Form

Field Summary
 
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
HTMLColorContentProducer()
          Constructor for the HTMLColorContentProducer object
 
Method Summary
 java.lang.Object getContent(ContentProducerContext context, java.lang.String ctxAttrName, java.lang.Object ctxAttrValue)
          Produces the contents for the color
static java.lang.String getHTMLColorCode(java.awt.Color color)
           
 
Methods inherited from class org.jhotdraw.contrib.html.ColorContentProducer
getColor, read, setColor, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLColorContentProducer

public HTMLColorContentProducer()
Constructor for the HTMLColorContentProducer object

Method Detail

getContent

public java.lang.Object getContent(ContentProducerContext context,
                                   java.lang.String ctxAttrName,
                                   java.lang.Object ctxAttrValue)
Produces the contents for the color

Specified by:
getContent in interface ContentProducer
Overrides:
getContent in class ColorContentProducer
Parameters:
context - the calling client context
ctxAttrName - the color attribute name (FrameColor, TextColor, etc)
ctxAttrValue - the color
Returns:
The HTML encoded RBG value for the color

getHTMLColorCode

public static java.lang.String getHTMLColorCode(java.awt.Color color)

JHotDraw 6.0b1