Package presenter.command

Examples of presenter.command.Command


            @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);
                }
            }
View Full Code Here


    public void removeArvore() {
        if (JOptionPane.showConfirmDialog(null, "Deseja realmente remover "
                + "a(s) árvore(s): " + Arrays.toString(view.getArvoresSelecionadas().toArray())
                + " ?", "Remover árvore(s)", JOptionPane.OK_CANCEL_OPTION) == 0) {
            try {
                Command removerArvores = new RemoverArvoresCommand(view, "Removendo árvores...");
                removerArvores.execute();
            } catch (Exception e) {
                System.err.println("Erro ao atualizar " + e.getMessage());
            }
        }
    }
View Full Code Here

        m1.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                try {
                    Command adicionaColuna = new AdicionarColunaCommand(view, "Adicionando coluna...");
                    adicionaColuna.execute();
                } catch (Exception ex) {
                    ErrorInfo info = new ErrorInfo("Erro", ex.getMessage(), null, "category", ex, Level.SEVERE, null);
                    JXErrorPane.showDialog(view, info);
                }
            }
        });


        JMenuItem m2 = new JMenuItem("Remover");
        m2.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                if (JOptionPane.showConfirmDialog(null, "Deseja realmente remover a coluna?", "Remover coluna", JOptionPane.OK_CANCEL_OPTION) == 0) {
                    try {
                        Command removerColuna = new RemoverColunaArvoreCommand(view, "Removendo coluna...");
                        removerColuna.execute();
                    } catch (Exception ex) {
                        ErrorInfo info = new ErrorInfo("Erro", ex.getMessage(), null, "category", ex, Level.SEVERE, null);
                        JXErrorPane.showDialog(view, info);
                    }
                }
View Full Code Here

TOP

Related Classes of presenter.command.Command

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.