Class BaseElementRenderable
- All Implemented Interfaces:
ImageObserver
,UINode
,BoundableRenderable
,RCollection
,RElement
,Renderable
,RenderableContainer
- Direct Known Subclasses:
RBlock
,RInlineBlock
,RTable
,RUIControl
Abstract BaseElementRenderable class.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Color
protected Image
protected Color
protected BorderInfo
protected Insets
protected Color
protected Color
protected Color
protected final RenderableContainer
protected List
<DelayedPair> protected static final Integer
Constant INVALID_SIZEprotected URL
protected boolean
protected boolean
protected Insets
protected final ModelNode
protected RCollection
protected int
protected int
protected Insets
protected RCollection
protected int
protected int
protected static final int
Constant SCROLL_BAR_THICKNESS=16protected static final Color
Constant SELECTION_COLORprotected static final Color
Constant SELECTION_XORprotected final UserAgentContext
protected int
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
ConstructorDescriptionBaseElementRenderable
(RenderableContainer container, ModelNode modelNode, UserAgentContext ucontext) Constructor for BaseElementRenderable. -
Method Summary
Modifier and TypeMethodDescriptionaddComponent
(Component component) addComponent.void
addDelayedPair
(DelayedPair pair) addDelayedPair.protected void
applyStyle
(int availWidth, int availHeight) applyStyle.void
blur()
blur.final void
clearDelayedPairs.protected final void
clearGUIComponents.protected void
clearStyle
(boolean isRootBlock) clearStyle.boolean
contains
(int x, int y) contains.protected abstract void
doLayout
(int availWidth, int availHeight, boolean sizeOnly) doLayout.boolean
extractSelectionText
(StringBuilder buffer, boolean isSelection, RenderableSpot startPoint, RenderableSpot endPoint) extractSelectionText.void
focus()
focus.getBlockBackgroundColor.Getter for the field borderInsets.getBounds.getClipBounds.getClipBoundsWithoutInsets.int
getCollapsibleMarginBottom.int
getCollapsibleMarginTop.getDeclaredHeight
(int actualAvailHeight) Getter for the field declaredHeight.int
getDeclaredHeightImpl
(HTMLElementImpl element, int availHeight) getDeclaredHeightImpl.protected Integer
getDeclaredMaxHeight
(RenderState renderState, int actualAvailHeight) protected Integer
getDeclaredMaxWidth
(RenderState renderState, int actualAvailWidth) protected Integer
getDeclaredMinHeight
(RenderState renderState, int actualAvailHeight) protected Integer
getDeclaredMinWidth
(RenderState renderState, int actualAvailWidth) protected Integer
getDeclaredWidth
(int actualAvailWidth) Getter for the field declaredWidth.int
getDeclaredWidthImpl
(HTMLElementImpl element, int availWidth) getDeclaredWidthImpl.final List
<DelayedPair> getDelayedPairs.getGUIPoint
(int clientX, int clientY) getGUIPoint.int
getInnerHeight.int
getInnerWidth.getInsets
(boolean hscroll, boolean vscroll) getInsets.getInsetsMarginBorder
(boolean hscroll, boolean vscroll) getInsetsMarginBorder.getInsetsPadding
(boolean hscroll, boolean vscroll) getInsetsPadding.int
getMarginBottom.int
getMarginLeft.int
getMarginRight.int
getMarginTop.getModelNode.getOrigin.getOriginalOrCurrentParent.getOriginalParent.getOriginRelativeTo
(RCollection ancestor) getOriginRelativeTo.getOriginRelativeToAbs
(RCollection ancestor) getOriginRelativeToAbs.getOriginRelativeToNoScroll
(RCollection ancestor) getOriginRelativeToNoScroll.getParent.getParentContainer.getRenderable
(int x, int y) getRenderable.getRenderablePoint
(int guiX, int guiY) getRenderablePoint.getSize()
getSize.getVisualBounds.int
getVisualHeight.int
getVisualWidth.int
getZIndex.final boolean
hasDeclaredWidth.boolean
imageUpdate
(Image img, int infoflags, int x, int y, int w, int h) final void
invalidateLayoutDeep.protected void
invalidateLayoutLocal.final void
invalidateLayoutUpTree.boolean
isContainedByNode.boolean
isDelegated.protected boolean
isMarginBoundary.boolean
isValid()
isValid.void
layout
(int availWidth, int availHeight, boolean sizeOnly) Lays out the subtree below the RElement.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.protected void
prePaint.void
relayout()
relayout.void
relayoutIfValid.void
repaint()
repaint.void
repaint
(int x, int y, int width, int height) repaint.protected final void
sendDelayedPairsToParent.protected final void
sendGUIComponentsToParent.void
setOriginalParent
(RCollection origParent) setOriginalParent.void
setParent
(RCollection parent) setParent.void
setupRelativePosition
(RenderableContainer container) setupRelativePosition.translateDescendentPoint
(BoundableRenderable descendent, int x, int y) translateDescendentPoint.void
updateAllWidgetBounds.void
Updates widget bounds below this node only.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, toString, wait, wait, wait
Methods inherited from interface org.loboevolution.html.renderer.BoundableRenderable
contains, extractSelectionText, getBounds, getGUIPoint, getHeight, getLowestRenderableSpot, getModelNode, getOrdinal, getOrigin, getOriginalOrCurrentParent, getOriginalParent, getOriginRelativeTo, getOriginRelativeToAbs, getOriginRelativeToNoScroll, getParent, getRectangle, getRenderablePoint, getSize, getVisualBounds, getVisualHeight, getVisualWidth, getWidth, getX, getY, invalidateLayoutUpTree, isDelegated, onDoubleClick, onMouseClick, onMouseDisarmed, onMouseMoved, onMouseOut, onMousePressed, onMouseReleased, onMouseScroll, onRightClick, paintSelection, 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, getClipBoundsWithoutInsets, getRenderable, getRenderables, updateWidgetBounds
Methods inherited from interface org.loboevolution.html.renderer.Renderable
findHtmlRenderable, isFixed
Methods inherited from interface org.loboevolution.html.renderer.RenderableContainer
focus, getGUIPoint, getOriginRelativeToAbs, getPaintedBackgroundColor, getVisualBounds, getVisualHeight, getVisualWidth, getY, invalidateLayoutUpTree, relayout, repaint
-
Field Details
-
INVALID_SIZE
Constant INVALID_SIZE -
SCROLL_BAR_THICKNESS
protected static final int SCROLL_BAR_THICKNESSConstant SCROLL_BAR_THICKNESS=16- See Also:
-
userAgentContext
-
backgroundColor
-
borderLeftColor
-
borderRightColor
-
borderTopColor
-
borderBottomColor
-
backgroundImage
-
borderInfo
-
borderInsets
-
marginInsets
-
paddingInsets
-
delayedPairs
-
lastBackgroundImageUri
-
layoutDeepCanBeInvalidated
protected boolean layoutDeepCanBeInvalidated -
overflowX
protected int overflowX -
overflowY
protected int overflowY -
relativeOffsetX
protected int relativeOffsetX -
relativeOffsetY
protected int relativeOffsetY -
zIndex
protected int zIndex -
SELECTION_COLOR
Constant SELECTION_COLOR -
SELECTION_XOR
Constant SELECTION_XOR -
container
-
layoutUpTreeCanBeInvalidated
protected boolean layoutUpTreeCanBeInvalidated -
modelNode
-
originalParent
-
parent
-
-
Constructor Details
-
BaseElementRenderable
public BaseElementRenderable(RenderableContainer container, ModelNode modelNode, UserAgentContext ucontext) Constructor for BaseElementRenderable.
- Parameters:
container
- aRenderableContainer
object.modelNode
- aModelNode
object.ucontext
- aUserAgentContext
object.
-
-
Method Details
-
addComponent
addComponent.
- Specified by:
addComponent
in interfaceRenderableContainer
- Parameters:
component
- aComponent
object.- Returns:
- a
Component
object.
-
getBorderInsets
Getter for the field borderInsets.
- Returns:
- a
Insets
object.
-
addDelayedPair
addDelayedPair.
- Specified by:
addDelayedPair
in interfaceRenderableContainer
- Parameters:
pair
- aDelayedPair
object.
-
applyStyle
protected void applyStyle(int availWidth, int availHeight) applyStyle.
-
clearDelayedPairs
public final void clearDelayedPairs()clearDelayedPairs.
- Specified by:
clearDelayedPairs
in interfaceRenderableContainer
-
clearGUIComponents
protected final void clearGUIComponents()clearGUIComponents.
-
clearStyle
protected void clearStyle(boolean isRootBlock) clearStyle.
- Parameters:
isRootBlock
- a boolean.
-
setupRelativePosition
setupRelativePosition.
- Specified by:
setupRelativePosition
in interfaceRElement
- Parameters:
container
- aRenderableContainer
object.
-
doLayout
protected abstract void doLayout(int availWidth, int availHeight, boolean sizeOnly) doLayout.
-
getCollapsibleMarginBottom
public int getCollapsibleMarginBottom()getCollapsibleMarginBottom.
- Specified by:
getCollapsibleMarginBottom
in interfaceRElement
- Returns:
- a
Integer
object.
-
getCollapsibleMarginTop
public int getCollapsibleMarginTop()getCollapsibleMarginTop.
- Specified by:
getCollapsibleMarginTop
in interfaceRElement
- Returns:
- a
Integer
object.
-
getDeclaredHeight
Getter for the field declaredHeight.
-
getDeclaredWidth
Getter for the field declaredWidth.
-
getDeclaredMaxWidth
-
getDeclaredMinWidth
-
getDeclaredMaxHeight
-
getDeclaredMinHeight
-
getDelayedPairs
getDelayedPairs.
- Specified by:
getDelayedPairs
in interfaceRenderableContainer
- Returns:
- a
List
object.
-
getInnerWidth
public int getInnerWidth()getInnerWidth.
- Specified by:
getInnerWidth
in interfaceRenderableContainer
- Returns:
- a
Integer
object.
-
getInnerHeight
public int getInnerHeight()getInnerHeight.
- Specified by:
getInnerHeight
in interfaceRenderableContainer
- Returns:
- a
Integer
object.
-
getInsets
getInsets.
- Specified by:
getInsets
in interfaceRenderableContainer
- Parameters:
hscroll
- a boolean.vscroll
- a boolean.- Returns:
- a
Insets
object.
-
getInsetsMarginBorder
getInsetsMarginBorder.
- Specified by:
getInsetsMarginBorder
in interfaceRenderableContainer
- Parameters:
hscroll
- a boolean.vscroll
- a boolean.- Returns:
- a
Insets
object.
-
getInsetsPadding
getInsetsPadding.
- Parameters:
hscroll
- a boolean.vscroll
- a boolean.- Returns:
- a
Insets
object.
-
getMarginBottom
public int getMarginBottom()getMarginBottom.
- Specified by:
getMarginBottom
in interfaceRElement
- Returns:
- a
Integer
object.
-
getMarginLeft
public int getMarginLeft()getMarginLeft.
- Specified by:
getMarginLeft
in interfaceRElement
- Returns:
- a
Integer
object.
-
getMarginRight
public int getMarginRight()getMarginRight.
- Specified by:
getMarginRight
in interfaceRElement
- Returns:
- a
Integer
object.
-
getMarginTop
public int getMarginTop()getMarginTop.
- Specified by:
getMarginTop
in interfaceRElement
- Returns:
- a
Integer
object.
-
getParentContainer
getParentContainer.
- Specified by:
getParentContainer
in interfaceRenderableContainer
- Returns:
- a
RenderableContainer
object.
-
getZIndex
public int getZIndex()getZIndex.
- Specified by:
getZIndex
in interfaceBoundableRenderable
- Returns:
- a
Integer
object.
-
hasDeclaredWidth
public final boolean hasDeclaredWidth()hasDeclaredWidth.
- Returns:
- a boolean.
-
imageUpdate
- Specified by:
imageUpdate
in interfaceImageObserver
-
layout
public void layout(int availWidth, int availHeight, boolean sizeOnly) Lays out the subtree below the RElement. The RElement is expected to set its own dimensions, but not its origin. Lays out children, and deals with "valid" state. Override doLayout method instead of this one. -
invalidateLayoutDeep
public final void invalidateLayoutDeep()invalidateLayoutDeep.
Invalidates this Renderable and all descendents. This is only used in special cases, such as when a new style sheet is added.- Specified by:
invalidateLayoutDeep
in interfaceRCollection
-
translateDescendentPoint
translateDescendentPoint.
- Specified by:
translateDescendentPoint
in interfaceRenderableContainer
- Parameters:
descendent
- aBoundableRenderable
object.x
- aInteger
object.y
- aInteger
object.- Returns:
- a
Point
object.
-
invalidateLayoutLocal
protected void invalidateLayoutLocal()invalidateLayoutLocal.
-
isContainedByNode
public boolean isContainedByNode()isContainedByNode.
- Specified by:
isContainedByNode
in interfaceBoundableRenderable
- Returns:
- a boolean.
-
isMarginBoundary
protected boolean isMarginBoundary()isMarginBoundary.
- Returns:
- a boolean.
-
paint
paint.
- Specified by:
paint
in interfaceRenderable
- Parameters:
g
- aGraphics
object.
-
getClipBounds
getClipBounds.
- Specified by:
getClipBounds
in interfaceRCollection
- Returns:
- a
Rectangle
object.
-
sendDelayedPairsToParent
protected final void sendDelayedPairsToParent()sendDelayedPairsToParent.
-
sendGUIComponentsToParent
protected final void sendGUIComponentsToParent()sendGUIComponentsToParent.
-
updateAllWidgetBounds
public void updateAllWidgetBounds()updateAllWidgetBounds.
- Specified by:
updateAllWidgetBounds
in interfaceRenderableContainer
-
updateWidgetBounds
public void updateWidgetBounds()Updates widget bounds below this node only. Should not be called during general rendering. -
prePaint
prePaint.
- Parameters:
g
- aGraphics
object.
-
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
-
getRenderable
getRenderable.
- Specified by:
getRenderable
in interfaceRCollection
- Parameters:
x
- aInteger
object.y
- aInteger
object.- Returns:
- a
BoundableRenderable
object.
-
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.
-
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.
-
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.
-
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.
-
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
-