cytoscape.editor.impl
Class BasicCytoShapeEntity

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended bycytoscape.editor.impl.BasicCytoShapeEntity
All Implemented Interfaces:
java.awt.dnd.DragGestureListener, java.util.EventListener, GraphicalEntity, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class BasicCytoShapeEntity
extends javax.swing.JComponent
implements java.awt.dnd.DragGestureListener, GraphicalEntity

The BasicCytoShapeEntity class defines draggable/droppable visual components in the Cytoscape editor framework. The framework provides for dragging and dropping graphical entities from palette onto the canvas. BasicCytoShapeEntity objects are associated with semantic objects, i.e. nodes and edges, that are created when the graphical entities are dropped onto the canvas.

Version:
1.0
Author:
Allan Kuchinsky
See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Field Summary
 
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.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
BasicCytoShapeEntity(java.lang.String attributeName, java.lang.String attributeValue, javax.swing.Icon image, java.lang.String title)
           
 
Method Summary
 void dragGestureRecognized(java.awt.dnd.DragGestureEvent e)
           
 java.awt.Image get_image()
          get the image for the icon used on the palette to represent the graphical entity
 java.lang.String getAttributeName()
          returns the name of the attribute associated with the Graphical Entity.
 java.lang.String getAttributeValue()
          returns the value of the attribute associated with the Graphical Entity.
 javax.swing.Icon getIcon()
          get the icon used on the palette to represent the graphical entity
 java.awt.dnd.DragSource getMyDragSource()
          retrieves the source of the drag operation, used when dragging a graphical entity from the palette onto the canvas
 java.lang.String getTitle()
          get the Title of the graphical entity
 void set_image(java.awt.Image _img)
          set the image for the icon used on the palette to represent the graphical entity
 void setAttributeName(java.lang.String attributeName)
          sets the name of the attribute associated with the Graphical Entity.
 void setAttributeValue(java.lang.String attributeValue)
          sets the value of the attribute associated with the Graphical Entity.
 void setIcon(javax.swing.Icon _image)
          set the icon used on the palette to represent the graphical entity
 void setMyDragSource(java.awt.dnd.DragSource myDragSource)
          defines the source of the drag operation, used when dragging a graphical entity from the palette onto the canvas
 void setTitle(java.lang.String title)
          set the Title of the graphical entity
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, 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, 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
 

Constructor Detail

BasicCytoShapeEntity

public BasicCytoShapeEntity(java.lang.String attributeName,
                            java.lang.String attributeValue,
                            javax.swing.Icon image,
                            java.lang.String title)
Parameters:
attributeName - attribute name for the shape, should be one of "NodeType" or "EdgeType"
attributeValue - value for the attribute assigned to the shape, for example a "NodeType" of "protein"
image - the icon for the shape
title - the title of the shape
Method Detail

getTitle

public java.lang.String getTitle()
Description copied from interface: GraphicalEntity
get the Title of the graphical entity

Specified by:
getTitle in interface GraphicalEntity
Returns:
Returns the title.

setTitle

public void setTitle(java.lang.String title)
Description copied from interface: GraphicalEntity
set the Title of the graphical entity

Specified by:
setTitle in interface GraphicalEntity
Parameters:
title - The title to set.

getMyDragSource

public java.awt.dnd.DragSource getMyDragSource()
Description copied from interface: GraphicalEntity
retrieves the source of the drag operation, used when dragging a graphical entity from the palette onto the canvas

Specified by:
getMyDragSource in interface GraphicalEntity
Returns:
Returns the DragSource.

setMyDragSource

public void setMyDragSource(java.awt.dnd.DragSource myDragSource)
Description copied from interface: GraphicalEntity
defines the source of the drag operation, used when dragging a graphical entity from the palette onto the canvas

Specified by:
setMyDragSource in interface GraphicalEntity
Parameters:
myDragSource - The DragSource to set.

getIcon

public javax.swing.Icon getIcon()
Description copied from interface: GraphicalEntity
get the icon used on the palette to represent the graphical entity

Specified by:
getIcon in interface GraphicalEntity
Returns:
Returns the icon associated with the shape

setIcon

public void setIcon(javax.swing.Icon _image)
Description copied from interface: GraphicalEntity
set the icon used on the palette to represent the graphical entity

Specified by:
setIcon in interface GraphicalEntity
Parameters:
_image - the icon to set for the shape

get_image

public java.awt.Image get_image()
Description copied from interface: GraphicalEntity
get the image for the icon used on the palette to represent the graphical entity

Specified by:
get_image in interface GraphicalEntity
Returns:
Returns the image associated with the shape's icon

set_image

public void set_image(java.awt.Image _img)
Description copied from interface: GraphicalEntity
set the image for the icon used on the palette to represent the graphical entity

Specified by:
set_image in interface GraphicalEntity
Parameters:
_img - The _img to set.

getAttributeName

public java.lang.String getAttributeName()
Description copied from interface: GraphicalEntity
returns the name of the attribute associated with the Graphical Entity. This is used to determine whether a Node or an Edge has been dropped on the canvas. This attribute will also be set for the CyNode or CyEdge created as a result of the drop operation.

Specified by:
getAttributeName in interface GraphicalEntity
Returns:
Returns the attributeName.

setAttributeName

public void setAttributeName(java.lang.String attributeName)
Description copied from interface: GraphicalEntity
sets the name of the attribute associated with the Graphical Entity. This is used to determine whether a Node or an Edge has been dropped on the canvas. This attribute will also be set for the CyNode or CyEdge created as a result of the drop operation.

Specified by:
setAttributeName in interface GraphicalEntity
Parameters:
attributeName - The attributeName to set.

getAttributeValue

public java.lang.String getAttributeValue()
Description copied from interface: GraphicalEntity
returns the value of the attribute associated with the Graphical Entity. This attribute will be set for the CyNode or CyEdge created as a result of the drop operation.

Specified by:
getAttributeValue in interface GraphicalEntity
Returns:
Returns the attributeValue.

setAttributeValue

public void setAttributeValue(java.lang.String attributeValue)
Description copied from interface: GraphicalEntity
sets the value of the attribute associated with the Graphical Entity. This attribute will be set for the CyNode or CyEdge created as a result of the drop operation.

Specified by:
setAttributeValue in interface GraphicalEntity
Parameters:
attributeValue - The attributeValue to set.

dragGestureRecognized

public void dragGestureRecognized(java.awt.dnd.DragGestureEvent e)
Specified by:
dragGestureRecognized in interface java.awt.dnd.DragGestureListener