import java.util.*;
import java.util.zip.*;
import java.util.List;
import java.util.regex.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.*;
import java.util.concurrent.locks.*;
import java.util.function.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.text.*;
import javax.swing.table.*;
import java.io.*;
import java.net.*;
import java.lang.reflect.*;
import java.lang.ref.*;
import java.lang.management.*;
import java.security.*;
import java.security.spec.*;
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.awt.geom.*;
import javax.imageio.*;
import java.math.*;
import javax.swing.event.AncestorListener;
import javax.swing.event.AncestorEvent;
import javax.swing.Timer;
import static x30_pkg.x30_util.DynamicObject;
import java.awt.geom.*;
class main {
static A awtEveryAndNow(A component, long delay, Object r) {
swingEvery(component, delay, 0, r);
return component;
}
static A awtEveryAndNow(A component, long delay, Runnable r) {
return awtEveryAndNow(component, delay, (Object) r);
}
static A awtEveryAndNow(A component, double delaySeconds, Object r) {
return awtEveryAndNow(component, toMS(delaySeconds), r);
}
static A awtEveryAndNow(A component, double delaySeconds, Runnable r) {
return awtEveryAndNow(component, toMS(delaySeconds), r);
}
static void awtEveryAndNow(RootPaneContainer frame, long delay, Object r) {
swingEvery(frame, delay, 0, r);
}
static void swingEvery(JComponent component, long delay, Object r) {
installTimer(component, delay, r);
}
static void swingEvery(JComponent component, long delay, long firstDelay, Object r) {
installTimer(component, r, delay, firstDelay);
}
static void swingEvery(RootPaneContainer frame, long delay, Object r) {
installTimer(frame, delay, r);
}
static void swingEvery(RootPaneContainer frame, long delay, long firstDelay, Object r) {
installTimer(frame, delay, firstDelay, r);
}
static long toMS(double seconds) {
return (long) (seconds*1000);
}
// first delay = delay
static Timer installTimer(JComponent component, Object r, long delay) {
return installTimer(component, r, delay, delay);
}
// first delay = delay
static Timer installTimer(RootPaneContainer frame, long delay, Object r) {
return installTimer(frame.getRootPane(), r, delay, delay);
}
// first delay = delay
static Timer installTimer(JComponent component, long delay, Object r) {
return installTimer(component, r, delay, delay);
}
static Timer installTimer(JComponent component, long delay, long firstDelay, Object r) {
return installTimer(component, r, delay, firstDelay);
}
static Timer installTimer(final JComponent component, final Object r, final long delay, final long firstDelay) {
return installTimer(component, r, delay, firstDelay, true);
}
static Timer installTimer(final JComponent component, final Object r, final long delay, final long firstDelay, final boolean repeats) {
if (component == null) return null;
return (Timer) swingAndWait(new F0