Package com.inet.html

Class InetHtmlFactory

java.lang.Object
com.inet.html.InetHtmlFactory
All Implemented Interfaces:
ViewFactory

public class InetHtmlFactory extends Object implements ViewFactory
The factory to create views for model elements.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    default implementation: use normal Font constructor
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Marks an element as a virtual end marker of a block element.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates the factory instance with default painter and default font factory.
    InetHtmlFactory(PainterFactory painterFactory, InetHtmlFontFactory fontFactory)
    Creates the factory with a given PainterFactory for a different-than-default paint strategy.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.inet.html.views.BoxView
    create(Element elem, int displayValue)
    Creates a view depending solely on the display value (as required by CSS).
    com.inet.html.views.BoxView
    Creates the view for a block element.
    com.inet.html.views.BoxView
    Creates the view for an control element.
    com.inet.html.views.BoxView
    Creates the view for a horizontal rule element.
    com.inet.html.views.ImageView
    Creates an not initialized image view, which can use any element as image source
    com.inet.html.views.BoxView
    createListItem(com.inet.html.views.BoxView view, int numericValue)
    Creates a view to display list items
    com.inet.html.views.BoxView
    Creates the view for an applet or object element.
    com.inet.html.views.VariableSpaceView
    createSpace(Element elem, boolean isBreakChar)
    Creates a white space view for the content or a part of the content of elem.
    com.inet.html.views.VariableSpaceView
    createSpace(Element elem, int paintMode)
    Creates a white space to paint the background or the left or right edge of a inline content box
    com.inet.html.views.BoxView
    Creates the view for a table element.
    void
    setAutoScaleImages(boolean enable)
    Enables the auto scale feature for all ImageViews which will be created by this instance.
    void
    Updates the font factory to be used by this instance.
    void
    setUseTextAntiAlias(boolean useTextAntiAlias)
    Sets the default text anti alias.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • END_BLOCK_MARKER

      public static final String END_BLOCK_MARKER
      Marks an element as a virtual end marker of a block element. This marker is required to establish a caret position at the end of a block. It's will not be written by the InetHtmlWriter.
      See Also:
  • Constructor Details

    • InetHtmlFactory

      public InetHtmlFactory()
      Creates the factory instance with default painter and default font factory.
      Since:
      1.0
    • InetHtmlFactory

      public InetHtmlFactory(PainterFactory painterFactory, InetHtmlFontFactory fontFactory)
      Creates the factory with a given PainterFactory for a different-than-default paint strategy.
      Parameters:
      painterFactory - PainterFactory for painters.
      fontFactory - Factory to create new font objects
      Since:
      1.05
  • Method Details

    • setUseTextAntiAlias

      public void setUseTextAntiAlias(boolean useTextAntiAlias)
      Sets the default text anti alias. This is only a hint for offscreen rendering!
      Parameters:
      useTextAntiAlias - true to active text anti alias
      Since:
      1.05
    • setFontFactory

      public void setFontFactory(InetHtmlFontFactory fontFactory)
      Updates the font factory to be used by this instance.
      NOTE: This will only have an effect on the next HTML root view that is created by this factory!
      Parameters:
      fontFactory - the font factory to be used, set null for default
    • setAutoScaleImages

      public void setAutoScaleImages(boolean enable)
      Enables the auto scale feature for all ImageViews which will be created by this instance. This does affect already created views.
      Parameters:
      enable - true to enable, false to disable
      Since:
      1.07
    • create

      public View create(Element elem)
      Specified by:
      create in interface ViewFactory
    • createControl

      public com.inet.html.views.BoxView createControl(Element elem)
      Creates the view for an control element.
      Parameters:
      elem - the element to create the view for, will not be checked for correct tag, must not be null
      Returns:
      the created control view, never null
      Since:
      1.08
      See Also:
    • createObject

      public com.inet.html.views.BoxView createObject(Element elem)
      Creates the view for an applet or object element.
      Parameters:
      elem - the element to create the view for, will not be checked for correct tag, must not be null
      Returns:
      the created object view, may be a block view as well in case of an error, never null
      Since:
      1.08
      See Also:
    • createBlock

      public com.inet.html.views.BoxView createBlock(Element elem)
      Creates the view for a block element.
      Parameters:
      elem - the element to create the view for, must not be null
      Returns:
      the created block view, never null
      Since:
      1.08
      See Also:
    • createTable

      public com.inet.html.views.BoxView createTable(Element elem)
      Creates the view for a table element.
      Parameters:
      elem - the element to create the view for, must not be null
      Returns:
      the created table view, never null
      Since:
      1.08
      See Also:
    • createHRule

      public com.inet.html.views.BoxView createHRule(Element elem)
      Creates the view for a horizontal rule element.
      Parameters:
      elem - the element to create the view for, must not be null
      Returns:
      the created horizontal rule, never null
      Since:
      1.08
      See Also:
    • createSpace

      public com.inet.html.views.VariableSpaceView createSpace(Element elem, boolean isBreakChar)
      Creates a white space view for the content or a part of the content of elem. This view may represent a line break as well.
      Parameters:
      elem - the model element
      isBreakChar - true, if this is a line-break
      Returns:
      a not initialized space view
      Since:
      1.05
    • createSpace

      public com.inet.html.views.VariableSpaceView createSpace(Element elem, int paintMode)
      Creates a white space to paint the background or the left or right edge of a inline content box
      Parameters:
      elem - the model element
      paintMode - the type of this view (which edge to paint)
      Returns:
      a not initialized space view
      Since:
      1.05
      See Also:
      • IBoxPainter.PAINT_MODE_LEFTEDGE
      • IBoxPainter.PAINT_MODE_RIGHTEDGE
      • IBoxPainter.PAINT_MODE_CENTER
    • createImage

      public com.inet.html.views.ImageView createImage(Element elem)
      Creates an not initialized image view, which can use any element as image source
      Parameters:
      elem - the element, to read the image source from
      Returns:
      an image view
      Since:
      1.05
    • create

      public com.inet.html.views.BoxView create(Element elem, int displayValue)
      Creates a view depending solely on the display value (as required by CSS). This may as well be used to override an existing display value in case of an error.
      Parameters:
      elem - the element to display
      displayValue - the DisplayValue constant
      Returns:
      the created view
      Since:
      1.05
    • createListItem

      public com.inet.html.views.BoxView createListItem(com.inet.html.views.BoxView view, int numericValue)
      Creates a view to display list items
      Parameters:
      view - the view of the underlying List box element
      numericValue - the running number within the current list
      Returns:
      a view to display the item
      Since:
      1.05