Examples of GraphModel


Examples of org.gephi.graph.api.GraphModel

    public boolean canExecute() {
        return Lookup.getDefault().lookup(GraphElementsController.class).getNodesCount()>1;//At least 2 nodes to link them
    }

    public ManipulatorUI getUI() {
        GraphModel currentGraphModel=Lookup.getDefault().lookup(GraphController.class).getModel();
        if(graphModel!=currentGraphModel){//If graph model has changed since last execution, change default mode for edges to create in UI, else keep this parameter across calls
            directed=currentGraphModel.isDirected()||currentGraphModel.isMixed();//Get graph directed state. Set to true if graph is directed or mixed
            graphModel=currentGraphModel;
        }
        return new AddEdgeToGraphUI();
    }
View Full Code Here

Examples of org.gephi.graph.api.GraphModel

     *
     * @param statistics
     */
    public void execute(final Statistics pStatistics, LongTaskListener listener) {
        final GraphController graphController = Lookup.getDefault().lookup(GraphController.class);
        final GraphModel graphModel = graphController.getModel();
        final AttributeModel attributeModel = Lookup.getDefault().lookup(AttributeController.class).getModel();
        StatisticsBuilder builder = getBuilder(pStatistics.getClass());
        final StatisticsUI[] uis = getUI(pStatistics);

        for (StatisticsUI s : uis) {
View Full Code Here

Examples of org.gephi.graph.api.GraphModel

        }

        public Partition getCurrentPartition() {
            if (partition.getPartsCount() == 0) {
                //build partition
                GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
                this.partition = Lookup.getDefault().lookup(PartitionController.class).buildPartition(partition.getColumn(), graphModel.getHierarchicalGraphVisible());
            }
            return partition;
        }
View Full Code Here

Examples of org.gephi.graph.api.GraphModel

        attributesExportCheckbox.setSelected(exporterGEXF.isExportAttributes());
        normalizeCheckbox.setSelected(exporterGEXF.isNormalize());
        dynamicExportCheckbox.setSelected(exporterGEXF.isExportDynamic());
        hierarchyCheckbox.setSelected(exporterGEXF.isExportHierarchy());

        GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
        hierarchyCheckbox.setEnabled(graphModel.isHierarchical());
    }
View Full Code Here

Examples of org.gephi.graph.api.GraphModel

        attributesExportCheckbox.setSelected(exporterGraphML.isExportAttributes());
        normalizeCheckbox.setSelected(exporterGraphML.isNormalize());

        hierarchyCheckbox.setSelected(exporterGraphML.isExportHierarchy());

        GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
        hierarchyCheckbox.setEnabled(graphModel.isHierarchical());
    }
View Full Code Here

Examples of org.gephi.graph.api.GraphModel

        levelLimitCombo.setModel(comboBoxModel);
        levelLimitCombo.setSelectedIndex(Math.min(h, dendrogram.getMaxHeight()));
    }

    public void refresh() {
        final GraphModel model = Lookup.getDefault().lookup(GraphController.class).getModel();
        if (model != null) {
            Thread thread = new Thread(new Runnable() {

                public void run() {
                    BusyLabel busyLabel = BusyUtils.createCenteredBusyLabel(centerScrollPane, NbBundle.getMessage(HierarchyTopComponent.class, "HierarchyTopComponent.busyLabel.text"), dendrogram);
                    busyLabel.setBusy(true);
                    final HierarchicalGraph graph = model.getHierarchicalGraph();
                    SwingUtilities.invokeLater(new Runnable() {

                        public void run() {
                            refreshLevelLimit(graph);
                        }
View Full Code Here

Examples of org.gephi.graph.api.GraphModel

        if (container.getSource() != null) {
            pc.setSource(workspace, container.getSource());
        }

        //Architecture
        GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();

        HierarchicalGraph graph = null;
        switch (container.getEdgeDefault()) {
            case DIRECTED:
                graph = graphModel.getHierarchicalDirectedGraph();
                break;
            case UNDIRECTED:
                graph = graphModel.getHierarchicalUndirectedGraph();
                break;
            case MIXED:
                graph = graphModel.getHierarchicalMixedGraph();
                break;
            default:
                graph = graphModel.getHierarchicalMixedGraph();
                break;
        }
        GraphFactory factory = graphModel.factory();

        //Attributes - Manually merge models with new dynamic cols
        attributeModel = Lookup.getDefault().lookup(AttributeController.class).getModel();
        AttributeTable nodeTable = container.getAttributeModel().getNodeTable();
        AttributeTable edgeTable = container.getAttributeModel().getEdgeTable();
View Full Code Here

Examples of org.gephi.graph.api.GraphModel

        if (container.getSource() != null) {
            pc.setSource(workspace, container.getSource());
        }

        //Architecture
        GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();

        HierarchicalGraph graph = null;
        switch (container.getEdgeDefault()) {
            case DIRECTED:
                graph = graphModel.getHierarchicalDirectedGraph();
                break;
            case UNDIRECTED:
                graph = graphModel.getHierarchicalUndirectedGraph();
                break;
            case MIXED:
                graph = graphModel.getHierarchicalMixedGraph();
                break;
            default:
                graph = graphModel.getHierarchicalMixedGraph();
                break;
        }
        GraphFactory factory = graphModel.factory();

        //Attributes - Creates columns for properties
        attributeModel = Lookup.getDefault().lookup(AttributeController.class).getModel();
        attributeModel.mergeModel(container.getAttributeModel());
View Full Code Here

Examples of org.gephi.graph.api.GraphModel

            node.getNodeData().setB(b);
        }
    }

    private Node[] getDiffusedNodes(Node[] input) {
        GraphModel model = Lookup.getDefault().lookup(GraphController.class).getModel();
        switch (diffusionMethod) {
            case NEIGHBORS:
                return DiffusionMethods.getNeighbors(model.getGraphVisible(), input);
            case NEIGHBORS_OF_NEIGHBORS:
                return DiffusionMethods.getNeighborsOfNeighbors(model.getGraphVisible(), input);
            case PREDECESSORS:
                if (model.isDirected()) {
                    return DiffusionMethods.getPredecessors(model.getDirectedGraphVisible(), input);
                } else {
                    return DiffusionMethods.getNeighbors(model.getGraphVisible(), input);
                }
            case SUCCESSORS:
                if (model.isDirected()) {
                    return DiffusionMethods.getSuccessors(model.getDirectedGraphVisible(), input);
                } else {
                    return DiffusionMethods.getNeighbors(model.getGraphVisible(), input);
                }
        }
        return new Node[0];
    }
View Full Code Here

Examples of org.gephi.graph.api.GraphModel

        public Category getCategory() {
            return FilterLibrary.HIERARCHY;
        }

        public boolean isValid() {
            GraphModel graphModel = Lookup.getDefault().lookup(GraphController.class).getModel();
            return graphModel.isHierarchical();
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.