com.cmpware.ide.views
Class Node

java.lang.Object
  extended by org.eclipse.swt.widgets.Widget
      extended by org.eclipse.swt.widgets.Control
          extended by org.eclipse.swt.widgets.Scrollable
              extended by org.eclipse.swt.widgets.Composite
                  extended by org.eclipse.swt.widgets.Canvas
                      extended by com.cmpware.ide.views.Node
All Implemented Interfaces:
java.util.EventListener, org.eclipse.swt.events.MouseListener, org.eclipse.swt.events.PaintListener, org.eclipse.swt.graphics.Drawable, org.eclipse.swt.internal.SWTEventListener

public class Node
extends org.eclipse.swt.widgets.Canvas
implements org.eclipse.swt.events.PaintListener, org.eclipse.swt.events.MouseListener

This class implements the graphical view of the processor array. It mirrors the data in the Multiprocessor model.

Copyright (c) 2004, 2005 Cmpware, Inc. All Rights Reserved.

Author:
SAG

Field Summary
static java.lang.String copyright
          Copyright string
 
Fields inherited from class org.eclipse.swt.widgets.Control
handle
 
Constructor Summary
Node(org.eclipse.swt.widgets.Composite parent, int row, int col)
          Create the Node.
 
Method Summary
 void dispose()
           
 int getCol()
          This method returns the column of the processor represented by this node.
 int getRow()
          This method returns the row of the processor represented by this node.
 int getScaleFactor()
          This method returns the current zoom-in scale factor.
static Node getSelectedNode()
          This static method returns the currently selected node.
 void initialize(int row, int col)
          This method (re-)initializes the data which drives the display.
 void mouseDoubleClick(org.eclipse.swt.events.MouseEvent e)
           
 void mouseDown(org.eclipse.swt.events.MouseEvent e)
           
 void mouseUp(org.eclipse.swt.events.MouseEvent e)
           
 void paintControl(org.eclipse.swt.events.PaintEvent event)
           
 void selectNode()
          Select this node.
 void setIdle()
          Deprecated. Use setState()
 void setRunning()
          Deprecated. Use setState()
 void setScaleFactor(int scaleFactor)
          This method sets the zoom-in scale factor.
 void setState()
          This method replaces the setIdle() and setRunning() methods.
 
Methods inherited from class org.eclipse.swt.widgets.Canvas
drawBackground, getCaret, scroll, setCaret, setFont
 
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
 
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
 
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addFocusListener, addHelpListener, addKeyListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addPaintListener, addTraverseListener, computeSize, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, redraw, redraw, removeControlListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
 
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, getData, getData, getDisplay, getStyle, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, setData, setData, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright
Copyright string

See Also:
Constant Field Values
Constructor Detail

Node

public Node(org.eclipse.swt.widgets.Composite parent,
            int row,
            int col)
Create the Node. This should only perform canvas specific initialization. All other work should be done in initialize() to permit nodes to be moved without re-building the canvas.

Parameters:
parent - The parent SWT object
Method Detail

initialize

public void initialize(int row,
                       int col)
This method (re-)initializes the data which drives the display. This does not re-allocate any elements on the canvas, but only modifies the underlying local data with information from the multiprocessor array. This permits nodes to be 'swapped' without re-building the array view.

Parameters:
row - The row of the processor represented by this Node.
col - The column of the processor represented by this Node.

dispose

public void dispose()
Overrides:
dispose in class org.eclipse.swt.widgets.Widget

setState

public void setState()
This method replaces the setIdle() and setRunning() methods. This directly probes the underlying processor model and sets the state bitmap.


setIdle

public void setIdle()
Deprecated. Use setState()

This method changes the node bitmap to "idle". Note that no redraw is performed.


setRunning

public void setRunning()
Deprecated. Use setState()

This method changes the node bitmap to "running".


paintControl

public void paintControl(org.eclipse.swt.events.PaintEvent event)
Specified by:
paintControl in interface org.eclipse.swt.events.PaintListener

setScaleFactor

public void setScaleFactor(int scaleFactor)
This method sets the zoom-in scale factor.

Parameters:
scaleFactor - The scale factor.

getScaleFactor

public int getScaleFactor()
This method returns the current zoom-in scale factor.

Returns:
The current scale factor.

mouseDoubleClick

public void mouseDoubleClick(org.eclipse.swt.events.MouseEvent e)
Specified by:
mouseDoubleClick in interface org.eclipse.swt.events.MouseListener

mouseDown

public void mouseDown(org.eclipse.swt.events.MouseEvent e)
Specified by:
mouseDown in interface org.eclipse.swt.events.MouseListener

mouseUp

public void mouseUp(org.eclipse.swt.events.MouseEvent e)
Specified by:
mouseUp in interface org.eclipse.swt.events.MouseListener

selectNode

public void selectNode()
Select this node.


getRow

public int getRow()
This method returns the row of the processor represented by this node.

Returns:
This method returns the row of the processor represented by this node.

getCol

public int getCol()
This method returns the column of the processor represented by this node.

Returns:
This method returns the column of the processor represented by this node.

getSelectedNode

public static Node getSelectedNode()
This static method returns the currently selected node.

Returns:
This static method returns the currently selected node.