From 0ec8481c10cd8277d84c7c1a785483a0a739e5a0 Mon Sep 17 00:00:00 2001 From: abranson Date: Thu, 4 Aug 2011 00:42:34 +0200 Subject: 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 --- .../com/c2kernel/graph/model/GraphableVertex.java | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'source/com/c2kernel/graph/model/GraphableVertex.java') 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()) -- cgit v1.2.3