summaryrefslogtreecommitdiff
path: root/src/cuchaz/enigma/gui/Gui.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/cuchaz/enigma/gui/Gui.java')
-rw-r--r--src/cuchaz/enigma/gui/Gui.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/cuchaz/enigma/gui/Gui.java b/src/cuchaz/enigma/gui/Gui.java
index 914359b..dd82b8e 100644
--- a/src/cuchaz/enigma/gui/Gui.java
+++ b/src/cuchaz/enigma/gui/Gui.java
@@ -54,6 +54,7 @@ import javax.swing.JTextField;
54import javax.swing.JTree; 54import javax.swing.JTree;
55import javax.swing.KeyStroke; 55import javax.swing.KeyStroke;
56import javax.swing.ListSelectionModel; 56import javax.swing.ListSelectionModel;
57import javax.swing.SwingUtilities;
57import javax.swing.Timer; 58import javax.swing.Timer;
58import javax.swing.WindowConstants; 59import javax.swing.WindowConstants;
59import javax.swing.event.CaretEvent; 60import javax.swing.event.CaretEvent;
@@ -776,9 +777,16 @@ public class Gui
776 // make sure the token is visible in the scroll window 777 // make sure the token is visible in the scroll window
777 Rectangle start = m_editor.modelToView( token.start ); 778 Rectangle start = m_editor.modelToView( token.start );
778 Rectangle end = m_editor.modelToView( token.end ); 779 Rectangle end = m_editor.modelToView( token.end );
779 Rectangle show = start.union( end ); 780 final Rectangle show = start.union( end );
780 show.grow( 0, start.height*6 ); 781 show.grow( start.width*10, start.height*6 );
781 m_editor.scrollRectToVisible( show ); 782 SwingUtilities.invokeLater( new Runnable( )
783 {
784 @Override
785 public void run( )
786 {
787 m_editor.scrollRectToVisible( show );
788 }
789 } );
782 } 790 }
783 catch( BadLocationException ex ) 791 catch( BadLocationException ex )
784 { 792 {
@@ -818,6 +826,8 @@ public class Gui
818 } 826 }
819 } ); 827 } );
820 timer.start(); 828 timer.start();
829
830 redraw();
821 } 831 }
822 832
823 public void showTokens( Collection<Token> tokens ) 833 public void showTokens( Collection<Token> tokens )