Package com.inet.html
Class InetHtmlFactory
java.lang.Object
com.inet.html.InetHtmlFactory
- All Implemented Interfaces:
ViewFactory
The factory to create views for model elements.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classdefault implementation: use normal Font constructor -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringMarks an element as a virtual end marker of a block element. -
Constructor Summary
ConstructorsConstructorDescriptionCreates 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 TypeMethodDescriptioncom.inet.html.views.BoxViewCreates a view depending solely on the display value (as required by CSS).com.inet.html.views.BoxViewcreateBlock(Element elem) Creates the view for a block element.com.inet.html.views.BoxViewcreateControl(Element elem) Creates the view for an control element.com.inet.html.views.BoxViewcreateHRule(Element elem) Creates the view for a horizontal rule element.com.inet.html.views.ImageViewcreateImage(Element elem) Creates an not initialized image view, which can use any element as image sourcecom.inet.html.views.BoxViewcreateListItem(com.inet.html.views.BoxView view, int numericValue) Creates a view to display list itemscom.inet.html.views.BoxViewcreateObject(Element elem) Creates the view for an applet or object element.com.inet.html.views.VariableSpaceViewcreateSpace(Element elem, boolean isBreakChar) Creates a white space view for the content or a part of the content ofelem.com.inet.html.views.VariableSpaceViewcreateSpace(Element elem, int paintMode) Creates a white space to paint the background or the left or right edge of a inline content boxcom.inet.html.views.BoxViewcreateTable(Element elem) Creates the view for a table element.voidsetAutoScaleImages(boolean enable) Enables the auto scale feature for allImageViews which will be created by this instance.voidsetFontFactory(InetHtmlFontFactory fontFactory) Updates the font factory to be used by this instance.voidsetUseTextAntiAlias(boolean useTextAntiAlias) Sets the default text anti alias.
-
Field Details
-
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 theInetHtmlWriter.- See Also:
-
-
Constructor Details
-
InetHtmlFactory
public InetHtmlFactory()Creates the factory instance with default painter and default font factory.- Since:
- 1.0
-
InetHtmlFactory
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
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, setnullfor default
-
setAutoScaleImages
public void setAutoScaleImages(boolean enable) Enables the auto scale feature for allImageViews which will be created by this instance. This does affect already created views.- Parameters:
enable-trueto enable,falseto disable- Since:
- 1.07
-
create
- Specified by:
createin interfaceViewFactory
-
createControl
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 benull- Returns:
- the created control view, never
null - Since:
- 1.08
- See Also:
-
createObject
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 benull- 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
Creates the view for a block element.- Parameters:
elem- the element to create the view for, must not benull- Returns:
- the created block view, never
null - Since:
- 1.08
- See Also:
-
HTML.Tag.PHTML.Tag.DIVDisplayValue.BLOCK
-
createTable
Creates the view for a table element.- Parameters:
elem- the element to create the view for, must not benull- Returns:
- the created table view, never
null - Since:
- 1.08
- See Also:
-
HTML.Tag.TABLEDisplayValue.TABLEDisplayValue.INLINE_TABLE
-
createHRule
Creates the view for a horizontal rule element.- Parameters:
elem- the element to create the view for, must not benull- Returns:
- the created horizontal rule, never
null - Since:
- 1.08
- See Also:
-
createSpace
Creates a white space view for the content or a part of the content ofelem. This view may represent a line break as well.- Parameters:
elem- the model elementisBreakChar- true, if this is a line-break- Returns:
- a not initialized space view
- Since:
- 1.05
-
createSpace
Creates a white space to paint the background or the left or right edge of a inline content box- Parameters:
elem- the model elementpaintMode- the type of this view (which edge to paint)- Returns:
- a not initialized space view
- Since:
- 1.05
- See Also:
-
IBoxPainter.PAINT_MODE_LEFTEDGEIBoxPainter.PAINT_MODE_RIGHTEDGEIBoxPainter.PAINT_MODE_CENTER
-
createImage
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
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 displaydisplayValue- theDisplayValueconstant- 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 elementnumericValue- the running number within the current list- Returns:
- a view to display the item
- Since:
- 1.05
-