Package org.lobobrowser.html.renderer
Class RRelative
java.lang.Object
org.lobobrowser.html.renderer.RRelative
- All Implemented Interfaces:
BoundableRenderable
,RCollection
,Renderable
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final RenderableContainer
int
protected boolean
Starts as true because ancestors could be invalidated.protected static final Logger
protected final ModelNode
protected RCollection
Parent for invalidation.protected RCollection
Parent for graphics coordinates.protected static final Color
protected static final Color
int
int
int
Fields inherited from interface org.lobobrowser.html.renderer.Renderable
EMPTY_ARRAY
-
Constructor Summary
ConstructorsConstructorDescriptionRRelative
(RenderableContainer container, ModelNode modelNode, RElement child, int xoffset, int yoffset) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
blur()
boolean
contains
(int x, int y) boolean
extractSelectionText
(StringBuffer buffer, boolean inSelection, RenderableSpot startPoint, RenderableSpot endPoint) void
focus()
getGUIPoint
(int clientX, int clientY) int
getLowestRenderableSpot
(int x, int y) int
ReturnsBoundableRenderable.getOriginalParent()
if not null.This is the parent based on the original element hierarchy.getOriginRelativeTo
(RCollection ancestor) Gets the parent where the renderable is rendered.getRenderable
(int x, int y) getRenderablePoint
(int guiX, int guiY) Gets the collection ofRenderable
children.getSize()
int
getWidth()
int
getX()
int
int
getY()
int
int
void
Invalidates layout in all descendents.protected void
final void
Invalidates this Renderable and its parent (i.e.boolean
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
boolean
onDoubleClick
(MouseEvent event, int x, int y) boolean
onMouseClick
(MouseEvent event, int x, int y) boolean
onMouseDisarmed
(MouseEvent event) void
onMouseMoved
(MouseEvent event, int x, int y, boolean triggerEvent, ModelNode limit) void
onMouseOut
(MouseEvent event, int x, int y, ModelNode limit) boolean
onMousePressed
(MouseEvent event, int x, int y) Returns false if the event is consumed.boolean
onMouseReleased
(MouseEvent event, int x, int y) boolean
onRightClick
(MouseEvent event, int x, int y) void
boolean
paintSelection
(Graphics g, boolean inSelection, RenderableSpot startPoint, RenderableSpot endPoint) Asks the Renderable to paint the selection between two points.final void
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
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) protected final 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, toString, 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 Details
-
logger
-
SELECTION_COLOR
-
SELECTION_XOR
-
container
-
modelNode
-
x
public int x -
y
public int y -
width
public int width -
height
public int height -
layoutUpTreeCanBeInvalidated
protected boolean layoutUpTreeCanBeInvalidatedStarts as true because ancestors could be invalidated. -
parent
Parent for graphics coordinates. -
originalParent
Parent for invalidation.
-
-
Constructor Details
-
RRelative
public RRelative(RenderableContainer container, ModelNode modelNode, RElement child, int xoffset, int yoffset)
-
-
Method Details
-
assignDimension
public void assignDimension() -
getExportableFloatingInfo
-
getElement
-
getXOffset
public int getXOffset() -
getYOffset
public int getYOffset() -
getRenderables
Description copied from interface:RCollection
Gets the collection ofRenderable
children. -
invalidateLayoutLocal
protected void invalidateLayoutLocal() -
getLowestRenderableSpot
-
isContainedByNode
public boolean isContainedByNode()Description copied from interface:BoundableRenderable
Returns true if the renderable is fully contained by its modelNode, but said modelNode does not fully contain an ancestor renderable. -
onDoubleClick
-
onMouseClick
-
onMouseDisarmed
-
onMousePressed
Description copied from interface:BoundableRenderable
Returns false if the event is consumed. True to propagate further. -
onMouseReleased
-
paint
-
focus
public void focus()- Specified by:
focus
in interfaceRCollection
-
blur
public void blur()- Specified by:
blur
in interfaceRCollection
-
updateWidgetBounds
public void updateWidgetBounds(int guiX, int guiY) Updates bounds of all descendent's GUI components, based on root bounds.- Specified by:
updateWidgetBounds
in interfaceRCollection
-
paintSelection
public boolean paintSelection(Graphics g, boolean inSelection, RenderableSpot startPoint, RenderableSpot endPoint) Description copied from interface:BoundableRenderable
Asks the Renderable to paint the selection between two points. Nothing will be done if the points are outside the Renderable.- Specified by:
paintSelection
in interfaceBoundableRenderable
- Returns:
- True iff it's in selection when finished painting.
-
extractSelectionText
public boolean extractSelectionText(StringBuffer buffer, boolean inSelection, RenderableSpot startPoint, RenderableSpot endPoint) - Specified by:
extractSelectionText
in interfaceBoundableRenderable
-
invalidateLayoutDeep
public void invalidateLayoutDeep()Description copied from interface:RCollection
Invalidates layout in all descendents.- Specified by:
invalidateLayoutDeep
in interfaceRCollection
-
onMouseMoved
- Specified by:
onMouseMoved
in interfaceBoundableRenderable
-
onMouseOut
- Specified by:
onMouseOut
in interfaceBoundableRenderable
-
getRenderable
-
onRightClick
- Specified by:
onRightClick
in interfaceBoundableRenderable
-
markLayoutValid
public void markLayoutValid() -
getGUIPoint
- Specified by:
getGUIPoint
in interfaceBoundableRenderable
-
getRenderablePoint
- Specified by:
getRenderablePoint
in interfaceBoundableRenderable
-
getHeight
public int getHeight()- Specified by:
getHeight
in interfaceBoundableRenderable
-
getWidth
public int getWidth()- Specified by:
getWidth
in interfaceBoundableRenderable
-
setWidth
public void setWidth(int width) - Specified by:
setWidth
in interfaceBoundableRenderable
-
getX
public int getX()- Specified by:
getX
in interfaceBoundableRenderable
-
getY
public int getY()- Specified by:
getY
in interfaceBoundableRenderable
-
contains
public boolean contains(int x, int y) -
getBounds
- Specified by:
getBounds
in interfaceBoundableRenderable
-
getSize
- Specified by:
getSize
in interfaceBoundableRenderable
-
getModelNode
- Specified by:
getModelNode
in interfaceBoundableRenderable
- Specified by:
getModelNode
in interfaceRenderable
-
setBounds
public void setBounds(int x, int y, int width, int height) - Specified by:
setBounds
in interfaceBoundableRenderable
-
setX
public void setX(int x) - Specified by:
setX
in interfaceBoundableRenderable
-
setY
public void setY(int y) - Specified by:
setY
in interfaceBoundableRenderable
-
setHeight
public void setHeight(int height) - Specified by:
setHeight
in interfaceBoundableRenderable
-
setOrigin
public void setOrigin(int x, int y) - Specified by:
setOrigin
in interfaceBoundableRenderable
-
invalidateLayoutUpTree
public final void invalidateLayoutUpTree()Invalidates this Renderable and its parent (i.e. all ancestors).- Specified by:
invalidateLayoutUpTree
in interfaceBoundableRenderable
-
isValid
protected boolean isValid() -
relayout
public void 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() -
setParent
- Specified by:
setParent
in interfaceBoundableRenderable
-
getParent
Description copied from interface:BoundableRenderable
Gets the parent where the renderable is rendered.- Specified by:
getParent
in interfaceBoundableRenderable
-
setOriginalParent
- Specified by:
setOriginalParent
in interfaceBoundableRenderable
-
getOriginalParent
This is the parent based on the original element hierarchy.- Specified by:
getOriginalParent
in interfaceBoundableRenderable
-
getOriginalOrCurrentParent
Description copied from interface:BoundableRenderable
ReturnsBoundableRenderable.getOriginalParent()
if not null. Otherwise it returnsBoundableRenderable.getParent()
.- Specified by:
getOriginalOrCurrentParent
in interfaceBoundableRenderable
-
repaint
public void repaint(int x, int y, int width, int height) - Specified by:
repaint
in interfaceBoundableRenderable
-
repaint
public void repaint()- Specified by:
repaint
in interfaceBoundableRenderable
-
getBlockBackgroundColor
-
paintTranslated
Description copied from interface:BoundableRenderable
Paints by either creating a new clipped graphics context corresponding to the bounds of the Renderable, or by translating the origin.- Specified by:
paintTranslated
in interfaceBoundableRenderable
- Parameters:
g
- Parent's Graphics context.
-
translateDescendentPoint
-
getOrigin
- Specified by:
getOrigin
in interfaceBoundableRenderable
-
getOriginRelativeTo
- Specified by:
getOriginRelativeTo
in interfaceBoundableRenderable
-
getOrdinal
public int getOrdinal() -
getZIndex
public int getZIndex() -
setOrdinal
public void setOrdinal(int ordinal)
-