GraphLab Project

graphlab.graph.graph
Class GraphControl

java.lang.Object
  extended by graphlab.graph.graph.GraphControl
All Implemented Interfaces:
java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.util.EventListener

public class GraphControl
extends java.lang.Object
implements java.awt.event.MouseListener, java.awt.event.MouseWheelListener, java.awt.event.MouseMotionListener

Author:
Azin Azadi, roozbeh ebrahimi, Ali Ershadi

Field Summary
static int EDGE_CURVE_CPNTROL_BOX_DIAMETER
           
 
Constructor Summary
GraphControl(GraphModel g, javax.swing.JPanel gv, BlackBoard bb)
           
 
Method Summary
static boolean isPointOnVertex(GraphModel g, VertexModel v, GraphPoint p)
           
static Pair<EdgeModel,java.lang.Double> mindiste(GraphModel g, GraphPoint p)
           
static Pair<VertexModel,java.lang.Double> mindistv(GraphModel g, GraphPoint p)
           
 void mouseClicked(java.awt.event.MouseEvent mouseEvent)
           
 void mouseDragged(java.awt.event.MouseEvent mouseEvent)
           
 void mouseEntered(java.awt.event.MouseEvent mouseEvent)
           
 void mouseExited(java.awt.event.MouseEvent mouseEvent)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.MouseEvent mouseEvent)
           
 void mouseReleased(java.awt.event.MouseEvent mouseEvent)
           
 void mouseWheelMoved(java.awt.event.MouseWheelEvent mouseWheelEvent)
           
 void setListener(GraphControlListener l)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EDGE_CURVE_CPNTROL_BOX_DIAMETER

public static final int EDGE_CURVE_CPNTROL_BOX_DIAMETER
See Also:
Constant Field Values
Constructor Detail

GraphControl

public GraphControl(GraphModel g,
                    javax.swing.JPanel gv,
                    BlackBoard bb)
Method Detail

setListener

public void setListener(GraphControlListener l)

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent mouseEvent)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent mouseEvent)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent mouseEvent)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent mouseEvent)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent mouseEvent)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseWheelMoved

public void mouseWheelMoved(java.awt.event.MouseWheelEvent mouseWheelEvent)
Specified by:
mouseWheelMoved in interface java.awt.event.MouseWheelListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent mouseEvent)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mindiste

public static Pair<EdgeModel,java.lang.Double> mindiste(GraphModel g,
                                                        GraphPoint p)
Returns:
the minimum distanse edge and its distance to the given GraphPoint, If edges are curved the distance will be calculated to Curve Control Points

mindistv

public static Pair<VertexModel,java.lang.Double> mindistv(GraphModel g,
                                                          GraphPoint p)
Returns:
the minimum distance vertex to the given location, and its distanse square(^2).

isPointOnVertex

public static boolean isPointOnVertex(GraphModel g,
                                      VertexModel v,
                                      GraphPoint p)
Returns:
True if the given point in on the given vertex

GraphLab Project