br.uerj.petrinetanalyzer.gui.listener
Class MenuActionListener

java.lang.Object
  extended by br.uerj.petrinetanalyzer.gui.listener.AbstractActionListener
      extended by br.uerj.petrinetanalyzer.gui.listener.MenuActionListener
All Implemented Interfaces:
IntfLanguageConstants, IntfMainConstants

public class MenuActionListener
extends AbstractActionListener
implements IntfLanguageConstants, IntfMainConstants

Define a Janela Principal para o Editor/Simulador de Redes de Petri Toda a parte gráfica

Author:
Felipe Lino
Data: 04/01/2007
Atualizado: 20/04/2007

Field Summary
private  java.io.File file
           
 
Fields inherited from class br.uerj.petrinetanalyzer.gui.listener.AbstractActionListener
modo, sub_modo, window
 
Fields inherited from interface br.uerj.petrinetanalyzer.gui.interfaces.IntfLanguageConstants
ABOUT_MSG_01, ABOUT_MSG_01_KEY, ABOUT_MSG_02, ABOUT_MSG_02_KEY, ABOUT_MSG_03, ABOUT_MSG_03_KEY, boxExponencialKey, boxNormalKey, boxTransCurvaDensidadeKey, boxTransDensidadeExponencial, boxTransDensidadeNormal, boxTransDensidadeUniforme, boxUniformeKey, btEditArc, btEditArcKey, btEditDelete, btEditDeleteKey, btEditLabel, btEditLabelKey, btEditPlace, btEditPlaceKey, btEditSeta, btEditSetaKey, btEditTrans, btEditTransKey, btSimBack, btSimBackKey, btSimStart, btSimStartKey, btSimStop, btSimStopKey, ERROR_MSG_01, ERROR_MSG_01_KEY, ERROR_MSG_02, ERROR_MSG_02_KEY, ERROR_MSG_03, ERROR_MSG_03_KEY, ERROR_MSG_04, ERROR_MSG_04_KEY, fieldArcPlaceKey, fieldArcTransKey, fieldPlaceNomeKey, fieldStatusKey, fieldTransNameKey, fieldTransSeftKey, fieldTransSlftKey, lbArcInfo, lbArcInfoKey, lbArcPeso, lbArcPesoKey, lbArcPlace, lbArcPlaceKey, lbArcTrans, lbArcTransKey, lbPlaceFichas, lbPlaceFichasKey, lbPlaceInfo, lbPlaceInfoKey, lbPlaceName, lbPlaceNameKey, lbTransCurvaDensidade, lbTransCurvaDensidadeKey, lbTransInfo, lbTransInfoKey, lbTransName, lbTransNameKey, lbTransSeft, lbTransSeftKey, lbTransSlft, lbTransSlftKey, m1English, m1EnglishKey, m1Exit, m1ExitKey, m1Language, m1LanguageKey, m1New, m1NewKey, m1Open, m1OpenKey, m1Portugues, m1PortuguesKey, m1Save, m1SaveAs, m1SaveAsKey, m1SaveKey, m2Back, m2BackKey, m2Start, m2StartKey, m2Stop, m2StopKey, m3Geral, m3GeralKey, m4About, m4AboutKey, menu1File, menu1FileKey, menu2Simulator, menu2SimulatorKey, menu3Analisys, menu3AnalisysKey, menu4About, menu4AboutKey, menuBarKey, spinnerArcPesoKey, spinnerPlaceFichasKey, STATUS_MSG_01, STATUS_MSG_01_KEY, STATUS_MSG_02, STATUS_MSG_02_KEY, STATUS_MSG_03, STATUS_MSG_03_KEY, STATUS_MSG_04, STATUS_MSG_04_KEY, STATUS_MSG_05, STATUS_MSG_05_KEY, STATUS_MSG_06, STATUS_MSG_06_KEY, STATUS_MSG_07, STATUS_MSG_07_KEY, STATUS_MSG_08, STATUS_MSG_08_KEY, STATUS_MSG_09, STATUS_MSG_09_KEY, STATUS_MSG_10, STATUS_MSG_10_KEY, STATUS_MSG_11, STATUS_MSG_11_KEY, STATUS_MSG_12, STATUS_MSG_12_KEY, STATUS_MSG_13, STATUS_MSG_13_KEY, STATUS_MSG_14, STATUS_MSG_14_KEY, STATUS_MSG_15, STATUS_MSG_15_KEY, STATUS_MSG_16, STATUS_MSG_16_KEY, STATUS_MSG_17, STATUS_MSG_17_KEY, STATUS_MSG_18, STATUS_MSG_18_KEY, STATUS_MSG_19, STATUS_MSG_19_KEY, title, titleKey
 
Fields inherited from interface br.uerj.petrinetanalyzer.gui.interfaces.IntfMainConstants
DRAW_ARC, EDIT_ARC, EDIT_DELETE, EDIT_LABEL, EDIT_LUGAR, EDIT_MOUSE, EDIT_TRANS, FILE_SAVE, MODO_ANALISE, MODO_EDICAO, MODO_SIMULACAO, PROP_LANGUAGE_FILE_DEFAULT, PROP_LANGUAGE_FILE_ENGLISH, PROP_LANGUAGE_FILE_PORT_BR, SIM_BACK, SIM_START, SIM_STOP
 
Constructor Summary
MenuActionListener(MainWindow w)
          Construtor.
 
Method Summary
 void analyzerPetriNet()
          Trata evento de Análise das Propriedades da Rede de Petri
private  void newFile()
          Limpa a janela de edição e prepara para começar uma nova rede de petri.
private  void openFile()
          Lê o arquivo em formato XML e o converte para Objeto rede de Petri.
private  void openFileWindow()
          Cria janela de diálogo para abrir o arquivo.
 void performed(javax.swing.JMenuItem item)
          Através do nome do objeto verifica que ação deve tomar.
private  void saveAsWindow()
          Cria e trata a Janela de diálogo para salvar o arquivo de rede de petri.
 void saveOnly()
          Salva o arquivo se ele já existir, ou abre caixa de diálogo caso ele não exista.
 void showAboutMessage()
          Exibe Mensagem Sobre na Tela
private  void showErrorCastOpenFile(java.lang.ClassCastException exc)
          Exibe mensagem na tela informando falha ao tentar converter o arquivo.
private  void showErrorOpenFile(java.lang.Exception exc)
          Exibe mensagem de erro na tela informando falha ao tentar ler o arquivo.
private  void showErrorSaveFile(java.io.IOException exc)
          Exibição de mensagem de erro caso não consiga salvar o arquivo.
private  void showSucessOpenFile()
          Exibe mensagem de sucesso na barra de satus informando que o arquivo foi aberto com sucesso.
private  void showSucessSaveFile()
          Exibe na barra de status uma mensagem informando que o arquivo foi salvo com sucesso.
private  void writeFile()
          Grava o arquivo de rede de petri no formato XML.
 
Methods inherited from class br.uerj.petrinetanalyzer.gui.listener.AbstractActionListener
cleanInfoPanel, disableEditButton, disableSimulationButton, enableEditButton, enableSimulationButton, getWindow, setWindow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

file

private java.io.File file
Constructor Detail

MenuActionListener

public MenuActionListener(MainWindow w)
Construtor.

Parameters:
w - Janela do Programa principal
Method Detail

performed

public void performed(javax.swing.JMenuItem item)
Através do nome do objeto verifica que ação deve tomar.

Parameters:
item - instancia de JMenuItem

saveAsWindow

private void saveAsWindow()
Cria e trata a Janela de diálogo para salvar o arquivo de rede de petri.


saveOnly

public void saveOnly()
Salva o arquivo se ele já existir, ou abre caixa de diálogo caso ele não exista.


writeFile

private void writeFile()
                throws java.io.IOException
Grava o arquivo de rede de petri no formato XML.

Throws:
java.io.IOException

showErrorSaveFile

private void showErrorSaveFile(java.io.IOException exc)
Exibição de mensagem de erro caso não consiga salvar o arquivo.

Parameters:
exc - Exceção IOException

showSucessSaveFile

private void showSucessSaveFile()
Exibe na barra de status uma mensagem informando que o arquivo foi salvo com sucesso.


openFileWindow

private void openFileWindow()
Cria janela de diálogo para abrir o arquivo.


openFile

private void openFile()
               throws java.io.IOException,
                      java.lang.ClassCastException
Lê o arquivo em formato XML e o converte para Objeto rede de Petri.

Throws:
java.io.IOException
java.lang.ClassCastException

showSucessOpenFile

private void showSucessOpenFile()
Exibe mensagem de sucesso na barra de satus informando que o arquivo foi aberto com sucesso.


showErrorOpenFile

private void showErrorOpenFile(java.lang.Exception exc)
Exibe mensagem de erro na tela informando falha ao tentar ler o arquivo.

Parameters:
exc - Exceção

showErrorCastOpenFile

private void showErrorCastOpenFile(java.lang.ClassCastException exc)
Exibe mensagem na tela informando falha ao tentar converter o arquivo.

Parameters:
exc - Exceção

newFile

private void newFile()
Limpa a janela de edição e prepara para começar uma nova rede de petri.


analyzerPetriNet

public void analyzerPetriNet()
Trata evento de Análise das Propriedades da Rede de Petri


showAboutMessage

public void showAboutMessage()
Exibe Mensagem Sobre na Tela