|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.inet.html.views.RenderContext
public class RenderContext
This class contains all references and objects which are relevant to render the views correctly.
Field Summary | |
---|---|
static int |
BIDI_LTR
|
static int |
BIDI_MIXED
|
static int |
BIDI_RTL
|
static int |
BREAK_MODE_OVERFLOW
|
static int |
BREAK_MODE_WORDBREAK
|
static int |
BREAK_MODE_WORDBREAKINLINE
|
Constructor Summary | |
---|---|
RenderContext(javax.swing.text.Document document,
FormRegistry formReg,
InetHtmlFontFactory fontFactory)
Creates the render context for a view tree |
Method Summary | |
---|---|
boolean |
allowTabs()
Returns true, if tabs are activated |
void |
checkImageLoading()
Checks the current image load state and blocks the current thread until all images are rendered, if this is required by the current document. |
void |
clearForms()
Clears the form registry |
boolean |
collapseEmptyBlocks()
Returns true if empty blocks have an inner height of 0 PX by default, if false empty blocks have to get a height of one line. |
boolean |
collapseTailingBreak()
If a BR element is the last element in a block it will have no visible effect as defined by HTML. |
int |
countBlockingImages()
Returns the number of images which have to be loaded before the layouter can start |
void |
deregisterControl(ControlView control)
Deregister a control. |
int |
getBreakMode()
Returns the break mode which should be used by the layouter |
IBoxPainter |
getEmptyBoxPainter()
Returns an unbound blank box painter. |
java.awt.Font |
getFont(javax.swing.text.Element elem)
Returns the font of an element |
java.awt.Font |
getFont(javax.swing.text.Element elem,
float size)
Returns the font of an element |
java.awt.font.FontRenderContext |
getFontRenderContext()
Returns the font render context for this view structure |
static float |
getFontSize(javax.swing.text.Element elem)
Returns the font size of an element |
java.lang.Object |
getMedia()
Returns the media identifier of the document |
int |
getSelectionEnd()
Returns the Carets Mark position |
int |
getSelectionStart()
Returns the Caret Dot-position |
int |
getTabSize(int xOffset,
int spaceWidth)
Returns the size for the tab stop space at the current location. |
java.lang.Object |
getTextAntiAliasHint()
Returns the currently set text anti alias hint |
javax.swing.JEditorPane |
getTextContainer()
Returns the surrounding text component or null, if this view is not embedded in a JEditorPane. |
javax.swing.text.Document |
getTextContainerDocument()
Returns the Document instance currently referenced by the text container of this view tree. |
javax.swing.text.EditorKit |
getTextContainerKit()
Returns the EditorKit instance currently referenced by the text container of this view tree. |
boolean |
isBlockOnImageLoad()
Returns true if the renderer is requested to block the paint operation until all images in all sub-views were loaded |
boolean |
isFontFallbackAllowed()
If there are characters which cannot be displayed with a certain font, which has been set to and element, JWebEngine can use a fallback and search all known font for one, which can display the character. |
void |
notifiyBidi(int bidiConstant,
boolean overwrite)
Notify the bidi state of the current element or content. |
void |
notifyImageLoad(RemoteImage img)
Notifies the root that another image is currently loading. |
void |
notifyImageLoadDone(RemoteImage img)
Notifies the root that another image has finished loading. |
boolean |
paintSelection()
Checks, whether a selection can be painted |
void |
registerControl(ControlView control)
Register a control. |
boolean |
requiresBidiCheck()
Returns the bidi check flag. |
void |
setAntiAlias(boolean calculateAntiAlias)
Enable or disable the calculation of anti aliased text on the first layouting. |
void |
setFontRenderContext(java.awt.font.FontRenderContext frc)
Sets the current font render context. |
void |
setFraction(boolean useFractional)
Enable or disable the calculation of fractional metrics on the first layouting. |
void |
setTextAntiAlias(boolean useTextAntiAlias)
Enables or disables the text anti alias on this view and all descendants. |
void |
setTextContainer(javax.swing.JEditorPane container)
Sets the editor container for this view tree, if any. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int BIDI_LTR
public static final int BIDI_RTL
public static final int BIDI_MIXED
public static final int BREAK_MODE_OVERFLOW
public static final int BREAK_MODE_WORDBREAK
public static final int BREAK_MODE_WORDBREAKINLINE
Constructor Detail |
---|
public RenderContext(javax.swing.text.Document document, FormRegistry formReg, InetHtmlFontFactory fontFactory)
document
- the document base of this view treeformReg
- the form registry instance to control the form elements in the current view treefontFactory
- the font factory to create Font
instances, optionalMethod Detail |
---|
public void checkImageLoading()
public boolean isBlockOnImageLoad()
public void setFraction(boolean useFractional)
useFractional
- true to compute fractional metricspublic java.awt.font.FontRenderContext getFontRenderContext()
public void setAntiAlias(boolean calculateAntiAlias)
calculateAntiAlias
- true to compute anti aliaspublic void setFontRenderContext(java.awt.font.FontRenderContext frc)
Graphics
is known.
frc
- the font render context to use by all viewspublic void registerControl(ControlView control)
control
- the control to registerpublic void deregisterControl(ControlView control)
control
- the control to registerpublic void clearForms()
public void setTextContainer(javax.swing.JEditorPane container)
container
- the container or null if rendered directlypublic javax.swing.text.Document getTextContainerDocument()
Document
instance currently referenced by the text container of this view tree. Will
return null, if there is no container.
public javax.swing.text.EditorKit getTextContainerKit()
EditorKit
instance currently referenced by the text container of this view tree.
Will return null, if there is no container.
public int getSelectionStart()
public int getSelectionEnd()
public javax.swing.JEditorPane getTextContainer()
public boolean paintSelection()
public void setTextAntiAlias(boolean useTextAntiAlias)
useTextAntiAlias
- true to enablepublic java.lang.Object getTextAntiAliasHint()
public java.awt.Font getFont(javax.swing.text.Element elem)
elem
- The element to query
elem
public java.awt.Font getFont(javax.swing.text.Element elem, float size)
elem
- The element to querysize
- The font size of this element
elem
public static float getFontSize(javax.swing.text.Element elem)
elem
- The element to query
elem
in pixelpublic boolean collapseEmptyBlocks()
public boolean collapseTailingBreak()
public void notifiyBidi(int bidiConstant, boolean overwrite)
bidiConstant
- the bidi constantoverwrite
- if true, the current state will be replaces ignoring any conflict, should only
be done by the root viewpublic boolean requiresBidiCheck()
public void notifyImageLoad(RemoteImage img)
img
- the image which is about to loadpublic void notifyImageLoadDone(RemoteImage img)
img
- the image which was loaded or abortedpublic int countBlockingImages()
public java.lang.Object getMedia()
InetHtmlDocument.MEDIA_SCREEN
,
InetHtmlDocument.MEDIA_PRINT
public IBoxPainter getEmptyBoxPainter()
public int getTabSize(int xOffset, int spaceWidth)
xOffset
- the current line x offset int PXspaceWidth
- the with of a space glyph using the current font
public boolean allowTabs()
public int getBreakMode()
BREAK_MODE_OVERFLOW
,
BREAK_MODE_WORDBREAK
,
BREAK_MODE_WORDBREAKINLINE
public boolean isFontFallbackAllowed()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |