|
@@ -414,15 +414,76 @@ public class LayeredNode implements LayeredGraphNode {
|
|
combined.color = c;
|
|
combined.color = c;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private int calcClassSize( LayeredGraphNode sink, LayoutType layout )
|
|
|
|
+ {
|
|
|
|
+ if( parent == null )
|
|
|
|
+ return 1;
|
|
|
|
+ int ret = 0;
|
|
|
|
+ for( LayeredGraphNode n : parent.getContainedNodes() )
|
|
|
|
+ {
|
|
|
|
+ if( n.getRoot( layout ).getSink( layout ) == sink )
|
|
|
|
+ ret++;
|
|
|
|
+ }
|
|
|
|
+ return ret;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public Color getClassColor( LayoutType layout )
|
|
|
|
+ {
|
|
|
|
+ if( layout == LayoutType.TOP_BOTTOM_LEFT && this.layouts[ 0 ].sink == this && calcClassSize( this, layout ) == 1 )
|
|
|
|
+ return Color.LIGHT_GRAY;
|
|
|
|
+ if( layout == LayoutType.TOP_BOTTOM_LEFT && this.layouts[ 0 ].sink == this )
|
|
|
|
+ return this.layouts[ 0 ].color;
|
|
|
|
+ else if( layout == LayoutType.TOP_BOTTOM_LEFT )
|
|
|
|
+ return this.layouts[ 0 ].sink.getClassColor( layout );
|
|
|
|
+ if( layout == LayoutType.TOP_BOTTOM_RIGHT && this.layouts[ 1 ].sink == this && calcClassSize( this, layout ) == 1 )
|
|
|
|
+ return Color.LIGHT_GRAY;
|
|
|
|
+ if( layout == LayoutType.TOP_BOTTOM_RIGHT && this.layouts[ 1 ].sink == this )
|
|
|
|
+ return this.layouts[ 1 ].color;
|
|
|
|
+ else if( layout == LayoutType.TOP_BOTTOM_RIGHT )
|
|
|
|
+ return this.layouts[ 1 ].sink.getClassColor( layout );
|
|
|
|
+ if( layout == LayoutType.BOTTOM_TOP_LEFT && this.layouts[ 2 ].sink == this && calcClassSize( this, layout ) == 1 )
|
|
|
|
+ return Color.LIGHT_GRAY;
|
|
|
|
+ if( layout == LayoutType.BOTTOM_TOP_LEFT && this.layouts[ 2 ].sink == this )
|
|
|
|
+ return this.layouts[ 2 ].color;
|
|
|
|
+ else if( layout == LayoutType.BOTTOM_TOP_LEFT )
|
|
|
|
+ return this.layouts[ 2 ].sink.getClassColor( layout );
|
|
|
|
+ if( layout == LayoutType.BOTTOM_TOP_RIGHT && this.layouts[ 3 ].sink == this && calcClassSize( this, layout ) == 1 )
|
|
|
|
+ return Color.LIGHT_GRAY;
|
|
|
|
+ if( layout == LayoutType.BOTTOM_TOP_RIGHT && this.layouts[ 3 ].sink == this )
|
|
|
|
+ return this.layouts[ 3 ].color;
|
|
|
|
+ else if( layout == LayoutType.BOTTOM_TOP_RIGHT )
|
|
|
|
+ return this.layouts[ 3 ].sink.getClassColor( layout );
|
|
|
|
+ if( layout == LayoutType.COMBINED )
|
|
|
|
+ return combined.color;
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public Color getColor( LayoutType layout )
|
|
public Color getColor( LayoutType layout )
|
|
{
|
|
{
|
|
|
|
+ if( layout == LayoutType.TOP_BOTTOM_LEFT && this.layouts[ 0 ].root == this && this.layouts[ 0 ].align == this )
|
|
|
|
+ return Color.LIGHT_GRAY;
|
|
|
|
+ if( layout == LayoutType.TOP_BOTTOM_LEFT && this.layouts[ 0 ].root != this )
|
|
|
|
+ return this.layouts[ 0 ].root.getColor( layout );
|
|
if( layout == LayoutType.TOP_BOTTOM_LEFT )
|
|
if( layout == LayoutType.TOP_BOTTOM_LEFT )
|
|
return this.layouts[ 0 ].color;
|
|
return this.layouts[ 0 ].color;
|
|
|
|
+ if( layout == LayoutType.TOP_BOTTOM_RIGHT && this.layouts[ 1 ].root == this && this.layouts[ 1 ].align == this )
|
|
|
|
+ return Color.LIGHT_GRAY;
|
|
|
|
+ if( layout == LayoutType.TOP_BOTTOM_RIGHT && this.layouts[ 1 ].root != this )
|
|
|
|
+ return this.layouts[ 1 ].root.getColor( layout );
|
|
if( layout == LayoutType.TOP_BOTTOM_RIGHT )
|
|
if( layout == LayoutType.TOP_BOTTOM_RIGHT )
|
|
return this.layouts[ 1 ].color;
|
|
return this.layouts[ 1 ].color;
|
|
|
|
+ if( layout == LayoutType.BOTTOM_TOP_LEFT && this.layouts[ 2 ].root == this && this.layouts[ 2 ].align == this )
|
|
|
|
+ return Color.LIGHT_GRAY;
|
|
|
|
+ if( layout == LayoutType.BOTTOM_TOP_LEFT && this.layouts[ 2 ].root != this )
|
|
|
|
+ return this.layouts[ 2 ].root.getColor( layout );
|
|
if( layout == LayoutType.BOTTOM_TOP_LEFT )
|
|
if( layout == LayoutType.BOTTOM_TOP_LEFT )
|
|
return this.layouts[ 2 ].color;
|
|
return this.layouts[ 2 ].color;
|
|
|
|
+ if( layout == LayoutType.BOTTOM_TOP_RIGHT && this.layouts[ 3 ].root == this && this.layouts[ 3 ].align == this )
|
|
|
|
+ return Color.LIGHT_GRAY;
|
|
|
|
+ if( layout == LayoutType.BOTTOM_TOP_RIGHT && this.layouts[ 3 ].root != this )
|
|
|
|
+ return this.layouts[ 3 ].root.getColor( layout );
|
|
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 )
|
|
if( layout == LayoutType.COMBINED )
|