Package CH.ifa.draw.framework

Examples of CH.ifa.draw.framework.FigureEnumeration


    * @return null if none is found or the command text if one is found.
    */
   private String[] getAssociatedTexts(Figure fig) {
      if (fig == null) return null;
      ArrayList list = new ArrayList();
      FigureEnumeration enumer = fig.figures();
      while (enumer.hasNextFigure()) {
         Figure fig1 = enumer.nextFigure();
         if (fig1.getTextHolder() != null) {
            String txt = fig1.getTextHolder().getText();
            if (isCommand(txt)) list.add(txt);
         }
      }
View Full Code Here


      return (String[])list.toArray(new String[list.size()]);
   }


   private boolean prepareClient(Drawing drawing) {
      FigureEnumeration enumer = drawing.figures();
      boolean ret = false;
      while (enumer.hasNextFigure()) {
         Figure fig = enumer.nextFigure();
         String[] txt = getAssociatedTexts(fig);
         if (txt != null) {
            for (int i=0; i < txt.length; i++) {
               try {
                  MonitorCommand cmd = new MonitorCommand(this.global, txt[i], fig);
View Full Code Here

  {
    if (activeHandles == null)
    {
      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

      if (!getEditor().isUndoRecording())
      {
        getEditor().startUndo("Move Element");
      }

      FigureEnumeration figures = getView().selectionElements();
      while (figures.hasMoreElements())
      {
        figures.nextFigure().moveBy(x - lastX, y - lastY);
      }
    }

    lastX = x;
    lastY = y;
View Full Code Here

    throws CloneNotSupportedException
  {
    // A single node must be selected in order to have a paste target.
    if (workspaceView.selectionCount() == 1)
    {
      FigureEnumeration fe = workspaceView.selectionElements();
      if (fe.hasMoreElements())
      {
        Figure selection = fe.nextFigure();
        if (selection instanceof MultiSocketNodeFigure)
        {
          // Get the node figure to add the sockets to
          MultiSocketNodeFigure nodeFigure = (MultiSocketNodeFigure) selection;
          MultiSocketNode targetNode = (MultiSocketNode) nodeFigure.getNode();
View Full Code Here

    throws CloneNotSupportedException
  {
    // A single socket must be selected in order to have a paste target.
    if (workspaceView.selectionCount() == 1)
    {
      FigureEnumeration fe = workspaceView.selectionElements();
      if (fe.hasMoreElements())
      {
        Figure figure = fe.nextFigure();
        if (figure instanceof SocketFigure)
        {
          // Get the node figure to add the sockets to
          SocketFigure socketFigure = (SocketFigure) figure;
          NodeSocket targetSocket = socketFigure.getNodeSocket();
View Full Code Here

  public boolean pasteQualifier(ModelQualifier source)
  {
    // A single node must be selected in order to have a paste target.
    if (workspaceView.selectionCount() == 1)
    {
      FigureEnumeration fe = workspaceView.selectionElements();
      if (fe.hasMoreElements())
      {
        Figure selection = fe.nextFigure();
        if (selection instanceof PlaceholderNodeFigure)
        {
          // Get the node figure to add the sockets to
          PlaceholderNodeFigure nodeFigure = (PlaceholderNodeFigure) selection;
          nodeFigure.assignPlaceholderReference(source.toString());
View Full Code Here

   * original figuresReverse() for enumerating the figures.
   * @see CH.ifa.draw.standard.StandardDrawing#findFigure(int, int)
   */
  public Figure findFigure(int x, int y)
  {
    FigureEnumeration figures = figures();
    while (figures.hasMoreElements())
    {
      Figure figure = figures.nextFigure();
      if (figure.containsPoint(x, y))
      {
        return figure;
      }
    }
View Full Code Here

TOP

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

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.