GraphLab Project

graphlab.graph
Class GraphUtils

java.lang.Object
  extended by graphlab.graph.GraphUtils

public class GraphUtils
extends java.lang.Object

Author:
Azin Azadi

Constructor Summary
GraphUtils()
           
 
Method Summary
static void addEdgeGlobalUserdefinedAttribute(java.lang.String name, java.lang.Object defaultvalue)
           
static void addGraphGlobalUserdefinedAttribute(java.lang.String name, java.lang.Object defaultvalue)
           
static void addVertexGlobalUserdefinedAttribute(java.lang.String name, java.lang.Object defaultvalue)
           
static GraphPoint createGraphPoint(GraphModel g, int viewx, int viewy)
          creates a new graph point from the given point according too graph zoom, The input x and y are typically are directly from view, notice that inside the GraphLab everything are GraphPoint, so they are independent of zoom use this method only if you want to convert a view point to graph point!
static java.awt.Point createViewPoint(GraphModel g, GraphPoint p)
           
static java.awt.Rectangle createViewRectangle(GraphModel g, java.awt.Rectangle r)
           
static java.awt.Color getColor(java.lang.Integer i)
           
static void hideNotificationMessage(BlackBoard b)
           
 void ignoreRepaints(AbstractGraphRenderer renderer, java.lang.Runnable run, boolean repaintAfter)
           
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)
           
static void removeEdgeGlobalUserdefinedAttribute(java.lang.String name)
           
static void removeGraphGlobalUserdefinedAttribute(java.lang.String name)
           
static void removeVertexGlobalUserdefinedAttribute(java.lang.String name)
           
static void setMessage(java.lang.String message, BlackBoard b, boolean formatIt)
           
static void showNotificationMessage(java.lang.String message, BlackBoard b, boolean formatIt)
           
static void showTimeNotificationMessage(java.lang.String message, BlackBoard b, long timeMillis, boolean formatIt)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphUtils

public GraphUtils()
Method Detail

ignoreRepaints

public void ignoreRepaints(AbstractGraphRenderer renderer,
                           java.lang.Runnable run,
                           boolean repaintAfter)
See Also:
AbstractGraphRenderer.ignoreRepaints(Runnable,boolean)

showNotificationMessage

public static void showNotificationMessage(java.lang.String message,
                                           BlackBoard b,
                                           boolean formatIt)
See Also:
GTabbedGraphPane.showNotificationMessage(String,graphlab.platform.core.BlackBoard,boolean)

setMessage

public static void setMessage(java.lang.String message,
                              BlackBoard b,
                              boolean formatIt)
See Also:
GTabbedGraphPane.setMessage(String,graphlab.platform.core.BlackBoard,boolean)

hideNotificationMessage

public static void hideNotificationMessage(BlackBoard b)
See Also:
GTabbedGraphPane.hideNotificationMessage(graphlab.platform.core.BlackBoard)

showTimeNotificationMessage

public static void showTimeNotificationMessage(java.lang.String message,
                                               BlackBoard b,
                                               long timeMillis,
                                               boolean formatIt)
See Also:
GTabbedGraphPane.showTimeNotificationMessage(String,graphlab.platform.core.BlackBoard,long,boolean)

isPointOnVertex

public static boolean isPointOnVertex(GraphModel g,
                                      VertexModel v,
                                      GraphPoint p)
See Also:
GraphControl.isPointOnVertex(graphlab.graph.graph.GraphModel,graphlab.graph.graph.VertexModel,graphlab.graph.graph.GraphPoint)

mindistv

public static Pair<VertexModel,java.lang.Double> mindistv(GraphModel g,
                                                          GraphPoint p)
See Also:
GraphControl.mindistv(graphlab.graph.graph.GraphModel,graphlab.graph.graph.GraphPoint)

mindiste

public static Pair<EdgeModel,java.lang.Double> mindiste(GraphModel g,
                                                        GraphPoint p)
See Also:
GraphControl.mindiste(graphlab.graph.graph.GraphModel,graphlab.graph.graph.GraphPoint)

getColor

public static java.awt.Color getColor(java.lang.Integer i)
See Also:
GraphModel.getColor(Integer)

addGraphGlobalUserdefinedAttribute

public static void addGraphGlobalUserdefinedAttribute(java.lang.String name,
                                                      java.lang.Object defaultvalue)
See Also:
GraphModel.addGlobalUserDefinedAttribute(String,Object), VertexModel.setUserDefinedAttribute(String,Object)

removeGraphGlobalUserdefinedAttribute

public static void removeGraphGlobalUserdefinedAttribute(java.lang.String name)
See Also:
GraphModel.removeGlobalUserDefinedAttribute(String)

addVertexGlobalUserdefinedAttribute

public static void addVertexGlobalUserdefinedAttribute(java.lang.String name,
                                                       java.lang.Object defaultvalue)
See Also:
VertexModel.addGlobalUserDefinedAttribute(String,Object), VertexModel.setUserDefinedAttribute(String,Object)

removeVertexGlobalUserdefinedAttribute

public static void removeVertexGlobalUserdefinedAttribute(java.lang.String name)
See Also:
VertexModel.removeGlobalUserDefinedAttribute(String)

addEdgeGlobalUserdefinedAttribute

public static void addEdgeGlobalUserdefinedAttribute(java.lang.String name,
                                                     java.lang.Object defaultvalue)
See Also:
EdgeModel.addGlobalUserDefinedAttribute(String,Object), VertexModel.setUserDefinedAttribute(String,Object)

removeEdgeGlobalUserdefinedAttribute

public static void removeEdgeGlobalUserdefinedAttribute(java.lang.String name)
See Also:
EdgeModel.removeGlobalUserDefinedAttribute(String)

createGraphPoint

public static GraphPoint createGraphPoint(GraphModel g,
                                          int viewx,
                                          int viewy)
creates a new graph point from the given point according too graph zoom, The input x and y are typically are directly from view, notice that inside the GraphLab everything are GraphPoint, so they are independent of zoom use this method only if you want to convert a view point to graph point!

Parameters:
g - the graph that zoom and center values are used from.
viewx - initial x potition
viewy - initial y position
Returns:
a0 GraphPoint object which have x and y acording to zoom and center

createViewPoint

public static java.awt.Point createViewPoint(GraphModel g,
                                             GraphPoint p)

createViewRectangle

public static java.awt.Rectangle createViewRectangle(GraphModel g,
                                                     java.awt.Rectangle r)

GraphLab Project