Package org.loboevolution.html.renderer
Class RBlock
- All Implemented Interfaces:
ImageObserver,UINode,BoundableRenderable,RCollection,RElement,Renderable,RenderableContainer
- Direct Known Subclasses:
RTableCell
Represents a HTML block in a rendered document, typically a DIV. The root
renderer node is of this type as well.
Immediately below an RBlock you will find a node of type
RBlockViewport.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final RBlockViewportprotected intprotected intprotected RenderableSpotprotected final FrameContextprotected booleanprotected booleanprotected final intprotected final HtmlRendererContextprotected RenderableSpotFields inherited from class org.loboevolution.html.renderer.BaseElementRenderable
backgroundColor, backgroundImage, borderBottomColor, borderInfo, borderInsets, borderLeftColor, borderRightColor, borderTopColor, delayedPairs, INVALID_SIZE, lastBackgroundImageUri, layoutDeepCanBeInvalidated, marginInsets, overflowX, overflowY, paddingInsets, relativeOffsetX, relativeOffsetY, SCROLL_BAR_THICKNESS, userAgentContext, zIndexFields inherited from class org.loboevolution.html.renderer.BaseBoundableRenderable
container, layoutUpTreeCanBeInvalidated, modelNode, originalParent, parent, SELECTION_COLOR, SELECTION_XORFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface org.loboevolution.html.renderer.Renderable
EMPTY_ARRAY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclearStyle(boolean isRootBlock) clearStyle.final voiddoLayout(int availWidth, int availHeight, boolean sizeOnly) doLayout.voiddoLayout(RLayoutInfo info) Lays out and sets dimensions only if RBlock is invalid (or never before layed out), if the parameters passed differ from the last layout, or if the current font differs from the font for the last layout.voidensureVisible(Point point) ensureVisible.booleanextractSelectionText(StringBuilder buffer, boolean inSelection, RenderableSpot startPoint, RenderableSpot endPoint) extractSelectionText.getClipBoundsWithoutInsets.getExportableFloatingInfo.intgetFirstBaselineOffset.intgetFirstLineHeight.getLowestRenderableSpot(int x, int y) getLowestRenderableSpot.getPaintedBackgroundColor.getRBlockViewport.getRenderables.intgetViewportListNesting(int blockNesting) getViewportListNesting.intgetVisualHeight.intgetVisualWidth.intGets the width the vertical scrollbar has when shown.intgetX()getX.intgetY()getY.voidinvalidateLayoutLocal.final booleanisOverflowVisibleX.final booleanisOverflowVisibleY.voidlayout(RLayoutInfo info) layout.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.voidvoidpaint.booleanpaintSelection(Graphics g, boolean inSelection, RenderableSpot startPoint, RenderableSpot endPoint) paintSelection.voidCalledbooleanscrollByUnits(int orientation, int units) scrollByUnits.voidScrolls the viewport's origin to the given location, or as close to it as possible.voidsetSelectionEnd(RenderableSpot rpoint) setSelectionEnd.voidsetSelectionStart(RenderableSpot rpoint) setSelectionStart.toString()voidupdateWidgetBounds(int guiX, int guiY) updateWidgetBounds.Methods inherited from class org.loboevolution.html.renderer.BaseElementRenderable
addComponent, addDelayedPair, applyStyle, clearDelayedPairs, clearGUIComponents, getBorderInsets, getClipBounds, getCollapsibleMarginBottom, getCollapsibleMarginTop, getDeclaredHeight, getDeclaredMaxHeight, getDeclaredMaxWidth, getDeclaredMinHeight, getDeclaredMinWidth, getDeclaredWidth, getDelayedPairs, getInnerHeight, getInnerWidth, getInsets, getInsetsMarginBorder, getInsetsPadding, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getParentContainer, getZIndex, hasDeclaredWidth, imageUpdate, invalidateLayoutDeep, isContainedByNode, isMarginBoundary, layout, prePaint, sendDelayedPairsToParent, sendGUIComponentsToParent, setupRelativePosition, translateDescendentPoint, updateAllWidgetBounds, updateWidgetBoundsMethods inherited from class org.loboevolution.html.renderer.BaseRCollection
blur, focus, getDeclaredHeightImpl, getDeclaredWidthImpl, getRenderable, onMouseMoved, onMouseOut, onRightClickMethods 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, 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, invalidateLayoutUpTree, isDelegated, onMouseMoved, onMouseOut, onRightClick, paintTranslated, relayout, repaint, repaint, setBounds, setDelegator, setHeight, setOrdinal, setOrigin, setOriginalParent, setParent, setWidth, setX, setYMethods inherited from interface org.loboevolution.html.renderer.RCollection
blur, focus, getRenderableMethods inherited from interface org.loboevolution.html.renderer.Renderable
findHtmlRenderable, isFixedMethods inherited from interface org.loboevolution.html.renderer.RenderableContainer
focus, getGUIPoint, getOriginRelativeToAbs, getVisualBounds, invalidateLayoutUpTree, relayout, repaint
-
Field Details
-
bodyLayout
-
defaultOverflowX
protected int defaultOverflowX -
defaultOverflowY
protected int defaultOverflowY -
endSelection
-
frameContext
-
hasHScrollBar
protected boolean hasHScrollBar -
hasVScrollBar
protected boolean hasVScrollBar -
listNesting
protected final int listNesting -
rendererContext
-
startSelection
-
-
Constructor Details
-
RBlock
Constructor for RBlock.
- Parameters:
info- aRBlockInfoobject.
-
-
Method Details
-
clearStyle
protected void clearStyle(boolean isRootBlock) clearStyle.
- Overrides:
clearStylein classBaseElementRenderable- Parameters:
isRootBlock- a boolean.
-
doLayout
public final void doLayout(int availWidth, int availHeight, boolean sizeOnly) doLayout.
- Specified by:
doLayoutin classBaseElementRenderable- Parameters:
availWidth- aIntegerobject.availHeight- aIntegerobject.sizeOnly- a boolean.
-
doLayout
Lays out and sets dimensions only if RBlock is invalid (or never before layed out), if the parameters passed differ from the last layout, or if the current font differs from the font for the last layout.- Parameters:
info- aRLayoutInfoobject.
-
layout
layout.
- Parameters:
info- aRLayoutInfoobject.
-
ensureVisible
ensureVisible.
- Parameters:
point- aPointobject.
-
extractSelectionText
public boolean extractSelectionText(StringBuilder buffer, boolean inSelection, RenderableSpot startPoint, RenderableSpot endPoint) extractSelectionText.
- Specified by:
extractSelectionTextin interfaceBoundableRenderable- Overrides:
extractSelectionTextin classBaseRCollection- Parameters:
buffer- aStringBuilderobject.inSelection- a boolean.startPoint- aRenderableSpotobject.endPoint- aRenderableSpotobject.- Returns:
- a boolean.
-
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.
-
getPaintedBackgroundColor
getPaintedBackgroundColor.
- Returns:
- a
Colorobject.
-
getRBlockViewport
getRBlockViewport.
- Returns:
- a
RBlockViewportobject.
-
getRenderables
getRenderables.
- Returns:
- a
Listobject.
-
getViewportListNesting
public int getViewportListNesting(int blockNesting) getViewportListNesting.
-
getVScrollBarWidth
public int getVScrollBarWidth()Gets the width the vertical scrollbar has when shown.- Returns:
- a
Integerobject.
-
invalidateLayoutLocal
public void invalidateLayoutLocal()invalidateLayoutLocal.
RBlocks should only be invalidated if one of their properties change, or if a descendent changes, or if a style property of an ancestor is such that it could produce layout changes in this RBlock.- Overrides:
invalidateLayoutLocalin classBaseElementRenderable
-
getX
public int getX()getX.
- Returns:
- a
Integerobject.
-
getY
public int getY()getY.
- Returns:
- a
Integerobject.
-
getVisualWidth
public int getVisualWidth()getVisualWidth.
- Specified by:
getVisualWidthin interfaceBoundableRenderable- Specified by:
getVisualWidthin interfaceRenderableContainer- Overrides:
getVisualWidthin classBaseBoundableRenderable- Returns:
- a
Integerobject.
-
getVisualHeight
public int getVisualHeight()getVisualHeight.
- Specified by:
getVisualHeightin interfaceBoundableRenderable- Specified by:
getVisualHeightin interfaceRenderableContainer- Overrides:
getVisualHeightin classBaseBoundableRenderable- Returns:
- a
Integerobject.
-
isOverflowVisibleX
public final boolean isOverflowVisibleX()isOverflowVisibleX.
- Returns:
- a boolean.
-
isOverflowVisibleY
public final boolean isOverflowVisibleY()isOverflowVisibleY.
- Returns:
- a boolean.
-
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.
-
onMouseScroll
public void onMouseScroll()Description copied from class:BaseBoundableRenderable- Specified by:
onMouseScrollin interfaceBoundableRenderable- Overrides:
onMouseScrollin classBaseBoundableRenderable
-
paint
paint.
- Specified by:
paintin interfaceRenderable- Overrides:
paintin classBaseElementRenderable- Parameters:
gIn- aGraphicsobject.
-
paintSelection
public boolean paintSelection(Graphics g, boolean inSelection, RenderableSpot startPoint, RenderableSpot endPoint) paintSelection.
- Specified by:
paintSelectionin interfaceBoundableRenderable- Overrides:
paintSelectionin classBaseRCollection- Parameters:
g- aGraphicsobject.inSelection- a boolean.startPoint- aRenderableSpotobject.endPoint- aRenderableSpotobject.- Returns:
- a boolean.
-
repaint
Called- Parameters:
modelNode- aModelNodeobject.
-
scrollByUnits
public boolean scrollByUnits(int orientation, int units) scrollByUnits.
-
scrollTo
Scrolls the viewport's origin to the given location, or as close to it as possible.This method should be invoked in the GUI thread.
- Parameters:
bounds- The bounds of the scrollable area that should become visible.xIfNeeded- If this parameter is true the x coordinate is changed only if the horizontal bounds are not currently visible.yIfNeeded- If this parameter is true the y coordinate is changed only if the vertical bounds are not currently visible.
-
getClipBoundsWithoutInsets
getClipBoundsWithoutInsets.
- Specified by:
getClipBoundsWithoutInsetsin interfaceRCollection- Overrides:
getClipBoundsWithoutInsetsin classBaseRCollection- Returns:
- a
Rectangleobject.
-
setSelectionEnd
setSelectionEnd.
- Parameters:
rpoint- aRenderableSpotobject.
-
setSelectionStart
setSelectionStart.
- Parameters:
rpoint- aRenderableSpotobject.
-
toString
-
updateWidgetBounds
public void updateWidgetBounds(int guiX, int guiY) updateWidgetBounds.
Updates bounds of all descendent's GUI components, based on root bounds.- Specified by:
updateWidgetBoundsin interfaceRCollection- Overrides:
updateWidgetBoundsin classBaseRCollection- Parameters:
guiX- aIntegerobject.guiY- aIntegerobject.
-