Package org.nanograph.drawing

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


        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

    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

        // 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

        this.addPaintListener(new GraphPaintListener());
    }
   
    public SWTNanoGraphPanel(Composite parent, int style) {
        this(parent, style, new NanoGraph());
    }
View Full Code Here

TOP

Related Classes of org.nanograph.drawing.NanoGraph

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.