Ver código fonte

fixed layout display option

Kolja Strohm 6 anos atrás
pai
commit
60318da37b
2 arquivos alterados com 31 adições e 16 exclusões
  1. 1 1
      src/main/Main.java
  2. 30 15
      src/view/MainView.java

+ 1 - 1
src/main/Main.java

@@ -17,7 +17,7 @@ public class Main {
      * @param args the command line arguments, currently not in use
      */
     public static void main(String[] args) {
-        Reader r = new Reader( "papergraph.json" );
+        Reader r = new Reader( "logo.json" );
         LayeredGraphNode graph = r.readInputGraph();
         SimpleNodePlacement.placeNodes( graph );
         new MainView( graph );

+ 30 - 15
src/view/MainView.java

@@ -686,28 +686,43 @@ public class MainView {
                 pl.remove( bottomLeft );
                 pl.remove( bottomRight );
                 pl.remove( combined );
-                switch( algorithm.getAlgorithmState() )
+                layne.remove( combined );
+                if( optionsDialog.getLayerDisplayOption() == 0)
                 {
-                case CONFLICT_DETECTION:
+                	pl.setLayout( grout );
                     pl.add( topLeft );
-                    break;
-                case LEFTMOST_UPPER:
-                    pl.add( topLeft );
-                    break;
-                case RIGHTMOST_UPPER:
                     pl.add( topRight );
-                    break;
-                case LEFTMOST_LOWER:
                     pl.add( bottomLeft );
-                    break;
-                case RIGHTMOST_LOWER:
                     pl.add( bottomRight );
-                    break;
-                case COMBINE:
-                    pl.add( combined );
-                    break;
+                	layne.add( combined, 0 );
+                }
+                else
+                {
+                    pl.setLayout( new BorderLayout() );
+                    switch( algorithm.getAlgorithmState() )
+	                {
+	                case CONFLICT_DETECTION:
+	                    pl.add( topLeft );
+	                    break;
+	                case LEFTMOST_UPPER:
+	                    pl.add( topLeft );
+	                    break;
+	                case RIGHTMOST_UPPER:
+	                    pl.add( topRight );
+	                    break;
+	                case LEFTMOST_LOWER:
+	                    pl.add( bottomLeft );
+	                    break;
+	                case RIGHTMOST_LOWER:
+	                    pl.add( bottomRight );
+	                    break;
+	                case COMBINE:
+	                    pl.add( combined );
+	                    break;
+	                }
                 }
                 pl.revalidate();
+                layne.revalidate();
                 for( ComponentListener l : frame.getComponentListeners() )
                     l.componentResized( new ComponentEvent( frame, 0 ) );
             }