Examples of Graph2DView


Examples of com.intellij.openapi.graph.view.Graph2DView

    if (path == null) return;

    String extension = path.substring(path.lastIndexOf(".")+1).trim();
    if (!myExtensions.containsKey(extension)) return;

    Graph2DView originalView = (Graph2DView)graph.getCurrentView();
    Point2D originalViewPoint2D = originalView.getViewPoint2D();

    JComponent component = tuneGraph2DView(originalView);

    FileOutputStream os = null;
    try {
      BufferedImage bi = new BufferedImage(component.getWidth(), component.getHeight(), BufferedImage.TYPE_INT_RGB);

      component.paint(bi.getGraphics());

      os = new FileOutputStream(path);
      ImageIO.write(bi, extension, os);
    } catch (Exception ex) {
      LOG.error(ex);
    } finally {
      try {
        os.close();
      }
      catch (IOException e1) {
        LOG.error(e1);
      }
      originalView.setViewPoint2D(originalViewPoint2D.getX(), originalViewPoint2D.getY());
    }

  }
View Full Code Here

Examples of com.intellij.openapi.graph.view.Graph2DView

  public ApplyCurrentLayoutAction(final Graph2D graph) {
    super(graph, NAME, ICON);
  }

  public void actionPerformed(final AnActionEvent e, final Graph2D graph) {
    final Graph2DView view = AbstractGraphAction.getGraph2DView(graph);
    final Project project = getProject(e);
    if (project != null) {
      AbstractLayoutAction.doLayout(view, GraphSettingsProvider.getInstance(project).getSettings(graph).getCurrentLayouter(), project);
    }
  }
View Full Code Here

Examples of y.view.Graph2DView

     * Initialize the graph panel.
     */
    public void initGraphPanel() {
        fGraphLoader.initGraph(fDependencyGraph);

        fGraphView = new Graph2DView(fDependencyGraph);
        fGraphView.setAntialiasedPainting(true);
        fDependencyGraph.registerView(fGraphView);

        initGraphLayout();
        registerViewModes();
View Full Code Here

Examples of y.view.Graph2DView

  protected JFrame createFrame() {
    JFrame frame = super.createFrame();

    Graph2D graph2D = new Graph2DPresenter().present( rootNode );

    Graph2DView graph2DView = new Graph2DView( graph2D );
    graph2DView.addViewMode( new NavigationMode() );
    graph2DView.fitContent();
    frame.getContentPane().add( graph2DView );
    return frame;
  }
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.