ice.pilots.html4
Class DocPaneXml

java.lang.Object
  extended byice.storm.DocPane
      extended byice.pilots.html4.DocPaneXml
All Implemented Interfaces:
ICEDropClient

public abstract class DocPaneXml
extends DocPane
implements ICEDropClient


Field Summary
 boolean enableTextSelection
           
 
Constructor Summary
DocPaneXml()
           
 
Method Summary
protected abstract  void checkAwtTree(ObjectBox box, Component c)
          Check if the AWT component of the given ObjectPainter is properly located in the AWT hierarchy (DocViews, Scrollers).
 boolean checkDocumentId()
           
 DOMUIEvent createDomUIEvent(int id)
           
protected abstract  Container createEmbeddedContainer(EmbeddedObject obj, Component child)
          Create a graphical container for an embedded object (IFRAME, OBJECT)
protected abstract  ObjectPainter createFormControl(DElement e)
          Create a form control for a given DOM element If e is DSelectElement, should return DSelectElement.SelectPainter
protected abstract  Component createFramesDividerComponent()
          Create the graphical component for the FrameDivider( the actual border)
protected abstract  ObjectPainter createScroller()
          Create a CSS Scroller
 void docClearHighlights()
          Clear all highlighted segments
 void docClearSelection()
          Clear any selection.
 boolean docContainsFixedBoxes()
           
 void docHighlightRange(int startPosition, int endPosition)
          Highlight a section of text.
 boolean docIsSelectionActive()
          Publicly expose a docMethod to clients wishing to know if there is currently something selected in this visual component tree.
 void docLayout(int viewportWidth, int viewportHeight)
           
 void docMarkDocument(int xPos, int yPos)
          With clearing the selection comes placing a cursor which enables keyboard text selection from this point.
 void docPaint(Graphics g)
           
 void docPaintFixed(Graphics g)
           
 void docPostLayout()
           
 void docScrollChanged(int x, int y)
          A method that indicates that the scroll position has changed.
 void docSetSelection(int x1, int y1, int x2, int y2)
          Set a selection range based on a dragging operation.
 int getDocHeight()
           
 int getDocWidth()
           
 String getDragPayload()
          Retrieve the Drag payload from the Document.
 ObjectPainter getNodePainter(DNode node)
           
protected abstract  Component getPaneComponent()
           
 ThePilot getPilot()
           
abstract  Color getSelectionBackground()
          Retrieve the selection background color for the tookit in use.
abstract  Color getSelectionColor()
          Retrieve the selection foreground color for the tookit in use.
protected abstract  void init(int scrollbars)
           
 boolean is_msie_event_emulation()
           
 boolean isGestureListeningEnabled(int xPos, int yPos)
          Check to see if DragAndDrop Gesture recognition should be enabled in the Component.
 boolean isPilotDisposed()
           
protected  void notifyFocusGain()
           
protected  void notifyFocusLost()
           
protected abstract  void onNodeBlurEvent(DOMUIEvent event, DNode node)
           
protected abstract  void onNodeFocusEvent(DOMUIEvent event, DNode node)
           
protected abstract  void onNodeSelectCall(DNode node)
           
 void packageDropped(String payload)
          Default implementation of the ICEDropClient interface.
 void postSelectedToClipboard()
          Post selected items to the clipboard.
protected  boolean processAwtKeyEvent(Component c, KeyEvent awtEvent, EventListener action)
           
protected abstract  void revalidate()
           
 void revalidate(int x, int y, int w, int h)
          Schedule relayout with new boundaries
abstract  void setDropClient(ICEDropClient client)
          Register a 'Drag and Drop' Drop client with the Browser containment hierarchy.
protected abstract  void setPaneBounds(int x, int y, int w, int h)
           
 boolean uiEvent(DOMUIEvent uie, InputEvent awtEvent, EventListener action)
          Append general UI event info and dispatch to cssLayout and DOM
 
Methods inherited from class ice.storm.DocPane
canScroll, createImage, doesAutoRepaint, getPaneHeight, getPaneWidth, getScrollMaxX, getScrollMaxY, getScrollX, getScrollX, getScrollY, getScrollY, isVisibleOnScreen, reqClear, reqFocus, reqRepaint, reqRepaint, setAutoRepaint, setCursor, setScrollPosition, updateScrollbars
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

enableTextSelection

public boolean enableTextSelection
Constructor Detail

DocPaneXml

public DocPaneXml()
Method Detail

revalidate

public void revalidate(int x,
                       int y,
                       int w,
                       int h)
Description copied from class: DocPane
Schedule relayout with new boundaries

Specified by:
revalidate in class DocPane

setPaneBounds

protected abstract void setPaneBounds(int x,
                                      int y,
                                      int w,
                                      int h)

revalidate

protected abstract void revalidate()

init

protected abstract void init(int scrollbars)

getPaneComponent

protected abstract Component getPaneComponent()

getSelectionColor

public abstract Color getSelectionColor()
Retrieve the selection foreground color for the tookit in use. In AWT, this will default to the SystemColor setting, in Swing this will default to the Look and Feel implementation. This implementation should retrieve the value currently in effect #3954

Returns:
The Color to be used for the selected Text coloration

getSelectionBackground

public abstract Color getSelectionBackground()
Retrieve the selection background color for the tookit in use. In AWT, this will default to the SystemColor setting, in Swing this will default to the Look and Feel implementation #3954

Returns:
The Color to be used for the selection Background

postSelectedToClipboard

public void postSelectedToClipboard()
Post selected items to the clipboard. This method allows the GUI components to define the time when this is to occur (namely when the mouse is released, not during each mouse movement event). This notification should be promoted to the CSSLayout class for handling


createFormControl

protected abstract ObjectPainter createFormControl(DElement e)
Create a form control for a given DOM element If e is DSelectElement, should return DSelectElement.SelectPainter


createScroller

protected abstract ObjectPainter createScroller()
Create a CSS Scroller


createEmbeddedContainer

protected abstract Container createEmbeddedContainer(EmbeddedObject obj,
                                                     Component child)
Create a graphical container for an embedded object (IFRAME, OBJECT)

Parameters:
obj - EmbeddedObject (viewport)
child - pilot component

createFramesDividerComponent

protected abstract Component createFramesDividerComponent()
Create the graphical component for the FrameDivider( the actual border)


checkAwtTree

protected abstract void checkAwtTree(ObjectBox box,
                                     Component c)
Check if the AWT component of the given ObjectPainter is properly located in the AWT hierarchy (DocViews, Scrollers).


processAwtKeyEvent

protected final boolean processAwtKeyEvent(Component c,
                                           KeyEvent awtEvent,
                                           EventListener action)

uiEvent

public final boolean uiEvent(DOMUIEvent uie,
                             InputEvent awtEvent,
                             EventListener action)
Append general UI event info and dispatch to cssLayout and DOM

Returns:
true if the DOM event was consumed, false otherwise

onNodeSelectCall

protected abstract void onNodeSelectCall(DNode node)

onNodeBlurEvent

protected abstract void onNodeBlurEvent(DOMUIEvent event,
                                        DNode node)

onNodeFocusEvent

protected abstract void onNodeFocusEvent(DOMUIEvent event,
                                         DNode node)

packageDropped

public void packageDropped(String payload)
Default implementation of the ICEDropClient interface. This method will attempt to load a page in a very rudimentary way if the secret property is turned on.

Specified by:
packageDropped in interface ICEDropClient
Parameters:
payload -
Since:
6.1

isGestureListeningEnabled

public boolean isGestureListeningEnabled(int xPos,
                                         int yPos)
Check to see if DragAndDrop Gesture recognition should be enabled in the Component. This method will return true if the x,y position arguments are over either a bit of selected document, or a hyperlink. As a side effect, this method caches the hyperlink string representation (since it only really needs to be fetched once between this method and getDragPayload.

This method takes care of converting the screen location to a document location.

Parameters:
xPos - Screen X position
yPos - Screen y position
Returns:
True, if this position is above a selected area, or directly above a hyperlink
Since:
6.1

getDragPayload

public String getDragPayload()
Retrieve the Drag payload from the Document. Currently, the CSSLayout class has access to what is selected in the document. This method should only be called if the isGestureListeningEnabled method returns true.

Returns:
The String Drag payload from the Document. Null if nothing is selected, or the cached position was not above a hyperlink.
Since:
6.1
See Also:
isGestureListeningEnabled(int, int)

setDropClient

public abstract void setDropClient(ICEDropClient client)
Register a 'Drag and Drop' Drop client with the Browser containment hierarchy. This method is intended to be used by external clients wishing to be notified when Text is dragged and dropped onto the Browser Container. Clients can then do as they wish with the Dropped information (Including loading a new page). The Browser itself will do nothing with any information dropped onto it, that behaviour is strictly in the control of any clients to the machinery.

Currently, this Drop mechanism will only deliver notification of Textual Drop operations. No images will be accepted.

Alternatively, if Clients are using Swing, and they are guaranteed to be in a Java 1.4 environment, they may register themselves as Drop clients of the Glass Pane component that is over the JPanel hierarchy as part of normal windows layout. If additional functionality is required, this would be the preferred method of Drop architecture, since this is strictly a convenience mechanism for a wide range of JVM targets.

Parameters:
client - An instance of the Drop Client
Since:
6.1

docIsSelectionActive

public boolean docIsSelectionActive()
Publicly expose a docMethod to clients wishing to know if there is currently something selected in this visual component tree. This currently exposes state information that is in CSSLayout, for clients who cannot obtain a reference to CSSLayout.

Returns:
True if a range of nodes is currently selected.
Since:
6.1

checkDocumentId

public final boolean checkDocumentId()

is_msie_event_emulation

public boolean is_msie_event_emulation()
Returns:
true if should emulate MSIE event model as close as possible

getPilot

public final ThePilot getPilot()

isPilotDisposed

public final boolean isPilotDisposed()

getDocWidth

public final int getDocWidth()
Specified by:
getDocWidth in class DocPane

getDocHeight

public final int getDocHeight()
Specified by:
getDocHeight in class DocPane

docLayout

public final void docLayout(int viewportWidth,
                            int viewportHeight)

docPostLayout

public final void docPostLayout()

docClearSelection

public final void docClearSelection()
Clear any selection. With clearing the selection comes placing a cursor which enables keyboard text selection from this point. Thusly, we need to pass the information allowing the location of the cursor within the document. Clear out the cached Hyperlink value, just to be sure.


docScrollChanged

public final void docScrollChanged(int x,
                                   int y)
A method that indicates that the scroll position has changed. This method will notify CSSLayout not to jump to the focused form widget after the next layout. This addressed #4669 todo: This along with the rest of the docXXX methods, should be in a listener format.

Parameters:
x - X scrollPosition
y - Y scrollPosition

docMarkDocument

public final void docMarkDocument(int xPos,
                                  int yPos)
With clearing the selection comes placing a cursor which enables keyboard text selection from this point. Thusly, we need to pass the information allowing the location of the cursor within the document.

Parameters:
xPos - x position of the click that caused the clear.
yPos - y position of the click

docSetSelection

public final void docSetSelection(int x1,
                                  int y1,
                                  int x2,
                                  int y2)
Set a selection range based on a dragging operation. There is no requirement or restriction on x2,y2 wrt x1,y1. This method propagates the scroll indication to the CSSLayout instance that is providing the layout for the viewport.

Parameters:
x1 - the x coordinate of the starting position of the scroll
y1 - the y coordinate of the starting position of the scroll
x2 - the x coordinate of the ending position of the scroll
y2 - the y coordinate of the ending position of the scroll

docHighlightRange

public void docHighlightRange(int startPosition,
                              int endPosition)
Highlight a section of text. This performs a visual highlighting without selection. Highlighting just marks a piece of text with some highlighting. The start and end positions can be from zero to the value returned by getCount() in the HTML4DocumentAccess interface.

Currently, this assumes a generally LTR layout, and that the startPosition will be less than the endPosition.

Parameters:
startPosition - the character offset within the document of the start of the highlight region.
endPosition - the character offset of the last highlighted region
See Also:
Html4DocumentAccess.getCount(int)

docClearHighlights

public void docClearHighlights()
Clear all highlighted segments


docContainsFixedBoxes

public final boolean docContainsFixedBoxes()

docPaint

public final void docPaint(Graphics g)

docPaintFixed

public final void docPaintFixed(Graphics g)

createDomUIEvent

public final DOMUIEvent createDomUIEvent(int id)

getNodePainter

public final ObjectPainter getNodePainter(DNode node)

notifyFocusGain

protected final void notifyFocusGain()

notifyFocusLost

protected final void notifyFocusLost()