|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.lobobrowser.html.renderer.RBlockViewport
public class RBlockViewport
A substantial portion of the HTML rendering logic of the package can be found in this class. This class is in charge of laying out the DOM subtree of a node, usually on behalf of an RBlock. It creates a renderer subtree consisting of RLine's or RBlock's. RLine's in turn contain RWord's and so on. This class also happens to be used as an RBlock scrollable viewport.
| Field Summary | |
|---|---|
int |
height
|
protected boolean |
layoutUpTreeCanBeInvalidated
Starts as true because ancestors could be invalidated. |
protected ModelNode |
modelNode
|
protected RCollection |
originalParent
Parent for invalidation. |
protected RCollection |
parent
Parent for graphics coordinates. |
protected static java.awt.Color |
SELECTION_COLOR
|
protected static java.awt.Color |
SELECTION_XOR
|
int |
width
|
int |
x
|
int |
y
|
static java.awt.Insets |
ZERO_INSETS
|
| Fields inherited from interface org.lobobrowser.html.renderer.Renderable |
|---|
EMPTY_ARRAY |
| Constructor Summary | |
|---|---|
RBlockViewport(ModelNode modelNode,
RenderableContainer container,
int listNesting,
UserAgentContext pcontext,
HtmlRendererContext rcontext,
FrameContext frameContext,
RCollection parent)
Constructs an HtmlBlockLayout. |
|
| Method Summary | |
|---|---|
void |
alignX(int alignXPercent,
int canvasWidth,
java.awt.Insets paddingInsets)
Applies any horizonal aLignment. |
void |
alignY(int alignYPercent,
int canvasHeight,
java.awt.Insets paddingInsets)
Applies vertical alignment. |
void |
blur()
|
boolean |
contains(int x,
int y)
|
boolean |
extractSelectionText(java.lang.StringBuffer buffer,
boolean inSelection,
RenderableSpot startPoint,
RenderableSpot endPoint)
|
void |
focus()
|
int |
getAvailContentWidth()
|
java.awt.Color |
getBlockBackgroundColor()
|
java.awt.Rectangle |
getBounds()
|
FloatingInfo |
getExportableFloatingInfo()
|
int |
getFirstBaselineOffset()
|
int |
getFirstLineHeight()
|
java.awt.Point |
getGUIPoint(int clientX,
int clientY)
|
int |
getHeight()
|
RenderableSpot |
getLowestRenderableSpot(int x,
int y)
|
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)
|
RCollection |
getParent()
Gets the parent where the renderable is rendered. |
BoundableRenderable |
getRenderable(int x,
int y)
|
BoundableRenderable |
getRenderable(java.awt.Point point)
|
java.awt.Point |
getRenderablePoint(int guiX,
int guiY)
|
java.util.Iterator |
getRenderables()
Gets the collection of Renderable children. |
java.util.Iterator |
getRenderables(int pointx,
int pointy)
|
java.util.Iterator |
getRenderables(java.awt.Point point)
|
java.util.Iterator |
getRenderables(java.awt.Rectangle clipBounds)
|
Renderable[] |
getRenderablesArray()
|
java.awt.Dimension |
getSize()
|
int |
getWidth()
|
int |
getX()
|
int |
getY()
|
int |
getZIndex()
|
void |
invalidateLayoutDeep()
Invalidates layout in all descendents. |
void |
invalidateLayoutLocal()
|
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 |
isValid()
|
void |
layout(int desiredWidth,
int desiredHeight,
java.awt.Insets paddingInsets,
int yLimit,
org.lobobrowser.html.renderer.FloatingBounds floatBounds,
boolean sizeOnly)
Builds the layout/renderer tree from scratch. |
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)
|
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. |
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 |
setBounds(int x,
int y,
int width,
int height)
|
void |
setHeight(int height)
|
void |
setOrdinal(int ordinal)
|
void |
setOrigin(int x,
int y)
|
void |
setOriginalParent(RCollection origParent)
|
void |
setParent(RCollection parent)
|
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 |
updateWidgetBounds(int guiX,
int guiY)
Updates bounds of all descendent's GUI components, based on root bounds. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.lobobrowser.html.renderer.BoundableRenderable |
|---|
getBounds, getGUIPoint, getHeight, getModelNode, getOrdinal, getOrigin, getOriginalOrCurrentParent, getOriginalParent, getOriginRelativeTo, getParent, getRenderablePoint, getSize, getWidth, getX, getY, getZIndex, invalidateLayoutUpTree, paintTranslated, relayout, repaint, repaint, setBounds, setHeight, setOrdinal, setOrigin, setOriginalParent, setParent, setWidth, setX, setY |
| Field Detail |
|---|
public static final java.awt.Insets ZERO_INSETS
protected static final java.awt.Color SELECTION_COLOR
protected static final java.awt.Color SELECTION_XOR
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
| Constructor Detail |
|---|
public RBlockViewport(ModelNode modelNode,
RenderableContainer container,
int listNesting,
UserAgentContext pcontext,
HtmlRendererContext rcontext,
FrameContext frameContext,
RCollection parent)
container - This is usually going to be an RBlock.listNesting - The nesting level for lists. This is zero except inside a list.pcontext - The HTMLParserContext instance.frameContext - This is usually going to be HtmlBlock, an object where text selections are contained.parent - This is usually going to be the parent of container.| Method Detail |
|---|
public void invalidateLayoutLocal()
public int getAvailContentWidth()
public void layout(int desiredWidth,
int desiredHeight,
java.awt.Insets paddingInsets,
int yLimit,
org.lobobrowser.html.renderer.FloatingBounds floatBounds,
boolean sizeOnly)
yLimit - If other than -1, layout will throw SizeExceededException
in the event that the layout goes beyond this y-coordinate point.
public void alignX(int alignXPercent,
int canvasWidth,
java.awt.Insets paddingInsets)
canvasWidth - The new width of the viewport. It could be
different to the previously calculated width.paddingInsets -
public void alignY(int alignYPercent,
int canvasHeight,
java.awt.Insets paddingInsets)
canvasHeight - paddingInsets - public Renderable[] getRenderablesArray()
public java.util.Iterator getRenderables()
RCollectionRenderable children.
public java.util.Iterator getRenderables(java.awt.Rectangle clipBounds)
public BoundableRenderable getRenderable(int x,
int y)
public BoundableRenderable getRenderable(java.awt.Point point)
public java.util.Iterator getRenderables(java.awt.Point point)
public java.util.Iterator getRenderables(int pointx,
int pointy)
public int getFirstLineHeight()
public int getFirstBaselineOffset()
public RenderableSpot getLowestRenderableSpot(int x,
int y)
public boolean onMouseClick(java.awt.event.MouseEvent event,
int x,
int y)
public boolean onDoubleClick(java.awt.event.MouseEvent event,
int x,
int y)
public boolean onMouseDisarmed(java.awt.event.MouseEvent event)
public boolean onMousePressed(java.awt.event.MouseEvent event,
int x,
int y)
BoundableRenderable
public boolean onMouseReleased(java.awt.event.MouseEvent event,
int x,
int y)
public void paint(java.awt.Graphics g)
public boolean isContainedByNode()
BoundableRenderable
public java.lang.String toString()
toString in class java.lang.Objectpublic FloatingInfo getExportableFloatingInfo()
public void focus()
focus in interface RCollectionpublic void blur()
blur in interface RCollection
public void updateWidgetBounds(int guiX,
int guiY)
updateWidgetBounds in interface RCollection
public boolean paintSelection(java.awt.Graphics g,
boolean inSelection,
RenderableSpot startPoint,
RenderableSpot endPoint)
BoundableRenderable
paintSelection in interface BoundableRenderable
public boolean extractSelectionText(java.lang.StringBuffer buffer,
boolean inSelection,
RenderableSpot startPoint,
RenderableSpot endPoint)
extractSelectionText in interface BoundableRenderablepublic void invalidateLayoutDeep()
RCollection
invalidateLayoutDeep in interface RCollection
public void onMouseMoved(java.awt.event.MouseEvent event,
int x,
int y,
boolean triggerEvent,
ModelNode limit)
onMouseMoved in interface BoundableRenderable
public void onMouseOut(java.awt.event.MouseEvent event,
int x,
int y,
ModelNode limit)
onMouseOut in interface BoundableRenderable
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 BoundableRenderable
public 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 BoundableRenderable
public 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 Renderable
public 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 BoundableRenderable
public 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()
BoundableRenderable
getParent 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 BoundableRenderable
public 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)
BoundableRenderable
paintTranslated 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 int getZIndex()
public void setOrdinal(int ordinal)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||