Package CH.ifa.draw.framework

Examples of CH.ifa.draw.framework.Figure


      activeHandles = new Vector();

      FigureEnumeration k = selectionElements();
      while (k.hasMoreElements())
      {
        Figure figure = k.nextFigure();
        Enumeration kk = figure.handles().elements();

        while (kk.hasMoreElements())
        {
          activeHandles.addElement(kk.nextElement());
        }
View Full Code Here


      // Purge the event
      e.consume();

      if (selection.size() == 1)
      {
        Figure figure = (Figure) selection.get(0);
        displayPopupMenu(figure, null);
      }

      return;
    }

    if (code == KeyEvent.VK_ENTER && InputState.isAltDown())
    {
      if (selection.size() == 1)
      {
        Figure figure = (Figure) selection.get(0);
        if (figure instanceof ProcessElementContainer && ! (figure instanceof ProcessDrawing))
        {
          // we directly set the tool inside the editor
          modeler.getToolSupport().displayInPlaceEditor((ProcessElementContainer) figure);
        }
View Full Code Here

        modeler.startUndo("Move element");

        boolean first = true;
        for (Iterator it = selection.iterator(); it.hasNext();)
        {
          Figure f = (Figure) it.next();

          f.moveBy(xOffset, yOffset);
          if (first)
          {
            scrollIntoView(f, true);
            first = false;
          }
View Full Code Here

  public void mouseUp(MouseEvent e, int x, int y)
  {
    Connector endConnector = null;
    if (moved)
    {
      Figure figure = null;
      if (startConnector != null)
      {
        figure = findTargetFigure(x, y, getDrawing());
        if (figure != null)
        {
View Full Code Here

   * @param x Document coordinate
   * @param y Document coordinate
   */
  protected void trackConnectors(MouseEvent e, int x, int y)
  {
    Figure figure = null;

    if (startConnector == null)
    {
      figure = findSourceFigure(x, y, getDrawing());
    }
View Full Code Here

   * @param drawing Drawing we operate on
   * @return The figure or null
   */
  protected Figure findTargetFigure(int x, int y, Drawing drawing)
  {
    Figure target = findConnectableFigure(x, y, drawing);
    Figure start = startConnector.owner();

    if (target != null && connectionFigure != null && target.canConnect() && !target.includes(start) && canLinkFigures(start, target))
    {
      return target;
    }
View Full Code Here

   * @param drawing Drawing we operate on
   * @return The figure or null
   */
  protected Figure findConnectionStart(int x, int y, Drawing drawing)
  {
    Figure target = findConnectableFigure(x, y, drawing);
    if ((target != null) && target.canConnect())
    {
      return target;
    }
    return null;
  }
View Full Code Here

   */
  protected Figure findConnectableFigure(int x, int y, Drawing drawing)
  {
    for (FigureEnumeration k = drawing.figures(); k.hasMoreElements();)
    {
      Figure figure = k.nextFigure();
      figure = figure.findFigureInside(x, y);

      if (figure != null && !figure.includes(connectionFigure) && figure.canConnect())
      {
        return figure;
      }
    }
    return null;
View Full Code Here

  private void toggleDecorator(boolean on)
  {
    if (startConnector != null && connectionFigure instanceof FlowConnection)
    {
      Figure startSocketFigure = startConnector.owner();

      // If control connectors are hidden, make sure we display the connectors we can connect to
      if (!ViewModeMgr.getInstance().isControlAnchorVisible())
      {
        for (Iterator it = ((ProcessDrawing) getDrawing()).getNodeFigures(); it.hasNext();)
        {
          NodeFigure nodeFigure = (NodeFigure) it.next();

          for (FigureEnumeration fe = nodeFigure.figures(); fe.hasMoreElements();)
          {
            Figure f = fe.nextFigure();
            if (f instanceof SocketFigure)
            {
              SocketFigure socketFigure = (SocketFigure) f;

              boolean affected = false;
View Full Code Here

    AffineTransform trans = g2.getTransform();
    g2.transform(to);

    while (en.hasMoreElements())
    {
      Figure next = en.nextFigure();
      next.draw(g);
    }

    g2.setTransform(trans);
  }
View Full Code Here

TOP

Related Classes of CH.ifa.draw.framework.Figure

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.