|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.text.View
com.inet.html.views.BoxView
com.inet.html.views.BlockView
com.inet.html.views.HtmlRootView
public class HtmlRootView
HTML root view. This class is the interface between the the Editor Pane and the HTML content(JWebEngine views). It controls the layout/update process initiated by the surrounding view and the z-order in case of a repaint.
Field Summary | |
---|---|
static int |
IMAGE_LOAD_TIMEOUT
The time in ms this view will wait for all images to be loaded. |
Fields inherited from class com.inet.html.views.BoxView |
---|
BASELINE, STATUS_REQ_LAYOUT, STATUS_REQ_PRELAYOUT, STATUS_UPTODATE |
Fields inherited from class javax.swing.text.View |
---|
BadBreakWeight, ExcellentBreakWeight, ForcedBreakWeight, GoodBreakWeight, X_AXIS, Y_AXIS |
Fields inherited from interface javax.swing.SwingConstants |
---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Constructor Summary | |
---|---|
HtmlRootView(javax.swing.text.Element elem)
Create a new View object |
|
HtmlRootView(javax.swing.text.Element elem,
ViewPainter painter,
InetHtmlFontFactory fontFactory)
Creates a new RootView with a custom painter and a custom font factory |
Method Summary | |
---|---|
void |
blockOnLayoutRunning()
Blocks the current thread until the current layout-run has finished. |
void |
changedUpdate(javax.swing.event.DocumentEvent e,
java.awt.Shape a,
javax.swing.text.ViewFactory f)
|
void |
forceLayout()
Forces a perform-layout and repaints the whole document. |
void |
forceLayout(long timeout)
Forces a COMPLETE re-layout of the whole document! |
HtmlRootView |
getHTMLRoot()
Returns the HTML root view or null, if this view was disposed |
float |
getMinimumSpan(int axis)
|
int |
getNextVisualPositionFrom(int pos,
javax.swing.text.Position.Bias b,
java.awt.Shape a,
int direction,
javax.swing.text.Position.Bias[] biasRet)
|
float |
getPreferredSpan(int axis)
|
RenderContext |
getRenderContext()
Returns the current render context, which defines render specific settings for this view tree |
void |
insertUpdate(javax.swing.event.DocumentEvent e,
java.awt.Shape a,
javax.swing.text.ViewFactory f)
|
boolean |
isPositionRoot()
Returns whether this block is a root for positioned or floated elements |
java.awt.Shape |
modelToView(int pos,
java.awt.Shape a,
javax.swing.text.Position.Bias b)
|
java.awt.Shape |
nativeModelToView(int pos,
java.awt.Shape a,
javax.swing.text.Position.Bias b)
The same like modelToView but it cannot be ovveridden. |
void |
paint(java.awt.Graphics g,
java.awt.Shape allocation)
|
java.awt.Rectangle |
performLayout(boolean hard)
Causes this view to update its layout. |
void |
performLayoutWidth()
Layout what is required to determin the width of this view. In most cases this method only requires the CSS width setting, the parent's width and the minumum and preferred span. ATTENTION: This method mus be called before layouting the children of a view. Otherwise the children don't get a corrent parent's size. |
void |
performPreLayout()
Causes this view to update its preLayout data. In case of print media this operation will wait for all images to be loaded. |
void |
removeUpdate(javax.swing.event.DocumentEvent e,
java.awt.Shape a,
javax.swing.text.ViewFactory f)
|
void |
setAntiAlias(boolean calculateAntiAlias)
Enable or disable the calculation of anti aliased text on the first layouting. |
void |
setFraction(boolean useFractional)
Enable or disable the calculation of fractional metrics on the first layouting. |
void |
setParent(javax.swing.text.View parent)
|
void |
setSize(float newWidth,
float newHeight)
This method changes the OUTER box size, which is the box around the border of this box. |
int |
viewToModel(float x,
float y,
java.awt.Shape a,
javax.swing.text.Position.Bias[] biasReturn)
|
Methods inherited from class com.inet.html.views.BlockView |
---|
createFragment, getChildAllocation, getChildViews, getCompleteHight, getContentHeight, getLayout, getLeftUpperCorner, getListValue, getMargins, getOriginalMargins, getOuterHeight, getPositionManager, getSpan, getTextIndent, getView, getViewCount, performLayoutVAlign, predictWidth, replace, replace, toExternalBox, toString, updateListMarkers |
Methods inherited from class javax.swing.text.View |
---|
append, breakView, getAttributes, getBreakWeight, getContainer, getDocument, getElement, getGraphics, getMaximumSpan, getParent, getToolTipText, getViewFactory, getViewIndex, insert, isVisible, modelToView, modelToView, preferenceChanged, remove, removeAll, viewToModel |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int IMAGE_LOAD_TIMEOUT
Constructor Detail |
---|
public HtmlRootView(javax.swing.text.Element elem)
elem
- Element to presentpublic HtmlRootView(javax.swing.text.Element elem, ViewPainter painter, InetHtmlFontFactory fontFactory)
elem
- the root element of the HTML documentpainter
- the custom paint manager, may be nullfontFactory
- the font factory to override the default new Font behaviorMethod Detail |
---|
public void forceLayout()
forceLayout
in class BoxView
public void forceLayout(long timeout)
forceLayout
in class BoxView
timeout
- the timeout until the layout is performed(may be interesting to set it to 0 or for large images)public void setParent(javax.swing.text.View parent)
setParent
in class BlockView
java.lang.IllegalArgumentException
- Will be thrown if this is not the root of the html documentpublic void setSize(float newWidth, float newHeight)
setSize
in class BoxView
newWidth
- the new width in pxnewHeight
- the new height in pxpublic void performPreLayout()
performPreLayout
in interface ILayouted
performPreLayout
in class BlockView
public java.awt.Rectangle performLayout(boolean hard)
performLayout
in class BlockView
hard
- if set to true, the current layout state will be ignored and the view will be re-layouted anyways
public void performLayoutWidth()
performLayoutWidth
in class BlockView
public float getPreferredSpan(int axis)
getPreferredSpan
in class BlockView
public float getMinimumSpan(int axis)
getMinimumSpan
in class BlockView
public void paint(java.awt.Graphics g, java.awt.Shape allocation)
paint
in class BlockView
public void changedUpdate(javax.swing.event.DocumentEvent e, java.awt.Shape a, javax.swing.text.ViewFactory f)
changedUpdate
in class BlockView
public void insertUpdate(javax.swing.event.DocumentEvent e, java.awt.Shape a, javax.swing.text.ViewFactory f)
insertUpdate
in class BlockView
public void removeUpdate(javax.swing.event.DocumentEvent e, java.awt.Shape a, javax.swing.text.ViewFactory f)
removeUpdate
in class BlockView
public int viewToModel(float x, float y, java.awt.Shape a, javax.swing.text.Position.Bias[] biasReturn)
viewToModel
in class BlockView
public java.awt.Shape modelToView(int pos, java.awt.Shape a, javax.swing.text.Position.Bias b) throws javax.swing.text.BadLocationException
modelToView
in class BlockView
javax.swing.text.BadLocationException
public final java.awt.Shape nativeModelToView(int pos, java.awt.Shape a, javax.swing.text.Position.Bias b) throws javax.swing.text.BadLocationException
pos
- the position of the desired character (>=0)a
- the area of the view, which encompasses the requested characterb
- the bias
javax.swing.text.BadLocationException
- if the specified position does not represent a valid location in the associated documentpublic int getNextVisualPositionFrom(int pos, javax.swing.text.Position.Bias b, java.awt.Shape a, int direction, javax.swing.text.Position.Bias[] biasRet) throws javax.swing.text.BadLocationException
getNextVisualPositionFrom
in class javax.swing.text.View
javax.swing.text.BadLocationException
public HtmlRootView getHTMLRoot()
getHTMLRoot
in class BoxView
public void setAntiAlias(boolean calculateAntiAlias)
calculateAntiAlias
- true to compute anti aliaspublic void setFraction(boolean useFractional)
useFractional
- true to compute fractional metricspublic RenderContext getRenderContext()
getRenderContext
in class BoxView
public void blockOnLayoutRunning()
public boolean isPositionRoot()
isPositionRoot
in class BlockView
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |