JHotDraw 6.0b1

org.jhotdraw.contrib.html
Interface ContentProducer

All Superinterfaces:
Storable
All Known Implementing Classes:
AbstractContentProducer, AttributeFigureContentProducer, ColorContentProducer, FigureDataContentProducer, HTMLColorContentProducer, HTMLContentProducer, ResourceContentProducer, TextHolderContentProducer, URLContentProducer

public interface ContentProducer
extends Storable

ContentProducer defines the interface for objects capable of producing contents on behalf of a client context.
Primarely based on the Strategy pattern, the purpose of ContentProducers is twofold:

  • Detach the logic for producing generic content from interested parties so as to maximize reuse, of special interest for complex content
  • Standardize contents by allowing for the automatic decentralization of contents source and production logic. Used together with the ContentProducerRegistry it is possible to globally modify the behaviour required for producing a specific type of contents. For example, a FieldContentProducer could be declined to get its contents from variables in an in-memory object, a setting from a configuration file, or even a field in a database record.

  • Field Summary
    static java.lang.String ENTITY_ARROW_MODE
              Entity name for the figure's current arrow mode
    static java.lang.String ENTITY_FIGURE_HEIGHT
              Entity name for the figure's current height in pixels
    static java.lang.String ENTITY_FIGURE_POSX
              Entity name for the figure's current x position in pixels
    static java.lang.String ENTITY_FIGURE_POSY
              Entity name for the figure's current y position in pixels
    static java.lang.String ENTITY_FIGURE_WIDTH
              Entity name for the figure's current width in pixels
    static java.lang.String ENTITY_FILL_COLOR
              Entity name for the figure's current fill color
    static java.lang.String ENTITY_FONT_NAME
              Entity name for the figure's current font name
    static java.lang.String ENTITY_FONT_SIZE
              Entity name for the figure's current font size
    static java.lang.String ENTITY_FONT_STYLE
              Entity name for the figure's current font style
    static java.lang.String ENTITY_FRAME_COLOR
              Entity name for the figure's current text color
     
    Method Summary
     java.lang.Object getContent(ContentProducerContext context, java.lang.String ctxAttrName, java.lang.Object ctxAttrValue)
              Produces the contents
     
    Methods inherited from interface org.jhotdraw.util.Storable
    read, write
     

    Field Detail

    ENTITY_FIGURE_POSX

    static final java.lang.String ENTITY_FIGURE_POSX
    Entity name for the figure's current x position in pixels

    See Also:
    Constant Field Values

    ENTITY_FIGURE_POSY

    static final java.lang.String ENTITY_FIGURE_POSY
    Entity name for the figure's current y position in pixels

    See Also:
    Constant Field Values

    ENTITY_FIGURE_WIDTH

    static final java.lang.String ENTITY_FIGURE_WIDTH
    Entity name for the figure's current width in pixels

    See Also:
    Constant Field Values

    ENTITY_FIGURE_HEIGHT

    static final java.lang.String ENTITY_FIGURE_HEIGHT
    Entity name for the figure's current height in pixels

    See Also:
    Constant Field Values

    ENTITY_FRAME_COLOR

    static final java.lang.String ENTITY_FRAME_COLOR
    Entity name for the figure's current text color

    See Also:
    Constant Field Values

    ENTITY_FILL_COLOR

    static final java.lang.String ENTITY_FILL_COLOR
    Entity name for the figure's current fill color

    See Also:
    Constant Field Values

    ENTITY_ARROW_MODE

    static final java.lang.String ENTITY_ARROW_MODE
    Entity name for the figure's current arrow mode

    See Also:
    Constant Field Values

    ENTITY_FONT_NAME

    static final java.lang.String ENTITY_FONT_NAME
    Entity name for the figure's current font name

    See Also:
    Constant Field Values

    ENTITY_FONT_SIZE

    static final java.lang.String ENTITY_FONT_SIZE
    Entity name for the figure's current font size

    See Also:
    Constant Field Values

    ENTITY_FONT_STYLE

    static final java.lang.String ENTITY_FONT_STYLE
    Entity name for the figure's current font style

    See Also:
    Constant Field Values
    Method Detail

    getContent

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

    Parameters:
    context - the calling client context
    ctxAttrName - the attribute name
    ctxAttrValue - the attribute value that led to the call to this
    Returns:
    The content value

    JHotDraw 6.0b1