org.opencores.graphics
Class Draw

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--org.opencores.graphics.Draw

public class Draw
extends java.awt.Canvas

Component used for graph drawing.

See Also:
Serialized Form

Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Field Summary
static int DM_GRID
          grid drawing mode - placement
static int DM_LINEAR
          linear drawing mode - no grid - mapping
static int DM_SEGMENT
          segment drawing mode - routing
private  Graph g
          graph to work on
private static int GRID
          grid size
private  java.lang.Object holding
          Object mouse is holding
private  int mode
          current mode
 
Fields inherited from class java.awt.Canvas
base, graphicsConfig, nameCounter, serialVersionUID
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, assert, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, serialVersionUID, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Constructor Summary
Draw(Graph g)
          Constructs new frame, showing graph g
 
Method Summary
 void moveTo(java.lang.Object o, int x, int y)
          moves object to window position (x,y)
 void paint(java.awt.Graphics gr)
          Draws graph to specified graphics.
 java.lang.Object pick(int x, int y)
          function that returns object at window position (x,y)
 void setGraph(Graph g)
          Changes graph displayed
 void setMode(int mode)
          Sets drawing mode.
 
Methods inherited from class java.awt.Canvas
, addNotify, constructComponentName, postsOldMouseEvents
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, dispatchEventImpl, doLayout, enable, enable, enableEvents, enableInputMethods, eventEnabled, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, initIDs, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, lightweightPrint, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, readObject, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate, writeObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

GRID

private static final int GRID
grid size

DM_LINEAR

public static final int DM_LINEAR
linear drawing mode - no grid - mapping

DM_GRID

public static final int DM_GRID
grid drawing mode - placement

DM_SEGMENT

public static final int DM_SEGMENT
segment drawing mode - routing

g

private Graph g
graph to work on

mode

private int mode
current mode

holding

private java.lang.Object holding
Object mouse is holding
Constructor Detail

Draw

public Draw(Graph g)
Constructs new frame, showing graph g
Parameters:
g - graph to display
See Also:
Graph
Method Detail

setMode

public void setMode(int mode)
Sets drawing mode.
See Also:
for parameters.

setGraph

public void setGraph(Graph g)
Changes graph displayed
Parameters:
g - graph to display
See Also:
Graph

paint

public void paint(java.awt.Graphics gr)
Draws graph to specified graphics.
Parameters:
gr - graphics object
Overrides:
paint in class java.awt.Canvas

pick

public java.lang.Object pick(int x,
                             int y)
function that returns object at window position (x,y)
Parameters:
x - mouse x (relative to this frame)
y - mouse y (relative to this frame)

moveTo

public void moveTo(java.lang.Object o,
                   int x,
                   int y)
moves object to window position (x,y)
Parameters:
o - object to move
x - mouse x (relative to this frame)
y - mouse y (relative to this frame)