wt.clients.beans.graph
Class GraphLinkComponent

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended bywt.clients.beans.graph.GraphComponent
              extended bywt.clients.beans.graph.GraphLabelComponent
                  extended bywt.clients.beans.graph.GraphLinkComponent
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable

public class GraphLinkComponent
extends GraphLabelComponent

See Also:
Serialized Form

Nested Class Summary
(package private)  class GraphLinkComponent.NameMouseListener
           
(package private)  class GraphLinkComponent.QueryPoint
           
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
(package private)  ActionListener actionListener
           
(package private) static int END
           
(package private)  GraphNodeComponent from
           
private  Point fromLoopPoint
           
(package private)  Point fromPoint
           
(package private)  GraphLink link
           
(package private) static int MIDDLE
           
(package private)  MouseListener nodeMouseListener
           
(package private) static int OUT
           
(package private) static int OUTSIDE
           
protected static int SELECTION_MARGIN
           
(package private) static int START
           
(package private)  boolean strait
           
(package private)  GraphNodeComponent to
           
(package private)  Point toPoint
           
private static String versionID
           
 
Fields inherited from class wt.clients.beans.graph.GraphLabelComponent
ascent, component, descent, label, stringColor
 
Fields inherited from class wt.clients.beans.graph.GraphComponent
selected
 
Fields inherited from class java.awt.Container
 
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
GraphLinkComponent()
           
GraphLinkComponent(GraphLink link)
           
 
Method Summary
 void addActionListener(ActionListener listener)
           
 void drawLine(Graphics g)
           
private  Polygon getArrow(Point from, Point to)
           
(package private)  GraphNodeComponent getFrom()
           
 GraphLink getGraphLink()
           
 int getSelectedAt(int x, int y)
           
 Polygon getSelectionZone()
           
(package private)  GraphNodeComponent getTo()
           
private  Point intersection(Point from, Point to, Rectangle rectangle)
          This method finds the intersection of the line and rectangle.
 boolean isStraitLine()
           
 void setEndPoint(int x, int y)
           
 void setFrom(GraphNodeComponent from)
           
 void setGraphLink(GraphLink link)
           
private  void setLineColor(Graphics g)
           
 void setStartPoint(int x, int y)
           
 void setStraitLine(boolean strait)
           
 void setTo(GraphNodeComponent to)
           
 
Methods inherited from class wt.clients.beans.graph.GraphLabelComponent
getLabel, paint, position, setColor, setLabel, toString, updateSize
 
Methods inherited from class wt.clients.beans.graph.GraphComponent
isSelected, setSelected, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

versionID

private static final String versionID
See Also:
Constant Field Values

link

GraphLink link

from

GraphNodeComponent from

fromPoint

Point fromPoint

toPoint

Point toPoint

to

GraphNodeComponent to

SELECTION_MARGIN

protected static final int SELECTION_MARGIN
See Also:
Constant Field Values

START

static final int START
See Also:
Constant Field Values

MIDDLE

static final int MIDDLE
See Also:
Constant Field Values

END

static final int END
See Also:
Constant Field Values

OUTSIDE

static final int OUTSIDE
See Also:
Constant Field Values

OUT

static final int OUT
See Also:
Constant Field Values

nodeMouseListener

MouseListener nodeMouseListener

strait

boolean strait

actionListener

transient ActionListener actionListener

fromLoopPoint

private Point fromLoopPoint
Constructor Detail

GraphLinkComponent

public GraphLinkComponent()

GraphLinkComponent

public GraphLinkComponent(GraphLink link)
Method Detail

setGraphLink

public void setGraphLink(GraphLink link)

getGraphLink

public GraphLink getGraphLink()

addActionListener

public void addActionListener(ActionListener listener)

setFrom

public void setFrom(GraphNodeComponent from)
             throws WTPropertyVetoException
Throws:
WTPropertyVetoException

getFrom

GraphNodeComponent getFrom()

setTo

public void setTo(GraphNodeComponent to)
           throws WTPropertyVetoException
Throws:
WTPropertyVetoException

getTo

GraphNodeComponent getTo()

setStraitLine

public void setStraitLine(boolean strait)

isStraitLine

public boolean isStraitLine()

setStartPoint

public void setStartPoint(int x,
                          int y)

setEndPoint

public void setEndPoint(int x,
                        int y)

setLineColor

private void setLineColor(Graphics g)

drawLine

public void drawLine(Graphics g)

getSelectedAt

public int getSelectedAt(int x,
                         int y)

getSelectionZone

public Polygon getSelectionZone()

intersection

private Point intersection(Point from,
                           Point to,
                           Rectangle rectangle)
This method finds the intersection of the line and rectangle. It assumes they do infact intersect and the rectangle is actually a square.


getArrow

private Polygon getArrow(Point from,
                         Point to)