Package org.eclipse.zest.core.widgets

Examples of org.eclipse.zest.core.widgets.Graph


        viewer.getGraphControl().addControlListener(new ControlAdapter()
        {
            @Override
            public void controlResized(ControlEvent e)
            {
                Graph g = (Graph) e.getSource();
                int x = g.getSize().x;
                int y = g.getSize().y;
                if (lastX != x || lastY != y)
                {
                    lastX = x;
                    lastY = y;
                    redraw();
View Full Code Here


        viewer.setSelection(new StructuredSelection(focus));
        viewer.setFilters(new ViewerFilter[] {});
        viewer.setInput(focus);

        Iterator nodes = viewer.getGraphControl().getNodes().iterator();
        Graph graph = viewer.getGraphControl();
        Dimension centre = new Dimension(graph.getBounds().width / 2, graph.getBounds().height / 2);
        while (nodes.hasNext()) {
            GraphNode graphNode = (GraphNode) nodes.next();
            if (graphNode.getLocation().x <= 1 && graphNode.getLocation().y <= 1) {
                graphNode.setLocation(centre.width, centre.height);
            }
View Full Code Here

    }

    private class InternalGraphViewer extends GraphViewer {
        public InternalGraphViewer(Composite parent, int style) {
            super(parent, style);
            Graph graph = new Graph(parent, style) {
                public Point computeSize(int hint, int hint2, boolean changed) {
                    return new Point(0, 0);
                }
            };
            setControl(graph);
View Full Code Here

  @Override
  public void createPartControl(Composite parent) {
    class MyGraphViewer extends GraphViewer {
      public MyGraphViewer(Composite parent, int style) {
        super(parent, style);
        Graph graphControl = new Graph(parent, style) {
          /*
           * (non-Javadoc)
           *
           * @see org.eclipse.draw2d.FigureCanvas#computeSize(int,
           * int, boolean)
View Full Code Here

  @Override
  public void createPartControl(Composite parent) {
    class MyGraphViewer extends GraphViewer {
      public MyGraphViewer(Composite parent, int style) {
        super(parent, style);
        Graph graphControl = new Graph(parent, style) {
          /*
           * (non-Javadoc)
           *
           * @see org.eclipse.draw2d.FigureCanvas#computeSize(int,
           * int, boolean)
View Full Code Here

        viewer.setSelection(new StructuredSelection(focus));
        viewer.setFilters(new ViewerFilter[] {});
        viewer.setInput(focus);

        Iterator nodes = viewer.getGraphControl().getNodes().iterator();
        Graph graph = viewer.getGraphControl();
        Dimension centre = new Dimension(graph.getBounds().width / 2, graph.getBounds().height / 2);
        while (nodes.hasNext()) {
            GraphNode graphNode = (GraphNode) nodes.next();
            if (graphNode.getLocation().x <= 1 && graphNode.getLocation().y <= 1) {
                graphNode.setLocation(centre.width, centre.height);
            }
View Full Code Here

        {
            // TODO This is only a temporary implementation, until the Zest
            // Graph supports true
            // scalable printing...
            // print the neo figure
            Graph g = view.getViewer().getGraphControl();
            PrintFigureOperation p = new PrintFigureOperation( new Printer(
                    data ), g.getContents() );
            p.setPrintMode( PrintFigureOperation.FIT_PAGE );
            p.run( view.getTitle() );
        }
    }
View Full Code Here

TOP

Related Classes of org.eclipse.zest.core.widgets.Graph

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.