org.lobobrowser.html.renderer
Class RRelative

java.lang.Object
  extended by org.lobobrowser.html.renderer.RRelative
All Implemented Interfaces:
BoundableRenderable, RCollection, Renderable

public class RRelative
extends java.lang.Object


Field Summary
protected  RenderableContainer container
           
 int height
           
protected  boolean layoutUpTreeCanBeInvalidated
          Starts as true because ancestors could be invalidated.
protected static java.util.logging.Logger logger
           
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
           
 
Fields inherited from interface org.lobobrowser.html.renderer.Renderable
EMPTY_ARRAY
 
Constructor Summary
RRelative(RenderableContainer container, ModelNode modelNode, RElement child, int xoffset, int yoffset)
           
 
Method Summary
 void assignDimension()
           
 void blur()
           
 boolean contains(int x, int y)
           
 boolean extractSelectionText(java.lang.StringBuffer buffer, boolean inSelection, RenderableSpot startPoint, RenderableSpot endPoint)
           
 void focus()
           
 java.awt.Color getBlockBackgroundColor()
           
 java.awt.Rectangle getBounds()
           
 RElement getElement()
           
 FloatingInfo getExportableFloatingInfo()
           
 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)
           
 java.awt.Point getRenderablePoint(int guiX, int guiY)
           
 java.util.Iterator getRenderables()
          Gets the collection of Renderable children.
 java.awt.Dimension getSize()
           
 int getWidth()
           
 int getX()
           
 int getXOffset()
           
 int getY()
           
 int getYOffset()
           
 int getZIndex()
           
 void invalidateLayoutDeep()
          Invalidates layout in all descendents.
protected  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 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)
           
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, 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 Detail

logger

protected static final java.util.logging.Logger logger

SELECTION_COLOR

protected static final java.awt.Color SELECTION_COLOR

SELECTION_XOR

protected static final java.awt.Color SELECTION_XOR

container

protected final RenderableContainer container

modelNode

protected final ModelNode modelNode

x

public int x

y

public int y

width

public int width

height

public int height

layoutUpTreeCanBeInvalidated

protected boolean layoutUpTreeCanBeInvalidated
Starts as true because ancestors could be invalidated.


parent

protected RCollection parent
Parent for graphics coordinates.


originalParent

protected RCollection originalParent
Parent for invalidation.

Constructor Detail

RRelative

public RRelative(RenderableContainer container,
                 ModelNode modelNode,
                 RElement child,
                 int xoffset,
                 int yoffset)
Method Detail

assignDimension

public void assignDimension()

getExportableFloatingInfo

public FloatingInfo getExportableFloatingInfo()

getElement

public RElement getElement()

getXOffset

public int getXOffset()

getYOffset

public int getYOffset()

getRenderables

public java.util.Iterator getRenderables()
Description copied from interface: RCollection
Gets the collection of Renderable children.


invalidateLayoutLocal

protected void invalidateLayoutLocal()

getLowestRenderableSpot

public RenderableSpot getLowestRenderableSpot(int x,
                                              int y)

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

public boolean onDoubleClick(java.awt.event.MouseEvent event,
                             int x,
                             int y)

onMouseClick

public boolean onMouseClick(java.awt.event.MouseEvent event,
                            int x,
                            int y)

onMouseDisarmed

public boolean onMouseDisarmed(java.awt.event.MouseEvent event)

onMousePressed

public boolean onMousePressed(java.awt.event.MouseEvent event,
                              int x,
                              int y)
Description copied from interface: BoundableRenderable
Returns false if the event is consumed. True to propagate further.


onMouseReleased

public boolean onMouseReleased(java.awt.event.MouseEvent event,
                               int x,
                               int y)

paint

public void paint(java.awt.Graphics g)

focus

public void focus()
Specified by:
focus in interface RCollection

blur

public void blur()
Specified by:
blur in interface RCollection

updateWidgetBounds

public void updateWidgetBounds(int guiX,
                               int guiY)
Updates bounds of all descendent's GUI components, based on root bounds.

Specified by:
updateWidgetBounds in interface RCollection

paintSelection

public boolean paintSelection(java.awt.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 interface BoundableRenderable
Returns:
True iff it's in selection when finished painting.

extractSelectionText

public boolean extractSelectionText(java.lang.StringBuffer buffer,
                                    boolean inSelection,
                                    RenderableSpot startPoint,
                                    RenderableSpot endPoint)
Specified by:
extractSelectionText in interface BoundableRenderable

invalidateLayoutDeep

public void invalidateLayoutDeep()
Description copied from interface: RCollection
Invalidates layout in all descendents.

Specified by:
invalidateLayoutDeep in interface RCollection

onMouseMoved

public void onMouseMoved(java.awt.event.MouseEvent event,
                         int x,
                         int y,
                         boolean triggerEvent,
                         ModelNode limit)
Specified by:
onMouseMoved in interface BoundableRenderable

onMouseOut

public void onMouseOut(java.awt.event.MouseEvent event,
                       int x,
                       int y,
                       ModelNode limit)
Specified by:
onMouseOut in interface BoundableRenderable

getRenderable

public BoundableRenderable getRenderable(int x,
                                         int y)

onRightClick

public boolean onRightClick(java.awt.event.MouseEvent event,
                            int x,
                            int y)
Specified by:
onRightClick in interface BoundableRenderable

markLayoutValid

public void markLayoutValid()

getGUIPoint

public java.awt.Point getGUIPoint(int clientX,
                                  int clientY)
Specified by:
getGUIPoint in interface BoundableRenderable

getRenderablePoint

public java.awt.Point getRenderablePoint(int guiX,
                                         int guiY)
Specified by:
getRenderablePoint in interface BoundableRenderable

getHeight

public int getHeight()
Specified by:
getHeight in interface BoundableRenderable

getWidth

public int getWidth()
Specified by:
getWidth in interface BoundableRenderable

setWidth

public void setWidth(int width)
Specified by:
setWidth in interface BoundableRenderable

getX

public int getX()
Specified by:
getX in interface BoundableRenderable

getY

public int getY()
Specified by:
getY in interface BoundableRenderable

contains

public boolean contains(int x,
                        int y)

getBounds

public java.awt.Rectangle getBounds()
Specified by:
getBounds in interface BoundableRenderable

getSize

public java.awt.Dimension getSize()
Specified by:
getSize in interface BoundableRenderable

getModelNode

public ModelNode getModelNode()
Specified by:
getModelNode in interface BoundableRenderable
Specified by:
getModelNode in interface Renderable

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
Specified by:
setBounds in interface BoundableRenderable

setX

public void setX(int x)
Specified by:
setX in interface BoundableRenderable

setY

public void setY(int y)
Specified by:
setY in interface BoundableRenderable

setHeight

public void setHeight(int height)
Specified by:
setHeight in interface BoundableRenderable

setOrigin

public void setOrigin(int x,
                      int y)
Specified by:
setOrigin in interface BoundableRenderable

invalidateLayoutUpTree

public final void invalidateLayoutUpTree()
Invalidates this Renderable and its parent (i.e. all ancestors).

Specified by:
invalidateLayoutUpTree in interface BoundableRenderable

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 interface BoundableRenderable

relayoutIfValid

public void relayoutIfValid()

setParent

public void setParent(RCollection parent)
Specified by:
setParent in interface BoundableRenderable

getParent

public RCollection getParent()
Description copied from interface: BoundableRenderable
Gets the parent where the renderable is rendered.

Specified by:
getParent in interface BoundableRenderable

setOriginalParent

public void setOriginalParent(RCollection origParent)
Specified by:
setOriginalParent in interface BoundableRenderable

getOriginalParent

public RCollection getOriginalParent()
This is the parent based on the original element hierarchy.

Specified by:
getOriginalParent in interface BoundableRenderable

getOriginalOrCurrentParent

public RCollection getOriginalOrCurrentParent()
Description copied from interface: BoundableRenderable
Returns BoundableRenderable.getOriginalParent() if not null. Otherwise it returns BoundableRenderable.getParent().

Specified by:
getOriginalOrCurrentParent in interface BoundableRenderable

repaint

public void repaint(int x,
                    int y,
                    int width,
                    int height)
Specified by:
repaint in interface BoundableRenderable

repaint

public void repaint()
Specified by:
repaint in interface BoundableRenderable

getBlockBackgroundColor

public java.awt.Color getBlockBackgroundColor()

paintTranslated

public final void paintTranslated(java.awt.Graphics g)
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 interface BoundableRenderable
Parameters:
g - Parent's Graphics context.

translateDescendentPoint

protected final java.awt.Point translateDescendentPoint(BoundableRenderable descendent,
                                                        int x,
                                                        int y)

getOrigin

public java.awt.Point getOrigin()
Specified by:
getOrigin in interface BoundableRenderable

getOriginRelativeTo

public java.awt.Point getOriginRelativeTo(RCollection ancestor)
Specified by:
getOriginRelativeTo in interface BoundableRenderable

getOrdinal

public int getOrdinal()

getZIndex

public int getZIndex()

setOrdinal

public void setOrdinal(int ordinal)


SourceForge.net LogoCopyright © 2005, 2006, 2007 The Lobo Project. All Rights Reserved.
[Cobra Project Home]