Examples of mxGraphTransferable


Examples of com.mxgraph.swing.util.mxGraphTransferable

          final TransferHandler th = graphComponent
              .getTransferHandler();

          if (th instanceof mxGraphTransferHandler)
          {
            final mxGraphTransferable t = (mxGraphTransferable) ((mxGraphTransferHandler) th)
                .createTransferable(graphComponent);

            if (t != null)
            {
              e.startDrag(null, mxConstants.EMPTY_IMAGE,
View Full Code Here

Examples of com.mxgraph.swing.util.mxGraphTransferable

      {
        Transferable t = e.getTransferable();

        if (t.isDataFlavorSupported(mxGraphTransferable.dataFlavor))
        {
          mxGraphTransferable gt = (mxGraphTransferable) t
              .getTransferData(mxGraphTransferable.dataFlavor);
          dragCells = gt.getCells();

          if (gt.getBounds() != null)
          {
            mxGraph graph = graphComponent.getGraph();
            double scale = graph.getView().getScale();
            transferBounds = gt.getBounds();
            int w = (int) Math.ceil((transferBounds.getWidth() + 1)
                * scale);
            int h = (int) Math
                .ceil((transferBounds.getHeight() + 1) * scale);
            setPreviewBounds(new Rectangle(
View Full Code Here

Examples of com.mxgraph.swing.util.mxGraphTransferable

      {
        Object tmp = evt.getProperty("transferable");

        if (tmp instanceof mxGraphTransferable)
        {
          mxGraphTransferable t = (mxGraphTransferable) tmp;
          Object cell = t.getCells()[0];

          if (graph.getModel().isEdge(cell))
          {
            ((CustomGraph) graph).setEdgeTemplate(cell);
          }
View Full Code Here

Examples of com.mxgraph.swing.util.mxGraphTransferable

        {
          sourceRow = getSelectedRow();
          dragSource = JTableRenderer.this;
          //mxRectangle bounds = new mxRectangle(0, 0, MyTable.this
          //    .getWidth(), 20);
          return new mxGraphTransferable(null, null, null);
        }

      });

      setDragEnabled(true);
View Full Code Here

Examples of com.mxgraph.swing.util.mxGraphTransferable

   */
  public mxGraphTransferable createGraphTransferable(
      mxGraphComponent graphComponent, Object[] cells,
      mxRectangle bounds, ImageIcon icon)
  {
    return new mxGraphTransferable(graphComponent.getGraph().cloneCells(
        cells), bounds, icon);
  }
View Full Code Here

Examples of com.mxgraph.swing.util.mxGraphTransferable

          mxGraphComponent graphComponent = (mxGraphComponent) c;

          if (graphComponent.isEnabled()
              && t.isDataFlavorSupported(mxGraphTransferable.dataFlavor))
          {
            mxGraphTransferable gt = (mxGraphTransferable) t
                .getTransferData(mxGraphTransferable.dataFlavor);

            if (gt.getCells() != null)
            {
              result = importGraphTransferable(graphComponent, gt);
            }

          }
View Full Code Here

Examples of com.mxgraph.swing.util.mxGraphTransferable

   * @param cell
   */
  public void addTemplate(final String name, ImageIcon icon, mxCell cell)
  {
    mxRectangle bounds = (mxGeometry) cell.getGeometry().clone();
    final mxGraphTransferable t = new mxGraphTransferable(
        new Object[] { cell }, bounds);

    // Scales the image if it's too large for the library
    if (icon != null)
    {
View Full Code Here

Examples of com.mxgraph.swing.util.mxGraphTransferable

   * @param cell
   */
  public void addTemplate(final String name, ImageIcon icon, mxCell cell)
  {
    mxRectangle bounds = (mxGeometry) cell.getGeometry().clone();
    final mxGraphTransferable t = new mxGraphTransferable(
        new Object[] { cell }, bounds);

    // Scales the image if it's too large for the library
    if (icon != null)
    {
View Full Code Here

Examples of com.mxgraph.swing.util.mxGraphTransferable

          final TransferHandler th = graphComponent
              .getTransferHandler();

          if (th instanceof mxGraphTransferHandler)
          {
            final mxGraphTransferable t = (mxGraphTransferable) ((mxGraphTransferHandler) th)
                .createTransferable(graphComponent);

            if (t != null)
            {
              e.startDrag(null, mxSwingConstants.EMPTY_IMAGE,
View Full Code Here

Examples of com.mxgraph.swing.util.mxGraphTransferable

      {
        Transferable t = e.getTransferable();

        if (t.isDataFlavorSupported(mxGraphTransferable.dataFlavor))
        {
          mxGraphTransferable gt = (mxGraphTransferable) t
              .getTransferData(mxGraphTransferable.dataFlavor);
          dragCells = gt.getCells();

          if (gt.getBounds() != null)
          {
            mxGraph graph = graphComponent.getGraph();
            double scale = graph.getView().getScale();
            transferBounds = gt.getBounds();
            int w = (int) Math.ceil((transferBounds.getWidth() + 1)
                * scale);
            int h = (int) Math
                .ceil((transferBounds.getHeight() + 1) * scale);
            setPreviewBounds(new Rectangle(
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.