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 RBlockViewport
protected int
protected int
protected RenderableSpot
protected final FrameContext
protected boolean
protected boolean
protected final int
protected final HtmlRendererContext
protected RenderableSpot
Fields 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, zIndex
Fields inherited from class org.loboevolution.html.renderer.BaseBoundableRenderable
container, layoutUpTreeCanBeInvalidated, modelNode, originalParent, parent, SELECTION_COLOR, SELECTION_XOR
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Fields inherited from interface org.loboevolution.html.renderer.Renderable
EMPTY_ARRAY
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
clearStyle
(boolean isRootBlock) clearStyle.final void
doLayout
(int availWidth, int availHeight, boolean sizeOnly) doLayout.void
doLayout
(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.void
ensureVisible
(Point point) ensureVisible.boolean
extractSelectionText
(StringBuilder buffer, boolean inSelection, RenderableSpot startPoint, RenderableSpot endPoint) extractSelectionText.getClipBoundsWithoutInsets.getExportableFloatingInfo.int
getFirstBaselineOffset.int
getFirstLineHeight.getLowestRenderableSpot
(int x, int y) getLowestRenderableSpot.getPaintedBackgroundColor.getRBlockViewport.getRenderables.int
getViewportListNesting
(int blockNesting) getViewportListNesting.int
getVisualHeight.int
getVisualWidth.int
Gets the width the vertical scrollbar has when shown.int
getX()
getX.int
getY()
getY.void
invalidateLayoutLocal.final boolean
isOverflowVisibleX.final boolean
isOverflowVisibleY.void
layout
(RLayoutInfo info) layout.boolean
onDoubleClick
(MouseEvent event, int x, int y) onDoubleClick.boolean
onMouseClick
(MouseEvent event, int x, int y) onMouseClick.boolean
onMouseDisarmed
(MouseEvent event) onMouseDisarmed.boolean
onMousePressed
(MouseEvent event, int x, int y) onMousePressed.boolean
onMouseReleased
(MouseEvent event, int x, int y) onMouseReleased.void
void
paint.boolean
paintSelection
(Graphics g, boolean inSelection, RenderableSpot startPoint, RenderableSpot endPoint) paintSelection.void
Calledboolean
scrollByUnits
(int orientation, int units) scrollByUnits.void
Scrolls the viewport's origin to the given location, or as close to it as possible.void
setSelectionEnd
(RenderableSpot rpoint) setSelectionEnd.void
setSelectionStart
(RenderableSpot rpoint) setSelectionStart.toString()
void
updateWidgetBounds
(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, updateWidgetBounds
Methods inherited from class org.loboevolution.html.renderer.BaseRCollection
blur, focus, getDeclaredHeightImpl, getDeclaredWidthImpl, getRenderable, onMouseMoved, onMouseOut, onRightClick
Methods 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, setParent
Methods inherited from class org.loboevolution.html.renderer.RRectangle
setBounds, setOrigin
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods 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, setY
Methods inherited from interface org.loboevolution.html.renderer.RCollection
blur, focus, getRenderable
Methods inherited from interface org.loboevolution.html.renderer.Renderable
findHtmlRenderable, isFixed
Methods 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
- aRBlockInfo
object.
-
-
Method Details
-
clearStyle
protected void clearStyle(boolean isRootBlock) clearStyle.
- Overrides:
clearStyle
in classBaseElementRenderable
- Parameters:
isRootBlock
- a boolean.
-
doLayout
public final void doLayout(int availWidth, int availHeight, boolean sizeOnly) doLayout.
- Specified by:
doLayout
in classBaseElementRenderable
- Parameters:
availWidth
- aInteger
object.availHeight
- aInteger
object.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
- aRLayoutInfo
object.
-
layout
layout.
- Parameters:
info
- aRLayoutInfo
object.
-
ensureVisible
ensureVisible.
- Parameters:
point
- aPoint
object.
-
extractSelectionText
public boolean extractSelectionText(StringBuilder buffer, boolean inSelection, RenderableSpot startPoint, RenderableSpot endPoint) extractSelectionText.
- Specified by:
extractSelectionText
in interfaceBoundableRenderable
- Overrides:
extractSelectionText
in classBaseRCollection
- Parameters:
buffer
- aStringBuilder
object.inSelection
- a boolean.startPoint
- aRenderableSpot
object.endPoint
- aRenderableSpot
object.- Returns:
- a boolean.
-
getExportableFloatingInfo
getExportableFloatingInfo.
- Returns:
- a
FloatingInfo
object.
-
getFirstBaselineOffset
public int getFirstBaselineOffset()getFirstBaselineOffset.
- Returns:
- a
Integer
object.
-
getFirstLineHeight
public int getFirstLineHeight()getFirstLineHeight.
- Returns:
- a
Integer
object.
-
getLowestRenderableSpot
getLowestRenderableSpot.
- Parameters:
x
- aInteger
object.y
- aInteger
object.- Returns:
- a
RenderableSpot
object.
-
getPaintedBackgroundColor
getPaintedBackgroundColor.
- Returns:
- a
Color
object.
-
getRBlockViewport
getRBlockViewport.
- Returns:
- a
RBlockViewport
object.
-
getRenderables
getRenderables.
- Returns:
- a
List
object.
-
getViewportListNesting
public int getViewportListNesting(int blockNesting) getViewportListNesting.
-
getVScrollBarWidth
public int getVScrollBarWidth()Gets the width the vertical scrollbar has when shown.- Returns:
- a
Integer
object.
-
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:
invalidateLayoutLocal
in classBaseElementRenderable
-
getX
public int getX()getX.
- Returns:
- a
Integer
object.
-
getY
public int getY()getY.
- Returns:
- a
Integer
object.
-
getVisualWidth
public int getVisualWidth()getVisualWidth.
- Specified by:
getVisualWidth
in interfaceBoundableRenderable
- Specified by:
getVisualWidth
in interfaceRenderableContainer
- Overrides:
getVisualWidth
in classBaseBoundableRenderable
- Returns:
- a
Integer
object.
-
getVisualHeight
public int getVisualHeight()getVisualHeight.
- Specified by:
getVisualHeight
in interfaceBoundableRenderable
- Specified by:
getVisualHeight
in interfaceRenderableContainer
- Overrides:
getVisualHeight
in classBaseBoundableRenderable
- Returns:
- a
Integer
object.
-
isOverflowVisibleX
public final boolean isOverflowVisibleX()isOverflowVisibleX.
- Returns:
- a boolean.
-
isOverflowVisibleY
public final boolean isOverflowVisibleY()isOverflowVisibleY.
- Returns:
- a boolean.
-
onDoubleClick
onDoubleClick.
- Specified by:
onDoubleClick
in interfaceBoundableRenderable
- Overrides:
onDoubleClick
in classBaseBoundableRenderable
- Parameters:
event
- aMouseEvent
object.x
- aInteger
object.y
- aInteger
object.- Returns:
- a boolean.
-
onMouseClick
onMouseClick.
- Specified by:
onMouseClick
in interfaceBoundableRenderable
- Overrides:
onMouseClick
in classBaseBoundableRenderable
- Parameters:
event
- aMouseEvent
object.x
- aInteger
object.y
- aInteger
object.- Returns:
- a boolean.
-
onMouseDisarmed
onMouseDisarmed.
- Specified by:
onMouseDisarmed
in interfaceBoundableRenderable
- Overrides:
onMouseDisarmed
in classBaseBoundableRenderable
- Parameters:
event
- aMouseEvent
object.- Returns:
- a boolean.
-
onMousePressed
onMousePressed.
- Specified by:
onMousePressed
in interfaceBoundableRenderable
- Overrides:
onMousePressed
in classBaseBoundableRenderable
- Parameters:
event
- aMouseEvent
object.x
- aInteger
object.y
- aInteger
object.- Returns:
- a boolean.
-
onMouseReleased
onMouseReleased.
- Specified by:
onMouseReleased
in interfaceBoundableRenderable
- Overrides:
onMouseReleased
in classBaseBoundableRenderable
- Parameters:
event
- aMouseEvent
object.x
- aInteger
object.y
- aInteger
object.- Returns:
- a boolean.
-
onMouseScroll
public void onMouseScroll()Description copied from class:BaseBoundableRenderable
- Specified by:
onMouseScroll
in interfaceBoundableRenderable
- Overrides:
onMouseScroll
in classBaseBoundableRenderable
-
paint
paint.
- Specified by:
paint
in interfaceRenderable
- Overrides:
paint
in classBaseElementRenderable
- Parameters:
gIn
- aGraphics
object.
-
paintSelection
public boolean paintSelection(Graphics g, boolean inSelection, RenderableSpot startPoint, RenderableSpot endPoint) paintSelection.
- Specified by:
paintSelection
in interfaceBoundableRenderable
- Overrides:
paintSelection
in classBaseRCollection
- Parameters:
g
- aGraphics
object.inSelection
- a boolean.startPoint
- aRenderableSpot
object.endPoint
- aRenderableSpot
object.- Returns:
- a boolean.
-
repaint
Called- Parameters:
modelNode
- aModelNode
object.
-
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:
getClipBoundsWithoutInsets
in interfaceRCollection
- Overrides:
getClipBoundsWithoutInsets
in classBaseRCollection
- Returns:
- a
Rectangle
object.
-
setSelectionEnd
setSelectionEnd.
- Parameters:
rpoint
- aRenderableSpot
object.
-
setSelectionStart
setSelectionStart.
- Parameters:
rpoint
- aRenderableSpot
object.
-
toString
-
updateWidgetBounds
public void updateWidgetBounds(int guiX, int guiY) updateWidgetBounds.
Updates bounds of all descendent's GUI components, based on root bounds.- Specified by:
updateWidgetBounds
in interfaceRCollection
- Overrides:
updateWidgetBounds
in classBaseRCollection
- Parameters:
guiX
- aInteger
object.guiY
- aInteger
object.
-