org.lobobrowser.html.renderer
public class RImgControl extends java.lang.Object
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 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 RenderableContainer |
container |
protected java.awt.Insets |
defaultMarginInsets |
protected java.awt.Insets |
defaultPaddingInsets |
protected java.util.Collection |
delayedPairs
A list of absolute positioned or
float parent-child pairs.
|
int |
height |
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 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 static int |
SCROLL_BAR_THICKNESS |
protected static java.awt.Color |
SELECTION_COLOR |
protected static java.awt.Color |
SELECTION_XOR |
protected UserAgentContext |
userAgentContext |
org.lobobrowser.html.renderer.UIControl |
widget |
int |
width |
int |
x |
int |
y |
protected int |
zIndex |
VALIGN_ABSBOTTOM, VALIGN_ABSMIDDLE, VALIGN_BASELINE, VALIGN_BOTTOM, VALIGN_MIDDLE, VALIGN_TOP
EMPTY_ARRAY
Constructor and Description |
---|
RImgControl(ModelNode me,
org.lobobrowser.html.renderer.UIControl widget,
RenderableContainer container,
FrameContext frameContext,
UserAgentContext ucontext) |
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) |
boolean |
extractSelectionText(java.lang.StringBuffer buffer,
boolean inSelection,
RenderableSpot startPoint,
RenderableSpot endPoint) |
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) |
java.util.Collection |
getDelayedPairs() |
java.awt.Color |
getForegroundColor() |
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() |
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 |
getWidth() |
int |
getX() |
int |
getY() |
int |
getZIndex() |
boolean |
hasBackground() |
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() |
void |
invalidateLayoutUpTree()
Invalidates this Renderable and its parent (i.e.
|
void |
invalidateRenderStyle() |
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() |
protected boolean |
isValid() |
void |
layout(int availWidth,
int availHeight,
boolean sizeOnly)
Lays out children, and deals with "valid" state.
|
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.
|
void |
preferredSizeInvalidated()
May be called by controls when
they wish to modifiy their preferred
size (e.g.
|
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
|
protected void |
sendDelayedPairsToParent() |
protected void |
sendGUIComponentsToParent() |
void |
setBounds(int x,
int y,
int width,
int height) |
void |
setDefaultMarginInsets(java.awt.Insets insets) |
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 |
setWidth(int width) |
void |
setX(int x) |
void |
setY(int y) |
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, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getCollapsibleMarginBottom, getCollapsibleMarginTop, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, layout
blur, invalidateLayoutDeep
getBounds, getGUIPoint, getHeight, getModelNode, getOrdinal, getOrigin, getOriginalOrCurrentParent, getOriginalParent, getOriginRelativeTo, getParent, getRenderablePoint, getSize, getWidth, getX, getY, getZIndex, invalidateLayoutUpTree, isContainedByNode, onMouseMoved, onMouseOut, onRightClick, paintTranslated, relayout, repaint, repaint, setBounds, setHeight, setOrdinal, setOrigin, setOriginalParent, setParent, setWidth, setX, setY
blur, getBounds, getBoundsRelativeToBlock
getGUIPoint, invalidateLayoutUpTree, relayout, repaint
public final org.lobobrowser.html.renderer.UIControl widget
protected final ModelNode modelNode
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.util.logging.Logger logger
protected static final java.awt.Color SELECTION_COLOR
protected static final java.awt.Color SELECTION_XOR
protected final RenderableContainer container
public int x
public int y
public int width
public int height
protected boolean layoutUpTreeCanBeInvalidated
protected RCollection parent
protected RCollection originalParent
public RImgControl(ModelNode me, org.lobobrowser.html.renderer.UIControl widget, RenderableContainer container, FrameContext frameContext, UserAgentContext ucontext)
protected void applyStyle(int availWidth, int availHeight)
public void focus()
focus
in interface UINode
focus
in interface RCollection
focus
in interface RenderableContainer
public final void invalidateLayoutLocal()
public int getVAlign()
RElement
public boolean hasBackground()
public final void paint(java.awt.Graphics g)
paint
in interface Renderable
public boolean onMouseClick(java.awt.event.MouseEvent event, int x, int y)
onMouseClick
in interface BoundableRenderable
public boolean onDoubleClick(java.awt.event.MouseEvent event, int x, int y)
onDoubleClick
in interface BoundableRenderable
public boolean onMousePressed(java.awt.event.MouseEvent event, int x, int y)
BoundableRenderable
onMousePressed
in interface BoundableRenderable
public boolean onMouseReleased(java.awt.event.MouseEvent event, int x, int y)
onMouseReleased
in interface BoundableRenderable
public boolean onMouseDisarmed(java.awt.event.MouseEvent event)
onMouseDisarmed
in interface BoundableRenderable
public void invalidateRenderStyle()
public void updateWidgetBounds(int guiX, int guiY)
updateWidgetBounds
in interface RCollection
public java.awt.Color getBlockBackgroundColor()
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 BoundableRenderable
public RenderableSpot getLowestRenderableSpot(int x, int y)
getLowestRenderableSpot
in interface BoundableRenderable
public void doLayout(int availWidth, int availHeight, boolean sizeOnly)
public final void preferredSizeInvalidated()
public java.util.Iterator getRenderables()
RCollection
Renderable
children.getRenderables
in interface RCollection
public java.awt.Color getPaintedBackgroundColor()
getPaintedBackgroundColor
in interface RenderableContainer
public java.awt.Color getForegroundColor()
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 RCollection
protected 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 RenderableContainer
public void updateAllWidgetBounds()
updateAllWidgetBounds
in interface RenderableContainer
public void updateWidgetBounds()
public java.awt.Rectangle getBoundsRelativeToBlock()
getBoundsRelativeToBlock
in interface UINode
protected void clearStyle(boolean isRootBlock)
protected void loadBackgroundImage(java.net.URL imageURL)
public int getZIndex()
getZIndex
in interface BoundableRenderable
protected 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.ImageObserver
public java.awt.Insets getInsets(boolean hscroll, boolean vscroll)
protected final void sendDelayedPairsToParent()
public final void clearDelayedPairs()
clearDelayedPairs
in interface RenderableContainer
public final java.util.Collection getDelayedPairs()
getDelayedPairs
in interface RenderableContainer
public void addDelayedPair(DelayedPair pair)
addDelayedPair
in interface RenderableContainer
public RenderableContainer getParentContainer()
getParentContainer
in interface RenderableContainer
public boolean isContainedByNode()
BoundableRenderable
isContainedByNode
in interface BoundableRenderable
public int getCollapsibleMarginBottom()
getCollapsibleMarginBottom
in interface RElement
protected boolean isMarginBoundary()
public int getCollapsibleMarginTop()
getCollapsibleMarginTop
in interface RElement
public int getMarginBottom()
getMarginBottom
in interface RElement
public int getMarginLeft()
getMarginLeft
in interface RElement
public int getMarginRight()
getMarginRight
in interface RElement
public int getMarginTop()
getMarginTop
in interface RElement
public void blur()
blur
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 BoundableRenderable getRenderable(int x, int y)
public boolean onRightClick(java.awt.event.MouseEvent event, int x, int y)
onRightClick
in interface BoundableRenderable
public 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 BoundableRenderable
public int getHeight()
getHeight
in interface BoundableRenderable
public int getWidth()
getWidth
in interface BoundableRenderable
public void setWidth(int width)
setWidth
in interface BoundableRenderable
public int getX()
getX
in interface BoundableRenderable
public int getY()
getY
in interface BoundableRenderable
public boolean contains(int x, int y)
public java.awt.Rectangle getBounds()
getBounds
in interface BoundableRenderable
public java.awt.Dimension getSize()
getSize
in interface BoundableRenderable
public ModelNode getModelNode()
getModelNode
in interface BoundableRenderable
getModelNode
in interface Renderable
public void setBounds(int x, int y, int width, int height)
setBounds
in interface BoundableRenderable
public void setX(int x)
setX
in interface BoundableRenderable
public void setY(int y)
setY
in interface BoundableRenderable
public void setHeight(int height)
setHeight
in interface BoundableRenderable
public void setOrigin(int x, int y)
setOrigin
in interface BoundableRenderable
public final void invalidateLayoutUpTree()
invalidateLayoutUpTree
in interface BoundableRenderable
protected boolean isValid()
public void relayout()
relayout
in interface BoundableRenderable
public void relayoutIfValid()
public void setParent(RCollection parent)
setParent
in interface BoundableRenderable
public RCollection getParent()
BoundableRenderable
getParent
in interface BoundableRenderable
public void setOriginalParent(RCollection origParent)
setOriginalParent
in interface BoundableRenderable
public RCollection getOriginalParent()
getOriginalParent
in interface BoundableRenderable
public RCollection getOriginalOrCurrentParent()
BoundableRenderable
BoundableRenderable.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 BoundableRenderable
public void repaint()
repaint
in interface BoundableRenderable
public final void paintTranslated(java.awt.Graphics g)
BoundableRenderable
paintTranslated
in interface BoundableRenderable
g
- Parent's Graphics context.protected final java.awt.Point translateDescendentPoint(BoundableRenderable descendent, int x, int y)
public java.awt.Point getOrigin()
getOrigin
in interface BoundableRenderable
public java.awt.Point getOriginRelativeTo(RCollection ancestor)
getOriginRelativeTo
in interface BoundableRenderable
public int getOrdinal()
public void setOrdinal(int ordinal)