com.inet.html
Class InetHtmlFactory

java.lang.Object
  extended by com.inet.html.InetHtmlFactory
All Implemented Interfaces:
javax.swing.text.ViewFactory

public class InetHtmlFactory
extends java.lang.Object
implements javax.swing.text.ViewFactory

The factory to create views for model elements.


Constructor Summary
InetHtmlFactory()
          creates the factory
InetHtmlFactory(PainterFactory painterFactory, InetHtmlFontFactory fontFactory)
          creates the factory with a given PainterFactory for a different-than-default paint strategy
 
Method Summary
 javax.swing.text.View create(javax.swing.text.Element elem)
          
 BoxView create(javax.swing.text.Element elem, int displayValue)
          Creates a view depending solely on the display value (as required by CSS).
 ImageView createImage(javax.swing.text.Element elem)
          Creates an not initialized image view, which can use any element as image source
 BoxView createListItem(BoxView view, int numericValue)
          Creates a view to display list items
 VariableSpaceView createSpace(javax.swing.text.Element elem, boolean isBreakChar)
          Creates a white space view for the content or a part of the content of elem.
 VariableSpaceView createSpace(javax.swing.text.Element elem, int paintMode)
          Creates a white space to paint the background or the left or right edge of a inline content box
 void setUseTextAntiAlias(boolean useTextAntiAlias)
          Sets the default text anti alias.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InetHtmlFactory

public InetHtmlFactory()
creates the factory


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
Method Detail

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

create

public javax.swing.text.View create(javax.swing.text.Element elem)

Specified by:
create in interface javax.swing.text.ViewFactory

createSpace

public VariableSpaceView createSpace(javax.swing.text.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 initialzed space view

createSpace

public VariableSpaceView createSpace(javax.swing.text.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
See Also:
BoxPainter.PAINT_MODE_LEFTEDGE, BoxPainter.PAINT_MODE_RIGHTEDGE, BoxPainter.PAINT_MODE_CENTER

createImage

public ImageView createImage(javax.swing.text.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

create

public BoxView create(javax.swing.text.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

createListItem

public BoxView createListItem(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