Package org.gephi.appearance.spi

Examples of org.gephi.appearance.spi.TransformerUI


            if (model != null) {
                for (Enumeration<AbstractButton> btns = buttonGroups.getElements(); btns.hasMoreElements();) {
                    AbstractButton btn = btns.nextElement();
                    btn.setVisible(false);
                }
                TransformerUI u = model.getSelectedTransformerUI();
                if (u != null && model.isAttributeTransformerUI(u)) {
                    //Ranking
                    Function selectedColumn = model.getSelectedFunction();
                    if (selectedColumn != null) {
                        if (selectedColumn.isRanking()) {
View Full Code Here


    }

    private void initSelectedTransformerUIs(String elementClass) {
        Map<TransformerCategory, TransformerUI> newMap = new HashMap<TransformerCategory, TransformerUI>();
        for (Function func : elementClass.equals(AppearanceUIController.NODE_ELEMENT) ? appearanceModel.getNodeFunctions() : appearanceModel.getEdgeFunctions()) {
            TransformerUI ui = func.getUI();
            if (ui != null) {
                TransformerCategory cat = ui.getCategory();
                if (!newMap.containsKey(cat)) {
                    newMap.put(cat, ui);
                }

                if (!selectedCategory.containsKey(elementClass)) {
View Full Code Here

    }

    private void refreshSelectedFunctions(String elementClass) {
        Set<Function> functionSet = new HashSet<Function>();
        for (Function func : elementClass.equals(AppearanceUIController.NODE_ELEMENT) ? appearanceModel.getNodeFunctions() : appearanceModel.getEdgeFunctions()) {
            TransformerUI ui = func.getUI();
            if (ui != null) {
                functionSet.add(func);
            }
        }
View Full Code Here

    }

    public Collection<Function> getFunctions() {
        List<Function> functions = new ArrayList<Function>();
        for (Function func : selectedElementClass.equalsIgnoreCase(AppearanceUIController.NODE_ELEMENT) ? appearanceModel.getNodeFunctions() : appearanceModel.getEdgeFunctions()) {
            TransformerUI ui = func.getUI();
            if (ui != null && ui.getDisplayName().equals(getSelectedTransformerUI().getDisplayName())) {
                if (ui.getCategory().equals(selectedCategory.get(selectedElementClass))) {
                    functions.add(func);
                }
            }
        }
        return functions;
View Full Code Here

        }
    }

    public void setSelectedTransformerUI(TransformerUI ui) {
        if (model != null) {
            TransformerUI oldValue = model.getSelectedTransformerUI();
            if (!oldValue.equals(ui)) {
                model.setAutoApply(false);
                model.setSelectedTransformerUI(ui);
                firePropertyChangeEvent(AppearanceUIModelEvent.SELECTED_TRANSFORMER_UI, oldValue, ui);
            }
        }
View Full Code Here

                if (transformerPanel != null) {
                    centerPanel.remove(transformerPanel);
                    transformerPanel = null;
                }
                if (model != null) {
                    TransformerUI ui = model.getSelectedTransformerUI();
                    if (ui != null) {
                        boolean attribute = model.isAttributeTransformerUI(ui);

                        attributePanel.setVisible(attribute);
                        if (attribute) {
                            Function function = model.getSelectedFunction();
                            if (function != null) {
                                ui = function.getUI();
                                transformerPanel = ui.getPanel(function);
                            }
                        } else {
                            Function function = model.getSelectedFunction();
                            transformerPanel = ui.getPanel(function);
                        }

                        if (transformerPanel != null) {
                            transformerPanel.setOpaque(false);
                            centerPanel.add(transformerPanel, BorderLayout.CENTER);
View Full Code Here

        SwingUtilities.invokeLater(new Runnable() {
            @Override
            public void run() {
                final DefaultComboBoxModel comboBoxModel = new DefaultComboBoxModel();
                if (model != null) {
                    TransformerUI ui = model.getSelectedTransformerUI();
                    if (ui != null && model.isAttributeTransformerUI(ui)) {

                        //Ranking
                        Function selectedColumn = model.getSelectedFunction();
                        attibuteBox.removeItemListener(attributeListener);
View Full Code Here

                            titles.put(t.getDisplayName(), t);
                        }

                        for (Map.Entry<String, TransformerUI> entry : titles.entrySet()) {
                            //Build button
                            final TransformerUI value = entry.getValue();
                            Icon icon = entry.getValue().getIcon();
//                        DecoratedIcon decoratedIcon = getDecoratedIcon(icon, t);
//                        JToggleButton btn = new JToggleButton(decoratedIcon);
                            JToggleButton btn = new JToggleButton(icon);
                            btn.setToolTipText(entry.getValue().getDescription());
View Full Code Here

                    for (TransformerCategory c : controller.getCategories(elmtType)) {
                        ButtonGroup g = buttonGroups.get(index);

                        boolean active = model.getSelectedElementClass().equals(elmtType) && model.getSelectedCategory().equals(c);
                        g.clearSelection();
                        TransformerUI t = model.getSelectedTransformerUI();

                        for (Enumeration<AbstractButton> btns = g.getElements(); btns.hasMoreElements();) {
                            AbstractButton btn = btns.nextElement();
                            btn.setVisible(active);
                            if (t != null && btn.getName().equals(t.getDisplayName())) {
                                g.setSelected(btn.getModel(), true);
                            }
                        }
                        index++;
                    }
View Full Code Here

TOP

Related Classes of org.gephi.appearance.spi.TransformerUI

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.