package net.miginfocom.swing;

import java.awt.BasicStroke;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Graphics2D;
import net.miginfocom.layout.ComponentWrapper;
import net.miginfocom.layout.ContainerWrapper;

public final class SwingContainerWrapper extends SwingComponentWrapper implements ContainerWrapper {
   private static final Color DB_CELL_OUTLINE = new Color(255, 0, 0);

   public SwingContainerWrapper(Container var1) {
      super(var1);
   }

   public ComponentWrapper[] getComponents() {
      Container var1 = (Container)this.getComponent();
      ComponentWrapper[] var2 = new ComponentWrapper[var1.getComponentCount()];

      for(int var3 = 0; var3 < var2.length; ++var3) {
         var2[var3] = new SwingComponentWrapper(var1.getComponent(var3));
      }

      return var2;
   }

   public int getComponentCount() {
      return ((Container)this.getComponent()).getComponentCount();
   }

   public Object getLayout() {
      return ((Container)this.getComponent()).getLayout();
   }

   public final boolean isLeftToRight() {
      return ((Container)this.getComponent()).getComponentOrientation().isLeftToRight();
   }

   public final void paintDebugCell(int var1, int var2, int var3, int var4) {
      Component var5 = (Component)this.getComponent();
      if (var5.isShowing()) {
         Graphics2D var6 = (Graphics2D)var5.getGraphics();
         if (var6 != null) {
            var6.setStroke(new BasicStroke(1.0F, 2, 0, 10.0F, new float[]{2.0F, 3.0F}, 0.0F));
            var6.setPaint(DB_CELL_OUTLINE);
            var6.drawRect(var1, var2, var3 - 1, var4 - 1);
         }
      }
   }

   public int getComponetType(boolean var1) {
      return 1;
   }

   public int getLayoutHashCode() {
      long var1 = System.nanoTime();
      int var3 = super.getLayoutHashCode();
      if (this.isLeftToRight()) {
         var3 += 416343;
      }

      return 0;
   }
}
