Examples of mxIEventListener


Examples of com.mxgraph.util.mxEventSource.mxIEventListener

            if(alreadyPaintedFlag==0){
              graph.insertVertex(parentVertex, null,Messages.getString("PetriNet.Resources.NoGroupsDefined"),10,10,150,30, "rounded=1;opacity=0;fontStyle=1;fontColor=black");
            }
           
            // Create Listener, first parameter in constructor is the observed graph
            mxIEventListener mySelectListener = new selectListener(graph);
            // add Listener as CHANGE-Listener
            graph.getSelectionModel().addListener(mxEvent.CHANGE, mySelectListener);
            graphComponent = new mxGraphComponent(graph);
 
            tempGroupGraph = graph;
View Full Code Here

Examples of com.mxgraph.util.mxEventSource.mxIEventListener

    zoomCombo.setMaximumSize(new Dimension(75, 100));
    zoomCombo.setMaximumRowCount(9);
    add(zoomCombo);

    // Sets the zoom in the zoom combo the current value
    mxIEventListener scaleTracker = new mxIEventListener()
    {
      /**
       *
       */
      public void invoke(Object sender, mxEventObject evt)
      {
        ignoreZoomChange = true;

        try
        {
          zoomCombo.setSelectedItem((int) Math.round(100 * view
              .getScale())
              + "%");
        }
        finally
        {
          ignoreZoomChange = false;
        }
      }
    };

    // Installs the scale tracker to update the value in the combo box
    // if the zoom is changed from outside the combo box
    view.getGraph().getView().addListener(mxEvent.SCALE, scaleTracker);
    view.getGraph().getView().addListener(mxEvent.SCALE_AND_TRANSLATE,
        scaleTracker);

    // Invokes once to sync with the actual zoom value
    scaleTracker.invoke(null, null);

    zoomCombo.addActionListener(new ActionListener()
    {
      /**
       *
 
View Full Code Here

Examples of com.mxgraph.util.mxEventSource.mxIEventListener

    // Adds the required listeners
    graphComponent.getGraphControl().addMouseListener(this);
    graphComponent.getGraphControl().addMouseMotionListener(this);

    graphComponent.addListener(mxEvent.AFTER_PAINT, new mxIEventListener()
    {

      public void invoke(Object source, mxEventObject evt)
      {
        paintRubberband((Graphics) evt.getProperty("g"));
View Full Code Here

Examples of com.mxgraph.util.mxEventSource.mxIEventListener

        }
      }
    });

    // Installs the paint handler
    graphComponent.addListener(mxEvent.PAINT, new mxIEventListener()
    {
      public void invoke(Object sender, mxEventObject evt)
      {
        Graphics g = (Graphics) evt.getProperty("g");
        paintHandles(g);
View Full Code Here

Examples of com.mxgraph.util.mxEventSource.mxIEventListener

    this.graphComponent = graphComponent;
    graphComponent.addMouseListener(this);
    handle = createHandle();

    // Installs the paint handler
    graphComponent.addListener(mxEvent.AFTER_PAINT, new mxIEventListener()
    {
      public void invoke(Object sender, mxEventObject evt)
      {
        Graphics g = (Graphics) evt.getProperty("g");
        paint(g);
View Full Code Here

Examples of com.mxgraph.util.mxEventSource.mxIEventListener

  {
    this.graphComponent = graphComponent;
    this.style = style;

    // Installs the paint handler
    graphComponent.addListener(mxEvent.AFTER_PAINT, new mxIEventListener()
    {
      public void invoke(Object sender, mxEventObject evt)
      {
        Graphics g = (Graphics) evt.getProperty("g");
        paint(g);
View Full Code Here

Examples of com.mxgraph.util.mxEventSource.mxIEventListener

    this.graphComponent = graphComponent;
    marker = createMarker();
    movePreview = createMovePreview();

    // Installs the paint handler
    graphComponent.addListener(mxEvent.AFTER_PAINT, new mxIEventListener()
    {
      public void invoke(Object sender, mxEventObject evt)
      {
        Graphics g = (Graphics) evt.getProperty("g");
        paint(g);
View Full Code Here

Examples of com.mxgraph.util.mxEventSource.mxIEventListener

    EditorPalette imagesPalette = insertPalette(mxResources.get("images"));
    EditorPalette symbolsPalette = insertPalette(mxResources.get("symbols"));

    // Sets the edge template to be used for creating new edges if an edge
    // is clicked in the shape palette
    shapesPalette.addListener(mxEvent.SELECT, new mxIEventListener()
    {
      public void invoke(Object sender, mxEventObject evt)
      {
        Object tmp = evt.getProperty("transferable");
View Full Code Here

Examples of com.mxgraph.util.mxEventSource.mxIEventListener

    new mxRubberband(graphComponent);
    new mxKeyboardHandler(graphComponent);

    // Installs automatic validation (use editor.validation = true
    // if you are using an mxEditor instance)
    graph.getModel().addListener(mxEvent.CHANGE, new mxIEventListener()
    {
      public void invoke(Object sender, mxEventObject evt)
      {
        graphComponent.validateGraph();
      }
View Full Code Here

Examples of com.mxgraph.util.mxEventSource.mxIEventListener

    zoomCombo.setMaximumSize(new Dimension(75, 100));
    zoomCombo.setMaximumRowCount(9);
    add(zoomCombo);

    // Sets the zoom in the zoom combo the current value
    mxIEventListener scaleTracker = new mxIEventListener()
    {
      /**
       *
       */
      public void invoke(Object sender, mxEventObject evt)
      {
        ignoreZoomChange = true;

        try
        {
          zoomCombo.setSelectedItem((int) Math.round(100 * view
              .getScale())
              + "%");
        }
        finally
        {
          ignoreZoomChange = false;
        }
      }
    };

    // Installs the scale tracker to update the value in the combo box
    // if the zoom is changed from outside the combo box
    view.getGraph().getView().addListener(mxEvent.SCALE, scaleTracker);
    view.getGraph().getView().addListener(mxEvent.SCALE_AND_TRANSLATE,
        scaleTracker);

    // Invokes once to sync with the actual zoom value
    scaleTracker.invoke(null, null);

    zoomCombo.addActionListener(new ActionListener()
    {
      /**
       *
 
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.