Package org.openbp.cockpit.modeler.figures

Examples of org.openbp.cockpit.modeler.figures.VisualElementEvent


  {
    if (figure instanceof VisualElement)
    {
      // Create a visual element event
      String type = selected ? VisualElementEvent.SELECTED : VisualElementEvent.DESELECTED;
      ((VisualElement) figure).handleEvent(new VisualElementEvent(type, (DrawingEditorPlugin) editor()));
    }

    while (figure != null)
    {
      if (figure instanceof VisualElement)
      {
        // Create a visual element event
        ((VisualElement) figure).handleEvent(new VisualElementEvent(VisualElementEvent.UPDATE_STATE, (DrawingEditorPlugin) editor()));
      }

      figure.changed();

      if (figure instanceof ChildFigure)
View Full Code Here


        // Mouse moved to another figure, update figure hover effect if not entering a child element
        if (lastFigure != null && (figure == null || figure.getParentElement() != lastFigure))
        {
          // Tell the figure it is not hovered by the cursor any more
          lastFigure.invalidate();
          lastFigure.handleEvent(new VisualElementEvent(VisualElementEvent.CURSOR_LEFT, editor, e, x, y));
        }

        if (figure != null)
        {
          // Tell the figure it is hovered by the cursor
          figure.handleEvent(new VisualElementEvent(VisualElementEvent.CURSOR_ENTERED, editor, e, x, y));
        }

        lastFigure = figure;
        view.setFigureUnderCursor(figure);
View Full Code Here

      Figure figure = drawing().findFigure(x, y);

      if (figure instanceof VisualElement)
      {
        // Let the figure itself handle the doubleclick
        if (((VisualElement) figure).handleEvent(new VisualElementEvent(VisualElementEvent.DOUBLE_CLICK, editor, e, x, y)))
        {
          // Handled by the element itself
          return;
        }
      }
View Full Code Here

              if (affected)
              {
                // Notify possibly affected sockets of the DnD operation
                String eventType = on ? VisualElementEvent.SET_DND_PARTICIPANT : VisualElementEvent.UNSET_DND_PARTICIPANT;
                socketFigure.handleEvent(new VisualElementEvent(eventType, getEditor()));
              }
            }
          }
        }
      }
View Full Code Here

  public void dragStarted(Transferable transferable)
  {
    if (transferable.isDataFlavorSupported(ModelerFlavors.COLOR) || transferable.isDataFlavorSupported(ClientFlavors.TYPE_ITEM))
    {
      handleEvent(new VisualElementEvent(VisualElementEvent.SET_DND_PARTICIPANT, getDrawing().getEditor()));
    }

    super.dragStarted(transferable);
  }
View Full Code Here

  public void dragEnded(Transferable transferable)
  {
    if (transferable.isDataFlavorSupported(ModelerFlavors.COLOR) || transferable.isDataFlavorSupported(ClientFlavors.TYPE_ITEM))
    {
      handleEvent(new VisualElementEvent(VisualElementEvent.UNSET_DND_PARTICIPANT, getDrawing().getEditor()));
    }

    super.dragEnded(transferable);
  }
View Full Code Here

TOP

Related Classes of org.openbp.cockpit.modeler.figures.VisualElementEvent

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.