org.xhtmlrenderer.swing
Class RootPanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.xhtmlrenderer.swing.RootPanel
All Implemented Interfaces:
ComponentListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, FSCanvas, UserInterface, RepaintListener
Direct Known Subclasses:
BasicPanel

public class RootPanel
extends JPanel
implements ComponentListener, UserInterface, FSCanvas, RepaintListener

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 Element active_element
           
protected  Document doc
           
protected  Map documentListeners
           
protected  JScrollPane enclosingScrollPane
           
 Element focus_element
           
 Element hovered_element
           
protected  SharedContext sharedContext
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
RootPanel()
           
 
Method Summary
 void addNotify()
          Overrides the default implementation to test for and configure any JScrollPane parent.
 void componentHidden(ComponentEvent e)
           
 void componentMoved(ComponentEvent e)
           
 void componentResized(ComponentEvent e)
           
 void componentShown(ComponentEvent e)
           
 void doDocumentLayout(Graphics g)
           
 Box find(int x, int y)
           
 Box find(MouseEvent e)
           
protected  void fireDocumentLoaded()
           
protected  void fireDocumentStarted()
           
protected  void fireOnLayoutException(Throwable t)
           
protected  void fireOnRenderException(Throwable t)
           
 CellRendererPane getCellRendererPane()
           
 Rectangle getFixedRectangle()
          Gets the fixedRectangle attribute of the BasicPanel object
 LayoutContext getLayoutContext()
           
 double getLayoutWidth()
           
 Box getRootBox()
           
 Layer getRootLayer()
           
 Rectangle getScreenExtents()
           
 SharedContext getSharedContext()
           
protected  void init()
           
 boolean isActive(Element e)
          Gets the active attribute of the UserInterface object
 boolean isDefaultFontFromComponent()
           
protected  boolean isExtentsHaveChanged()
           
 boolean isFocus(Element e)
          Gets the focus attribute of the UserInterface object
 boolean isHover(Element e)
          Gets the hover attribute of the UserInterface object
protected  boolean isNeedRelayout()
           
 boolean isPrintView()
           
protected  LayoutContext newLayoutContext(Graphics2D g)
           
 RenderingContext newRenderingContext(Graphics2D g)
           
protected  void relayout()
           
 void removeNotify()
          Overrides the default implementation unconfigure any JScrollPane parent.
 void repaintRequested(boolean doLayout)
           
 void resetScrollPosition()
           
 void setDefaultFontFromComponent(boolean defaultFontFromComponent)
           
 void setDocument(Document doc, String url, NamespaceHandler nsh)
           
protected  void setEnclosingScrollPane(JScrollPane scrollPane)
          The method is invoked by addNotify() and removeNotify() to ensure that any enclosing JScrollPane works correctly with this panel.
protected  void setNeedRelayout(boolean needRelayout)
           
 void setRootBox(Box rootBox)
           
 void validate()
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.xhtmlrenderer.extend.FSCanvas
getX, getY
 

Field Detail

documentListeners

protected Map documentListeners

sharedContext

protected SharedContext sharedContext

enclosingScrollPane

protected JScrollPane enclosingScrollPane

doc

protected Document doc

hovered_element

public Element hovered_element

active_element

public Element active_element

focus_element

public Element focus_element
Constructor Detail

RootPanel

public RootPanel()
Method Detail

getSharedContext

public SharedContext getSharedContext()

getLayoutContext

public LayoutContext getLayoutContext()

setDocument

public void setDocument(Document doc,
                        String url,
                        NamespaceHandler nsh)

resetScrollPosition

public void resetScrollPosition()

setEnclosingScrollPane

protected void setEnclosingScrollPane(JScrollPane scrollPane)
The method is invoked by addNotify() and removeNotify() to ensure that any enclosing JScrollPane works correctly with this panel. This method can be safely invoked with a null scrollPane.

Parameters:
scrollPane - the enclosing JScrollPane or null if the panel is no longer enclosed in a JScrollPane.

getFixedRectangle

public Rectangle getFixedRectangle()
Gets the fixedRectangle attribute of the BasicPanel object

Specified by:
getFixedRectangle in interface FSCanvas
Returns:
The fixedRectangle value

addNotify

public void addNotify()
Overrides the default implementation to test for and configure any JScrollPane parent.

Overrides:
addNotify in class JComponent

removeNotify

public void removeNotify()
Overrides the default implementation unconfigure any JScrollPane parent.

Overrides:
removeNotify in class JComponent

init

protected void init()

newRenderingContext

public RenderingContext newRenderingContext(Graphics2D g)

newLayoutContext

protected LayoutContext newLayoutContext(Graphics2D g)

getScreenExtents

public Rectangle getScreenExtents()

doDocumentLayout

public void doDocumentLayout(Graphics g)

fireDocumentStarted

protected void fireDocumentStarted()

fireDocumentLoaded

protected void fireDocumentLoaded()

fireOnLayoutException

protected void fireOnLayoutException(Throwable t)

fireOnRenderException

protected void fireOnRenderException(Throwable t)

getCellRendererPane

public CellRendererPane getCellRendererPane()
Returns:
a CellRendererPane suitable for drawing components in (with CellRendererPane.paintComponent)

isHover

public boolean isHover(Element e)
Description copied from interface: UserInterface
Gets the hover attribute of the UserInterface object

Specified by:
isHover in interface UserInterface
Parameters:
e - PARAM
Returns:
The hover value

isActive

public boolean isActive(Element e)
Description copied from interface: UserInterface
Gets the active attribute of the UserInterface object

Specified by:
isActive in interface UserInterface
Parameters:
e - PARAM
Returns:
The active value

isFocus

public boolean isFocus(Element e)
Description copied from interface: UserInterface
Gets the focus attribute of the UserInterface object

Specified by:
isFocus in interface UserInterface
Parameters:
e - PARAM
Returns:
The focus value

componentHidden

public void componentHidden(ComponentEvent e)
Specified by:
componentHidden in interface ComponentListener

componentMoved

public void componentMoved(ComponentEvent e)
Specified by:
componentMoved in interface ComponentListener

componentResized

public void componentResized(ComponentEvent e)
Specified by:
componentResized in interface ComponentListener

relayout

protected void relayout()

componentShown

public void componentShown(ComponentEvent e)
Specified by:
componentShown in interface ComponentListener

getLayoutWidth

public double getLayoutWidth()

isPrintView

public boolean isPrintView()

getRootBox

public Box getRootBox()

setRootBox

public void setRootBox(Box rootBox)

getRootLayer

public Layer getRootLayer()

find

public Box find(MouseEvent e)

find

public Box find(int x,
                int y)

validate

public void validate()
Overrides:
validate in class Container

isExtentsHaveChanged

protected boolean isExtentsHaveChanged()

isNeedRelayout

protected boolean isNeedRelayout()

setNeedRelayout

protected void setNeedRelayout(boolean needRelayout)

repaintRequested

public void repaintRequested(boolean doLayout)
Specified by:
repaintRequested in interface RepaintListener

isDefaultFontFromComponent

public boolean isDefaultFontFromComponent()

setDefaultFontFromComponent

public void setDefaultFontFromComponent(boolean defaultFontFromComponent)


Copyright © 2013. All Rights Reserved.