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
}