Cytoscape 2.8.0 API

ding.view
Class InnerCanvas

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by ding.view.DingCanvas
                  extended by ding.view.InnerCanvas
All Implemented Interfaces:
DropTargetListener, KeyListener, MouseListener, MouseMotionListener, MouseWheelListener, ImageObserver, MenuContainer, Serializable, EventListener, PhoebeCanvasDroppable

public class InnerCanvas
extends DingCanvas
implements MouseListener, MouseMotionListener, DropTargetListener, PhoebeCanvasDroppable, KeyListener, MouseWheelListener

The GUI component for drawing networks.

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.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
 Vector edgeContextMenuListeners
          Listeners for edge right-click menu.
 Vector listeners
           
 Vector nodeContextMenuListeners
          Listeners for node right-click menu
 
Fields inherited from class ding.view.DingCanvas
m_backgroundColor, m_img, m_isOpaque, m_isVisible
 
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
 
Method Summary
 void addEdgeContextMenuListener(EdgeContextMenuListener l)
          DOCUMENT ME!
 void addNodeContextMenuListener(NodeContextMenuListener l)
          adds a listener to the store of NodeContextMenuListeners
 void addPhoebeCanvasDropListener(PhoebeCanvasDropListener l)
          adds a listener to the store of PhoebeCanvasDropTargetListeners
 void addTransferComponent(JComponent comp)
          DOCUMENT ME!
 void disableNodeMovement()
           
 void dragEnter(DropTargetDragEvent dte)
          default dragEnter handler.
 void dragExit(DropTargetEvent dte)
          default dragExit handler.
 void dragOver(DropTargetDragEvent dte)
          default dragOver handler.
 void drop(DropTargetDropEvent dte)
          default drop handler.
 void dropActionChanged(DropTargetDragEvent dte)
          default dropActionChanged handler.
 void enableNodeMovement()
           
 AffineTransform getAffineTransform()
          Called to get the tranform matrix used by the inner canvas to move the nodes.
 int getLastRenderDetail()
          DOCUMENT ME!
 double getScaleFactor()
           
 boolean isNodeMovementDisabled()
           
 boolean isPrinting()
          Return true if this view is curerntly being printed (as opposed to painted on the screen)
 boolean isSelecting()
          DOCUMENT ME!
 void keyPressed(KeyEvent k)
          Handles key press events.
 void keyReleased(KeyEvent k)
          Currently not used.
 void keyTyped(KeyEvent k)
          Currently not used.
 void mouseClicked(MouseEvent e)
          DOCUMENT ME!
 void mouseDragged(MouseEvent e)
          DOCUMENT ME!
 void mouseEntered(MouseEvent e)
          DOCUMENT ME!
 void mouseExited(MouseEvent e)
          DOCUMENT ME!
 void mouseMoved(MouseEvent e)
          DOCUMENT ME!
 void mousePressed(MouseEvent e)
          DOCUMENT ME!
 void mouseReleased(MouseEvent e)
          DOCUMENT ME!
 void mouseWheelMoved(MouseWheelEvent e)
           
 void paint(Graphics g)
          Paint this component using Java2D.
 void print(Graphics g)
          DOCUMENT ME!
 void printNoImposter(Graphics g)
          Print routine which corrects bug 1471/1495
protected  void processEdgeContextMenuEvent(MouseEvent event)
           
protected  void processNodeContextMenuEvent(MouseEvent event)
          handles a NodeContextMenuEvent.
protected  void processPhoebeCanvasDropEvent(PhoebeCanvasDropEvent event)
          handles a PhoebeCanvasDropEvent.
 void removeEdgeContextMenuListener(EdgeContextMenuListener l)
          DOCUMENT ME!
 void removeNodeContextMenuListener(NodeContextMenuListener l)
          removes a listener from the store of NodeContextMenuListeners
 void removePhoebeCanvasDropListener(PhoebeCanvasDropListener l)
          removes a listener from the store of PhoebeCanvasDropTargetListeners
 void removeTransferComponent(JComponent comp)
          DOCUMENT ME!
 void setBounds(int x, int y, int width, int height)
          DOCUMENT ME!
 void setScaleFactor(double val)
           
 void setSelecting(boolean s)
          DOCUMENT ME!
 void update(Graphics g)
          DOCUMENT ME!
 
Methods inherited from class ding.view.DingCanvas
getBackground, getImage, setBackground, setOpaque, setVisible
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, updateUI
 
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, validate, 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, 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, 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
 

Field Detail

listeners

public Vector listeners

nodeContextMenuListeners

public Vector nodeContextMenuListeners
Listeners for node right-click menu


edgeContextMenuListeners

public Vector edgeContextMenuListeners
Listeners for edge right-click menu.

Method Detail

getScaleFactor

public double getScaleFactor()

setScaleFactor

public void setScaleFactor(double val)

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)
DOCUMENT ME!

Overrides:
setBounds in class Component
Parameters:
x - DOCUMENT ME!
y - DOCUMENT ME!
width - DOCUMENT ME!
height - DOCUMENT ME!

update

public void update(Graphics g)
DOCUMENT ME!

Overrides:
update in class JComponent
Parameters:
g - DOCUMENT ME!

paint

public void paint(Graphics g)
Paint this component using Java2D.

Overrides:
paint in class JComponent
Parameters:
g - DOCUMENT ME!

print

public void print(Graphics g)
DOCUMENT ME!

Overrides:
print in class JComponent
Parameters:
g - Usually Graphics2D object for drawing network view as image.

printNoImposter

public void printNoImposter(Graphics g)
Print routine which corrects bug 1471/1495

Overrides:
printNoImposter in class DingCanvas
Parameters:
g - DOCUMENT ME!

isPrinting

public boolean isPrinting()
Return true if this view is curerntly being printed (as opposed to painted on the screen)

Returns:
true if we're currently being printed, false otherwise

mouseClicked

public void mouseClicked(MouseEvent e)
DOCUMENT ME!

Specified by:
mouseClicked in interface MouseListener
Parameters:
e - DOCUMENT ME!

mouseEntered

public void mouseEntered(MouseEvent e)
DOCUMENT ME!

Specified by:
mouseEntered in interface MouseListener
Parameters:
e - DOCUMENT ME!

mouseExited

public void mouseExited(MouseEvent e)
DOCUMENT ME!

Specified by:
mouseExited in interface MouseListener
Parameters:
e - DOCUMENT ME!

mousePressed

public void mousePressed(MouseEvent e)
DOCUMENT ME!

Specified by:
mousePressed in interface MouseListener
Parameters:
e - DOCUMENT ME!

mouseReleased

public void mouseReleased(MouseEvent e)
DOCUMENT ME!

Specified by:
mouseReleased in interface MouseListener
Parameters:
e - DOCUMENT ME!

mouseDragged

public void mouseDragged(MouseEvent e)
DOCUMENT ME!

Specified by:
mouseDragged in interface MouseMotionListener
Parameters:
e - DOCUMENT ME!

mouseMoved

public void mouseMoved(MouseEvent e)
DOCUMENT ME!

Specified by:
mouseMoved in interface MouseMotionListener
Parameters:
e - DOCUMENT ME!

keyPressed

public void keyPressed(KeyEvent k)
Handles key press events. Currently used with the up/down, left/right arrow keys. Pressing any of the listed keys will move the selected nodes one pixel in that direction.

Specified by:
keyPressed in interface KeyListener
Parameters:
k - The key event that we're listening for.

keyReleased

public void keyReleased(KeyEvent k)
Currently not used.

Specified by:
keyReleased in interface KeyListener
Parameters:
k - The key event that we're listening for.

keyTyped

public void keyTyped(KeyEvent k)
Currently not used.

Specified by:
keyTyped in interface KeyListener
Parameters:
k - The key event that we're listening for.

dragEnter

public void dragEnter(DropTargetDragEvent dte)
default dragEnter handler. Accepts the drag.

Specified by:
dragEnter in interface DropTargetListener
Parameters:
dte - the DropTargetDragEvent

dragExit

public void dragExit(DropTargetEvent dte)
default dragExit handler. Does nothing, can be overridden.

Specified by:
dragExit in interface DropTargetListener
Parameters:
dte - the DropTargetDragEvent

dropActionChanged

public void dropActionChanged(DropTargetDragEvent dte)
default dropActionChanged handler. Does nothing, can be overridden.

Specified by:
dropActionChanged in interface DropTargetListener
Parameters:
dte - the DropTargetDragEvent

dragOver

public void dragOver(DropTargetDragEvent dte)
default dragOver handler. Does nothing, can be overridden.

Specified by:
dragOver in interface DropTargetListener
Parameters:
dte - the DropTargetDragEvent

drop

public void drop(DropTargetDropEvent dte)
default drop handler. Accepts drop, builds a transferable, creates and fires a PhoebeCanvasDropEvent, then calls dropComplete().

Specified by:
drop in interface DropTargetListener
Parameters:
dte - the DropTargetDragEvent

addPhoebeCanvasDropListener

public void addPhoebeCanvasDropListener(PhoebeCanvasDropListener l)
adds a listener to the store of PhoebeCanvasDropTargetListeners

Specified by:
addPhoebeCanvasDropListener in interface PhoebeCanvasDroppable
Parameters:
l - the PhoebeCanvasDropTargetListener

removePhoebeCanvasDropListener

public void removePhoebeCanvasDropListener(PhoebeCanvasDropListener l)
removes a listener from the store of PhoebeCanvasDropTargetListeners

Specified by:
removePhoebeCanvasDropListener in interface PhoebeCanvasDroppable
Parameters:
l - the PhoebeCanvasDropTargetListener

processPhoebeCanvasDropEvent

protected void processPhoebeCanvasDropEvent(PhoebeCanvasDropEvent event)
handles a PhoebeCanvasDropEvent. For each listerner, calls its itemDropped() method

Parameters:
event - the PhoebeCanvasDropEvent

addTransferComponent

public void addTransferComponent(JComponent comp)
DOCUMENT ME!

Parameters:
comp - DOCUMENT ME!

removeTransferComponent

public void removeTransferComponent(JComponent comp)
DOCUMENT ME!

Parameters:
comp - DOCUMENT ME!

mouseWheelMoved

public void mouseWheelMoved(MouseWheelEvent e)
Specified by:
mouseWheelMoved in interface MouseWheelListener

addNodeContextMenuListener

public void addNodeContextMenuListener(NodeContextMenuListener l)
adds a listener to the store of NodeContextMenuListeners

Parameters:
l - the NodeContextMenuListener

removeNodeContextMenuListener

public void removeNodeContextMenuListener(NodeContextMenuListener l)
removes a listener from the store of NodeContextMenuListeners

Parameters:
l - the NodeContextMenuListener

addEdgeContextMenuListener

public void addEdgeContextMenuListener(EdgeContextMenuListener l)
DOCUMENT ME!

Parameters:
l - DOCUMENT ME!

removeEdgeContextMenuListener

public void removeEdgeContextMenuListener(EdgeContextMenuListener l)
DOCUMENT ME!

Parameters:
l - DOCUMENT ME!

processNodeContextMenuEvent

protected void processNodeContextMenuEvent(MouseEvent event)
handles a NodeContextMenuEvent. For each listerner, calls its itemDropped() method

Parameters:
event - the NodeContextMenuEvent

processEdgeContextMenuEvent

protected void processEdgeContextMenuEvent(MouseEvent event)

getLastRenderDetail

public int getLastRenderDetail()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setSelecting

public void setSelecting(boolean s)
DOCUMENT ME!

Parameters:
s - DOCUMENT ME!

isSelecting

public boolean isSelecting()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getAffineTransform

public AffineTransform getAffineTransform()
Called to get the tranform matrix used by the inner canvas to move the nodes.

Returns:
AffineTransform

enableNodeMovement

public void enableNodeMovement()

disableNodeMovement

public void disableNodeMovement()

isNodeMovementDisabled

public boolean isNodeMovementDisabled()

Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.