JHotDraw 6.0b1

org.jhotdraw.contrib.html
Class TextHolderContentProducer

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

public class TextHolderContentProducer
extends AbstractContentProducer
implements java.io.Serializable

TextAreaFigureContentProducer produces text contents from an existing TextHolder figure
It can either be specific if set for a specific figure, or generic, encoding any color passed to the getContents method.
The main usage of this producer is to embed a "master" or "shared" drawing figure into other figures so that updating the master figure automatically changes all dependent figures as well. Kind of a hot text snippet if you like

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
TextHolderContentProducer()
          Constructor for the TextAreaFigureContentProducer object
TextHolderContentProducer(TextHolder figure)
          Constructor for the TextAreaFigureContentProducer object
 
Method Summary
 java.lang.Object getContent(ContentProducerContext context, java.lang.String ctxAttrName, java.lang.Object ctxAttrValue)
          Gets the text from the text figure
protected  TextHolder getTextHolder()
           
 void read(StorableInput dr)
          Writes the storable
 void setTextHolder(TextHolder newFigure)
           
 void write(StorableOutput dw)
          Writes the storable
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextHolderContentProducer

public TextHolderContentProducer()
Constructor for the TextAreaFigureContentProducer object


TextHolderContentProducer

public TextHolderContentProducer(TextHolder figure)
Constructor for the TextAreaFigureContentProducer object

Parameters:
figure - Description of the Parameter
Method Detail

getContent

public java.lang.Object getContent(ContentProducerContext context,
                                   java.lang.String ctxAttrName,
                                   java.lang.Object ctxAttrValue)
Gets the text from the text figure

Specified by:
getContent in interface ContentProducer
Parameters:
context - Description of the Parameter
ctxAttrName - Description of the Parameter
ctxAttrValue - Description of the Parameter
Returns:
The content value

write

public void write(StorableOutput dw)
Writes the storable

Specified by:
write in interface Storable
Overrides:
write in class AbstractContentProducer
Parameters:
dw - the storable output

read

public void read(StorableInput dr)
          throws java.io.IOException
Writes the storable

Specified by:
read in interface Storable
Overrides:
read in class AbstractContentProducer
Parameters:
dr - the storable input
Throws:
java.io.IOException - thrown by called methods

getTextHolder

protected TextHolder getTextHolder()

setTextHolder

public void setTextHolder(TextHolder newFigure)

JHotDraw 6.0b1