Examples of GraphModel


Examples of org.gephi.graph.api.GraphModel

    }

    public void clusterize(final Clusterer clusterer) {
        //Get Graph
        GraphController gc = Lookup.getDefault().lookup(GraphController.class);
        final GraphModel graphModel = gc.getModel();

        //Model
        final ClusteringModel model = Lookup.getDefault().lookup(ProjectController.class).getCurrentWorkspace().getLookup().lookup(ClusteringModel.class);

        //LongTask
View Full Code Here

Examples of org.gephi.graph.api.GraphModel

        selectionManager.resetSelection();
        selectionManager.selectNodes(cluster.getNodes());
    }

    public void groupCluster(Cluster cluster) {
        GraphModel gm = Lookup.getDefault().lookup(GraphController.class).getModel();
        if (gm != null) {
            HierarchicalGraph graph = gm.getHierarchicalGraphVisible();
            Node[] newGroup = cluster.getNodes();
            float centroidX = 0;
            float centroidY = 0;
            int len = 0;
            Node group = graph.groupNodes(newGroup);
View Full Code Here

Examples of org.gephi.graph.api.GraphModel

            group.getNodeData().setY(centroidY);
        }
    }

    public void ungroupCluster(Cluster cluster) {
        GraphModel gm = Lookup.getDefault().lookup(GraphController.class).getModel();
        if (gm != null) {
            HierarchicalGraph graph = gm.getHierarchicalGraphVisible();
            graph.ungroupNodes(cluster.getMetaNode());
            cluster.setMetaNode(null);
        }
    }
View Full Code Here

Examples of org.gephi.graph.api.GraphModel

    //Dynamic
    private TimeInterval visibleInterval;

    public boolean execute() {
        AttributeModel attributeModel = workspace.getLookup().lookup(AttributeModel.class);
        GraphModel graphModel = workspace.getLookup().lookup(GraphModel.class);
        Graph graph = null;
        if (exportVisible) {
            graph = graphModel.getGraphVisible();
        } else {
            graph = graphModel.getGraph();
        }
        DynamicModel dynamicModel = workspace.getLookup().lookup(DynamicModel.class);
        visibleInterval = dynamicModel != null && exportVisible ? dynamicModel.getVisibleInterval() : new TimeInterval();
        try {
            exportData(graph, attributeModel);
View Full Code Here

Examples of org.gephi.graph.api.GraphModel

    private boolean exportVisible;
    private boolean cancel = false;
    private ProgressTicket progressTicket;

    public boolean execute() {
        GraphModel graphModel = workspace.getLookup().lookup(GraphModel.class);
        Graph graph = null;
        if (exportVisible) {
            graph = graphModel.getGraphVisible();
        } else {
            graph = graphModel.getGraph();
        }
        try {
            exportData(graph);
        } catch (Exception e) {
            throw new RuntimeException(e);
View Full Code Here

Examples of org.gephi.graph.api.GraphModel

        ProjectController projectController = Lookup.getDefault().lookup(ProjectController.class);
        projectController.newProject();
        AttributeController attributeController = Lookup.getDefault().lookup(AttributeController.class);
        AttributeModel attributeModel = attributeController.getModel();
        GraphController graphController = Lookup.getDefault().lookup(GraphController.class);
        GraphModel graphModel = graphController.getModel();

        StatisticsModelImpl model = new StatisticsModelImpl();

        ClusteringCoefficient clusteringCoefficient = new ClusteringCoefficient();
        ClusteringCoefficientUI clusteringCoefficientUI = new ClusteringCoefficientUI();
View Full Code Here

Examples of org.gephi.graph.api.GraphModel

@ServiceProvider(service = WorkspacePersistenceProvider.class, position = 15000)
public class AttributeRowPersistenceProvider implements WorkspacePersistenceProvider {

    public void writeXML(XMLStreamWriter writer, Workspace workspace) {
        AttributeModel model = workspace.getLookup().lookup(AttributeModel.class);
        GraphModel graphModel = workspace.getLookup().lookup(GraphModel.class);
        AttributeRowSerializer serializer = new AttributeRowSerializer();
        if (model != null && graphModel != null && model instanceof AbstractAttributeModel) {
            try {
                serializer.writeRows(writer, graphModel);
            } catch (XMLStreamException ex) {
View Full Code Here

Examples of org.jgraph.graph.GraphModel

public class HelloWorld {

  public static void main(String[] args) {

    // Construct Model and Graph
    GraphModel model = new DefaultGraphModel();
    JGraph graph = new JGraph(model);

    // Control-drag should clone selection
    graph.setCloneable(true);
View Full Code Here

Examples of org.jitterbit.ui.graph.model.GraphModel

     */
    public void setModel(GraphModel data, GraphLayout2D layout) {
        if (data == null) {
            throw new NullPointerException("data");
        }
        GraphModel oldModel = this.dataModel;
        if (oldModel != null) {
            clearCanvas();
            oldModel.removeModelListener(modelListener);
        }
        GraphLayout2D oldLayout = this.layout;
        if (oldLayout != null) {
            oldLayout.removeGraphLayoutListener(modelListener);
            oldLayout.removeNodeExpansionListener(modelListener);
View Full Code Here

Examples of org.nanograph.model.GraphModel

  public void setCentralNode(Object centralNode) {
    this.centralNode = centralNode;
  }

  public void layout(NanoGraph graph) {
    GraphModel g = graph.getModel();
    double x, y, angle;
    Object node;
    int counter = 0;
    for (int i = 0; i < g.getNodeCount(); i++) {
      int nodesOnCircle = (centralNode == null ? g.getNodeCount() : (g.getNodeCount() - 1));
      double d = (counter / ((double) nodesOnCircle));
      angle = d * 2.0d * Math.PI;
      double rotateFactor = 2;
      if (nodesOnCircle % 2 == 0) {
        rotateFactor = 6;
      } else {
        rotateFactor = 3;
      }
      angle += Math.PI / rotateFactor;
      angle = angle % (2 * Math.PI);
      node = g.getNode(i);
      if (centralNode != null && centralNode.equals(node)) {
        x = y = radius;
      } else {
        x = radius + radius * Math.sin(angle);
        y = radius + radius * Math.cos(angle);
        // only increment the counter when this node wasn't the central node
        // or else we get overlapping nodes at 0 degrees and 2 PI degrees
        counter++;
      }
      g.setLocation(node, new Point2D.Double(x+100, y+50));
    }
  }
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.