Package org.gephi.appearance.api

Examples of org.gephi.appearance.api.Function


                functionSet.add(func);
            }
        }

        for (Function func : functionSet) {
            Function oldFunc = selectedFunction.get(elementClass).get(func.getUI());
            if (oldFunc == null || !functionSet.contains(oldFunc)) {
                selectedFunction.get(elementClass).put(func.getUI(), func);
            }
        }
    }
View Full Code Here


            }
        }
    }

    public boolean refreshSelectedFunction() {
        Function sFunction = getSelectedFunction();
        if (sFunction != null && sFunction.isAttribute()) {
            for (Function func : getSelectedElementClass().equals(AppearanceUIController.NODE_ELEMENT) ? appearanceModel.getNodeFunctions() : appearanceModel.getEdgeFunctions()) {
                if (func.equals(sFunction)) {
                    return false;
                }
            }
View Full Code Here

        }
    }

    public void setSelectedFunction(Function function) {
        if (model != null) {
            Function oldValue = model.getSelectedFunction();
            if ((oldValue == null && function != null) || (oldValue != null && function == null) || (function != null && oldValue != null && !oldValue.equals(function))) {
                model.setAutoApply(false);
                model.setSelectedFunction(function);
                firePropertyChangeEvent(AppearanceUIModelEvent.SELECTED_FUNCTION, oldValue, function);
            }
        }
View Full Code Here

        }

        @Override
        public void run() {
            if (nodeObserver.hasTableChanged() || edgeObserver.hasTableChanged()) {
                Function oldValue = model.getSelectedFunction();
                model.refreshSelectedFunction();
                Function newValue = model.getSelectedFunction();
                firePropertyChangeEvent(AppearanceUIModelEvent.SELECTED_FUNCTION, oldValue, newValue);
            }
        }
View Full Code Here

                    btn.setVisible(false);
                }
                TransformerUI u = model.getSelectedTransformerUI();
                if (u != null && model.isAttributeTransformerUI(u)) {
                    //Ranking
                    Function selectedColumn = model.getSelectedFunction();
                    if (selectedColumn != null) {
                        if (selectedColumn.isRanking()) {
                            for (AbstractButton btn : rankingSouthControls) {
                                btn.setVisible(true);
                            }
                        } else if (selectedColumn.isPartition()) {
                            for (AbstractButton btn : partitionSouthControls) {
                                btn.setVisible(true);
                            }
                        }
                    }
                }
                clearControlButtons();
                if (u != null) {
                    Function selectedColumn = model.getSelectedFunction();
                    if (selectedColumn != null) {
                        AbstractButton[] bb = selectedColumn.getUI().getControlButton();
                        if (bb != null) {
                            for (AbstractButton b : bb) {
                                add(b);
                                controlButtons.add(b);
                            }
View Full Code Here

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

                if (model != null) {
                    TransformerUI ui = model.getSelectedTransformerUI();
                    if (ui != null && model.isAttributeTransformerUI(ui)) {

                        //Ranking
                        Function selectedColumn = model.getSelectedFunction();
                        attibuteBox.removeItemListener(attributeListener);

                        comboBoxModel.addElement(NO_SELECTION);
                        comboBoxModel.setSelectedItem(NO_SELECTION);

                        List<Function> rows = new ArrayList<Function>();
                        rows.addAll(model.getFunctions());

                        Collections.sort(rows, new Comparator<Function>() {
                            @Override
                            public int compare(Function o1, Function o2) {
                                return o1.getUI().getDisplayName().compareTo(o2.getUI().getDisplayName());
                            }
                        });
                        for (Function r : rows) {
                            comboBoxModel.addElement(r);
                            if (selectedColumn != null && selectedColumn.equals(r)) {
                                comboBoxModel.setSelectedItem(r);
                            }
                        }
                        attributeListener = new ItemListener() {
                            @Override
                            public void itemStateChanged(ItemEvent e) {
                                if (model != null) {
                                    if (!attibuteBox.getSelectedItem().equals(NO_SELECTION)) {
                                        Function selectedItem = (Function) attibuteBox.getSelectedItem();
                                        controller.setSelectedFunction(selectedItem);
                                    } else {
                                        controller.setSelectedFunction(null);
                                    }
                                }
View Full Code Here

            attributeNodeFunctions.removeAll(foundNodeColumns);
            attributeEdgeFunctions.removeAll(foundEdgeColumns);

            //Remove
            for (Iterator<Function> nodeItr = nodeFunctions.iterator(); nodeItr.hasNext();) {
                Function f = nodeItr.next();
                if (f.isAttribute() && attributeNodeFunctions.contains(((AttributeFunction) f).getColumn())) {
                    nodeItr.remove();
                }
            }
            for (Iterator<Function> edgeItr = edgeFunctions.iterator(); edgeItr.hasNext();) {
                Function f = edgeItr.next();
                if (f.isAttribute() && attributeEdgeFunctions.contains(((AttributeFunction) f).getColumn())) {
                    edgeItr.remove();
                }
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.gephi.appearance.api.Function

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.