Blame view
BRIC/src/GUI/BehaviorGUI.java
3.85 KB
eeb5cac08
![]() |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
package GUI; import LOGIC.Contract; import LOGIC.Internacional; public class BehaviorGUI extends javax.swing.JFrame { public BehaviorGUI(Internacional inter, String b, Contract c) { //inicialização da tela this.name = name; this.c = c; initComponents(); ContractGUI.aberto = true; this.b = b; this.setTitle("Behaviour"); //seta o título da tela texto.setText(c.getBehavior()); //seta o que estará no texto de b.csp concluir.setText(inter.retornarMensagem("COD0025")); } String b; static String resultado; String name;//variável que pegará o resultado do checker... Contract c = new Contract(); @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { concluir = new javax.swing.JButton(); jScrollPane1 = new javax.swing.JScrollPane(); texto = new javax.swing.JTextArea(); setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); setMinimumSize(new java.awt.Dimension(450, 400)); addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosed(java.awt.event.WindowEvent evt) { formWindowClosed(evt); } }); concluir.setText("concluir"); concluir.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { concluirActionPerformed(evt); } }); texto.setColumns(20); texto.setRows(5); jScrollPane1.setViewportView(texto); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(0, 0, Short.MAX_VALUE) .addComponent(concluir)) .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 420, Short.MAX_VALUE)) .addContainerGap()) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addComponent(concluir) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); }// </editor-fold>//GEN-END:initComponents private void concluirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_concluirActionPerformed ContractGUI.aberto = false; //boolean que serve para evitar a abertura de mais de uma tela b = texto.getText(); c.setBehavior(b); //b = b; //salva o que existe na caixa de texto numa variável this.dispose(); }//GEN-LAST:event_concluirActionPerformed private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed ContractGUI.aberto = false; }//GEN-LAST:event_formWindowClosed // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JButton concluir; private javax.swing.JScrollPane jScrollPane1; private javax.swing.JTextArea texto; // End of variables declaration//GEN-END:variables } |