RPLViewTab.java
Go to the documentation of this file.
00001 package instruction.gui.tab;
00002 
00003 import instruction.gui.internal.PlanImporterWrapper;
00004 import java.awt.BorderLayout;
00005 import java.awt.Font;
00006 import java.awt.event.ComponentEvent;
00007 import java.awt.event.ComponentListener;
00008 import javax.swing.BorderFactory;
00009 import javax.swing.JScrollPane;
00010 import javax.swing.JTextArea;
00011 import javax.swing.SwingUtilities;
00012 
00013 public class RPLViewTab extends InstructionTab {
00014 
00015         private static final long serialVersionUID = -7985157346179531359L;
00016 
00017         public static String TITLE = "RPL Plan";
00018 
00019         JScrollPane scroll = null;
00020         JTextArea text = null;
00021 
00022         public RPLViewTab () {
00023 
00024                 initialize();
00025         }
00026 
00027         public void initialize() {
00028 
00029                 setLayout( new BorderLayout() );
00030 
00031                 text = new JTextArea();
00032                 text.setEditable( false );
00033                 text.setBorder( BorderFactory.createLoweredBevelBorder() );
00034                 text.setFont( new Font( "DialogInput", Font.PLAIN, 14 ) );
00035                 text.setTabSize( 4 );
00036 
00037                 addComponentListener( new ComponentListener() {
00038 
00039                         public void componentHidden( ComponentEvent e ) {
00040 
00041                                 // TODO Auto-generated method stub
00042 
00043                         }
00044 
00045                         public void componentMoved( ComponentEvent e ) {
00046 
00047                                 // TODO Auto-generated method stub
00048 
00049                         }
00050 
00051                         public void componentResized( ComponentEvent e ) {
00052 
00053                                 // TODO Auto-generated method stub
00054 
00055                         }
00056 
00057                         public void componentShown( ComponentEvent e ) {
00058 
00059                                 String rpl = PlanImporterWrapper.getImporter().getRPLPlan();
00060 
00061                                 if ( rpl == null )
00062                                         text.setText( "No RPL Plan available" );
00063                                 else
00064                                         text.setText( PlanImporterWrapper.getImporter().getRPLPlan() );
00065 
00066                                 SwingUtilities.invokeLater( new Runnable() {
00067                                         public void run() {
00068 
00069                                                 scroll.getVerticalScrollBar().setValue( 0 );
00070                                         }
00071                                 } );
00072                         }
00073 
00074                 } );
00075 
00076                 scroll = new JScrollPane( text );
00077                 add( scroll, BorderLayout.CENTER );
00078         }
00079 
00080 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Friends


comp_ehow
Author(s): Moritz Tenorth, Daniel Nyga
autogenerated on Tue Apr 16 2013 00:18:03