Package org.loboevolution.html.renderer
Class RBlockViewport
java.lang.Object
org.loboevolution.html.renderer.BaseRenderable
org.loboevolution.html.renderer.RRectangle
org.loboevolution.html.renderer.BaseBoundableRenderable
org.loboevolution.html.renderer.BaseRCollection
org.loboevolution.html.renderer.RBlockViewport
- All Implemented Interfaces:
BoundableRenderable,RCollection,Renderable
A substantial portion of the HTML rendering logic of the package can be found
in this class. This class is in charge of laying out the DOM subtree of a
node, usually on behalf of an RBlock. It creates a renderer subtree
consisting of RLine's or RBlock's. RLine's in turn contain RWord's and so on.
This class also happens to be used as an RBlock scrollable viewport.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final FrameContextprotected final HtmlRendererContextstatic final InsetsConstant ZERO_INSETSFields inherited from class org.loboevolution.html.renderer.BaseBoundableRenderable
layoutUpTreeCanBeInvalidated, modelNode, originalParent, parent, SELECTION_COLOR, SELECTION_XORFields inherited from interface org.loboevolution.html.renderer.Renderable
EMPTY_ARRAY -
Constructor Summary
ConstructorsConstructorDescriptionRBlockViewport(RBlockInfo info, RenderableContainer container, RCollection parent) Constructs an HtmlBlockLayout. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLineBreak(ModelNode startNode, int breakType) addLineBreak.voidaddRenderableToLineCheckStyle(RElement renderable, HTMLElementImpl element) Checks property 'float' and in some cases attribute 'align'.voidApplies any horizonal aLignment.voidApplies vertical alignment.getClipBounds.getExportableFloatingInfo.intgetFirstBaselineOffset.intgetFirstLineHeight.getLowestRenderableSpot(int x, int y) getLowestRenderableSpot.getRenderable(int x, int y) getRenderable.getRenderable(Point point) getRenderable.getRenderables.getRenderables(int pointx, int pointy) getRenderables.intgetVisualHeight.intgetVisualWidth.voidinvalidateLayoutLocal.booleanisContainedByNode.voidlayout(int desiredWidth, int desiredHeight, Insets paddingInsets, int yLimit, FloatingBounds floatBounds, boolean sizeOnly) Builds the layout/renderer tree from scratch.voidlayoutChildFlex(HTMLElementImpl markupElement) layoutChildFlex.final voidlayoutList(HTMLElementImpl markupElement) layoutList.final voidlayoutListItem(HTMLElementImpl markupElement) layoutListItem.voidlayoutMarkup(NodeImpl node) layoutMarkup.final voidlayoutRBlock(HTMLElementImpl markupElement) layoutRBlock.voidlayoutRFlex(HTMLElementImpl markupElement) layoutRFlex.voidlayoutRInlineBlock(HTMLElementImpl markupElement) layoutRInlineBlock.final voidlayoutRTable(HTMLElementImpl markupElement) layoutRTable.booleanonDoubleClick(MouseEvent event, int x, int y) onDoubleClick.booleanonMouseClick(MouseEvent event, int x, int y) onMouseClick.booleanonMouseDisarmed(MouseEvent event) onMouseDisarmed.booleanonMousePressed(MouseEvent event, int x, int y) onMousePressed.booleanonMouseReleased(MouseEvent event, int x, int y) onMouseReleased.voidpaint.voidpositionDelayed.final voidpositionRElement(Element markupElement, RElement renderable, boolean usesAlignAttribute, boolean obeysFloats, boolean alignCenterAttribute) positionRElement.toString()Methods inherited from class org.loboevolution.html.renderer.BaseRCollection
blur, extractSelectionText, focus, getClipBoundsWithoutInsets, getDeclaredHeightImpl, getDeclaredWidthImpl, invalidateLayoutDeep, onMouseMoved, onMouseOut, onRightClick, paintSelection, updateWidgetBoundsMethods inherited from class org.loboevolution.html.renderer.BaseBoundableRenderable
contains, getBlockBackgroundColor, getBounds, getGUIPoint, getModelNode, getOrigin, getOriginalOrCurrentParent, getOriginalParent, getOriginRelativeTo, getOriginRelativeToAbs, getOriginRelativeToNoScroll, getParent, getRectangle, getRenderablePoint, getSize, getVisualBounds, invalidateLayoutUpTree, isDelegated, isValid, markLayoutValid, onMouseScroll, paintTranslated, relayout, relayoutIfValid, repaint, repaint, setOriginalParent, setParentMethods inherited from class org.loboevolution.html.renderer.RRectangle
setBounds, setOriginMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.loboevolution.html.renderer.BoundableRenderable
contains, getBounds, getGUIPoint, getHeight, getModelNode, getOrdinal, getOrigin, getOriginalOrCurrentParent, getOriginalParent, getOriginRelativeTo, getOriginRelativeToAbs, getOriginRelativeToNoScroll, getParent, getRectangle, getRenderablePoint, getSize, getVisualBounds, getWidth, getX, getY, getZIndex, invalidateLayoutUpTree, isDelegated, onMouseScroll, paintTranslated, relayout, repaint, repaint, setBounds, setDelegator, setHeight, setOrdinal, setOrigin, setOriginalParent, setParent, setWidth, setX, setYMethods inherited from interface org.loboevolution.html.renderer.Renderable
findHtmlRenderable, isFixed
-
Field Details
-
rendererContext
-
frameContext
-
ZERO_INSETS
Constant ZERO_INSETS
-
-
Constructor Details
-
RBlockViewport
Constructs an HtmlBlockLayout.- Parameters:
info- aRBlockInfoobject.
-
-
Method Details
-
addLineBreak
addLineBreak.
-
addRenderableToLineCheckStyle
Checks property 'float' and in some cases attribute 'align'.- Parameters:
renderable- aRElementobject.element- aHTMLElementImplobject.
-
alignX
Applies any horizonal aLignment. It may adjust height if necessary. -
alignY
Applies vertical alignment. -
getExportableFloatingInfo
getExportableFloatingInfo.
- Returns:
- a
FloatingInfoobject.
-
getFirstBaselineOffset
public int getFirstBaselineOffset()getFirstBaselineOffset.
- Returns:
- a
Integerobject.
-
getFirstLineHeight
public int getFirstLineHeight()getFirstLineHeight.
- Returns:
- a
Integerobject.
-
getLowestRenderableSpot
getLowestRenderableSpot.
- Parameters:
x- aIntegerobject.y- aIntegerobject.- Returns:
- a
RenderableSpotobject.
-
getRenderable
getRenderable.
- Specified by:
getRenderablein interfaceRCollection- Overrides:
getRenderablein classBaseRCollection- Parameters:
x- aIntegerobject.y- aIntegerobject.- Returns:
- a
BoundableRenderableobject.
-
getRenderable
getRenderable.
- Parameters:
point- aPointobject.- Returns:
- a
BoundableRenderableobject.
-
getRenderables
getRenderables.
- Returns:
- a
Listobject.
-
getRenderables
getRenderables.
-
invalidateLayoutLocal
public void invalidateLayoutLocal()invalidateLayoutLocal.
- Specified by:
invalidateLayoutLocalin classBaseBoundableRenderable
-
isContainedByNode
public boolean isContainedByNode()isContainedByNode.
- Returns:
- a boolean.
-
layout
public void layout(int desiredWidth, int desiredHeight, Insets paddingInsets, int yLimit, FloatingBounds floatBounds, boolean sizeOnly) Builds the layout/renderer tree from scratch. Note: Returned dimension needs to be actual size needed for rendered content, not the available container size. This is relied upon by table layout.- Parameters:
desiredWidth- aIntegerobject.desiredHeight- aIntegerobject.paddingInsets- aInsetsobject.yLimit- If other than -1, layout will throw SizeExceededException in the event that the layout goes beyond this y-coordinate point.floatBounds- aFloatingBoundsobject.sizeOnly- a boolean.
-
layoutList
layoutList.
- Parameters:
markupElement- aHTMLElementImplobject.
-
layoutListItem
layoutListItem.
- Parameters:
markupElement- aHTMLElementImplobject.
-
layoutMarkup
layoutMarkup.
- Parameters:
node- aNodeImplobject.
-
layoutRBlock
layoutRBlock.
- Parameters:
markupElement- aHTMLElementImplobject.
-
layoutRTable
layoutRTable.
- Parameters:
markupElement- aHTMLElementImplobject.
-
layoutRInlineBlock
layoutRInlineBlock.
- Parameters:
markupElement- aHTMLElementImplobject.
-
layoutRFlex
layoutRFlex.
- Parameters:
markupElement- aHTMLElementImplobject.
-
layoutChildFlex
layoutChildFlex.
- Parameters:
markupElement- aHTMLElementImplobject.
-
onDoubleClick
onDoubleClick.
- Specified by:
onDoubleClickin interfaceBoundableRenderable- Overrides:
onDoubleClickin classBaseBoundableRenderable- Parameters:
event- aMouseEventobject.x- aIntegerobject.y- aIntegerobject.- Returns:
- a boolean.
-
onMouseClick
onMouseClick.
- Specified by:
onMouseClickin interfaceBoundableRenderable- Overrides:
onMouseClickin classBaseBoundableRenderable- Parameters:
event- aMouseEventobject.x- aIntegerobject.y- aIntegerobject.- Returns:
- a boolean.
-
onMouseDisarmed
onMouseDisarmed.
- Specified by:
onMouseDisarmedin interfaceBoundableRenderable- Overrides:
onMouseDisarmedin classBaseBoundableRenderable- Parameters:
event- aMouseEventobject.- Returns:
- a boolean.
-
onMousePressed
onMousePressed.
- Specified by:
onMousePressedin interfaceBoundableRenderable- Overrides:
onMousePressedin classBaseBoundableRenderable- Parameters:
event- aMouseEventobject.x- aIntegerobject.y- aIntegerobject.- Returns:
- a boolean.
-
onMouseReleased
onMouseReleased.
- Specified by:
onMouseReleasedin interfaceBoundableRenderable- Overrides:
onMouseReleasedin classBaseBoundableRenderable- Parameters:
event- aMouseEventobject.x- aIntegerobject.y- aIntegerobject.- Returns:
- a boolean.
-
paint
paint.
- Parameters:
gIn- aGraphicsobject.
-
positionRElement
public final void positionRElement(Element markupElement, RElement renderable, boolean usesAlignAttribute, boolean obeysFloats, boolean alignCenterAttribute) positionRElement.
-
toString
-
getClipBounds
getClipBounds.
- Returns:
- a
Rectangleobject.
-
getVisualHeight
public int getVisualHeight()getVisualHeight.
- Specified by:
getVisualHeightin interfaceBoundableRenderable- Overrides:
getVisualHeightin classBaseBoundableRenderable- Returns:
- a
Integerobject.
-
getVisualWidth
public int getVisualWidth()getVisualWidth.
- Specified by:
getVisualWidthin interfaceBoundableRenderable- Overrides:
getVisualWidthin classBaseBoundableRenderable- Returns:
- a
Integerobject.
-
positionDelayed
public void positionDelayed()positionDelayed.
-