Examples of NanoGraph


Examples of nl.nanoworks.nanograph.NanoGraph

 
  NanoGraph p = null;
 
  public void init() {
    DefaultGraphModel g = new DefaultGraphModel();
    p = new NanoGraph();
   
    p.addMouseListener(new MouseAdapter(){
     
      public void mouseClicked(MouseEvent e)
      {
View Full Code Here

Examples of nl.nanoworks.nanograph.NanoGraph

    g.addEdge("is a", "C++", "Programming Language");
    g.addEdge("is a", "Perl", "Programming Language");
    g.addEdge("is a", "Python", "Programming Language");
 
   
    NanoGraph gp = new NanoGraph();
   
    DebugGraphListener dgl = new DebugGraphListener(new OutputStreamWriter(System.out));
    gp.getSelectionManager().addSelectionListener(dgl);
   
    gp.setGraph(g);
    gp.setLayout(new CircularLayoutAlgorithm(200));
   
    JFrame f = new JFrame();
    f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   
    f.getContentPane().add(gp);
View Full Code Here

Examples of org.nanograph.drawing.NanoGraph

    public SwingNanoGraphPanel() {
        SelectionMouseListener sml = new SelectionMouseListener();
        this.addMouseListener(sml);
        this.addMouseMotionListener(sml);
        nanograph = new NanoGraph();
        nanograph.setBackground(null);
        manager = new InteractionManager(nanograph);
        nanograph.setHighlightNodeSet(manager.getNodeSelection().getSelectedObjects());
    }
View Full Code Here

Examples of org.nanograph.drawing.NanoGraph

        this.panel = panel;
    }
   
    public void paintComponent(Graphics g)
    {
        NanoGraph nanograph = panel.getNanoGraph();
       
        if(nanograph.getGraphHeight() == 0 ||
                nanograph.getGraphWidth() == 0)
            return;
       
        Graphics2D g2d = (Graphics2D) g;
       
        // clear
        g2d.setColor(Color.WHITE);
        g2d.fillRect(0,0,getWidth(), getHeight());
       
        // compute scale
        double scale = (double)Math.min(
                getHeight()/(double)nanograph.getGraphHeight(),
                getWidth()/(double)nanograph.getGraphWidth()
        );
        g2d.scale(scale, scale);
       
        // draw outline
    g2d.setColor(Color.lightGray);
View Full Code Here

Examples of org.nanograph.drawing.NanoGraph

    public void setNanograph(NanoGraph nanograph) {
    this.nanograph = nanograph;
  }

  public NanoGraphImage(int width, int height) {
        nanograph = new NanoGraph();

        this.height = height;
        this.width = width;
    }
View Full Code Here

Examples of org.nanograph.drawing.NanoGraph

        // JOGL stuff
        GLData data = new GLData();
        data.doubleBuffer = true;

        canvas = new GLCanvas(c, SWT.NONE, data);
        nanoGraph = new NanoGraph();
        interactionManager = new InteractionManager(nanoGraph);
        nanoGraph.setDefaultDockingStrategy(new CenterDockingStrategy((JOGLGraphicsAdapter.SPHERE_RADIUS) * 100));

        canvas.setCurrent();
        context = GLDrawableFactory.getFactory().createExternalGLContext();
View Full Code Here

Examples of org.nanograph.drawing.NanoGraph

        this.addPaintListener(new GraphPaintListener());
    }
   
    public SWTNanoGraphPanel(Composite parent, int style) {
        this(parent, style, new NanoGraph());
    }
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.