ABLE 2.0.0 07/02/2003 10:25:01

com.ibm.able.editor
Class AbleEditorCanvas

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPanel
                          |
                          +--com.ibm.able.editor.AbleEditorCanvas
All Implemented Interfaces:
javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, javax.swing.event.PopupMenuListener, java.io.Serializable

public class AbleEditorCanvas
extends javax.swing.JPanel
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener, javax.swing.event.PopupMenuListener

This class is the main canvas class for Able Editor It supports drag/drop and connections of Able beans

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
 boolean connectionInProgress
           
 javax.swing.JFrame frame
           
 
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
AbleEditorCanvas()
           
 
Method Summary
 java.awt.Component add(java.awt.Component c)
          Add a component to the canvas.
 java.lang.Object getAgent()
          Get the container agent.
 AbleBean getSelectedObject()
          Get the selected bean object.
 AbleViewObject getSelectedViewObject()
          Get the selected view object.
 int getViewType()
           
 java.lang.String getWorkingDirectory()
           
 void mouseClicked(java.awt.event.MouseEvent theEvent)
          Handle mouseClicked event Select or deselect a tree node, object on canvas, or canvas.
 void mouseDragged(java.awt.event.MouseEvent theEvent)
          Handle mouseDragged event.
 void mouseEntered(java.awt.event.MouseEvent e)
          Handle mouseEntered event.
 void mouseExited(java.awt.event.MouseEvent theEvent)
          Handle mouseExited event.
 void mouseMoved(java.awt.event.MouseEvent theEvent)
          Handle mouseMoved event.
 void mousePressed(java.awt.event.MouseEvent theEvent)
          Handle mousePressed event.
 void mouseReleased(java.awt.event.MouseEvent theEvent)
          Handle mouseReleased event.
 void paintComponent(java.awt.Graphics g)
          Paint the objects and their connections.
 void popupMenuCanceled(javax.swing.event.PopupMenuEvent e)
           
 void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent e)
           
 void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent e)
           
 void remove(java.awt.Component c)
          Remove a component from the canvas.
static void removeBean(java.lang.Object theBean)
          Remove a bean from the container.
 void removeListeners()
           
 void setAgentViewObject(AbleViewObject anAgentView)
          Set the container agent.
 void setFrame(javax.swing.JFrame theFrame)
          Set the frame.
 void setNoSelectedViewObject()
          Deselect the selected view object.
 void setSelectedViewObject(AbleViewObject theViewObj, boolean setTreeToo)
          Set the selected view object.
 void setStatus(java.lang.String text)
          Write text to the AbleEditor status line.
 void setTreeView(javax.swing.JTree aTree)
          Set the tree view.
 void setViewType(int viewType)
           
 void setWorkingDirectory(java.lang.String theDir)
           
 void showPopup(java.awt.event.MouseEvent theEvent, AbleViewObject theViewObj)
          Show the canvas (agent) or object context menu.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUIClassID, paramString, updateUI
 
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, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

connectionInProgress

public boolean connectionInProgress

frame

public javax.swing.JFrame frame
Constructor Detail

AbleEditorCanvas

public AbleEditorCanvas()
Method Detail

setAgentViewObject

public void setAgentViewObject(AbleViewObject anAgentView)
Set the container agent.
Parameters:
anAgentView - A container agent object

getAgent

public java.lang.Object getAgent()
Get the container agent.
Returns:
Object or AbleAgent? A container agent object

setFrame

public void setFrame(javax.swing.JFrame theFrame)
Set the frame. ?frame is public, why???
Parameters:
theFrame -  

getViewType

public int getViewType()

setViewType

public void setViewType(int viewType)

setTreeView

public void setTreeView(javax.swing.JTree aTree)
Set the tree view.
Parameters:
aTree -  

removeBean

public static void removeBean(java.lang.Object theBean)
                       throws AbleException
Remove a bean from the container.
Parameters:
obj - ??? should this be an AbleBean

getSelectedObject

public AbleBean getSelectedObject()
Get the selected bean object.
Returns:
AbleBean

add

public java.awt.Component add(java.awt.Component c)
Add a component to the canvas.
Overrides:
add in class java.awt.Container
Parameters:
c - An AbleViewObject

remove

public void remove(java.awt.Component c)
Remove a component from the canvas.
Overrides:
remove in class java.awt.Container
Parameters:
c - An AbleViewObject

getSelectedViewObject

public AbleViewObject getSelectedViewObject()
Get the selected view object.
Returns:
AbleViewObject

setSelectedViewObject

public void setSelectedViewObject(AbleViewObject theViewObj,
                                  boolean setTreeToo)
Set the selected view object.
Parameters:
theViewObj - An AbleViewObject

setNoSelectedViewObject

public void setNoSelectedViewObject()
Deselect the selected view object.

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent theEvent)
Handle mouseClicked event Select or deselect a tree node, object on canvas, or canvas.
Specified by:
mouseClicked in interface java.awt.event.MouseListener
Parameters:
theEvent - A MouseEvent

mousePressed

public void mousePressed(java.awt.event.MouseEvent theEvent)
Handle mousePressed event.
Specified by:
mousePressed in interface java.awt.event.MouseListener
Parameters:
theEvent - A MouseEvent

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent theEvent)
Handle mouseReleased event.
Specified by:
mouseReleased in interface java.awt.event.MouseListener
Parameters:
theEvent - A MouseEvent

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Handle mouseEntered event.
Specified by:
mouseEntered in interface java.awt.event.MouseListener
Parameters:
theEvent - A MouseEvent

mouseExited

public void mouseExited(java.awt.event.MouseEvent theEvent)
Handle mouseExited event.
Specified by:
mouseExited in interface java.awt.event.MouseListener
Parameters:
theEvent - A MouseEvent

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent theEvent)
Handle mouseDragged event.
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Parameters:
theEvent - A MouseEvent

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent theEvent)
Handle mouseMoved event.
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Parameters:
theEvent - A MouseEvent

removeListeners

public void removeListeners()

showPopup

public void showPopup(java.awt.event.MouseEvent theEvent,
                      AbleViewObject theViewObj)
Show the canvas (agent) or object context menu.
Parameters:
theEvent - A MouseEvent
theViewObj - An AbleView object

popupMenuWillBecomeVisible

public void popupMenuWillBecomeVisible(javax.swing.event.PopupMenuEvent e)
Specified by:
popupMenuWillBecomeVisible in interface javax.swing.event.PopupMenuListener

popupMenuWillBecomeInvisible

public void popupMenuWillBecomeInvisible(javax.swing.event.PopupMenuEvent e)
Specified by:
popupMenuWillBecomeInvisible in interface javax.swing.event.PopupMenuListener

popupMenuCanceled

public void popupMenuCanceled(javax.swing.event.PopupMenuEvent e)
Specified by:
popupMenuCanceled in interface javax.swing.event.PopupMenuListener

getWorkingDirectory

public java.lang.String getWorkingDirectory()

setWorkingDirectory

public void setWorkingDirectory(java.lang.String theDir)

paintComponent

public void paintComponent(java.awt.Graphics g)
Paint the objects and their connections.
Overrides:
paintComponent in class javax.swing.JComponent
Parameters:
g - A Graphics context

Returns:
void.

setStatus

public void setStatus(java.lang.String text)
Write text to the AbleEditor status line.
Parameters:
text - The text to write to the status line

Returns:
void.

ABLE 2.0.0 07/02/2003 10:25:01

(C) Copyright IBM Corporation 1999, 2003