Package org.gephi.preview.api

Examples of org.gephi.preview.api.Graph


    public boolean execute() {
        // fetches the preview graph sheet
        PreviewController controller = Lookup.getDefault().lookup(PreviewController.class);
        GraphSheet graphSheet = controller.getGraphSheet();
        Graph graph = graphSheet.getGraph();
        try {
            exportData(graph);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
View Full Code Here


     * @throws Exception
     */
    private void exportData(GraphSheet graphSheet) throws Exception {
        SupportSize supportSize = new SupportSize(595, 841, LengthUnit.PIXELS);
        Progress.start(progress);
        Graph graph = graphSheet.getGraph();

        // calculates progress units count
        int max = 0;
        if (graph.showNodes()) {
            max += graph.countNodes();
        }
        if (graph.showEdges()) {
            max += graph.countUnidirectionalEdges() + graph.countBidirectionalEdges();
            if (graph.showSelfLoops()) {
                max += graph.countSelfLoops();
            }
        }
        Progress.switchToDeterminate(progress, max);

        // export tasks
View Full Code Here

     * @return                 a subgraph of the current preview graph
     */
    public Graph getPartialGraph(float visibilityRatio) {
        if (model != null) {
            if (model.isUpdateFlag() || null == partialPreviewGraph || partialPreviewGraph.getVisibilityRatio() != visibilityRatio) {
                Graph graph = getGraph();
                if (graph == null) {
                    return null;
                }
                partialPreviewGraph = new PartialGraphImpl(graph, visibilityRatio);
                model.setVisibilityRatio(visibilityRatio);
View Full Code Here

    }

    public GraphSheet getGraphSheet() {
        if (model != null) {
            if (model.isUpdateFlag() || null == graphSheet || graphSheet.getGraph() != previewGraph) {
                Graph graph = getGraph();
                if (graph == null) {
                    return null;
                }
                graphSheet = new GraphSheetImpl(graph);
            }
View Full Code Here

    public GraphSheet getPartialGraphSheet(float visibilityRatio) {
        if (model != null) {
            if (model.isUpdateFlag() || null == partialGraphSheet
                    || ((PartialGraphImpl) partialGraphSheet.getGraph()).getVisibilityRatio() != visibilityRatio) {
                Graph graph = getPartialGraph(visibilityRatio);
                if (graph != null) {
                    partialGraphSheet = new GraphSheetImpl(graph);
                }
            }
            return partialGraphSheet;
View Full Code Here

TOP

Related Classes of org.gephi.preview.api.Graph

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.