Package com.intellij.openapi.graph.view

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


  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

TOP

Related Classes of com.intellij.openapi.graph.view.Graph2DView

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.