summaryrefslogtreecommitdiff
path: root/source/com/c2kernel/graph/model/GraphableVertex.java
diff options
context:
space:
mode:
authorabranson <andrew.branson@cern.ch>2011-08-04 00:42:34 +0200
committerabranson <andrew.branson@cern.ch>2011-08-04 00:42:34 +0200
commit0ec8481c10cd8277d84c7c1a785483a0a739e5a0 (patch)
tree5f6e5d9ae75193e67e6f3b3dfa488960c5cde1d5 /source/com/c2kernel/graph/model/GraphableVertex.java
parent036cbdba66f804743c4c838ed598d6972c4b3e17 (diff)
More code cleanup:
Refactored Entity Proxy Subscription to handle generics better Rewrote RemoteMap to use TreeMap instead of the internal array for order. It now sorts its keys by number if they parse, else as strings. Removed a no-longer-in-progress outcome form class
Diffstat (limited to 'source/com/c2kernel/graph/model/GraphableVertex.java')
-rw-r--r--source/com/c2kernel/graph/model/GraphableVertex.java21
1 files changed, 14 insertions, 7 deletions
diff --git a/source/com/c2kernel/graph/model/GraphableVertex.java b/source/com/c2kernel/graph/model/GraphableVertex.java
index 6efd298..fc04743 100644
--- a/source/com/c2kernel/graph/model/GraphableVertex.java
+++ b/source/com/c2kernel/graph/model/GraphableVertex.java
@@ -4,6 +4,7 @@ package com.c2kernel.graph.model;
* @author $Author: abranson $
*/
import java.awt.Point;
+
import com.c2kernel.utils.CastorHashMap;
import com.c2kernel.utils.KeyValuePair;
public abstract class GraphableVertex extends Vertex
@@ -52,10 +53,12 @@ public abstract class GraphableVertex extends Vertex
throw new ExceptionInInitializerError();
this.parent = parent;
}
+ @Override
public GraphModel getChildGraphModel()
{
return mChildrenGraphModel;
}
+ @Override
public Object getCreationContext()
{
return this;
@@ -134,9 +137,9 @@ public abstract class GraphableVertex extends Vertex
ids = ids.substring(getPath().length() + 1);
else
return null;
-
- for (int i = 0; i < graphables.length; i++) {
- GraphableVertex grap = graphables[i].search(ids);
+
+ for (GraphableVertex graphable : graphables) {
+ GraphableVertex grap = graphable.search(ids);
if (grap != null) return grap;
}
}
@@ -201,17 +204,18 @@ public abstract class GraphableVertex extends Vertex
DirectedEdge[] edges = mChildrenGraphModel.getEdges();
GraphableVertex[] graphables = this.getLayoutableChildren();
if (graphables != null)
- for (int i = 0; i < graphables.length; i++)
- graphables[i].setParent(this);
+ for (GraphableVertex graphable : graphables)
+ graphable.setParent(this);
if (edges != null)
- for (int i = 0; i < edges.length; i++)
- ((GraphableEdge) edges[i]).setParent(this);
+ for (DirectedEdge edge : edges)
+ ((GraphableEdge) edge).setParent(this);
childrenGraph.setContainingVertex(this);
}
/**
* @see com.c2kernel.graph.model.Vertex#getCentrePoint()
*/
+ @Override
public GraphPoint getCentrePoint()
{
if (!getIsLayoutable())
@@ -221,6 +225,7 @@ public abstract class GraphableVertex extends Vertex
/**
* @see com.c2kernel.graph.model.Vertex#getInEdgeIds()
*/
+ @Override
public int[] getInEdgeIds()
{
if (!getIsLayoutable())
@@ -230,6 +235,7 @@ public abstract class GraphableVertex extends Vertex
/**
* @see com.c2kernel.graph.model.Vertex#getOutEdgeIds()
*/
+ @Override
public int[] getOutEdgeIds()
{
if (!getIsLayoutable())
@@ -239,6 +245,7 @@ public abstract class GraphableVertex extends Vertex
/**
* @see com.c2kernel.graph.model.Vertex#getOutlinePoints()
*/
+ @Override
public GraphPoint[] getOutlinePoints()
{
if (!getIsLayoutable())