Inheritance: global::java.util.Vector
Example #1
0
 public RootHandler()
 {
   base.\u002Ector();
   RootHandler rootHandler = this;
   this.subHandlers = new Stack();
 }
    private Point findSpace([In] DisplayElement obj0)
    {
      Stack stack = new Stack();
      ((Vector) stack).add((object) new Point(0, 0));
      Dimension size1 = ((Component) obj0).getSize();
      Dimension size2 = ((Component) this).getSize();
label_1:
      while (!((Vector) stack).isEmpty())
      {
        Point point1 = (Point) stack.pop();
        Rectangle rectangle = new Rectangle(point1, size1);
        if (rectangle.x >= 0 && rectangle.y >= 0 && (rectangle.x + rectangle.width <= size2.width && rectangle.y + rectangle.height <= size2.height))
        {
          Iterator iterator = ((AbstractSequentialList) this.elements).iterator();
          while (iterator.hasNext())
          {
            DisplayElement displayElement = (DisplayElement) iterator.next();
            if (displayElement != obj0 && displayElement.isObstruction())
            {
              Rectangle bounds = ((Component) displayElement).getBounds();
              if (bounds.x <= rectangle.x + rectangle.width && bounds.x + bounds.width >= rectangle.x && (bounds.y <= rectangle.y + rectangle.height && bounds.y + bounds.height >= rectangle.y))
              {
                Point point2 = new Point(bounds.x + bounds.width + 1, (int) point1.y);
                if (((Vector) stack).isEmpty())
                {
                  ((Vector) stack).add((object) point2);
                  point2 = (Point) null;
                }
                ((Vector) stack).add((object) new Point((int) point1.x, bounds.y + bounds.height + 1));
                if (point2 != null && Math.abs((int) (point2.x - rectangle.x)) < rectangle.width / 3)
                {
                  ((Vector) stack).add((object) point2);
                  goto label_1;
                }
                else
                  goto label_1;
              }
            }
          }
          System.get_out().println(new StringBuilder().append("Adding an element at [").append((int) point1.x).append(",").append((int) point1.y).append("]").toString());
          return point1;
        }
      }
      return new Point(DashboardPanel.random.nextInt(32), DashboardPanel.random.nextInt(32));
    }