|
@@ -42,8 +42,19 @@ public class LayeredNode implements LayeredGraphNode {
|
|
public LayeredGraphNode sink;
|
|
public LayeredGraphNode sink;
|
|
public double shift;
|
|
public double shift;
|
|
}
|
|
}
|
|
- LayoutInfo[] layouts;
|
|
|
|
|
|
|
|
|
|
+ private class CombinedLayoutInfo
|
|
|
|
+ {
|
|
|
|
+ public double x;
|
|
|
|
+ public double y;
|
|
|
|
+ public double w;
|
|
|
|
+ public double h;
|
|
|
|
+ public Color color;
|
|
|
|
+ public boolean selected;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ LayoutInfo[] layouts;
|
|
|
|
+ CombinedLayoutInfo combined;
|
|
String name;
|
|
String name;
|
|
|
|
|
|
// for subgraph in this node
|
|
// for subgraph in this node
|
|
@@ -78,6 +89,16 @@ public class LayeredNode implements LayeredGraphNode {
|
|
l.xUndef = true;
|
|
l.xUndef = true;
|
|
}
|
|
}
|
|
dummy = false;
|
|
dummy = false;
|
|
|
|
+ combined = new CombinedLayoutInfo();
|
|
|
|
+ if( original != null )
|
|
|
|
+ {
|
|
|
|
+ combined.x = original.getX();
|
|
|
|
+ combined.y = original.getX();
|
|
|
|
+ combined.w = original.getWidth();
|
|
|
|
+ combined.h = original.getHeight();
|
|
|
|
+ }
|
|
|
|
+ combined.color = null;
|
|
|
|
+ combined.selected = false;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -261,6 +282,7 @@ public class LayeredNode implements LayeredGraphNode {
|
|
this.layouts[ 1 ].selected = true;
|
|
this.layouts[ 1 ].selected = true;
|
|
this.layouts[ 2 ].selected = true;
|
|
this.layouts[ 2 ].selected = true;
|
|
this.layouts[ 3 ].selected = true;
|
|
this.layouts[ 3 ].selected = true;
|
|
|
|
+ combined.selected = true;
|
|
}
|
|
}
|
|
if( layout == LayoutType.TOP_BOTTOM_LEFT )
|
|
if( layout == LayoutType.TOP_BOTTOM_LEFT )
|
|
this.layouts[ 0 ].selected = true;
|
|
this.layouts[ 0 ].selected = true;
|
|
@@ -270,6 +292,8 @@ public class LayeredNode implements LayeredGraphNode {
|
|
this.layouts[ 2 ].selected = true;
|
|
this.layouts[ 2 ].selected = true;
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
this.layouts[ 3 ].selected = true;
|
|
this.layouts[ 3 ].selected = true;
|
|
|
|
+ if( layout == LayoutType.COMBINED )
|
|
|
|
+ combined.selected = true;
|
|
update();
|
|
update();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -300,6 +324,12 @@ public class LayeredNode implements LayeredGraphNode {
|
|
layouts[ 3 ].selected = false;
|
|
layouts[ 3 ].selected = false;
|
|
return tmp;
|
|
return tmp;
|
|
}
|
|
}
|
|
|
|
+ if( layout == LayoutType.COMBINED )
|
|
|
|
+ {
|
|
|
|
+ boolean tmp = combined.selected;
|
|
|
|
+ combined.selected = false;
|
|
|
|
+ return tmp;
|
|
|
|
+ }
|
|
return false;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -312,6 +342,7 @@ public class LayeredNode implements LayeredGraphNode {
|
|
this.layouts[ 1 ].color = c;
|
|
this.layouts[ 1 ].color = c;
|
|
this.layouts[ 2 ].color = c;
|
|
this.layouts[ 2 ].color = c;
|
|
this.layouts[ 3 ].color = c;
|
|
this.layouts[ 3 ].color = c;
|
|
|
|
+ combined.color = c;
|
|
}
|
|
}
|
|
if( layout == LayoutType.TOP_BOTTOM_LEFT )
|
|
if( layout == LayoutType.TOP_BOTTOM_LEFT )
|
|
this.layouts[ 0 ].color = c;
|
|
this.layouts[ 0 ].color = c;
|
|
@@ -321,6 +352,8 @@ public class LayeredNode implements LayeredGraphNode {
|
|
this.layouts[ 2 ].color = c;
|
|
this.layouts[ 2 ].color = c;
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
this.layouts[ 3 ].color = c;
|
|
this.layouts[ 3 ].color = c;
|
|
|
|
+ if( layout == LayoutType.COMBINED )
|
|
|
|
+ combined.color = c;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -334,6 +367,8 @@ public class LayeredNode implements LayeredGraphNode {
|
|
return this.layouts[ 2 ].color;
|
|
return this.layouts[ 2 ].color;
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
return this.layouts[ 3 ].color;
|
|
return this.layouts[ 3 ].color;
|
|
|
|
+ if( layout == LayoutType.COMBINED )
|
|
|
|
+ return combined.color;
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -381,6 +416,7 @@ public class LayeredNode implements LayeredGraphNode {
|
|
layouts[ 1 ].x = x;
|
|
layouts[ 1 ].x = x;
|
|
layouts[ 2 ].x = x;
|
|
layouts[ 2 ].x = x;
|
|
layouts[ 3 ].x = x;
|
|
layouts[ 3 ].x = x;
|
|
|
|
+ combined.x = x;
|
|
}
|
|
}
|
|
if( layout == LayoutType.TOP_BOTTOM_LEFT )
|
|
if( layout == LayoutType.TOP_BOTTOM_LEFT )
|
|
{
|
|
{
|
|
@@ -402,6 +438,8 @@ public class LayeredNode implements LayeredGraphNode {
|
|
layouts[ 3 ].xUndef = !def;
|
|
layouts[ 3 ].xUndef = !def;
|
|
layouts[ 3 ].x = x;
|
|
layouts[ 3 ].x = x;
|
|
}
|
|
}
|
|
|
|
+ if( layout == LayoutType.COMBINED )
|
|
|
|
+ combined.x = x;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -412,6 +450,7 @@ public class LayeredNode implements LayeredGraphNode {
|
|
layouts[ 1 ].y = y;
|
|
layouts[ 1 ].y = y;
|
|
layouts[ 2 ].y = y;
|
|
layouts[ 2 ].y = y;
|
|
layouts[ 3 ].y = y;
|
|
layouts[ 3 ].y = y;
|
|
|
|
+ combined.y = y;
|
|
}
|
|
}
|
|
if( layout == LayoutType.TOP_BOTTOM_LEFT )
|
|
if( layout == LayoutType.TOP_BOTTOM_LEFT )
|
|
layouts[ 0 ].y = y;
|
|
layouts[ 0 ].y = y;
|
|
@@ -421,6 +460,8 @@ public class LayeredNode implements LayeredGraphNode {
|
|
layouts[ 2 ].y = y;
|
|
layouts[ 2 ].y = y;
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
layouts[ 3 ].y = y;
|
|
layouts[ 3 ].y = y;
|
|
|
|
+ if( layout == LayoutType.COMBINED )
|
|
|
|
+ combined.y = y;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -433,6 +474,8 @@ public class LayeredNode implements LayeredGraphNode {
|
|
return this.layouts[ 2 ].x;
|
|
return this.layouts[ 2 ].x;
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
return this.layouts[ 3 ].x;
|
|
return this.layouts[ 3 ].x;
|
|
|
|
+ if( layout == LayoutType.COMBINED )
|
|
|
|
+ return combined.x;
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -446,6 +489,8 @@ public class LayeredNode implements LayeredGraphNode {
|
|
return this.layouts[ 2 ].y;
|
|
return this.layouts[ 2 ].y;
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
return this.layouts[ 3 ].y;
|
|
return this.layouts[ 3 ].y;
|
|
|
|
+ if( layout == LayoutType.COMBINED )
|
|
|
|
+ return combined.y;
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -469,6 +514,8 @@ public class LayeredNode implements LayeredGraphNode {
|
|
return Math.max( max - min, layouts[ 2 ].w );
|
|
return Math.max( max - min, layouts[ 2 ].w );
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
return Math.max( max - min, layouts[ 3 ].w );
|
|
return Math.max( max - min, layouts[ 3 ].w );
|
|
|
|
+ if( layout == LayoutType.COMBINED )
|
|
|
|
+ return Math.max( max - min, combined.w );
|
|
}
|
|
}
|
|
if( layout == LayoutType.TOP_BOTTOM_LEFT )
|
|
if( layout == LayoutType.TOP_BOTTOM_LEFT )
|
|
return layouts[ 0 ].w;
|
|
return layouts[ 0 ].w;
|
|
@@ -478,6 +525,8 @@ public class LayeredNode implements LayeredGraphNode {
|
|
return layouts[ 2 ].w;
|
|
return layouts[ 2 ].w;
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
return layouts[ 3 ].w;
|
|
return layouts[ 3 ].w;
|
|
|
|
+ if( layout == LayoutType.COMBINED )
|
|
|
|
+ return combined.w;
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -499,6 +548,8 @@ public class LayeredNode implements LayeredGraphNode {
|
|
return Math.max( max, layouts[ 2 ].h );
|
|
return Math.max( max, layouts[ 2 ].h );
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
return Math.max( max, layouts[ 3 ].h );
|
|
return Math.max( max, layouts[ 3 ].h );
|
|
|
|
+ if( layout == LayoutType.COMBINED )
|
|
|
|
+ return Math.max( max, combined.h );
|
|
}
|
|
}
|
|
if( layout == LayoutType.TOP_BOTTOM_LEFT )
|
|
if( layout == LayoutType.TOP_BOTTOM_LEFT )
|
|
return layouts[ 0 ].h;
|
|
return layouts[ 0 ].h;
|
|
@@ -508,6 +559,8 @@ public class LayeredNode implements LayeredGraphNode {
|
|
return layouts[ 2 ].h;
|
|
return layouts[ 2 ].h;
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
return layouts[ 3 ].h;
|
|
return layouts[ 3 ].h;
|
|
|
|
+ if( layout == LayoutType.COMBINED )
|
|
|
|
+ return combined.h;
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -520,6 +573,7 @@ public class LayeredNode implements LayeredGraphNode {
|
|
this.layouts[ 1 ].w = w;
|
|
this.layouts[ 1 ].w = w;
|
|
this.layouts[ 2 ].w = w;
|
|
this.layouts[ 2 ].w = w;
|
|
this.layouts[ 3 ].w = w;
|
|
this.layouts[ 3 ].w = w;
|
|
|
|
+ combined.w = w;
|
|
}
|
|
}
|
|
if( layout == LayoutType.TOP_BOTTOM_LEFT )
|
|
if( layout == LayoutType.TOP_BOTTOM_LEFT )
|
|
this.layouts[ 0 ].w = w;
|
|
this.layouts[ 0 ].w = w;
|
|
@@ -529,6 +583,8 @@ public class LayeredNode implements LayeredGraphNode {
|
|
this.layouts[ 2 ].w = w;
|
|
this.layouts[ 2 ].w = w;
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
this.layouts[ 3 ].w = w;
|
|
this.layouts[ 3 ].w = w;
|
|
|
|
+ if( layout == LayoutType.COMBINED )
|
|
|
|
+ combined.w = w;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
@@ -540,6 +596,7 @@ public class LayeredNode implements LayeredGraphNode {
|
|
this.layouts[ 1 ].h = h;
|
|
this.layouts[ 1 ].h = h;
|
|
this.layouts[ 2 ].h = h;
|
|
this.layouts[ 2 ].h = h;
|
|
this.layouts[ 3 ].h = h;
|
|
this.layouts[ 3 ].h = h;
|
|
|
|
+ combined.h = h;
|
|
}
|
|
}
|
|
if( layout == LayoutType.TOP_BOTTOM_LEFT )
|
|
if( layout == LayoutType.TOP_BOTTOM_LEFT )
|
|
this.layouts[ 0 ].h = h;
|
|
this.layouts[ 0 ].h = h;
|
|
@@ -549,6 +606,8 @@ public class LayeredNode implements LayeredGraphNode {
|
|
this.layouts[ 2 ].h = h;
|
|
this.layouts[ 2 ].h = h;
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
this.layouts[ 3 ].h = h;
|
|
this.layouts[ 3 ].h = h;
|
|
|
|
+ if( layout == LayoutType.COMBINED )
|
|
|
|
+ combined.h = h;
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|