📄 invariantdialog.java
字号:
package pipe.modules.predatorInvariantAnalysis;
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
/**
* Title:
* Description:
* Copyright: Copyright (c) 2001
* Company:
* @author
* @version 1.0
*/
public class InvariantDialog extends JDialog implements ActionListener{
JPanel panel1 = new JPanel();
JLabel jLabel1 = new JLabel();
JLabel jLabel2 = new JLabel();
JScrollPane jScrollPane1 = new JScrollPane();
JLabel jLabel3 = new JLabel();
JScrollPane jScrollPane2 = new JScrollPane();
JTextArea pInvarTextArea = new JTextArea();
JTextArea tInvarTextArea = new JTextArea();
JLabel jLabel4 = new JLabel();
JTextArea pEquTextArea = new JTextArea();
JScrollPane jScrollPane3 = new JScrollPane();
JLabel jLabel5 = new JLabel();
JTextArea boundTextArea = new JTextArea();
JScrollPane jScrollPane4 = new JScrollPane();
JButton jButton1 = new JButton();
GridBagLayout gridBagLayout1 = new GridBagLayout();
public InvariantDialog(
String tinvarString,
String pinvarString,
String pinvarEquation,
String covered){
//super (frame, "Invariant Analysis", true);
setModal(false);//true);
setTitle("Invariant Analysis Module");
enableEvents(AWTEvent.WINDOW_EVENT_MASK);
try {
jbInit();
//pack();
}
catch(Exception ex){
ex.printStackTrace();
}
//now set up the text area text
pInvarTextArea.setText(pinvarString);
tInvarTextArea.setText(tinvarString);
pEquTextArea.setText(pinvarEquation);
boundTextArea.setText(covered);
pInvarTextArea.setEditable(false);
tInvarTextArea.setEditable(false);
pEquTextArea.setEditable(false);
boundTextArea.setEditable(false);
setSize(500,500);
}
public InvariantDialog(Frame frame, String title, boolean modal) {
super(frame, title, modal);
try {
jbInit();
pack();
}
catch(Exception ex) {
ex.printStackTrace();
}
}
public InvariantDialog() {
this(null, "", false);
}
void jbInit() throws Exception {
panel1.setLayout(gridBagLayout1);
jLabel1.setText("Invariant Analysis Results for the current Petri Net");
jLabel2.setText("P Invariants");
jLabel3.setText("T Invariants");
jLabel4.setText("P Invariant Equations");
jLabel5.setText("Boundedness and Liveness");
jButton1.setText("Ok");
jButton1.addActionListener(this);/*new java.awt.event.ActionListener() {
public void actionPerformed(ActionEvent e) {
}
});*/
pInvarTextArea.setToolTipText("P invariants for the current petri net");
getContentPane().add(panel1, BorderLayout.CENTER);
panel1.add(jLabel1, new GridBagConstraints(0, 0, 2, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(7, 25, 0, 46), 12, 12));
panel1.add(jScrollPane1, new GridBagConstraints(0, 2, 1, 1, 1.0, 1.0
,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(10, 25, 0, 0), 132, 36));
panel1.add(jLabel4, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(17, 25, 0, 17), -1, 15));
panel1.add(jScrollPane3, new GridBagConstraints(0, 4, 1, 1, 1.0, 1.0
,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(10, 25, 0, 0), 132, 36));
panel1.add(jLabel2, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 25, 0, 30), 38, 2));
panel1.add(jButton1, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0
,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(7, 46, 27, 40), 23, 3));
panel1.add(jScrollPane2, new GridBagConstraints(1, 2, 1, 1, 1.0, 1.0
,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(11, 12, 0, 46), 148, 35));
panel1.add(jLabel5, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(16, 12, 0, 40), 1, 16));
panel1.add(jLabel3, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 12, 0, 92), 39, 2));
panel1.add(jScrollPane4, new GridBagConstraints(1, 4, 1, 1, 1.0, 1.0
,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(8, 14, 0, 40), 148, 38));
jScrollPane4.getViewport().add(boundTextArea, null);
jScrollPane2.getViewport().add(tInvarTextArea, null);
jScrollPane3.getViewport().add(pEquTextArea, null);
jScrollPane1.getViewport().add(pInvarTextArea, null);
}
protected void processWindowEvent(WindowEvent e){
if(e.getID()==WindowEvent.WINDOW_CLOSING){
cancel();
}
super.processWindowEvent(e);
}
protected void cancel(){
dispose();
}
public void actionPerformed(ActionEvent e){
//System.out.println("An action has been performed");
if (e.getSource() == jButton1) {
cancel();
}
}
// void jButton1_actionPerformed(ActionEvent e) {
// processWindowEvent(WindowEvent.WINDOW_CLOSING);
//hide();
// }
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -