Pārlūkot izejas kodu

Merge branch 'master' of https://koljastrohm-games.com:3000/GraphDrawer/NodeShuffler

Kolja Strohm 6 gadi atpakaļ
vecāks
revīzija
7e4e32e3eb
5 mainītis faili ar 14 papildinājumiem un 10 dzēšanām
  1. 3 0
      README.md
  2. 1 2
      src/bk/BlockCalc.java
  3. 2 1
      src/bk/Combine.java
  4. 1 0
      src/bk/ExtremalLayoutCalc.java
  5. 7 7
      src/view/MainView.java

+ 3 - 0
README.md

@@ -0,0 +1,3 @@
+# Readme
+
+Under construction

+ 1 - 2
src/bk/BlockCalc.java

@@ -426,8 +426,7 @@ public class BlockCalc implements AlgorithmStage {
         {
             String info = "Subgraph of " + graph.getContainedLayers().get( calcLayerIndex() ).get( calcNodeIndex( nodeIndex ) ).getName() + ":\n";
             String tmp = subgraphAlgs.get( calcLayerIndex() ).get( calcNodeIndex( nodeIndex ) ).getDebugString();
-            tmp = tmp.replaceAll( "\n", "\n " );
-            info += " " + tmp;
+            info += tmp;
             return info;
         }
         return "";

+ 2 - 1
src/bk/Combine.java

@@ -418,7 +418,8 @@ public class Combine implements AlgorithmStage {
     @Override
     public String getDebugString()
     {
-        String info = "| Node |  x  | x TL | x TR | x BL | x BR |\n";
+        String info = "| Node |  x  | x LU | x RU | x LL | x RL |\n";
+        info +=       "|------|-----|------|------|------|------|\n";
         for( LayeredGraphNode n : graph.getContainedNodes() )
         {
             info += "|" + TextLayoutHelper.strToLen( n.getName(), 6 ) + 

+ 1 - 0
src/bk/ExtremalLayoutCalc.java

@@ -136,6 +136,7 @@ public class ExtremalLayoutCalc implements AlgorithmStage {
     public String getDebugString()
     {
         String info = "| Node | Shift | Sink | Root | Align |  x  |  xDef  |\n";
+        info +=       "|------|-------|------|------|-------|-----|--------|\n";
         for( LayeredGraphNode n : graph.getContainedNodes() )
         {
             info += "|" + TextLayoutHelper.strToLen( n.getName(), 6 ) + 

+ 7 - 7
src/view/MainView.java

@@ -287,7 +287,7 @@ public class MainView {
             
         });
         debug = new NiceButton( "debug" );
-        debug.setLocation( 350, 10 );
+        debug.setLocation( 360, 10 );
         debug.setMnemonic( KeyEvent.VK_D );
         debug.setToolTipText( "Show debug info (alt + d)" );
         debug.addActionListener( new ActionListener() {
@@ -299,7 +299,7 @@ public class MainView {
             
         });
         randomGraph = new NiceButton( "random" );
-        randomGraph.setLocation( 350, 60 );
+        randomGraph.setLocation( 360, 60 );
         randomGraph.setMnemonic( KeyEvent.VK_G );
         randomGraph.setToolTipText( "Generate random graph (alt + g)" );
         randomGraph.addActionListener( new ActionListener() {
@@ -599,7 +599,7 @@ public class MainView {
         delayText = new JLabel( "Delay (ms)" );
         delayText.setBounds( 260, 10, 80, 20 );
         delay = new JTextField( "50" );
-        delay.setBounds( 260, 30, 80, 20 );
+        delay.setBounds( 260, 30, 90, 20 );
         delay.getDocument().addDocumentListener( new DocumentListener() {
 
             @Override
@@ -662,7 +662,7 @@ public class MainView {
             
         });
         save = new NiceButton( "save" );
-        save.setLocation( 285, 60 );
+        save.setLocation( 295, 60 );
         save.setMnemonic( KeyEvent.VK_S );
         save.setToolTipText( "Save graph (alt + s)" );
         save.addActionListener( new ActionListener() {
@@ -710,7 +710,7 @@ public class MainView {
         } );
         pseudoTree.setRowHeight(15);
         JScrollPane treeView = new JScrollPane( pseudoTree );
-        treeView.setBounds( 10,  110,  380, 380 );
+        treeView.setBounds( 10,  110,  390, 380 );
         
         JTextArea debugText = new JTextArea();
         debugText.setFont( new Font( "Monospaced", Font.PLAIN, 12 ) );
@@ -746,7 +746,7 @@ public class MainView {
         frame.add( layne );
         JPanel menue = new JPanel();
         menue.setLayout( null );
-        menue.setPreferredSize( new Dimension( 400, 500 ) );
+        menue.setPreferredSize( new Dimension( 410, 500 ) );
         menue.add( stepForward );
         menue.add( stepForwardInto );
         menue.add( stepForwardOut );
@@ -790,7 +790,7 @@ public class MainView {
                 combined.setSize( layne.getWidth() / 3, layne.getHeight() / 3 );
                 combined.setLocation( layne.getWidth() / 3, layne.getHeight() / 3 );
 
-                debugText.setText( algorithm.getDebugString() );
+                debugText.setText( algorithm.getDebugString().trim() );
                 layne.remove( pl );
                 layne.add( pl, 1 );
                 frame.repaint();