Mercurial > hg > mep
view EndBlockPanel.java @ 48:f3261bd3dd49
Added the functionality of being able to run a post-run batch (windows only) or unix script read from a file specified by the run arguments.
author | Carl Bussey <c.bussey@se10.qmul.ac.uk> |
---|---|
date | Sun, 16 Jun 2013 17:06:25 +0100 |
parents | be66ee2fe9fe |
children |
line wrap: on
line source
/*============================================================================= * File: EndBlockPanel.java * Author: Carl Bussey <c.bussey@se10.qmul.ac.uk> * Created: <2013-06-13 17:32> *============================================================================= */ import java.awt.*; import java.awt.event.*; import javax.swing.*; abstract class EndBlockPanel extends JPanel { /* variables */ protected JButton continueButton; protected String continueButtonText; protected JLabel message; protected Experiment exp; protected StringBuffer sb; /* accessors */ public JButton getContinueButton() { return continueButton; } /* constructor */ public EndBlockPanel(Experiment e) { exp = e; sb = new StringBuffer(); } public void updateMessageDisplay() { message.setText(formatMessage()); } abstract protected String formatMessage(); public void addContinueButtonListener(ActionListener al) { continueButton.addActionListener(al); } public void setUp(String buttonText){ continueButton = new JButton(buttonText); JPanel continuePane = new JPanel(); continuePane.add(continueButton); message = new JLabel(); message.setHorizontalAlignment(JLabel.CENTER); updateMessageDisplay(); JPanel messagePane = new JPanel(new FlowLayout(FlowLayout.CENTER)); messagePane.setBorder(BorderFactory.createEmptyBorder(10,10,10,10)); messagePane.add(message); this.setLayout(new BorderLayout()); this.add(messagePane, BorderLayout.CENTER); this.add(continuePane, BorderLayout.SOUTH); } }