Package com.mxgraph.swing.mxGraphComponent

Examples of com.mxgraph.swing.mxGraphComponent.mxGraphControl


      }
    });

    connectPreview = createConnectPreview();

    mxGraphControl graphControl = graphComponent.getGraphControl();
    graphControl.addMouseListener(this);
    graphControl.addMouseMotionListener(this);

    mxGraphView view = graphComponent.getGraph().getView();
    view.addListener(mxEvent.SCALE, resetHandler);
    view.addListener(mxEvent.TRANSLATE, resetHandler);
    view.addListener(mxEvent.SCALE_AND_TRANSLATE, resetHandler);
View Full Code Here


  /**
   * Initializes the DnD Handler
   */
  private void initializeDragAndDrop() {
    graphView.setDragEnabled(true);
    mxGraphControl graphControl = graphView.getGraphControl();
    // graphControl.setDropTarget(graphControl.getDropTarget());

    dndHandler = new ViewDragAndDropHandler(graphControl, this, DnDConstants.ACTION_MOVE) {

      /**
 
View Full Code Here

      bounds = new Rectangle(first);
      bounds.add(e.getPoint());

      if (graphComponent.isSignificant(bounds.width, bounds.height))
      {
        mxGraphControl control = graphComponent.getGraphControl();

        // Repaints exact difference between old and new bounds
        Rectangle union = new Rectangle(oldBounds);
        union.add(bounds);

        if (bounds.x != oldBounds.x)
        {
          int maxleft = Math.max(bounds.x, oldBounds.x);
          Rectangle tmp = new Rectangle(union.x - 1, union.y, maxleft
              - union.x + 2, union.height);
          control.repaint(tmp);
        }

        if (bounds.x + bounds.width != oldBounds.x + oldBounds.width)
        {
          int minright = Math.min(bounds.x + bounds.width,
              oldBounds.x + oldBounds.width);
          Rectangle tmp = new Rectangle(minright - 1, union.y,
              union.x + union.width - minright + 1, union.height);
          control.repaint(tmp);
        }

        if (bounds.y != oldBounds.y)
        {
          int maxtop = Math.max(bounds.y, oldBounds.y);
          Rectangle tmp = new Rectangle(union.x, union.y - 1,
              union.width, maxtop - union.y + 2);
          control.repaint(tmp);
        }

        if (bounds.y + bounds.height != oldBounds.y + oldBounds.height)
        {
          int minbottom = Math.min(bounds.y + bounds.height,
              oldBounds.y + oldBounds.height);
          Rectangle tmp = new Rectangle(union.x, minbottom - 1,
              union.width, union.y + union.height - minbottom + 1);
          control.repaint(tmp);
        }

        if (!graphComponent.isToggleEvent(e)
            && !graphComponent.getGraph().isSelectionEmpty())
        {
View Full Code Here

      }
    });

    connectPreview = createConnectPreview();

    mxGraphControl graphControl = graphComponent.getGraphControl();
    graphControl.addMouseListener(this);
    graphControl.addMouseMotionListener(this);

    // Installs the graph listeners and keeps them in sync
    addGraphListeners(graphComponent.getGraph());

    graphComponent.addPropertyChangeListener(new PropertyChangeListener()
View Full Code Here

      }
    });

    connectPreview = createConnectPreview();

    mxGraphControl graphControl = graphComponent.getGraphControl();
    graphControl.addMouseListener(this);
    graphControl.addMouseMotionListener(this);

    mxGraphView view = graphComponent.getGraph().getView();
    view.addListener(mxEvent.SCALE, resetHandler);
    view.addListener(mxEvent.TRANSLATE, resetHandler);
    view.addListener(mxEvent.SCALE_AND_TRANSLATE, resetHandler);
View Full Code Here

      bounds = new Rectangle(first);
      bounds.add(e.getPoint());

      if (graphComponent.isSignificant(bounds.width, bounds.height))
      {
        mxGraphControl control = graphComponent.getGraphControl();

        // Repaints exact difference between old and new bounds
        Rectangle union = new Rectangle(oldBounds);
        union.add(bounds);

        if (bounds.x != oldBounds.x)
        {
          int maxleft = Math.max(bounds.x, oldBounds.x);
          Rectangle tmp = new Rectangle(union.x - 1, union.y, maxleft
              - union.x + 2, union.height);
          control.repaint(tmp);
        }

        if (bounds.x + bounds.width != oldBounds.x + oldBounds.width)
        {
          int minright = Math.min(bounds.x + bounds.width,
              oldBounds.x + oldBounds.width);
          Rectangle tmp = new Rectangle(minright - 1, union.y,
              union.x + union.width - minright + 1, union.height);
          control.repaint(tmp);
        }

        if (bounds.y != oldBounds.y)
        {
          int maxtop = Math.max(bounds.y, oldBounds.y);
          Rectangle tmp = new Rectangle(union.x, union.y - 1,
              union.width, maxtop - union.y + 2);
          control.repaint(tmp);
        }

        if (bounds.y + bounds.height != oldBounds.y + oldBounds.height)
        {
          int minbottom = Math.min(bounds.y + bounds.height,
              oldBounds.y + oldBounds.height);
          Rectangle tmp = new Rectangle(union.x, minbottom - 1,
              union.width, union.y + union.height - minbottom + 1);
          control.repaint(tmp);
        }

        if (!graphComponent.isToggleEvent(e)
            && !graphComponent.getGraph().isSelectionEmpty())
        {
View Full Code Here

TOP

Related Classes of com.mxgraph.swing.mxGraphComponent.mxGraphControl

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.