org.lobobrowser.html.gui

Class HtmlBlockPanel

Implemented Interfaces:
ClipboardOwner, NodeRenderer, RenderableContainer

public class HtmlBlockPanel
extends JComponent
implements NodeRenderer, RenderableContainer, ClipboardOwner

A Swing component that renders a HTML block, given by a DOM root or an internal element, typically a DIV. This component cannot render FRAMESETs.
Author:
J. H. S.
See Also:
HtmlPanel, FrameSetPanel

Field Summary

protected RenderableSpot
endSelection
protected FrameContext
frameContext
protected int
preferredWidth
protected RBlock
rblock
protected HtmlRendererContext
rcontext
protected RenderableSpot
startSelection
protected UserAgentContext
ucontext

Constructor Summary

HtmlBlockPanel(int listNesting, Color background, boolean opaque, UserAgentContext pcontext, HtmlRendererContext rcontext, FrameContext frameContext)
HtmlBlockPanel(int listNesting, UserAgentContext pcontext, HtmlRendererContext rcontext, FrameContext frameContext)

Method Summary

void
addDelayedPair(DelayedPair pair)
void
clearDelayedPairs()
boolean
copy()
void
doLayout()
void
finalize()
void
focus()
Collection
getDelayedPairs()
int
getFirstLineHeight()
Point
getGUIPoint(int clientX, int clientY)
Color
getPaintedBackgroundColor()
RenderableContainer
getParentContainer()
Dimension
getPreferredSize()
If the preferred size has been set with setPreferredSize(Dimension), then that size is returned.
NodeImpl
getRootNode()
BoundableRenderable
getRootRenderable()
org.w3c.dom.Node
getSelectionNode()
String
getSelectionText()
boolean
hasSelection()
void
invalidateLayoutUpTree()
boolean
isSelectionAvailable()
void
lostOwnership(Clipboard arg0, Transferable arg1)
void
paint(Graphics g)
protected void
paintChildren(Graphics g)
void
relayout()
void
repaint(ModelNode modelNode)
Implementation of UINode.repaint().
protected void
revalidatePanel()
void
setDefaultPaddingInsets(Insets insets)
void
setPreferredWidth(int width)
Allows getPreferredSize() to render the HTML block in order to determine the preferred size of this component.
void
setRootNode(NodeImpl node)
Sets the root node to render.
void
setRootNode(NodeImpl node, boolean setContainer)
Deprecated. setContainer is unused.
void
setSelectionEnd(RenderableSpot rpoint)
void
setSelectionStart(RenderableSpot rpoint)
void
updateAllWidgetBounds()
protected void
validateAll()

Field Details

endSelection

protected RenderableSpot endSelection

frameContext

protected final FrameContext frameContext

preferredWidth

protected int preferredWidth

rblock

protected RBlock rblock

rcontext

protected final HtmlRendererContext rcontext

startSelection

protected RenderableSpot startSelection

ucontext

protected final UserAgentContext ucontext

Constructor Details

HtmlBlockPanel

public HtmlBlockPanel(int listNesting,
                      Color background,
                      boolean opaque,
                      UserAgentContext pcontext,
                      HtmlRendererContext rcontext,
                      FrameContext frameContext)

HtmlBlockPanel

public HtmlBlockPanel(int listNesting,
                      UserAgentContext pcontext,
                      HtmlRendererContext rcontext,
                      FrameContext frameContext)

Method Details

addDelayedPair

public void addDelayedPair(DelayedPair pair)
Specified by:
addDelayedPair in interface RenderableContainer

clearDelayedPairs

public void clearDelayedPairs()
Specified by:
clearDelayedPairs in interface RenderableContainer

copy

public boolean copy()

doLayout

public void doLayout()

finalize

public void finalize()
            throws Throwable

focus

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

getDelayedPairs

public Collection getDelayedPairs()
Specified by:
getDelayedPairs in interface RenderableContainer

getFirstLineHeight

public int getFirstLineHeight()

getGUIPoint

public Point getGUIPoint(int clientX,
                         int clientY)
Specified by:
getGUIPoint in interface RenderableContainer

getPaintedBackgroundColor

public Color getPaintedBackgroundColor()
Specified by:
getPaintedBackgroundColor in interface RenderableContainer

getParentContainer

public RenderableContainer getParentContainer()
Specified by:
getParentContainer in interface RenderableContainer

getPreferredSize

public Dimension getPreferredSize()

getRootNode

public NodeImpl getRootNode()

getRootRenderable

public BoundableRenderable getRootRenderable()

getSelectionNode

public org.w3c.dom.Node getSelectionNode()

getSelectionText

public String getSelectionText()

hasSelection

public boolean hasSelection()

invalidateLayoutUpTree

public void invalidateLayoutUpTree()
Specified by:
invalidateLayoutUpTree in interface RenderableContainer

isSelectionAvailable

public boolean isSelectionAvailable()

lostOwnership

public void lostOwnership(Clipboard arg0,
                          Transferable arg1)

paint

public void paint(Graphics g)

paintChildren

protected void paintChildren(Graphics g)

relayout

public void relayout()
Specified by:
relayout in interface RenderableContainer

repaint

public void repaint(ModelNode modelNode)
Implementation of UINode.repaint().

revalidatePanel

protected void revalidatePanel()

setDefaultPaddingInsets

public void setDefaultPaddingInsets(Insets insets)

setPreferredWidth

public void setPreferredWidth(int width)
Allows getPreferredSize() to render the HTML block in order to determine the preferred size of this component. Note that getPreferredSize() is a potentially time-consuming operation if the preferred width is set.
Parameters:
width - The preferred blocked width. Use -1 to unset.

setRootNode

public void setRootNode(NodeImpl node)
Sets the root node to render. This method should be invoked in the GUI dispatch thread.
Specified by:
setRootNode in interface NodeRenderer

setRootNode

public void setRootNode(NodeImpl node,
                        boolean setContainer)

Deprecated. setContainer is unused.


setSelectionEnd

public void setSelectionEnd(RenderableSpot rpoint)

setSelectionStart

public void setSelectionStart(RenderableSpot rpoint)

updateAllWidgetBounds

public void updateAllWidgetBounds()
Specified by:
updateAllWidgetBounds in interface RenderableContainer

validateAll

protected void validateAll()