|
GraphLab Project | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgraphlab.library.BaseGraph<VertexType,EdgeType>
graphlab.library.ListGraph<VertexModel,EdgeModel>
graphlab.graph.graph.GraphModel
public class GraphModel
Field Summary | |
---|---|
static java.awt.Color[] |
color
|
boolean |
isEdgesCurved
It is true if the edges of this graph are curves (not line), This will be applied to all edges of graph |
static boolean |
showEdgeWeights
|
static boolean |
vertexLabelsEnabled
|
Fields inherited from class graphlab.library.BaseGraph |
---|
isSubgraph, lastSubgraphIndex, subgraphIndex, superGraph |
Fields inherited from interface graphlab.platform.preferences.lastsettings.StorableOnExit |
---|
SETTINGS |
Constructor Summary | |
---|---|
GraphModel()
generates an undirected graph |
|
GraphModel(boolean isdirected)
|
Method Summary | ||
---|---|---|
static void |
addGlobalUserDefinedAttribute(java.lang.String name,
java.lang.Object defaultvalue)
sets and stores a global user defined attribute for the graph. |
|
void |
addGraphListener(GraphModelListener listener)
|
|
void |
addSubGraph(GraphModel graph,
java.awt.Rectangle _rect)
adds graph to this graph and place it in the given rectangle |
|
void |
clear()
Clears the graph. |
|
GraphModel |
createEmptyGraph()
Returns a new instance of an empty graph of the current graph type. |
|
java.awt.geom.Rectangle2D.Double |
getAbsBounds()
|
|
static java.awt.Color |
getColor(java.lang.Integer i)
in GraphLab all Colors that assign to Vertices/Edges are in values, so they can not directly shown with distinct colors, this method gived the standard GraphLab solution to this which assigns unique colors to 1..20 and if i>20, It will regards the i itself as the color (new Color(i)) regarding the fact that normally in GraphTheory Colors have small values. |
|
EdgeModel |
getEdge(VertexModel v1,
VertexModel v2)
|
|
int |
getEdgesCount()
|
|
java.awt.Font |
getFont()
|
|
java.lang.String |
getLabel()
|
|
|
getUserDefinedAttribute(java.lang.String name)
returns the specified user defined attribute, or null if it does not exists. |
|
java.util.HashMap<java.lang.String,java.lang.Object> |
getUserDefinedAttributes()
|
|
VertexModel[] |
getVertexArray()
Returns array of vertices upcasted to BaseVertex. |
|
ArrayX<java.lang.String> |
getZoom()
|
|
java.awt.geom.Rectangle2D.Double |
getZoomedBounds()
|
|
double |
getZoomFactor()
|
|
void |
insertEdge(EdgeModel newedge)
adds new edge only if it doesn't exist in graph |
|
void |
insertEdges(EdgeModel[] edges)
|
|
void |
insertEdges(java.lang.Iterable<EdgeModel> edgeModels)
|
|
void |
insertVertex(VertexModel newVertex)
same to insertVertex |
|
void |
insertVertices(java.util.Collection<VertexModel> vertices)
|
|
void |
insertVertices(VertexModel[] vertices)
|
|
boolean |
isDrawEdgeLabels()
|
|
boolean |
isDrawVertexLabels()
|
|
boolean |
isEdgesCurved()
|
|
boolean |
isShowChangesOnView()
|
|
void |
removeAllEdges(VertexModel source,
VertexModel target)
Removes all edges between two vertices. |
|
void |
removeEdge(EdgeModel edge)
Removes an edge from the graph. |
|
static void |
removeGlobalUserDefinedAttribute(java.lang.String name)
|
|
void |
removeGraphListener(GraphModelListener listener)
|
|
void |
removeUserDefinedAttribute(java.lang.String name)
removes the given attribute from the list of user defined attributes |
|
void |
removeVertex(VertexModel v)
Removes a vertex and all it's connected edges. |
|
void |
setDrawEdgeLabels(boolean drawEdgeLabels)
|
|
void |
setDrawVertexLabels(boolean drawVertexLabels)
|
|
void |
setFont(java.awt.Font font)
|
|
void |
setIsEdgesCurved(boolean isCurve)
set the edges of this graph to be curves or lines |
|
void |
setLabel(java.lang.String s)
|
|
void |
setShowChangesOnView(boolean showChangesOnView)
determines whether show changes in model to view, for example when an algorithm changes the color of a vertex in VertexModel(BaseVertex) should a color be assigned in GUI to it or not? |
|
void |
setUserDefinedAttribute(java.lang.String name,
java.lang.Object value)
sets and stores a user defined attribute for the graph. |
|
void |
setZoom(ArrayX<java.lang.String> zoom)
|
|
void |
setZoom(double zoomFactor)
|
|
void |
zoomIn()
|
|
void |
zoomOut()
|
Methods inherited from class graphlab.library.ListGraph |
---|
checkVertex, containsVertex, copy, dump, edgeIterator, edgeIterator, getAdjacencyMatrix, getAVertex, getEdgeArray, getEdges, getInDegree, getOutDegree, getVerticesCount, isDirected, isEdge, iterator, lightEdgeIterator, lightEdgeIterator, setDirected, setId |
Methods inherited from class graphlab.library.BaseGraph |
---|
edges, getDegree, getEdges, getId, getNeighbors, getNewSubgraphIndex, registerSubgraph, setSubGraphIndex, vertices |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static boolean showEdgeWeights
public static boolean vertexLabelsEnabled
public static final java.awt.Color[] color
public boolean isEdgesCurved
Constructor Detail |
---|
public GraphModel()
public GraphModel(boolean isdirected)
Method Detail |
---|
public GraphModel createEmptyGraph()
BaseGraph
createEmptyGraph
in class ListGraph<VertexModel,EdgeModel>
public void setUserDefinedAttribute(java.lang.String name, java.lang.Object value)
name
- value
- public <t> t getUserDefinedAttribute(java.lang.String name)
name
-
public void removeUserDefinedAttribute(java.lang.String name)
name
- public java.util.HashMap<java.lang.String,java.lang.Object> getUserDefinedAttributes()
public static void addGlobalUserDefinedAttribute(java.lang.String name, java.lang.Object defaultvalue)
public static void removeGlobalUserDefinedAttribute(java.lang.String name)
addGlobalUserDefinedAttribute(java.lang.String, java.lang.Object)
public void setShowChangesOnView(boolean showChangesOnView)
showChangesOnView
- public boolean isShowChangesOnView()
public void insertVertex(VertexModel newVertex)
insertVertex
in class ListGraph<VertexModel,EdgeModel>
newVertex
- The new vertex to be inserted.public void insertVertices(java.util.Collection<VertexModel> vertices)
public void removeAllEdges(VertexModel source, VertexModel target) throws InvalidVertexException
BaseGraph
removeAllEdges
in class ListGraph<VertexModel,EdgeModel>
source
- Index of the edges' start point.target
- Index of the edges' end point.
InvalidVertexException
- Thrown when two supplied indexes of vertices are invalid.public void removeEdge(EdgeModel edge) throws InvalidEdgeException
BaseGraph
removeEdge
in class ListGraph<VertexModel,EdgeModel>
edge
- Edge to be removed.
InvalidEdgeException
- If edge
is an invalid edge object.public void removeVertex(VertexModel v) throws InvalidVertexException
BaseGraph
removeVertex
in class ListGraph<VertexModel,EdgeModel>
InvalidVertexException
public void clear()
BaseGraph
clear
in class ListGraph<VertexModel,EdgeModel>
public EdgeModel getEdge(VertexModel v1, VertexModel v2)
public void insertEdge(EdgeModel newedge)
insertEdge
in class ListGraph<VertexModel,EdgeModel>
newedge
- public int getEdgesCount()
getEdgesCount
in class ListGraph<VertexModel,EdgeModel>
public void addGraphListener(GraphModelListener listener)
public void removeGraphListener(GraphModelListener listener)
public java.awt.geom.Rectangle2D.Double getAbsBounds()
public java.awt.geom.Rectangle2D.Double getZoomedBounds()
public double getZoomFactor()
public ArrayX<java.lang.String> getZoom()
public void setZoom(ArrayX<java.lang.String> zoom)
public void zoomIn()
public void zoomOut()
public void setZoom(double zoomFactor)
public void setLabel(java.lang.String s)
public java.lang.String getLabel()
public void insertEdges(java.lang.Iterable<EdgeModel> edgeModels)
public void addSubGraph(GraphModel graph, java.awt.Rectangle _rect)
graph
- _rect
- public static java.awt.Color getColor(java.lang.Integer i)
public java.awt.Font getFont()
public void setFont(java.awt.Font font)
public boolean isDrawEdgeLabels()
public void setDrawEdgeLabels(boolean drawEdgeLabels)
public boolean isDrawVertexLabels()
public void setDrawVertexLabels(boolean drawVertexLabels)
public boolean isEdgesCurved()
public void setIsEdgesCurved(boolean isCurve)
isCurve
- public void insertVertices(VertexModel[] vertices)
public void insertEdges(EdgeModel[] edges)
public VertexModel[] getVertexArray()
BaseGraph
getVertexArray
in class ListGraph<VertexModel,EdgeModel>
|
GraphLab Project | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |