Browse Source

ausgewählte knoten besser sichtbar

Kolja Strohm 7 years ago
parent
commit
9c52786a75
1 changed files with 9 additions and 3 deletions
  1. 9 3
      src/view/NodeView.java

+ 9 - 3
src/view/NodeView.java

@@ -80,9 +80,10 @@ public class NodeView extends JPanel {
 			else
 				g2.fillRect( 0, 0, (int)model.getWidth( layout )-1, (int)model.getHeight( layout )-1 );
 		}
-		if( model.isSelected( layout ) )
+		boolean selected = model.isSelected( layout );
+		if( selected )
 		{
-			g.setColor( Color.GRAY );
+			g.setColor( Color.BLACK );
 			g.fillRect( 0, 0, (int)model.getWidth( layout )-1, (int)model.getHeight( layout )-1 );
 		}
 		Border linebor = BorderFactory.createLineBorder(model.getColor( layout ), 5);
@@ -92,7 +93,12 @@ public class NodeView extends JPanel {
 		{
     		g.setColor( model.getRoot( layout ).getSink( layout ).getColor( layout ) );
     		if( model.getContainedNodes().size() == 0 )
-    		    g.fillOval( (int)model.getWidth( layout ) / 2 - (int)model.getWidth( layout ) / 3, (int)model.getHeight( layout ) / 2 - (int)model.getHeight( layout ) / 3, (int)model.getWidth( layout ) / 3 * 2, (int)model.getHeight( layout ) / 3 * 2 );
+    		{
+    		    if( selected )
+    		        g.fillOval( (int)model.getWidth( layout ) / 2 - (int)model.getWidth( layout ) / 5, (int)model.getHeight( layout ) / 2 - (int)model.getHeight( layout ) / 5, (int)model.getWidth( layout ) / 5 * 2, (int)model.getHeight( layout ) / 5 * 2 );
+    		    else
+    		        g.fillOval( (int)model.getWidth( layout ) / 2 - (int)model.getWidth( layout ) / 3, (int)model.getHeight( layout ) / 2 - (int)model.getHeight( layout ) / 3, (int)model.getWidth( layout ) / 3 * 2, (int)model.getHeight( layout ) / 3 * 2 );
+    		}
 		}
 	}
 }