home *** CD-ROM | disk | FTP | other *** search
/ Sky at Night 2007 June / SAN CD 6-2007 CD-ROM 25.iso / pc / Software / AstroGrav_Win / Java / jre1.6.0 / lib / rt.jar / java / awt / Dialog.class (.txt) < prev    next >
Encoding:
Java Class File  |  2006-11-29  |  13.4 KB  |  660 lines

  1. package java.awt;
  2.  
  3. import java.awt.Dialog.4;
  4. import java.awt.event.ComponentEvent;
  5. import java.awt.event.InvocationEvent;
  6. import java.awt.peer.DialogPeer;
  7. import java.io.IOException;
  8. import java.io.ObjectInputStream;
  9. import java.lang.ref.WeakReference;
  10. import java.security.AccessController;
  11. import java.util.Vector;
  12. import java.util.concurrent.atomic.AtomicLong;
  13. import javax.accessibility.AccessibleContext;
  14. import sun.awt.AppContext;
  15. import sun.awt.PeerEvent;
  16. import sun.awt.SunToolkit;
  17. import sun.security.util.SecurityConstants;
  18.  
  19. public class Dialog extends Window {
  20.    boolean resizable;
  21.    boolean undecorated;
  22.    public static final ModalityType DEFAULT_MODALITY_TYPE;
  23.    boolean modal;
  24.    ModalityType modalityType;
  25.    private static final ModalExclusionType DEFAULT_MODAL_EXCLUSION_TYPE;
  26.    static transient Vector<Dialog> modalDialogs;
  27.    transient Vector<Window> blockedWindows;
  28.    String title;
  29.    private transient boolean keepBlocking;
  30.    private transient ModalEventFilter modalFilter;
  31.    transient volatile boolean isInHide;
  32.    transient volatile boolean isInDispose;
  33.    private static final String base = "dialog";
  34.    private static int nameCounter;
  35.    private static final long serialVersionUID = 5920926903803293709L;
  36.    private transient AppContext showAppContext;
  37.  
  38.    public Dialog(Frame var1) {
  39.       this(var1, "", false);
  40.    }
  41.  
  42.    public Dialog(Frame var1, boolean var2) {
  43.       this(var1, "", var2);
  44.    }
  45.  
  46.    public Dialog(Frame var1, String var2) {
  47.       this(var1, var2, false);
  48.    }
  49.  
  50.    public Dialog(Frame var1, String var2, boolean var3) {
  51.       this(var1, var2, var3 ? DEFAULT_MODALITY_TYPE : java.awt.Dialog.ModalityType.MODELESS);
  52.    }
  53.  
  54.    public Dialog(Frame var1, String var2, boolean var3, GraphicsConfiguration var4) {
  55.       this(var1, var2, var3 ? DEFAULT_MODALITY_TYPE : java.awt.Dialog.ModalityType.MODELESS, var4);
  56.    }
  57.  
  58.    public Dialog(Dialog var1) {
  59.       this(var1, "", false);
  60.    }
  61.  
  62.    public Dialog(Dialog var1, String var2) {
  63.       this(var1, var2, false);
  64.    }
  65.  
  66.    public Dialog(Dialog var1, String var2, boolean var3) {
  67.       this(var1, var2, var3 ? DEFAULT_MODALITY_TYPE : java.awt.Dialog.ModalityType.MODELESS);
  68.    }
  69.  
  70.    public Dialog(Dialog var1, String var2, boolean var3, GraphicsConfiguration var4) {
  71.       this(var1, var2, var3 ? DEFAULT_MODALITY_TYPE : java.awt.Dialog.ModalityType.MODELESS, var4);
  72.    }
  73.  
  74.    public Dialog(Window var1) {
  75.       this(var1, (String)null, java.awt.Dialog.ModalityType.MODELESS);
  76.    }
  77.  
  78.    public Dialog(Window var1, String var2) {
  79.       this(var1, var2, java.awt.Dialog.ModalityType.MODELESS);
  80.    }
  81.  
  82.    public Dialog(Window var1, ModalityType var2) {
  83.       this(var1, (String)null, var2);
  84.    }
  85.  
  86.    public Dialog(Window var1, String var2, ModalityType var3) {
  87.       super(var1);
  88.       this.resizable = true;
  89.       this.undecorated = false;
  90.       this.blockedWindows = new Vector();
  91.       this.keepBlocking = false;
  92.       this.isInHide = false;
  93.       this.isInDispose = false;
  94.       if (var1 != null && !(var1 instanceof Frame) && !(var1 instanceof Dialog)) {
  95.          throw new IllegalArgumentException("Wrong parent window");
  96.       } else {
  97.          this.title = var2;
  98.          this.setModalityType(var3);
  99.          SunToolkit.checkAndSetPolicy(this, false);
  100.       }
  101.    }
  102.  
  103.    public Dialog(Window var1, String var2, ModalityType var3, GraphicsConfiguration var4) {
  104.       super(var1, var4);
  105.       this.resizable = true;
  106.       this.undecorated = false;
  107.       this.blockedWindows = new Vector();
  108.       this.keepBlocking = false;
  109.       this.isInHide = false;
  110.       this.isInDispose = false;
  111.       if (var1 != null && !(var1 instanceof Frame) && !(var1 instanceof Dialog)) {
  112.          throw new IllegalArgumentException("wrong owner window");
  113.       } else {
  114.          this.title = var2;
  115.          this.setModalityType(var3);
  116.          SunToolkit.checkAndSetPolicy(this, false);
  117.       }
  118.    }
  119.  
  120.    String constructComponentName() {
  121.       synchronized(this.getClass()) {
  122.          return "dialog" + nameCounter++;
  123.       }
  124.    }
  125.  
  126.    public void addNotify() {
  127.       synchronized(this.getTreeLock()) {
  128.          if (this.parent != null && this.parent.getPeer() == null) {
  129.             this.parent.addNotify();
  130.          }
  131.  
  132.          if (this.peer == null) {
  133.             this.peer = this.getToolkit().createDialog(this);
  134.          }
  135.  
  136.          super.addNotify();
  137.       }
  138.    }
  139.  
  140.    public boolean isModal() {
  141.       return this.modalityType != java.awt.Dialog.ModalityType.MODELESS;
  142.    }
  143.  
  144.    public void setModal(boolean var1) {
  145.       this.modal = var1;
  146.       this.setModalityType(var1 ? DEFAULT_MODALITY_TYPE : java.awt.Dialog.ModalityType.MODELESS);
  147.    }
  148.  
  149.    public ModalityType getModalityType() {
  150.       return this.modalityType;
  151.    }
  152.  
  153.    public void setModalityType(ModalityType var1) {
  154.       if (var1 == null) {
  155.          var1 = java.awt.Dialog.ModalityType.MODELESS;
  156.       }
  157.  
  158.       if (this.modalityType != var1) {
  159.          if (var1 == java.awt.Dialog.ModalityType.TOOLKIT_MODAL) {
  160.             SecurityManager var2 = System.getSecurityManager();
  161.             if (var2 != null) {
  162.                var2.checkPermission(SecurityConstants.TOOLKIT_MODALITY_PERMISSION);
  163.             }
  164.          }
  165.  
  166.          this.modalityType = var1;
  167.          this.modal = this.modalityType != java.awt.Dialog.ModalityType.MODELESS;
  168.       }
  169.    }
  170.  
  171.    public String getTitle() {
  172.       return this.title;
  173.    }
  174.  
  175.    public void setTitle(String var1) {
  176.       String var2 = this.title;
  177.       synchronized(this) {
  178.          this.title = var1;
  179.          DialogPeer var4 = (DialogPeer)this.peer;
  180.          if (var4 != null) {
  181.             var4.setTitle(var1);
  182.          }
  183.       }
  184.  
  185.       this.firePropertyChange("title", var2, var1);
  186.    }
  187.  
  188.    private boolean conditionalShow(Component var1, AtomicLong var2) {
  189.       boolean var3;
  190.       synchronized(this.getTreeLock()) {
  191.          if (this.peer == null) {
  192.             this.addNotify();
  193.          }
  194.  
  195.          this.validate();
  196.          if (this.visible) {
  197.             this.toFront();
  198.             var3 = false;
  199.          } else {
  200.             var3 = true;
  201.             this.visible = true;
  202.             if (!this.isModal()) {
  203.                checkShouldBeBlocked(this);
  204.             } else {
  205.                this.modalShow();
  206.             }
  207.  
  208.             if (var1 != null && var2 != null && this.isFocusable() && this.isEnabled() && !this.isModalBlocked()) {
  209.                var2.set(Toolkit.getEventQueue().getMostRecentEventTimeEx());
  210.                KeyboardFocusManager.getCurrentKeyboardFocusManager().enqueueKeyEvents(var2.get(), var1);
  211.             }
  212.  
  213.             this.peer.show();
  214.             if (this.isModalBlocked()) {
  215.                this.modalBlocker.toFront();
  216.             }
  217.  
  218.             this.setLocationByPlatform(false);
  219.  
  220.             for(int var5 = 0; var5 < this.ownedWindowList.size(); ++var5) {
  221.                Window var6 = (Window)((WeakReference)this.ownedWindowList.elementAt(var5)).get();
  222.                if (var6 != null && var6.showWithParent) {
  223.                   var6.show();
  224.                   var6.showWithParent = false;
  225.                }
  226.             }
  227.  
  228.             Window.updateChildFocusableWindowState(this);
  229.             this.createHierarchyEvents(1400, this, this.parent, 4L, Toolkit.enabledOnToolkit(32768L));
  230.             if (this.componentListener != null || (this.eventMask & 1L) != 0L || Toolkit.enabledOnToolkit(1L)) {
  231.                ComponentEvent var9 = new ComponentEvent(this, 102);
  232.                Toolkit.getEventQueue().postEvent(var9);
  233.             }
  234.          }
  235.       }
  236.  
  237.       if (var3 && (this.state & 1) == 0) {
  238.          this.postWindowEvent(200);
  239.          this.state |= 1;
  240.       }
  241.  
  242.       return var3;
  243.    }
  244.  
  245.    public void setVisible(boolean var1) {
  246.       super.setVisible(var1);
  247.    }
  248.  
  249.    /** @deprecated */
  250.    @Deprecated
  251.    public void show() {
  252.       this.beforeFirstShow = false;
  253.       if (!this.isModal()) {
  254.          this.conditionalShow((Component)null, (AtomicLong)null);
  255.       } else {
  256.          this.keepBlocking = true;
  257.          this.showAppContext = AppContext.getAppContext();
  258.          AtomicLong var1 = new AtomicLong();
  259.          Component var2 = null;
  260.  
  261.          try {
  262.             var2 = this.getMostRecentFocusOwner();
  263.             if (this.conditionalShow(var2, var1)) {
  264.                this.modalFilter = ModalEventFilter.createFilterForDialog(this);
  265.                1 var3 = new 1(this);
  266.                if (this.modalityType == java.awt.Dialog.ModalityType.TOOLKIT_MODAL) {
  267.                   for(AppContext var5 : AppContext.getAppContexts()) {
  268.                      if (var5 != this.showAppContext) {
  269.                         EventQueue var6 = (EventQueue)var5.get(AppContext.EVENT_QUEUE_KEY);
  270.                         2 var7 = new 2(this);
  271.                         var6.postEvent(new InvocationEvent(this, var7));
  272.                         EventDispatchThread var8 = var6.getDispatchThread();
  273.                         var8.addEventFilter(this.modalFilter);
  274.                      }
  275.                   }
  276.                }
  277.  
  278.                this.modalityPushed();
  279.  
  280.                try {
  281.                   if (EventQueue.isDispatchThread()) {
  282.                      SequencedEvent var24 = KeyboardFocusManager.getCurrentKeyboardFocusManager().getCurrentSequencedEvent();
  283.                      if (var24 != null) {
  284.                         var24.dispose();
  285.                      }
  286.  
  287.                      AccessController.doPrivileged(new 3(this, var3));
  288.                   } else {
  289.                      synchronized(this.getTreeLock()) {
  290.                         Toolkit.getEventQueue().postEvent(new PeerEvent(this, var3, 1L));
  291.  
  292.                         while(this.keepBlocking && this.windowClosingException == null) {
  293.                            try {
  294.                               this.getTreeLock().wait();
  295.                            } catch (InterruptedException var20) {
  296.                               break;
  297.                            }
  298.                         }
  299.                      }
  300.                   }
  301.                } finally {
  302.                   this.modalityPopped();
  303.                }
  304.  
  305.                if (this.modalityType == java.awt.Dialog.ModalityType.TOOLKIT_MODAL) {
  306.                   for(AppContext var26 : AppContext.getAppContexts()) {
  307.                      if (var26 != this.showAppContext) {
  308.                         EventQueue var27 = (EventQueue)var26.get(AppContext.EVENT_QUEUE_KEY);
  309.                         EventDispatchThread var28 = var27.getDispatchThread();
  310.                         var28.removeEventFilter(this.modalFilter);
  311.                      }
  312.                   }
  313.                }
  314.  
  315.                if (this.windowClosingException != null) {
  316.                   this.windowClosingException.fillInStackTrace();
  317.                   throw this.windowClosingException;
  318.                }
  319.             }
  320.          } finally {
  321.             if (var2 != null) {
  322.                KeyboardFocusManager.getCurrentKeyboardFocusManager().dequeueKeyEvents(var1.get(), var2);
  323.             }
  324.  
  325.          }
  326.       }
  327.  
  328.    }
  329.  
  330.    final void modalityPushed() {
  331.       Toolkit var1 = Toolkit.getDefaultToolkit();
  332.       if (var1 instanceof SunToolkit) {
  333.          SunToolkit var2 = (SunToolkit)var1;
  334.          var2.notifyModalityPushed(this);
  335.       }
  336.  
  337.    }
  338.  
  339.    final void modalityPopped() {
  340.       Toolkit var1 = Toolkit.getDefaultToolkit();
  341.       if (var1 instanceof SunToolkit) {
  342.          SunToolkit var2 = (SunToolkit)var1;
  343.          var2.notifyModalityPopped(this);
  344.       }
  345.  
  346.    }
  347.  
  348.    void interruptBlocking() {
  349.       if (this.isModal()) {
  350.          this.disposeImpl();
  351.       } else if (this.windowClosingException != null) {
  352.          this.windowClosingException.fillInStackTrace();
  353.          this.windowClosingException.printStackTrace();
  354.          this.windowClosingException = null;
  355.       }
  356.  
  357.    }
  358.  
  359.    private void hideAndDisposePreHandler() {
  360.       this.isInHide = true;
  361.       if (this.keepBlocking) {
  362.          synchronized(this.getTreeLock()) {
  363.             if (modalDialogs.contains(this)) {
  364.                this.modalHide();
  365.                if (this.modalFilter != null) {
  366.                   this.modalFilter.disable();
  367.                }
  368.             }
  369.          }
  370.       }
  371.  
  372.    }
  373.  
  374.    private void hideAndDisposeHandler() {
  375.       if (this.keepBlocking) {
  376.          synchronized(this.getTreeLock()) {
  377.             this.keepBlocking = false;
  378.             if (this.showAppContext != null) {
  379.                SunToolkit.postEvent(this.showAppContext, new PeerEvent(this, new WakingRunnable(), 1L));
  380.                this.showAppContext = null;
  381.             }
  382.  
  383.             EventQueue.invokeLater(new WakingRunnable());
  384.             this.getTreeLock().notifyAll();
  385.          }
  386.       }
  387.  
  388.       this.isInHide = false;
  389.    }
  390.  
  391.    /** @deprecated */
  392.    @Deprecated
  393.    public void hide() {
  394.       this.hideAndDisposePreHandler();
  395.       super.hide();
  396.       if (!this.isInDispose) {
  397.          this.hideAndDisposeHandler();
  398.       }
  399.  
  400.    }
  401.  
  402.    void doDispose() {
  403.       this.isInDispose = true;
  404.       super.doDispose();
  405.       this.hideAndDisposeHandler();
  406.       this.isInDispose = false;
  407.    }
  408.  
  409.    public void toBack() {
  410.       super.toBack();
  411.       if (this.visible) {
  412.          synchronized(this.getTreeLock()) {
  413.             for(Window var3 : this.blockedWindows) {
  414.                var3.toBack_NoClientCode();
  415.             }
  416.          }
  417.       }
  418.  
  419.    }
  420.  
  421.    public boolean isResizable() {
  422.       return this.resizable;
  423.    }
  424.  
  425.    public void setResizable(boolean var1) {
  426.       boolean var2 = false;
  427.       synchronized(this) {
  428.          this.resizable = var1;
  429.          DialogPeer var4 = (DialogPeer)this.peer;
  430.          if (var4 != null) {
  431.             var4.setResizable(var1);
  432.             var2 = true;
  433.          }
  434.       }
  435.  
  436.       if (var2 && this.valid) {
  437.          this.invalidate();
  438.       }
  439.  
  440.    }
  441.  
  442.    public void setUndecorated(boolean var1) {
  443.       synchronized(this.getTreeLock()) {
  444.          if (this.isDisplayable()) {
  445.             throw new IllegalComponentStateException("The dialog is displayable.");
  446.          } else {
  447.             this.undecorated = var1;
  448.          }
  449.       }
  450.    }
  451.  
  452.    public boolean isUndecorated() {
  453.       return this.undecorated;
  454.    }
  455.  
  456.    protected String paramString() {
  457.       String var1 = super.paramString() + "," + this.modalityType;
  458.       if (this.title != null) {
  459.          var1 = var1 + ",title=" + this.title;
  460.       }
  461.  
  462.       return var1;
  463.    }
  464.  
  465.    private static native void initIDs();
  466.  
  467.    void modalShow() {
  468.       modalDialogs.add(this);
  469.       Vector var1 = new Vector();
  470.  
  471.       for(Dialog var3 : modalDialogs) {
  472.          if (var3.shouldBlock(this)) {
  473.             Object var4;
  474.             for(var4 = var3; var4 != null && var4 != this; var4 = ((Window)var4).getOwner()) {
  475.             }
  476.  
  477.             if (var4 == this || !this.shouldBlock(var3) || this.modalityType.compareTo(var3.getModalityType()) < 0) {
  478.                var1.add(var3);
  479.             }
  480.          }
  481.       }
  482.  
  483.       for(int var10 = 0; var10 < var1.size(); ++var10) {
  484.          Dialog var12 = (Dialog)var1.get(var10);
  485.          if (var12.isModalBlocked()) {
  486.             Dialog var14 = var12.getModalBlocker();
  487.             if (!var1.contains(var14)) {
  488.                var1.add(var10 + 1, var14);
  489.             }
  490.          }
  491.       }
  492.  
  493.       if (var1.size() > 0) {
  494.          ((Dialog)var1.get(0)).blockWindow(this);
  495.       }
  496.  
  497.       Vector var11 = new Vector(var1);
  498.  
  499.       for(int var13 = 0; var13 < var11.size(); ++var13) {
  500.          Window var15 = (Window)var11.get(var13);
  501.          Window[] var5 = var15.getOwnedWindows();
  502.  
  503.          for(Window var9 : var5) {
  504.             var11.add(var9);
  505.          }
  506.       }
  507.  
  508.       for(Window var18 : Window.getAllUnblockedWindows()) {
  509.          if (this.shouldBlock(var18) && !var11.contains(var18)) {
  510.             if (var18 instanceof Dialog && ((Dialog)var18).isModal()) {
  511.                Dialog var19 = (Dialog)var18;
  512.                if (var19.shouldBlock(this) && modalDialogs.indexOf(var19) > modalDialogs.indexOf(this)) {
  513.                   continue;
  514.                }
  515.             }
  516.  
  517.             this.blockWindow(var18);
  518.          }
  519.       }
  520.  
  521.       if (!this.isModalBlocked()) {
  522.          this.updateChildrenBlocking();
  523.       }
  524.  
  525.    }
  526.  
  527.    void modalHide() {
  528.       modalDialogs.remove(this);
  529.       Vector var1 = new Vector();
  530.       int var2 = this.blockedWindows.size();
  531.  
  532.       for(int var3 = 0; var3 < var2; ++var3) {
  533.          Window var4 = (Window)this.blockedWindows.get(0);
  534.          var1.add(var4);
  535.          this.unblockWindow(var4);
  536.       }
  537.  
  538.       for(int var6 = 0; var6 < var2; ++var6) {
  539.          Window var7 = (Window)var1.get(var6);
  540.          if (var7 instanceof Dialog && ((Dialog)var7).isModal()) {
  541.             Dialog var5 = (Dialog)var7;
  542.             var5.modalShow();
  543.          } else {
  544.             checkShouldBeBlocked(var7);
  545.          }
  546.       }
  547.  
  548.    }
  549.  
  550.    boolean shouldBlock(Window var1) {
  551.       if (this.isVisible() && (var1.isVisible() || var1.isInShow) && !this.isInHide && var1 != this && this.isModal()) {
  552.          if (var1 instanceof Dialog && ((Dialog)var1).isInHide) {
  553.             return false;
  554.          } else {
  555.             for(Dialog var2 = this; var2 != null; var2 = ((Window)var2).getModalBlocker()) {
  556.                Object var3;
  557.                for(var3 = var1; var3 != null && var3 != var2; var3 = ((Component)var3).getParent_NoClientCode()) {
  558.                }
  559.  
  560.                if (var3 == var2) {
  561.                   return false;
  562.                }
  563.             }
  564.  
  565.             switch (4.$SwitchMap$java$awt$Dialog$ModalityType[this.modalityType.ordinal()]) {
  566.                case 1:
  567.                   return false;
  568.                case 2:
  569.                   if (!var1.isModalExcluded(java.awt.Dialog.ModalExclusionType.APPLICATION_EXCLUDE)) {
  570.                      return this.getDocumentRoot() == var1.getDocumentRoot();
  571.                   }
  572.  
  573.                   Object var4;
  574.                   for(var4 = this; var4 != null && var4 != var1; var4 = ((Component)var4).getParent_NoClientCode()) {
  575.                   }
  576.  
  577.                   return var4 == var1;
  578.                case 3:
  579.                   return !var1.isModalExcluded(java.awt.Dialog.ModalExclusionType.APPLICATION_EXCLUDE) && this.appContext == var1.appContext;
  580.                case 4:
  581.                   return !var1.isModalExcluded(java.awt.Dialog.ModalExclusionType.TOOLKIT_EXCLUDE);
  582.                default:
  583.                   return false;
  584.             }
  585.          }
  586.       } else {
  587.          return false;
  588.       }
  589.    }
  590.  
  591.    void blockWindow(Window var1) {
  592.       if (!var1.isModalBlocked()) {
  593.          var1.setModalBlocked(this, true);
  594.          this.blockedWindows.add(var1);
  595.       }
  596.  
  597.    }
  598.  
  599.    void unblockWindow(Window var1) {
  600.       if (var1.isModalBlocked() && this.blockedWindows.contains(var1)) {
  601.          this.blockedWindows.remove(var1);
  602.          var1.setModalBlocked(this, false);
  603.       }
  604.  
  605.    }
  606.  
  607.    static void checkShouldBeBlocked(Window var0) {
  608.       synchronized(var0.getTreeLock()) {
  609.          for(int var2 = 0; var2 < modalDialogs.size(); ++var2) {
  610.             Dialog var3 = (Dialog)modalDialogs.get(var2);
  611.             if (var3.shouldBlock(var0)) {
  612.                var3.blockWindow(var0);
  613.                break;
  614.             }
  615.          }
  616.  
  617.       }
  618.    }
  619.  
  620.    private void readObject(ObjectInputStream var1) throws ClassNotFoundException, IOException, HeadlessException {
  621.       GraphicsEnvironment.checkHeadless();
  622.       var1.defaultReadObject();
  623.       if (this.modalityType == null) {
  624.          this.setModal(this.modal);
  625.       }
  626.  
  627.       this.blockedWindows = new Vector();
  628.    }
  629.  
  630.    public AccessibleContext getAccessibleContext() {
  631.       if (this.accessibleContext == null) {
  632.          this.accessibleContext = new AccessibleAWTDialog(this);
  633.       }
  634.  
  635.       return this.accessibleContext;
  636.    }
  637.  
  638.    // $FF: synthetic method
  639.    static boolean access$000(Dialog var0) {
  640.       return var0.keepBlocking;
  641.    }
  642.  
  643.    // $FF: synthetic method
  644.    static ModalEventFilter access$100(Dialog var0) {
  645.       return var0.modalFilter;
  646.    }
  647.  
  648.    static {
  649.       Toolkit.loadLibraries();
  650.       if (!GraphicsEnvironment.isHeadless()) {
  651.          initIDs();
  652.       }
  653.  
  654.       DEFAULT_MODALITY_TYPE = java.awt.Dialog.ModalityType.APPLICATION_MODAL;
  655.       DEFAULT_MODAL_EXCLUSION_TYPE = java.awt.Dialog.ModalExclusionType.APPLICATION_EXCLUDE;
  656.       modalDialogs = new Vector();
  657.       nameCounter = 0;
  658.    }
  659. }
  660.