@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
try {
view.getViewState().salvaDados();
Command salvarCommand = new SalvarArvoresCommand(pView, "Salvando o projeto...");
salvarCommand.execute();
} catch (Exception ex) {
ErrorInfo info = new ErrorInfo("Erro", ex.getMessage(), null, "category", ex, Level.SEVERE, null);
JXErrorPane.showDialog(view, info);
}
}
});
view.getBtnNovaArvore().addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
view.getViewState().novaArvore();
cenarioTM.addLinha();
GUIUtils.selectAndScroll(view.getGrid(), view.getGrid().getRowCount() - 1);
}
});
view.getBtnRemoverArvore().addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
removeArvore();
}
});
view.getBtnCancelar().addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
view.getViewState().cancela();
}
});
view.getBtnImportar().addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
try {
Command importarArvores = new ImportarArvoresCommand(pView, "Gravando dados importados...");
importarArvores.execute();
} catch (Exception ex) {
ErrorInfo info = new ErrorInfo("Erro", ex.getMessage(), null, "category", ex, Level.SEVERE, null);
JXErrorPane.showDialog(view, info);
}
}