diff options
| author | abranson <andrew.branson@cern.ch> | 2011-08-02 22:10:28 +0200 |
|---|---|---|
| committer | abranson <andrew.branson@cern.ch> | 2011-08-02 22:10:28 +0200 |
| commit | 5664fd4644c78f4571a1a72e6b9f0511fb10720a (patch) | |
| tree | 7be1c346d1d001bf6b079089f995a60c52b955c1 /source/com/c2kernel/graph/layout/DefaultGraphLayoutGenerator.java | |
| parent | 29bbf451a22916d39017ec1a3f53f4e0f0e65ee0 (diff) | |
Finished move to generics. Enforced 1.6 compliance for now. No errors or
warnings :)
Diffstat (limited to 'source/com/c2kernel/graph/layout/DefaultGraphLayoutGenerator.java')
| -rw-r--r--[-rwxr-xr-x] | source/com/c2kernel/graph/layout/DefaultGraphLayoutGenerator.java | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/com/c2kernel/graph/layout/DefaultGraphLayoutGenerator.java b/source/com/c2kernel/graph/layout/DefaultGraphLayoutGenerator.java index e243817..4b429fa 100755..100644 --- a/source/com/c2kernel/graph/layout/DefaultGraphLayoutGenerator.java +++ b/source/com/c2kernel/graph/layout/DefaultGraphLayoutGenerator.java @@ -19,7 +19,7 @@ public class DefaultGraphLayoutGenerator { public static void layoutGraph(GraphModel graphModel) {
Vertex start = graphModel.getStartVertex();
- Vector rowVector = new Vector(10, 10);
+ Vector<Vector<Vertex>> rowVector = new Vector<Vector<Vertex>>(10, 10);
int[] midPoints = null;
IntegerWrapper valueOfLargestMidPoint = new IntegerWrapper(0);
if (start == null) {
@@ -35,7 +35,7 @@ public class DefaultGraphLayoutGenerator { graphModel.forceNotify();
}
- private static void visitVertex(GraphModel graphModel, Vertex vertex, int rowIndex, Vector rowVector, Object tag) {
+ private static void visitVertex(GraphModel graphModel, Vertex vertex, int rowIndex, Vector<Vector<Vertex>> rowVector, Object tag) {
int i = 0;
Vertex[] children = graphModel.getOutVertices(vertex);
vertex.setTag(tag);
@@ -47,24 +47,24 @@ public class DefaultGraphLayoutGenerator { }
}
- private static void addVertexToRow(Vertex vertex, int rowIndex, Vector rowVector) {
- Vector rowsVertices = null;
+ private static void addVertexToRow(Vertex vertex, int rowIndex, Vector<Vector<Vertex>> rowVector) {
+ Vector<Vertex> rowsVertices = null;
// If there is no vector of vertices already created for this row,
// then create one
if (rowVector.size() == rowIndex) {
- rowVector.add(new Vector(10, 10));
+ rowVector.add(new Vector<Vertex>(10, 10));
}
// Add the vertex to the row's vector of vertices
- rowsVertices = (Vector)rowVector.elementAt(rowIndex);
+ rowsVertices = rowVector.elementAt(rowIndex);
rowsVertices.add(vertex);
}
- private static void calculateRowMidPoints(Vector rowVector, int[] midPoints, IntegerWrapper valueOfLargestMidPoint) {
+ private static void calculateRowMidPoints(Vector<Vector<Vertex>> rowVector, int[] midPoints, IntegerWrapper valueOfLargestMidPoint) {
Vector rowsVertices = null;
int rowsWidth = 0;
int i = 0;
for (i = 0; i < midPoints.length; i++) {
- rowsVertices = (Vector)rowVector.elementAt(i);
+ rowsVertices = rowVector.elementAt(i);
rowsWidth = mHorzGap * (rowsVertices.size() - 1);
midPoints[i] = rowsWidth / 2;
if (midPoints[i] > valueOfLargestMidPoint.mValue) {
@@ -73,7 +73,7 @@ public class DefaultGraphLayoutGenerator { }
}
- private static void fillInVertexLocations(GraphModel graphModel, Vector rowVector,
+ private static void fillInVertexLocations(GraphModel graphModel, Vector<Vector<Vertex>> rowVector,
IntegerWrapper valueOfLargestMidPoint, int[] midPoints) {
Vector rowsVertices = null;
Vertex vertex = null;
@@ -82,7 +82,7 @@ public class DefaultGraphLayoutGenerator { int rowsLeftMargin = 0;
GraphPoint point = new GraphPoint(0, 0);
for (rowIndex = 0; rowIndex < rowVector.size(); rowIndex++) {
- rowsVertices = (Vector)rowVector.elementAt(rowIndex);
+ rowsVertices = rowVector.elementAt(rowIndex);
rowsLeftMargin = mLeftMargin + valueOfLargestMidPoint.mValue - midPoints[rowIndex];
for (column = 0; column < rowsVertices.size(); column++) {
vertex = (Vertex)rowsVertices.elementAt(column);
|
