Package com.mxgraph.swing

Examples of com.mxgraph.swing.mxGraphComponent


                    }
                }
            }
            in.close();
            graph.getModel().endUpdate();
            mxGraphComponent graphComponent = new mxGraphComponent(graph);
            getContentPane().add(graphComponent);
            try {
                // Creates the image for the PNG file
                BufferedImage image = mxCellRenderer.createBufferedImage(graph,
                        null, 1, Color.WHITE, graphComponent.isAntiAlias(), null,
                        graphComponent.getCanvas());

            // Creates the URL-encoded XML data
            mxCodec codec = new mxCodec();
            String xml = URLEncoder.encode(mxUtils.getXml(codec.encode(graph.getModel())), "UTF-8");
            mxPngEncodeParam param = mxPngEncodeParam.getDefaultEncodeParam(image);
View Full Code Here


      Object source = e.getSource();

      if (source instanceof mxGraphComponent)
      {
        String name = getValue(Action.NAME).toString();
        mxGraphComponent graphComponent = (mxGraphComponent) source;

        if (name.equalsIgnoreCase("zoomIn"))
        {
          graphComponent.zoomIn();
        }
        else if (name.equalsIgnoreCase("zoomOut"))
        {
          graphComponent.zoomOut();
        }
        else
        {
          graphComponent.zoomActual();
        }
      }
    }
View Full Code Here

   */
  public Transferable createTransferable(JComponent c)
  {
    if (c instanceof mxGraphComponent)
    {
      mxGraphComponent graphComponent = (mxGraphComponent) c;
      mxGraph graph = graphComponent.getGraph();

      if (!graph.isSelectionEmpty())
      {
        originalCells = graphComponent.getExportableCells(graph
            .getSelectionCells());

        if (originalCells.length > 0)
        {
          ImageIcon icon = (transferImageEnabled) ? createTransferableImage(
View Full Code Here

    {
      try
      {
        if (c instanceof mxGraphComponent)
        {
          mxGraphComponent graphComponent = (mxGraphComponent) c;

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

        }
      });
      return;
    }

    graphComponent = new mxGraphComponent(currentGraph);

    graphComponent.setConnectable(false);
    graphComponent.setToolTips(true);
    graphComponent.setDragEnabled(false);
    graphComponent.setZoomFactor(2);
View Full Code Here

TOP

Related Classes of com.mxgraph.swing.mxGraphComponent

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.