Class RBlockViewport
- All Implemented Interfaces:
BoundableRenderable
,RCollection
,Renderable
-
Field Summary
Modifier and TypeFieldDescriptionprotected final RenderableContainer
protected final FrameContext
protected boolean
protected final ModelNode
protected RCollection
protected RCollection
protected final HtmlRendererContext
protected static final Color
Constant SELECTION_COLORprotected static final Color
Constant SELECTION_XORprotected final UserAgentContext
static final Insets
Constant ZERO_INSETSFields inherited from interface org.loboevolution.html.renderer.Renderable
EMPTY_ARRAY
-
Constructor Summary
ConstructorDescriptionRBlockViewport
(RBlockInfo info, RenderableContainer container, RCollection parent) Constructs an HtmlBlockLayout. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addLineBreak
(ModelNode startNode, int breakType) addLineBreak.protected void
addRenderableToLineCheckStyle
(RElement renderable, HTMLElementImpl element) Checks property 'float' and in some cases attribute 'align'.void
Applies any horizonal aLignment.void
Applies vertical alignment.void
blur()
blur.boolean
contains
(int x, int y) contains.boolean
extractSelectionText
(StringBuilder buffer, boolean isSelection, RenderableSpot startPoint, RenderableSpot endPoint) extractSelectionText.void
focus()
focus.getBlockBackgroundColor.getBounds.getClipBounds.getClipBoundsWithoutInsets.int
getDeclaredHeightImpl
(HTMLElementImpl element, int availHeight) getDeclaredHeightImpl.int
getDeclaredWidthImpl
(HTMLElementImpl element, int availWidth) getDeclaredWidthImpl.getExportableFloatingInfo.int
getFirstBaselineOffset.int
getFirstLineHeight.getGUIPoint
(int clientX, int clientY) getGUIPoint.getLowestRenderableSpot
(int x, int y) getLowestRenderableSpot.getModelNode.getOrigin.getOriginalOrCurrentParent.getOriginalParent.getOriginRelativeTo
(RCollection ancestor) getOriginRelativeTo.getOriginRelativeToAbs
(RCollection ancestor) getOriginRelativeToAbs.getOriginRelativeToNoScroll
(RCollection ancestor) getOriginRelativeToNoScroll.getParent.getRenderable
(int x, int y) getRenderable.getRenderable
(Point point) getRenderable.getRenderablePoint
(int guiX, int guiY) getRenderablePoint.getRenderables.getRenderables
(int pointx, int pointy) getRenderables.getSize()
getSize.getVisualBounds.int
getVisualHeight.int
getVisualWidth.void
invalidateLayoutDeep.void
invalidateLayoutLocal.final void
invalidateLayoutUpTree.boolean
isContainedByNode.boolean
isDelegated.boolean
isValid()
isValid.void
layout
(int desiredWidth, int desiredHeight, Insets paddingInsets, int yLimit, FloatingBounds floatBounds, boolean sizeOnly) Builds the layout/renderer tree from scratch.void
layoutChildFlex
(HTMLElementImpl markupElement) layoutChildFlex.protected final void
layoutList
(HTMLElementImpl markupElement) layoutList.protected final void
layoutListItem
(HTMLElementImpl markupElement) layoutListItem.protected void
layoutMarkup
(NodeImpl node) layoutMarkup.protected final void
layoutRBlock
(HTMLElementImpl markupElement) layoutRBlock.void
layoutRFlex
(HTMLElementImpl markupElement) layoutRFlex.void
layoutRInlineBlock
(HTMLElementImpl markupElement) layoutRInlineBlock.protected final void
layoutRTable
(HTMLElementImpl markupElement) layoutRTable.void
markLayoutValid.boolean
onDoubleClick
(MouseEvent event, int x, int y) onDoubleClick.boolean
onMouseClick
(MouseEvent event, int x, int y) onMouseClick.boolean
onMouseDisarmed
(MouseEvent event) onMouseDisarmed.void
onMouseMoved
(MouseEvent event, int x, int y, boolean triggerEvent, ModelNode limit) onMouseMoved.void
onMouseOut
(MouseEvent event, int x, int y, ModelNode limit) onMouseOut.boolean
onMousePressed
(MouseEvent event, int x, int y) onMousePressed.boolean
onMouseReleased
(MouseEvent event, int x, int y) onMouseReleased.void
boolean
onRightClick
(MouseEvent event, int x, int y) onRightClick.void
paint.boolean
paintSelection
(Graphics g, boolean inSelection, RenderableSpot startPoint, RenderableSpot endPoint) paintSelection.final void
paintTranslated.void
positionDelayed.protected final void
positionRElement
(HTMLElementImpl markupElement, RElement renderable, boolean usesAlignAttribute, boolean obeysFloats, boolean alignCenterAttribute) positionRElement.void
relayout()
relayout.void
relayoutIfValid.void
repaint()
repaint.void
repaint
(int x, int y, int width, int height) repaint.void
setOriginalParent
(RCollection origParent) setOriginalParent.void
setParent
(RCollection parent) setParent.toString()
void
updateWidgetBounds
(int guiX, int guiY) updateWidgetBounds.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, getX, getY, getZIndex, invalidateLayoutUpTree, isDelegated, onMouseScroll, paintTranslated, relayout, repaint, repaint, setBounds, setDelegator, setHeight, setOrdinal, setOrigin, setOriginalParent, setParent, setWidth, setX, setY
Methods inherited from interface org.loboevolution.html.renderer.Renderable
findHtmlRenderable, isFixed
-
Field Details
-
rendererContext
-
userAgentContext
-
container
-
frameContext
-
ZERO_INSETS
Constant ZERO_INSETS -
SELECTION_COLOR
Constant SELECTION_COLOR -
SELECTION_XOR
Constant SELECTION_XOR -
layoutUpTreeCanBeInvalidated
protected boolean layoutUpTreeCanBeInvalidated -
modelNode
-
originalParent
-
parent
-
-
Constructor Details
-
RBlockViewport
Constructs an HtmlBlockLayout.- Parameters:
info
- aRBlockInfo
object.
-
-
Method Details
-
addLineBreak
addLineBreak.
-
addRenderableToLineCheckStyle
Checks property 'float' and in some cases attribute 'align'.- Parameters:
renderable
- aRElement
object.element
- aHTMLElementImpl
object.
-
alignX
Applies any horizonal aLignment. It may adjust height if necessary. -
alignY
Applies vertical alignment. -
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.
-
getRenderable
getRenderable.
- Specified by:
getRenderable
in interfaceRCollection
- Parameters:
x
- aInteger
object.y
- aInteger
object.- Returns:
- a
BoundableRenderable
object.
-
getRenderable
getRenderable.
- Parameters:
point
- aPoint
object.- Returns:
- a
BoundableRenderable
object.
-
getRenderables
getRenderables.
- Returns:
- a
List
object.
-
getRenderables
getRenderables.
-
invalidateLayoutLocal
public void invalidateLayoutLocal()invalidateLayoutLocal.
-
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
- aInteger
object.desiredHeight
- aInteger
object.paddingInsets
- aInsets
object.yLimit
- If other than -1, layout will throw SizeExceededException in the event that the layout goes beyond this y-coordinate point.floatBounds
- aFloatingBounds
object.sizeOnly
- a boolean.
-
layoutList
layoutList.
- Parameters:
markupElement
- aHTMLElementImpl
object.
-
layoutListItem
layoutListItem.
- Parameters:
markupElement
- aHTMLElementImpl
object.
-
layoutMarkup
layoutMarkup.
- Parameters:
node
- aNodeImpl
object.
-
layoutRBlock
layoutRBlock.
- Parameters:
markupElement
- aHTMLElementImpl
object.
-
layoutRTable
layoutRTable.
- Parameters:
markupElement
- aHTMLElementImpl
object.
-
layoutRInlineBlock
layoutRInlineBlock.
- Parameters:
markupElement
- aHTMLElementImpl
object.
-
layoutRFlex
layoutRFlex.
- Parameters:
markupElement
- aHTMLElementImpl
object.
-
layoutChildFlex
layoutChildFlex.
- Parameters:
markupElement
- aHTMLElementImpl
object.
-
onDoubleClick
onDoubleClick.
- Specified by:
onDoubleClick
in interfaceBoundableRenderable
- Parameters:
event
- aMouseEvent
object.x
- aInteger
object.y
- aInteger
object.- Returns:
- a boolean.
-
onMouseClick
onMouseClick.
- Specified by:
onMouseClick
in interfaceBoundableRenderable
- Parameters:
event
- aMouseEvent
object.x
- aInteger
object.y
- aInteger
object.- Returns:
- a boolean.
-
onMouseDisarmed
onMouseDisarmed.
- Specified by:
onMouseDisarmed
in interfaceBoundableRenderable
- Parameters:
event
- aMouseEvent
object.- Returns:
- a boolean.
-
onMousePressed
onMousePressed.
- Specified by:
onMousePressed
in interfaceBoundableRenderable
- Parameters:
event
- aMouseEvent
object.x
- aInteger
object.y
- aInteger
object.- Returns:
- a boolean.
-
onMouseReleased
onMouseReleased.
- Specified by:
onMouseReleased
in interfaceBoundableRenderable
- Parameters:
event
- aMouseEvent
object.x
- aInteger
object.y
- aInteger
object.- Returns:
- a boolean.
-
paint
paint.
- Parameters:
gIn
- aGraphics
object.
-
positionRElement
protected final void positionRElement(HTMLElementImpl markupElement, RElement renderable, boolean usesAlignAttribute, boolean obeysFloats, boolean alignCenterAttribute) positionRElement.
- Parameters:
markupElement
- aHTMLElementImpl
object.renderable
- aRElement
object.usesAlignAttribute
- a boolean.obeysFloats
- a boolean.alignCenterAttribute
- a boolean.
-
toString
-
getClipBounds
getClipBounds.
- Returns:
- a
Rectangle
object.
-
getVisualHeight
public int getVisualHeight()getVisualHeight.
- Specified by:
getVisualHeight
in interfaceBoundableRenderable
- Returns:
- a
Integer
object.
-
getVisualWidth
public int getVisualWidth()getVisualWidth.
- Specified by:
getVisualWidth
in interfaceBoundableRenderable
- Returns:
- a
Integer
object.
-
positionDelayed
public void positionDelayed()positionDelayed.
-
blur
public void blur()blur.
- Specified by:
blur
in interfaceRCollection
-
getClipBoundsWithoutInsets
getClipBoundsWithoutInsets.
- Specified by:
getClipBoundsWithoutInsets
in interfaceRCollection
- Returns:
- a
Rectangle
object.
-
extractSelectionText
public boolean extractSelectionText(StringBuilder buffer, boolean isSelection, RenderableSpot startPoint, RenderableSpot endPoint) extractSelectionText.
- Specified by:
extractSelectionText
in interfaceBoundableRenderable
- Parameters:
buffer
- aStringBuilder
object.isSelection
- a boolean.startPoint
- aRenderableSpot
object.endPoint
- aRenderableSpot
object.- Returns:
- a boolean.
-
focus
public void focus()focus.
- Specified by:
focus
in interfaceRCollection
-
invalidateLayoutDeep
public void invalidateLayoutDeep()invalidateLayoutDeep.
- Specified by:
invalidateLayoutDeep
in interfaceRCollection
-
onMouseMoved
onMouseMoved.
- Specified by:
onMouseMoved
in interfaceBoundableRenderable
- Parameters:
event
- aMouseEvent
object.x
- aInteger
object.y
- aInteger
object.triggerEvent
- a boolean.limit
- aModelNode
object.
-
onMouseOut
onMouseOut.
- Specified by:
onMouseOut
in interfaceBoundableRenderable
- Parameters:
event
- aMouseEvent
object.x
- aInteger
object.y
- aInteger
object.limit
- aModelNode
object.
-
onRightClick
onRightClick.
- Specified by:
onRightClick
in interfaceBoundableRenderable
- Parameters:
event
- aMouseEvent
object.x
- aInteger
object.y
- aInteger
object.- Returns:
- a boolean.
-
paintSelection
public boolean paintSelection(Graphics g, boolean inSelection, RenderableSpot startPoint, RenderableSpot endPoint) paintSelection.
- Specified by:
paintSelection
in interfaceBoundableRenderable
- Parameters:
g
- aGraphics
object.inSelection
- a boolean.startPoint
- aRenderableSpot
object.endPoint
- aRenderableSpot
object.- Returns:
- a boolean.
-
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
- Parameters:
guiX
- aInteger
object.guiY
- aInteger
object.
-
getDeclaredWidthImpl
getDeclaredWidthImpl.
- Parameters:
element
- aHTMLElementImpl
object.availWidth
- aInteger
object.- Returns:
- a
Integer
object.
-
getDeclaredHeightImpl
getDeclaredHeightImpl.
- Parameters:
element
- aHTMLElementImpl
object.availHeight
- aInteger
object.- Returns:
- a
Integer
object.
-
contains
public boolean contains(int x, int y) contains.
- Specified by:
contains
in interfaceBoundableRenderable
- Parameters:
x
- aInteger
object.y
- aInteger
object.- Returns:
- a boolean.
-
getBlockBackgroundColor
getBlockBackgroundColor.
- Returns:
- a
Color
object.
-
getBounds
getBounds.
- Specified by:
getBounds
in interfaceBoundableRenderable
- Returns:
- a
Rectangle
object.
-
getVisualBounds
getVisualBounds.
- Specified by:
getVisualBounds
in interfaceBoundableRenderable
- Returns:
- a
Rectangle
object.
-
getGUIPoint
getGUIPoint.
- Specified by:
getGUIPoint
in interfaceBoundableRenderable
- Parameters:
clientX
- aInteger
object.clientY
- aInteger
object.- Returns:
- a
Point
object.
-
getModelNode
getModelNode.
- Specified by:
getModelNode
in interfaceBoundableRenderable
- Specified by:
getModelNode
in interfaceRenderable
- Returns:
- a
ModelNode
object.
-
getOrigin
getOrigin.
- Specified by:
getOrigin
in interfaceBoundableRenderable
- Returns:
- a
Point
object.
-
getOriginalOrCurrentParent
getOriginalOrCurrentParent.
- Specified by:
getOriginalOrCurrentParent
in interfaceBoundableRenderable
- Returns:
- a
RCollection
object.
-
getOriginalParent
getOriginalParent.
This is the parent based on the original element hierarchy.- Specified by:
getOriginalParent
in interfaceBoundableRenderable
- Returns:
- a
RCollection
object.
-
getOriginRelativeTo
getOriginRelativeTo.
- Specified by:
getOriginRelativeTo
in interfaceBoundableRenderable
- Parameters:
ancestor
- aRCollection
object.- Returns:
- a
Point
object.
-
getOriginRelativeToNoScroll
getOriginRelativeToNoScroll.
- Specified by:
getOriginRelativeToNoScroll
in interfaceBoundableRenderable
- Parameters:
ancestor
- aRCollection
object.- Returns:
- a
Point
object.
-
getOriginRelativeToAbs
getOriginRelativeToAbs.
- Specified by:
getOriginRelativeToAbs
in interfaceBoundableRenderable
- Parameters:
ancestor
- aRCollection
object.- Returns:
- a
Point
object.
-
getParent
getParent.
- Specified by:
getParent
in interfaceBoundableRenderable
- Returns:
- a
RCollection
object.
-
getRenderablePoint
getRenderablePoint.
- Specified by:
getRenderablePoint
in interfaceBoundableRenderable
- Parameters:
guiX
- aInteger
object.guiY
- aInteger
object.- Returns:
- a
Point
object.
-
getSize
getSize.
- Specified by:
getSize
in interfaceBoundableRenderable
- Returns:
- a
Dimension
object.
-
invalidateLayoutUpTree
public final void invalidateLayoutUpTree()invalidateLayoutUpTree.
Invalidates this Renderable and its parent (i.e. all ancestors).- Specified by:
invalidateLayoutUpTree
in interfaceBoundableRenderable
-
isValid
public boolean isValid()isValid.
- Returns:
- a boolean.
-
markLayoutValid
public void markLayoutValid()markLayoutValid.
-
onMouseScroll
public void onMouseScroll()- Specified by:
onMouseScroll
in interfaceBoundableRenderable
-
paintTranslated
paintTranslated.
- Specified by:
paintTranslated
in interfaceBoundableRenderable
- Parameters:
g
- aGraphics
object.
-
relayout
public void relayout()relayout.
Invalidates the current Renderable (which invalidates its ancestors) and then requests the top level GUI container to do the layout and repaint. It's safe to call this method outside the GUI thread.- Specified by:
relayout
in interfaceBoundableRenderable
-
relayoutIfValid
public void relayoutIfValid()relayoutIfValid.
-
repaint
public void repaint()repaint.
- Specified by:
repaint
in interfaceBoundableRenderable
-
repaint
public void repaint(int x, int y, int width, int height) repaint.
-
setOriginalParent
setOriginalParent.
- Specified by:
setOriginalParent
in interfaceBoundableRenderable
- Parameters:
origParent
- aRCollection
object.
-
setParent
setParent.
- Specified by:
setParent
in interfaceBoundableRenderable
- Parameters:
parent
- aRCollection
object.
-
isDelegated
public boolean isDelegated()Description copied from interface:BoundableRenderable
isDelegated.
- Specified by:
isDelegated
in interfaceBoundableRenderable
- Returns:
- a boolean.
-
getRectangle
- Specified by:
getRectangle
in interfaceBoundableRenderable
-