Package com.mxgraph.swing

Examples of com.mxgraph.swing.mxGraphComponent


     */
    public void actionPerformed(ActionEvent e)
    {
      if (e.getSource() instanceof mxGraphComponent)
      {
        mxGraphComponent graphComponent = (mxGraphComponent) e
            .getSource();
        graphComponent.setGridStyle(style);
        graphComponent.repaint();
      }
    }
View Full Code Here


     */
    public void actionPerformed(ActionEvent e)
    {
      if (e.getSource() instanceof mxGraphComponent)
      {
        mxGraphComponent graphComponent = (mxGraphComponent) e
            .getSource();
        Color newColor = JColorChooser.showDialog(graphComponent,
            mxResources.get("gridColor"),
            graphComponent.getGridColor());

        if (newColor != null)
        {
          graphComponent.setGridColor(newColor);
          graphComponent.repaint();
        }
      }
    }
View Full Code Here

     */
    public void actionPerformed(ActionEvent e)
    {
      if (e.getSource() instanceof mxGraphComponent)
      {
        mxGraphComponent graphComponent = (mxGraphComponent) e
            .getSource();
        double scale = this.scale;

        if (scale == 0)
        {
          String value = (String) JOptionPane.showInputDialog(
              graphComponent, mxResources.get("value"),
              mxResources.get("scale") + " (%)",
              JOptionPane.PLAIN_MESSAGE, null, null, "");

          if (value != null)
          {
            scale = Double.parseDouble(value.replace("%", "")) / 100;
          }
        }

        if (scale > 0)
        {
          graphComponent.zoomTo(scale, graphComponent.isCenterZoom());
        }
      }
    }
View Full Code Here

     */
    public void actionPerformed(ActionEvent e)
    {
      if (e.getSource() instanceof mxGraphComponent)
      {
        mxGraphComponent graphComponent = (mxGraphComponent) e
            .getSource();
        PrinterJob pj = PrinterJob.getPrinterJob();
        PageFormat format = pj.pageDialog(graphComponent
            .getPageFormat());

        if (format != null)
        {
          graphComponent.setPageFormat(format);
          graphComponent.zoomAndCenter();
        }
      }
    }
View Full Code Here

     */
    public void actionPerformed(ActionEvent e)
    {
      if (e.getSource() instanceof mxGraphComponent)
      {
        mxGraphComponent graphComponent = (mxGraphComponent) e
            .getSource();
        PrinterJob pj = PrinterJob.getPrinterJob();

        if (pj.printDialog())
        {
          PageFormat pf = graphComponent.getPageFormat();
          Paper paper = new Paper();
          double margin = 36;
          paper.setImageableArea(margin, margin, paper.getWidth()
              - margin * 2, paper.getHeight() - margin * 2);
          pf.setPaper(paper);
 
View Full Code Here

     */
    public void actionPerformed(ActionEvent e)
    {
      if (e.getSource() instanceof mxGraphComponent)
      {
        mxGraphComponent graphComponent = (mxGraphComponent) e
            .getSource();
        mxGraph graph = graphComponent.getGraph();

        if (!graph.isSelectionEmpty())
        {
          Color newColor = JColorChooser.showDialog(graphComponent,
              name, null);
View Full Code Here

     */
    public void actionPerformed(ActionEvent e)
    {
      if (e.getSource() instanceof mxGraphComponent)
      {
        mxGraphComponent graphComponent = (mxGraphComponent) e
            .getSource();
        String value = (String) JOptionPane.showInputDialog(
            graphComponent, mxResources.get("backgroundImage"),
            "URL", JOptionPane.PLAIN_MESSAGE, null, null,
            "http://www.callatecs.com/images/background2.JPG");

        if (value != null)
        {
          if (value.length() == 0)
          {
            graphComponent.setBackgroundImage(null);
          }
          else
          {
            Image background = mxUtils.loadImage(value);
            // Incorrect URLs will result in no image.
            // TODO provide feedback that the URL is not correct
            if (background != null)
            {
              graphComponent.setBackgroundImage(new ImageIcon(
                  background));
            }
          }

          // Forces a repaint of the outline
          graphComponent.getGraph().repaint();
        }
      }
    }
View Full Code Here

     */
    public void actionPerformed(ActionEvent e)
    {
      if (e.getSource() instanceof mxGraphComponent)
      {
        mxGraphComponent graphComponent = (mxGraphComponent) e
            .getSource();
        Color newColor = JColorChooser.showDialog(graphComponent,
            mxResources.get("background"), null);

        if (newColor != null)
        {
          graphComponent.getViewport().setOpaque(true);
          graphComponent.getViewport().setBackground(newColor);
        }

        // Forces a repaint of the outline
        graphComponent.getGraph().repaint();
      }
    }
View Full Code Here

     */
    public void actionPerformed(ActionEvent e)
    {
      if (e.getSource() instanceof mxGraphComponent)
      {
        mxGraphComponent graphComponent = (mxGraphComponent) e
            .getSource();
        Color newColor = JColorChooser.showDialog(graphComponent,
            mxResources.get("pageBackground"), null);

        if (newColor != null)
        {
          graphComponent.setPageBackgroundColor(newColor);
        }

        // Forces a repaint of the component
        graphComponent.repaint();
      }
    }
View Full Code Here

     */
    public void actionPerformed(ActionEvent e)
    {
      if (e.getSource() instanceof mxGraphComponent)
      {
        mxGraphComponent graphComponent = (mxGraphComponent) e
            .getSource();
        mxGraph graph = graphComponent.getGraph();
        String initial = graph.getModel().getStyle(
            graph.getSelectionCell());
        String value = (String) JOptionPane.showInputDialog(
            graphComponent, mxResources.get("style"),
            mxResources.get("style"), JOptionPane.PLAIN_MESSAGE,
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.