Version: 1.1.1

ca.ucalgary.seahawk.gui
Class MobyContentPane

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 ca.ucalgary.seahawk.gui.MobyContentPane
All Implemented Interfaces:
ClipboardOwner, ActionListener, KeyListener, MouseListener, MouseMotionListener, ImageObserver, MenuContainer, Printable, Serializable, EventListener, Accessible, CaretListener, ChangeListener, HyperlinkListener, MobyRequestEventHandler
Direct Known Subclasses:
MobyContentClipboard, MobyContentHelpPane

public class MobyContentPane
extends JPanel
implements Printable, CaretListener, HyperlinkListener, MouseListener, MouseMotionListener, MobyRequestEventHandler, KeyListener, ChangeListener, ClipboardOwner, ActionListener

Text area contained in a Seahawk GUI tab. Displays HTML, RTF, text etc. using a JEditorPane. Also provides link handling (including service options popup) and drag 'n' drop capabilities.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Component
Component.BaselineResizeBehavior
 
Field Summary
static String FAILED_TAB_ICON_RESOURCE
           
static String LOADED_TAB_ICON_RESOURCE
           
static String MOBY_SERVICE_POPUP_NAME
           
static String SERVICE_CREATION_MSG
           
static String WAITING_TAB_ICON_RESOURCE
           
static String WRAPPING_RESULTFILE_PREFIX
           
static String XSL_DOC_SOURCE_PARAM
          The name of the param in the stylesheet that will hold the Moby doc URL for XPointer usage
 
Fields inherited from class javax.swing.JComponent
TOOL_TIP_TEXT_KEY, 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.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
MobyContentPane(MobyContentGUI cGUI, MobyServicesGUI sGUI, JTabbedPane parentComponent, DataFlowRecorder recorder, JLabel statusBar)
           
 
Method Summary
 void actionPerformed(ActionEvent e)
           
 boolean canFilter()
           
 boolean canGoBack()
           
 boolean canGoForward()
           
 void caretUpdate(CaretEvent e)
           
 void exportDone(String valuePasted, String transformRuleURI)
          Called after data copied from this pane is pasted.
 void failed(String msg)
           
 MobyContentGUI getContentGUI()
           
 URL getCurrentURL()
           
 DataFlowRecorder getDataFlowRecorder()
           
 PrintableJEditorPane getDisplay()
           
 MobyDataInstance getDraggedData()
           
 int getExportOption(String[] options)
           
 FilterSearch getFilter()
          Gets the filter criteria currently being applied to the document being viewed.
 int getHistoryIndex()
           
 int getHistorySize()
           
 String getHTMLSource()
           
 JTabbedPane getTabbedPaneParent()
           
 boolean getWrappingEnabled()
           
 String getXMLSource()
           
 void goBackward()
           
 void goForward()
           
 void gotoURL(URL url, boolean addToHistory)
          This is the URLLoader callback method the MOBY data fetcher will call when MOBY XML data is ready to be seen.
 boolean hasFailure()
           
 boolean hasXMLSource()
           
 void hyperlinkUpdate(HyperlinkEvent he)
          The editor pane calls back here when the user flies over or clicks on a hyperlink
 boolean isFilterForwardConsistent()
          If the filter condition has changed since the next service was originally called, only allow navigation to that document (service results) again if the new filter allows the data used in the original call to pass (for logical dataflow consistency).
 boolean isMobyURL(URL u)
           
 boolean isWrappingService()
          Tells whether the tab is in the middle of wrapping a Web Service at the moment.
 void keyPressed(KeyEvent e)
          Implemented to provide paste functionality (control-v or the paste button on a Sun keyboard), since the editor panes are not editable and therefore by default do not respond to paste events.
 void keyReleased(KeyEvent e)
           
 void keyTyped(KeyEvent e)
           
 void lostOwnership(Clipboard clipboard, Transferable contents)
           
 void mouseClicked(MouseEvent e)
           
 void mouseDragged(MouseEvent e)
           
 void mouseEntered(MouseEvent e)
          Grabs the keyboard focus for the component if the mouse is over it, which eliminates the need for clicking before using keyboard shortcuts like Control-v to paste.
 void mouseExited(MouseEvent e)
           
 void mouseMoved(MouseEvent e)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
 void paste()
           
 int print(Graphics g, PageFormat pf, int pageIndex)
           
 void processEvent(MobyRequestEvent mre)
           
 void setFilterVisible(boolean visible)
          The search/filter widget is document specific (since you may want to have different view of different service responses), therefore setting the visibility is only valid for the time the current document is being shown.
 void setPreferredSize(Dimension dims)
           
 void setStatus(String msg)
           
 void setWaitScreen()
           
 void setWrappingEnabled(boolean b)
           
 void start(MobyRequestEvent requestEvent)
          Called by MOBYRequest when the service request is being sent.
 void stateChanged(ChangeEvent ce)
           
 void stop(MobyRequest request, int requestID)
          If a client, denotes the end of a service request.
 void succeeded(String msg)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

MOBY_SERVICE_POPUP_NAME

public static final String MOBY_SERVICE_POPUP_NAME
See Also:
Constant Field Values

WAITING_TAB_ICON_RESOURCE

public static final String WAITING_TAB_ICON_RESOURCE
See Also:
Constant Field Values

FAILED_TAB_ICON_RESOURCE

public static final String FAILED_TAB_ICON_RESOURCE
See Also:
Constant Field Values

LOADED_TAB_ICON_RESOURCE

public static final String LOADED_TAB_ICON_RESOURCE
See Also:
Constant Field Values

WRAPPING_RESULTFILE_PREFIX

public static final String WRAPPING_RESULTFILE_PREFIX
See Also:
Constant Field Values

SERVICE_CREATION_MSG

public static final String SERVICE_CREATION_MSG
See Also:
Constant Field Values

XSL_DOC_SOURCE_PARAM

public static final String XSL_DOC_SOURCE_PARAM
The name of the param in the stylesheet that will hold the Moby doc URL for XPointer usage

See Also:
Constant Field Values
Constructor Detail

MobyContentPane

public MobyContentPane(MobyContentGUI cGUI,
                       MobyServicesGUI sGUI,
                       JTabbedPane parentComponent,
                       DataFlowRecorder recorder,
                       JLabel statusBar)
Method Detail

getTabbedPaneParent

public JTabbedPane getTabbedPaneParent()

getDataFlowRecorder

public DataFlowRecorder getDataFlowRecorder()

stateChanged

public void stateChanged(ChangeEvent ce)
Specified by:
stateChanged in interface ChangeListener

actionPerformed

public void actionPerformed(ActionEvent e)
Specified by:
actionPerformed in interface ActionListener

setStatus

public void setStatus(String msg)

setPreferredSize

public void setPreferredSize(Dimension dims)
Overrides:
setPreferredSize in class JComponent

hasXMLSource

public boolean hasXMLSource()

getXMLSource

public String getXMLSource()
                    throws IOException
Throws:
IOException

getHTMLSource

public String getHTMLSource()

setWrappingEnabled

public void setWrappingEnabled(boolean b)

getWrappingEnabled

public boolean getWrappingEnabled()

isWrappingService

public boolean isWrappingService()
Tells whether the tab is in the middle of wrapping a Web Service at the moment.


gotoURL

public void gotoURL(URL url,
                    boolean addToHistory)
This is the URLLoader callback method the MOBY data fetcher will call when MOBY XML data is ready to be seen.


getHistorySize

public int getHistorySize()

getHistoryIndex

public int getHistoryIndex()

getCurrentURL

public URL getCurrentURL()

canFilter

public boolean canFilter()

canGoBack

public boolean canGoBack()

canGoForward

public boolean canGoForward()

isFilterForwardConsistent

public boolean isFilterForwardConsistent()
If the filter condition has changed since the next service was originally called, only allow navigation to that document (service results) again if the new filter allows the data used in the original call to pass (for logical dataflow consistency).


goForward

public void goForward()

goBackward

public void goBackward()

exportDone

public void exportDone(String valuePasted,
                       String transformRuleURI)
Called after data copied from this pane is pasted. The actual text pasted in given so that it can be unified with the object that created it (lastURLDragged) in the PBE recorder.


getExportOption

public int getExportOption(String[] options)

start

public void start(MobyRequestEvent requestEvent)
Called by MOBYRequest when the service request is being sent. We can create the GUI and wait message here.

Specified by:
start in interface MobyRequestEventHandler

stop

public void stop(MobyRequest request,
                 int requestID)
Description copied from interface: MobyRequestEventHandler
If a client, denotes the end of a service request. If a server, denotes that the server is shutting down/this event handler should terminate.

Specified by:
stop in interface MobyRequestEventHandler

processEvent

public void processEvent(MobyRequestEvent mre)
Specified by:
processEvent in interface MobyRequestEventHandler

failed

public void failed(String msg)

succeeded

public void succeeded(String msg)

hasFailure

public boolean hasFailure()

hyperlinkUpdate

public void hyperlinkUpdate(HyperlinkEvent he)
The editor pane calls back here when the user flies over or clicks on a hyperlink

Specified by:
hyperlinkUpdate in interface HyperlinkListener

getContentGUI

public MobyContentGUI getContentGUI()

getDraggedData

public MobyDataInstance getDraggedData()

setWaitScreen

public void setWaitScreen()

getFilter

public FilterSearch getFilter()
Gets the filter criteria currently being applied to the document being viewed.

Returns:
null unless there is a currently a non-blank filter criteria

setFilterVisible

public void setFilterVisible(boolean visible)
                      throws Exception
The search/filter widget is document specific (since you may want to have different view of different service responses), therefore setting the visibility is only valid for the time the current document is being shown.

Throws:
Exception

isMobyURL

public boolean isMobyURL(URL u)

mousePressed

public void mousePressed(MouseEvent e)
Specified by:
mousePressed in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent e)
Grabs the keyboard focus for the component if the mouse is over it, which eliminates the need for clicking before using keyboard shortcuts like Control-v to paste.

Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Specified by:
mouseExited in interface MouseListener

mouseClicked

public void mouseClicked(MouseEvent e)
Specified by:
mouseClicked in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent e)
Specified by:
mouseReleased in interface MouseListener

print

public int print(Graphics g,
                 PageFormat pf,
                 int pageIndex)
          throws PrinterException
Specified by:
print in interface Printable
Throws:
PrinterException

getDisplay

public PrintableJEditorPane getDisplay()

caretUpdate

public void caretUpdate(CaretEvent e)
Specified by:
caretUpdate in interface CaretListener

keyPressed

public void keyPressed(KeyEvent e)
Implemented to provide paste functionality (control-v or the paste button on a Sun keyboard), since the editor panes are not editable and therefore by default do not respond to paste events.

Specified by:
keyPressed in interface KeyListener

keyReleased

public void keyReleased(KeyEvent e)
Specified by:
keyReleased in interface KeyListener

keyTyped

public void keyTyped(KeyEvent e)
Specified by:
keyTyped in interface KeyListener

paste

public void paste()

mouseDragged

public void mouseDragged(MouseEvent e)
Specified by:
mouseDragged in interface MouseMotionListener

mouseMoved

public void mouseMoved(MouseEvent e)
Specified by:
mouseMoved in interface MouseMotionListener

lostOwnership

public void lostOwnership(Clipboard clipboard,
                          Transferable contents)
Specified by:
lostOwnership in interface ClipboardOwner

Version: 1.1.1

Submit a bug or feature
Generated: Sat May 29 04:26:35 EDT 2010