public class RBlock extends java.lang.Object implements RenderableContainer, java.awt.image.ImageObserver
Immediately below an RBlock you will find a node of
type RBlockViewport.
| Modifier and Type | Field and Description |
|---|---|
protected java.awt.Color |
backgroundColor
Background color which may be different to
that from RenderState in the case of a Document node.
|
protected java.awt.Image |
backgroundImage |
protected RBlockViewport |
bodyLayout |
protected java.awt.Color |
borderBottomColor |
protected BorderInfo |
borderInfo |
protected java.awt.Insets |
borderInsets |
protected java.awt.Color |
borderLeftColor |
protected java.awt.Color |
borderRightColor |
protected java.awt.Color |
borderTopColor |
protected java.util.Map |
cachedLayout |
protected RenderableContainer |
container |
protected java.awt.Insets |
defaultMarginInsets |
protected int |
defaultOverflowX |
protected int |
defaultOverflowY |
protected java.awt.Insets |
defaultPaddingInsets |
protected java.util.Collection |
delayedPairs
A list of absolute positioned or
float parent-child pairs.
|
protected RenderableSpot |
endSelection |
protected FrameContext |
frameContext |
protected boolean |
hasHScrollBar |
protected boolean |
hasVScrollBar |
int |
height |
protected javax.swing.JScrollBar |
hScrollBar |
protected static java.lang.Integer |
INVALID_SIZE |
protected java.net.URL |
lastBackgroundImageUri |
protected boolean |
layoutDeepCanBeInvalidated |
protected boolean |
layoutUpTreeCanBeInvalidated
Starts as true because ancestors could be invalidated.
|
protected int |
listNesting |
protected static java.util.logging.Logger |
logger |
protected java.awt.Insets |
marginInsets |
protected ModelNode |
modelNode |
protected RCollection |
originalParent
Parent for invalidation.
|
protected int |
overflowX |
protected int |
overflowY |
protected java.awt.Insets |
paddingInsets |
protected RCollection |
parent
Parent for graphics coordinates.
|
protected HtmlRendererContext |
rendererContext |
protected static int |
SCROLL_BAR_THICKNESS |
protected static java.awt.Color |
SELECTION_COLOR |
protected static java.awt.Color |
SELECTION_XOR |
protected RenderableSpot |
startSelection |
protected UserAgentContext |
userAgentContext |
protected javax.swing.JScrollBar |
vScrollBar |
int |
width |
int |
x |
int |
y |
protected int |
zIndex |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHVALIGN_ABSBOTTOM, VALIGN_ABSMIDDLE, VALIGN_BASELINE, VALIGN_BOTTOM, VALIGN_MIDDLE, VALIGN_TOPEMPTY_ARRAY| Constructor and Description |
|---|
RBlock(NodeImpl modelNode,
int listNesting,
UserAgentContext pcontext,
HtmlRendererContext rcontext,
FrameContext frameContext,
RenderableContainer parentContainer) |
| Modifier and Type | Method and Description |
|---|---|
java.awt.Component |
addComponent(java.awt.Component component) |
void |
addDelayedPair(DelayedPair pair) |
protected void |
applyStyle(int availWidth,
int availHeight) |
void |
blur() |
void |
clearDelayedPairs() |
protected void |
clearGUIComponents() |
protected void |
clearStyle(boolean isRootBlock) |
boolean |
contains(int x,
int y) |
void |
doLayout(int availWidth,
int availHeight,
boolean sizeOnly) |
void |
doLayout(int availWidth,
int availHeight,
boolean expandWidth,
boolean expandHeight,
org.lobobrowser.html.renderer.FloatingBoundsSource floatBoundsSource,
int defaultOverflowX,
int defaultOverflowY,
boolean sizeOnly)
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(java.awt.Point point) |
boolean |
extractSelectionText(java.lang.StringBuffer buffer,
boolean inSelection,
RenderableSpot startPoint,
RenderableSpot endPoint) |
void |
finalize() |
void |
focus() |
float |
getAlignmentX() |
float |
getAlignmentY() |
java.awt.Color |
getBlockBackgroundColor() |
java.awt.Rectangle |
getBounds() |
java.awt.Rectangle |
getBoundsRelativeToBlock() |
int |
getCollapsibleMarginBottom() |
int |
getCollapsibleMarginTop() |
protected java.lang.Integer |
getDeclaredHeight(RenderState renderState,
int actualAvailHeight) |
protected int |
getDeclaredHeightImpl(RenderState renderState,
int availHeight) |
protected java.lang.Integer |
getDeclaredWidth(RenderState renderState,
int actualAvailWidth) |
int |
getDefaultOverflowX() |
int |
getDefaultOverflowY() |
java.util.Collection |
getDelayedPairs() |
FloatingInfo |
getExportableFloatingInfo() |
int |
getFirstBaselineOffset() |
int |
getFirstLineHeight() |
java.awt.Point |
getGUIPoint(int clientX,
int clientY) |
int |
getHeight() |
java.awt.Insets |
getInsets(boolean hscroll,
boolean vscroll)
Gets insets of content area.
|
RenderableSpot |
getLowestRenderableSpot(int x,
int y) |
int |
getMarginBottom() |
int |
getMarginLeft() |
int |
getMarginRight() |
int |
getMarginTop() |
ModelNode |
getModelNode() |
int |
getOrdinal() |
java.awt.Point |
getOrigin() |
RCollection |
getOriginalOrCurrentParent()
Returns
BoundableRenderable.getOriginalParent() if not null. |
RCollection |
getOriginalParent()
This is the parent based on the original element hierarchy.
|
java.awt.Point |
getOriginRelativeTo(RCollection ancestor) |
java.awt.Color |
getPaintedBackgroundColor() |
RCollection |
getParent()
Gets the parent where the renderable is rendered.
|
RenderableContainer |
getParentContainer() |
RBlockViewport |
getRBlockViewport() |
BoundableRenderable |
getRenderable(int x,
int y) |
java.awt.Point |
getRenderablePoint(int guiX,
int guiY) |
java.util.Iterator |
getRenderables()
Gets the collection of
Renderable children. |
java.awt.Dimension |
getSize() |
int |
getVAlign()
Vertical alignment for elements rendered in a line.
|
int |
getViewportListNesting(int blockNesting) |
int |
getVScrollBarWidth()
Gets the width the vertical scrollbar has when shown.
|
int |
getWidth() |
int |
getX() |
int |
getY() |
int |
getZIndex() |
boolean |
hasDeclaredWidth() |
boolean |
imageUpdate(java.awt.Image img,
int infoflags,
int x,
int y,
int w,
int h) |
void |
invalidateLayoutDeep()
Invalidates this Renderable and all
descendents.
|
void |
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.
|
void |
invalidateLayoutUpTree()
Invalidates this Renderable and its parent (i.e.
|
boolean |
isContainedByNode()
Returns true if the renderable is fully contained by its modelNode, but
said modelNode does not fully contain an ancestor renderable.
|
protected boolean |
isMarginBoundary() |
boolean |
isOverflowVisibleX() |
boolean |
isOverflowVisibleY() |
protected boolean |
isValid() |
void |
layout(int availWidth,
int availHeight,
boolean sizeOnly)
Lays out children, and deals with "valid" state.
|
void |
layout(int availWidth,
int availHeight,
boolean expandWidth,
boolean expandHeight,
org.lobobrowser.html.renderer.FloatingBoundsSource floatBoundsSource,
boolean sizeOnly) |
void |
layout(int availWidth,
int availHeight,
boolean expandWidth,
boolean expandHeight,
org.lobobrowser.html.renderer.FloatingBoundsSource floatBoundsSource,
int defaultOverflowX,
int defaultOverflowY,
boolean sizeOnly) |
void |
layout(int availWidth,
int availHeight,
boolean expandWidth,
boolean expandHeight,
int defaultOverflowX,
int defaultOverflowY,
boolean sizeOnly) |
protected void |
loadBackgroundImage(java.net.URL imageURL) |
void |
markLayoutValid() |
boolean |
onDoubleClick(java.awt.event.MouseEvent event,
int x,
int y) |
boolean |
onMouseClick(java.awt.event.MouseEvent event,
int x,
int y) |
boolean |
onMouseDisarmed(java.awt.event.MouseEvent event) |
void |
onMouseMoved(java.awt.event.MouseEvent event,
int x,
int y,
boolean triggerEvent,
ModelNode limit) |
void |
onMouseOut(java.awt.event.MouseEvent event,
int x,
int y,
ModelNode limit) |
boolean |
onMousePressed(java.awt.event.MouseEvent event,
int x,
int y)
Returns false if the event is consumed.
|
boolean |
onMouseReleased(java.awt.event.MouseEvent event,
int x,
int y) |
boolean |
onRightClick(java.awt.event.MouseEvent event,
int x,
int y) |
void |
paint(java.awt.Graphics g)
All overriders should call super implementation.
|
boolean |
paintSelection(java.awt.Graphics g,
boolean inSelection,
RenderableSpot startPoint,
RenderableSpot endPoint)
Asks the Renderable to paint the selection between two
points.
|
void |
paintTranslated(java.awt.Graphics g)
Paints by either creating a new clipped graphics context corresponding
to the bounds of the Renderable, or by translating the origin.
|
protected void |
prePaint(java.awt.Graphics g) |
void |
relayout()
Invalidates the current Renderable (which invalidates its ancestors)
and then requests the top level GUI container to do the layout and repaint.
|
void |
relayoutIfValid() |
void |
repaint() |
void |
repaint(int x,
int y,
int width,
int height) |
void |
repaint(ModelNode modelNode)
Called
|
void |
scrollBy(int orientation,
int offset) |
void |
scrollByUnits(int orientation,
int units) |
void |
scrollHorizontalTo(int newX) |
void |
scrollTo(java.awt.Rectangle bounds,
boolean xIfNeeded,
boolean yIfNeeded)
Scrolls the viewport's origin to the given location, or
as close to it as possible.
|
void |
scrollVerticalTo(int newY) |
protected void |
sendDelayedPairsToParent() |
protected void |
sendGUIComponentsToParent() |
void |
setBounds(int x,
int y,
int width,
int height) |
void |
setDefaultMarginInsets(java.awt.Insets insets) |
void |
setDefaultOverflowX(int defaultOverflowX) |
void |
setDefaultOverflowY(int defaultOverflowY) |
void |
setDefaultPaddingInsets(java.awt.Insets insets) |
void |
setHeight(int height) |
void |
setOrdinal(int ordinal) |
void |
setOrigin(int x,
int y) |
void |
setOriginalParent(RCollection origParent) |
void |
setParent(RCollection parent) |
void |
setSelectionEnd(RenderableSpot rpoint) |
void |
setSelectionStart(RenderableSpot rpoint) |
void |
setWidth(int width) |
void |
setX(int x) |
void |
setY(int y) |
java.lang.String |
toString() |
protected java.awt.Point |
translateDescendentPoint(BoundableRenderable descendent,
int x,
int y) |
void |
updateAllWidgetBounds() |
void |
updateWidgetBounds()
Updates widget bounds below this node only.
|
void |
updateWidgetBounds(int guiX,
int guiY)
Updates bounds of all descendent's GUI components,
based on root bounds.
|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, waitaddComponent, addDelayedPair, clearDelayedPairs, focus, getDelayedPairs, getGUIPoint, getParentContainer, invalidateLayoutUpTree, relayout, repaint, updateAllWidgetBoundsblur, focusgetBounds, getGUIPoint, getHeight, getModelNode, getOrdinal, getOrigin, getOriginalOrCurrentParent, getOriginalParent, getOriginRelativeTo, getParent, getRenderablePoint, getSize, getWidth, getX, getY, invalidateLayoutUpTree, onMouseMoved, onMouseOut, onRightClick, paintTranslated, relayout, repaint, repaint, setBounds, setHeight, setOrdinal, setOrigin, setOriginalParent, setParent, setWidth, setX, setYprotected static final java.util.logging.Logger logger
protected final FrameContext frameContext
protected final int listNesting
protected final HtmlRendererContext rendererContext
protected final RBlockViewport bodyLayout
protected final java.util.Map cachedLayout
protected RenderableSpot startSelection
protected RenderableSpot endSelection
protected javax.swing.JScrollBar vScrollBar
protected javax.swing.JScrollBar hScrollBar
protected boolean hasHScrollBar
protected boolean hasVScrollBar
protected int defaultOverflowX
protected int defaultOverflowY
protected static final java.lang.Integer INVALID_SIZE
protected java.util.Collection delayedPairs
protected java.awt.Color backgroundColor
protected volatile java.awt.Image backgroundImage
protected int zIndex
protected java.awt.Color borderTopColor
protected java.awt.Color borderLeftColor
protected java.awt.Color borderBottomColor
protected java.awt.Color borderRightColor
protected java.awt.Insets borderInsets
protected java.awt.Insets marginInsets
protected java.awt.Insets paddingInsets
protected BorderInfo borderInfo
protected java.net.URL lastBackgroundImageUri
protected java.awt.Insets defaultMarginInsets
protected java.awt.Insets defaultPaddingInsets
protected int overflowX
protected int overflowY
protected final UserAgentContext userAgentContext
protected boolean layoutDeepCanBeInvalidated
protected static final int SCROLL_BAR_THICKNESS
protected static final java.awt.Color SELECTION_COLOR
protected static final java.awt.Color SELECTION_XOR
protected final RenderableContainer container
protected final ModelNode modelNode
public int x
public int y
public int width
public int height
protected boolean layoutUpTreeCanBeInvalidated
protected RCollection parent
protected RCollection originalParent
public RBlock(NodeImpl modelNode, int listNesting, UserAgentContext pcontext, HtmlRendererContext rcontext, FrameContext frameContext, RenderableContainer parentContainer)
public int getVScrollBarWidth()
public void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic int getVAlign()
RElementpublic void ensureVisible(java.awt.Point point)
public final boolean isOverflowVisibleX()
public final boolean isOverflowVisibleY()
public int getFirstLineHeight()
public int getFirstBaselineOffset()
public void setSelectionEnd(RenderableSpot rpoint)
public void setSelectionStart(RenderableSpot rpoint)
public int getViewportListNesting(int blockNesting)
public void paint(java.awt.Graphics g)
paint in interface Renderablepublic final void layout(int availWidth,
int availHeight,
boolean expandWidth,
boolean expandHeight,
int defaultOverflowX,
int defaultOverflowY,
boolean sizeOnly)
public final void layout(int availWidth,
int availHeight,
boolean expandWidth,
boolean expandHeight,
org.lobobrowser.html.renderer.FloatingBoundsSource floatBoundsSource,
boolean sizeOnly)
public final void layout(int availWidth,
int availHeight,
boolean expandWidth,
boolean expandHeight,
org.lobobrowser.html.renderer.FloatingBoundsSource floatBoundsSource,
int defaultOverflowX,
int defaultOverflowY,
boolean sizeOnly)
public final void doLayout(int availWidth,
int availHeight,
boolean sizeOnly)
public void doLayout(int availWidth,
int availHeight,
boolean expandWidth,
boolean expandHeight,
org.lobobrowser.html.renderer.FloatingBoundsSource floatBoundsSource,
int defaultOverflowX,
int defaultOverflowY,
boolean sizeOnly)
availWidth - availHeight - public boolean paintSelection(java.awt.Graphics g,
boolean inSelection,
RenderableSpot startPoint,
RenderableSpot endPoint)
BoundableRenderablepaintSelection in interface BoundableRenderablepublic RenderableSpot getLowestRenderableSpot(int x, int y)
getLowestRenderableSpot in interface BoundableRenderablepublic void invalidateLayoutLocal()
protected void clearStyle(boolean isRootBlock)
public boolean onMouseClick(java.awt.event.MouseEvent event,
int x,
int y)
onMouseClick in interface BoundableRenderablepublic boolean onDoubleClick(java.awt.event.MouseEvent event,
int x,
int y)
onDoubleClick in interface BoundableRenderablepublic boolean onMouseDisarmed(java.awt.event.MouseEvent event)
onMouseDisarmed in interface BoundableRenderablepublic boolean onMousePressed(java.awt.event.MouseEvent event,
int x,
int y)
BoundableRenderableonMousePressed in interface BoundableRenderablepublic boolean onMouseReleased(java.awt.event.MouseEvent event,
int x,
int y)
onMouseReleased in interface BoundableRenderablepublic java.awt.Color getPaintedBackgroundColor()
getPaintedBackgroundColor in interface RenderableContainerpublic java.util.Iterator getRenderables()
RCollectionRenderable children.getRenderables in interface RCollectionpublic void updateWidgetBounds(int guiX,
int guiY)
updateWidgetBounds in interface RCollectionpublic void scrollHorizontalTo(int newX)
public void scrollVerticalTo(int newY)
public void scrollByUnits(int orientation,
int units)
public void scrollBy(int orientation,
int offset)
public void scrollTo(java.awt.Rectangle bounds,
boolean xIfNeeded,
boolean yIfNeeded)
This method should be invoked in the GUI thread.
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.public RBlockViewport getRBlockViewport()
public boolean extractSelectionText(java.lang.StringBuffer buffer,
boolean inSelection,
RenderableSpot startPoint,
RenderableSpot endPoint)
extractSelectionText in interface BoundableRenderablepublic java.lang.String toString()
toString in class java.lang.Objectpublic FloatingInfo getExportableFloatingInfo()
public int getDefaultOverflowX()
public int getDefaultOverflowY()
public void setDefaultOverflowX(int defaultOverflowX)
public void setDefaultOverflowY(int defaultOverflowY)
public void setDefaultPaddingInsets(java.awt.Insets insets)
public void setDefaultMarginInsets(java.awt.Insets insets)
public float getAlignmentX()
public float getAlignmentY()
public final void invalidateLayoutDeep()
invalidateLayoutDeep in interface RCollectionprotected java.lang.Integer getDeclaredWidth(RenderState renderState, int actualAvailWidth)
public final boolean hasDeclaredWidth()
protected java.lang.Integer getDeclaredHeight(RenderState renderState, int actualAvailHeight)
protected int getDeclaredHeightImpl(RenderState renderState, int availHeight)
public final void layout(int availWidth,
int availHeight,
boolean sizeOnly)
protected final void sendGUIComponentsToParent()
protected final void clearGUIComponents()
public java.awt.Component addComponent(java.awt.Component component)
addComponent in interface RenderableContainerpublic void updateAllWidgetBounds()
updateAllWidgetBounds in interface RenderableContainerpublic void updateWidgetBounds()
public java.awt.Rectangle getBoundsRelativeToBlock()
getBoundsRelativeToBlock in interface UINodeprotected void applyStyle(int availWidth,
int availHeight)
protected void loadBackgroundImage(java.net.URL imageURL)
public int getZIndex()
getZIndex in interface BoundableRenderableprotected void prePaint(java.awt.Graphics g)
public boolean imageUpdate(java.awt.Image img,
int infoflags,
int x,
int y,
int w,
int h)
imageUpdate in interface java.awt.image.ImageObserverpublic java.awt.Insets getInsets(boolean hscroll,
boolean vscroll)
protected final void sendDelayedPairsToParent()
public final void clearDelayedPairs()
clearDelayedPairs in interface RenderableContainerpublic final java.util.Collection getDelayedPairs()
getDelayedPairs in interface RenderableContainerpublic void addDelayedPair(DelayedPair pair)
addDelayedPair in interface RenderableContainerpublic RenderableContainer getParentContainer()
getParentContainer in interface RenderableContainerpublic boolean isContainedByNode()
BoundableRenderableisContainedByNode in interface BoundableRenderablepublic int getCollapsibleMarginBottom()
getCollapsibleMarginBottom in interface RElementprotected boolean isMarginBoundary()
public int getCollapsibleMarginTop()
getCollapsibleMarginTop in interface RElementpublic int getMarginBottom()
getMarginBottom in interface RElementpublic int getMarginLeft()
getMarginLeft in interface RElementpublic int getMarginRight()
getMarginRight in interface RElementpublic int getMarginTop()
getMarginTop in interface RElementpublic void focus()
focus in interface RCollectionpublic void blur()
blur in interface RCollectionpublic void onMouseMoved(java.awt.event.MouseEvent event,
int x,
int y,
boolean triggerEvent,
ModelNode limit)
onMouseMoved in interface BoundableRenderablepublic void onMouseOut(java.awt.event.MouseEvent event,
int x,
int y,
ModelNode limit)
onMouseOut in interface BoundableRenderablepublic BoundableRenderable getRenderable(int x, int y)
public boolean onRightClick(java.awt.event.MouseEvent event,
int x,
int y)
onRightClick in interface BoundableRenderablepublic void markLayoutValid()
public java.awt.Point getGUIPoint(int clientX,
int clientY)
getGUIPoint in interface BoundableRenderablepublic java.awt.Point getRenderablePoint(int guiX,
int guiY)
getRenderablePoint in interface BoundableRenderablepublic int getHeight()
getHeight in interface BoundableRenderablepublic int getWidth()
getWidth in interface BoundableRenderablepublic void setWidth(int width)
setWidth in interface BoundableRenderablepublic int getX()
getX in interface BoundableRenderablepublic int getY()
getY in interface BoundableRenderablepublic boolean contains(int x,
int y)
public java.awt.Rectangle getBounds()
getBounds in interface BoundableRenderablepublic java.awt.Dimension getSize()
getSize in interface BoundableRenderablepublic ModelNode getModelNode()
getModelNode in interface BoundableRenderablegetModelNode in interface Renderablepublic void setBounds(int x,
int y,
int width,
int height)
setBounds in interface BoundableRenderablepublic void setX(int x)
setX in interface BoundableRenderablepublic void setY(int y)
setY in interface BoundableRenderablepublic void setHeight(int height)
setHeight in interface BoundableRenderablepublic void setOrigin(int x,
int y)
setOrigin in interface BoundableRenderablepublic final void invalidateLayoutUpTree()
invalidateLayoutUpTree in interface BoundableRenderableprotected boolean isValid()
public void relayout()
relayout in interface BoundableRenderablepublic void relayoutIfValid()
public void setParent(RCollection parent)
setParent in interface BoundableRenderablepublic RCollection getParent()
BoundableRenderablegetParent in interface BoundableRenderablepublic void setOriginalParent(RCollection origParent)
setOriginalParent in interface BoundableRenderablepublic RCollection getOriginalParent()
getOriginalParent in interface BoundableRenderablepublic RCollection getOriginalOrCurrentParent()
BoundableRenderableBoundableRenderable.getOriginalParent() if not null. Otherwise
it returns BoundableRenderable.getParent().getOriginalOrCurrentParent in interface BoundableRenderablepublic void repaint(int x,
int y,
int width,
int height)
repaint in interface BoundableRenderablepublic void repaint()
repaint in interface BoundableRenderablepublic java.awt.Color getBlockBackgroundColor()
public final void paintTranslated(java.awt.Graphics g)
BoundableRenderablepaintTranslated in interface BoundableRenderableg - Parent's Graphics context.protected final java.awt.Point translateDescendentPoint(BoundableRenderable descendent, int x, int y)
public java.awt.Point getOrigin()
getOrigin in interface BoundableRenderablepublic java.awt.Point getOriginRelativeTo(RCollection ancestor)
getOriginRelativeTo in interface BoundableRenderablepublic int getOrdinal()
public void setOrdinal(int ordinal)