Package view.helpers

Examples of view.helpers.IconNode


                if (e.getClickCount() == 1) {
                    switch (e.getButton()) {
                        case MouseEvent.BUTTON1: {
                            if (treeNavigator.getLastSelectedPathComponent() != null) {
                                String noSelecionado = ((IconNode) treeNavigator.getLastSelectedPathComponent()).toString();
                                IconNode no = ((IconNode) treeNavigator.getLastSelectedPathComponent());

                                if (noSelecionado.equals("Projeto")) {
                                    ProjetoPresenter projetoPresenter = new ProjetoPresenter(Main.this);
                                    projetoPresenter.setStrategy(new EdicaoProjeto(projeto.getId(), projetoPresenter.getView()));
                                    activePanel(projetoPresenter.getView());
                                } else if ((((ImageIcon) no.getIcon()).getDescription().contains("cenario2.png"))) {
                                    CenarioVolume cenario = projeto.getCenarioById(no.getId());
                                    CenarioVolumePresenter presenterEditaCenario = new CenarioVolumePresenter(Main.this);
                                    removeFrameVolume();
                                    presenterEditaCenario.setStrategy(new EdicaoCenario(projeto.getId(), cenario.getId(), presenterEditaCenario.getView()));
                                    activePanel(presenterEditaCenario.getView());
                                } else {
View Full Code Here


        btnIndLocalNovoCenario.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                iLocal++;
                IconNode node = new IconNode("Cenário " + iLocal, true, new ImageIcon(Configuracao.getPath() + "images/cenario4.png"), IconNode.CENARIO_INDICELOCAL);
                addNode("Índice de Local", node);
            }
        });

        indLocalBand.addCommandButton(btnIndLocalNovoCenario, RibbonElementPriority.LOW);
View Full Code Here

    private void createStatusBar() {
        stbMain.add(new JLabel("Pronto"), JXStatusBar.Constraint.ResizeBehavior.FILL);
    }

    private void addNode(String nodeName, IconNode icFilho) {
        IconNode icRoot = (IconNode) treeNavigator.getModel().getRoot();
        for (int i = 0; i < icRoot.getChildCount(); i++) {
            IconNode icNode = ((IconNode) icRoot.getChildAt(i));
            if (icNode.getUserObject().toString().equals(nodeName)) {
                icNode.add(icFilho);
                treeNavigator.updateUI();
                treeNavigator.expandAll();
            }
        }
    }
View Full Code Here

        view.getDesktop().closeAll();
    }

    @Override
    public void updateTreeModel() {
        IconNode projetoNode = new IconNode("", false, null, 0);
        DefaultTreeModel model = new DefaultTreeModel(projetoNode);

        view.getTreeNavigator().setModel(model);
        view.getTreeNavigator().updateUI();
    }
View Full Code Here

        view.getTreeNavigator().expandAll();
    }

    @Override
    public void updateTreeModel() {
        IconNode projetoNode = new IconNode("Projeto", true, new ImageIcon(Configuracao.getPath() + "images/projeto1.png"), IconNode.PROJETO);
        DefaultTreeModel model = new DefaultTreeModel(projetoNode);

        IconNode volumeNode = new IconNode("Volume", true, new ImageIcon(Configuracao.getPath() + "images/cenario.png"), IconNode.NONE);

        Iterator<CenarioVolume> itCenariosVolume = view.getProjeto().getIteratorCenario();
        while (itCenariosVolume.hasNext()) {
            CenarioVolume cenarioVolume = itCenariosVolume.next();
            IconNode cenarioNode = new IconNode(cenarioVolume.getNome(), true, new ImageIcon(Configuracao.getPath() + "images/cenario2.png"), IconNode.CENARIO_VOLUME, cenarioVolume.getId());
            IconNode arvoresNode = new IconNode("Árvores", false, new ImageIcon(Configuracao.getPath() + "images/arvores.png"), IconNode.ARVORES, cenarioVolume.getId());
            cenarioNode.add(arvoresNode);
            volumeNode.add(cenarioNode);
        }

        IconNode indiceLocalNode = new IconNode("Índice de Local", true, new ImageIcon(Configuracao.getPath() + "images/indice.png"), IconNode.NONE);

        ((IconNode) model.getRoot()).setAllowsChildren(true);
        ((IconNode) model.getRoot()).add(volumeNode);
        ((IconNode) model.getRoot()).add(indiceLocalNode);
View Full Code Here

TOP

Related Classes of view.helpers.IconNode

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.