package java.lang;
import org.checkerframework.checker.guieffect.qual.*;
@PolyUIType class Object {
    @SafeEffect Class<? extends Object> getClass(@PolyUI Object this) ;
}

@PolyUIType interface Runnable {
    @PolyUIEffect void run(@PolyUI Runnable this);
}

// These types are polymorphic, but they're basically unusable unless I fix the subtyping among
// differently permissioned interfaces...
//package java.util;
//@PolyUIType interface Observer {
//    @PolyUIEffect void update(@PolyUI Observer this, @PolyUI Observable o, Object arg);
//}
//@PolyUIType class Observable {
//    @SafeEffect void addObserver(@PolyUI Observable this, @PolyUI Observer o);
//    @SafeEffect void deleteObserver(@PolyUI Observable this, @PolyUI Observer o);
//    @PolyUIEffect void notifyObservers(@PolyUI Observable this);
//    @PolyUIEffect void notifyObservers(@PolyUI Observable this, Object arg);
//}

@UIPackage
package java.awt;

@UIType class Component implements ImageObserver, MenuContainer, Serializable {
    @SafeEffect void repaint();
    @SafeEffect void repaint(long arg0);
    @SafeEffect void repaint(int arg0, int arg1, int arg2, int arg3);
    @SafeEffect void repaint(long arg0, int arg1, int arg2, int arg3, int arg4);
}
@UIType class Container extends Component {
    @SafeEffect void invalidate();
}

class Desktop {
    @SafeEffect void browse(URI uri);
    @SafeEffect void edit(File file);
    @SafeEffect static Desktop getDesktop();
    @SafeEffect static boolean isDesktopSupported();
    @SafeEffect boolean isSupported(Desktop.Action action);
    @SafeEffect void mail();
    @SafeEffect void mail(URI mailtoURI);
    @SafeEffect void open(File file);
    @SafeEffect void print(File file);
}

@UIType class EventQueue {
    @SafeEffect void invokeLater(@UI Runnable arg0);
}

package java.beans;
@PolyUIType public interface PropertyChangeListener extends EventListener {
    @PolyUIEffect void propertyChange(@PolyUI PropertyChangeListener this, PropertyChangeEvent evt);
}
@PolyUIType public class PropertyChangeSupport implements Serializable {
    @SafeEffect public PropertyChangeSupport(@PolyUI Object sourceBean);
    @PolyUIEffect public void addPropertyChangeListener(@PolyUI PropertyChangeSupport this, @PolyUI PropertyChangeListener listener);
    @PolyUIEffect public void removePropertyChangeListener(@PolyUI PropertyChangeSupport this, PropertyChangeListener listener);
    @PolyUIEffect public @PolyUI PropertyChangeListener[] getPropertyChangeListeners(@PolyUI PropertyChangeSupport this);
    @PolyUIEffect public void addPropertyChangeListener(@PolyUI PropertyChangeSupport this, String propertyName, @PolyUI PropertyChangeListener listener);
    @PolyUIEffect public void removePropertyChangeListener(@PolyUI PropertyChangeSupport this, String propertyName, @PolyUI PropertyChangeListener listener);
    @PolyUIEffect public @PolyUI PropertyChangeListener[] getPropertyChangeListeners(@PolyUI PropertyChangeSupport this, String propertyName);
    @PolyUIEffect public void firePropertyChange(@PolyUI PropertyChangeSupport this, String propertyName, Object oldValue, Object newValue);
    @PolyUIEffect public void firePropertyChange(@PolyUI PropertyChangeSupport this, String propertyName, int oldValue, int newValue);
    @PolyUIEffect public void firePropertyChange(@PolyUI PropertyChangeSupport this, String propertyName, boolean oldValue, boolean newValue);
    @PolyUIEffect public void firePropertyChange(@PolyUI PropertyChangeSupport this, PropertyChangeEvent event);
    @PolyUIEffect public void fireIndexedPropertyChange(@PolyUI PropertyChangeSupport this, String propertyName,
                             int index,
                             Object oldValue,
                             Object newValue);
    @PolyUIEffect public void fireIndexedPropertyChange(@PolyUI PropertyChangeSupport this, String propertyName,
                             int index,
                             int oldValue,
                             int newValue);
    @PolyUIEffect public void fireIndexedPropertyChange(@PolyUI PropertyChangeSupport this, String propertyName,
                             int index,
                             boolean oldValue,
                             boolean newValue);
    @PolyUIEffect public boolean hasListeners(@PolyUI PropertyChangeSupport this, String propertyName);
}


@UIPackage
package java.awt.event;

import org.checkerframework.checker.guieffect.qual.*;

@UIType interface ActionListener extends EventListener {
    @UIEffect void actionPerformed(ActionEvent e);
}

@UIPackage package java.awt.dnd;

@UIPackage
package javax.swing;

import org.checkerframework.checker.guieffect.qual.*;
@UIType class JComponent extends Container implements Serializable, HasGetTransferHandler {
    @SafeEffect void revalidate();
}

@UIType class SwingUtilities implements SwingConstants {
    @SafeEffect static void invokeLater(@UI Runnable doRun);
    @SafeEffect static void invokeAndWait(@UI Runnable doRun);
}

@UIType class UIManager implements Serializable {
    @SafeEffect static void setLookAndFeel(LookAndFeel newLookAndFeel);
    @SafeEffect static void setLookAndFeel(String classname);
}

@UIPackage package javax.swing.text;
public abstract class JTextComponent extends JComponent implements Scrollable, Accessible {
    @SafeEffect public void setText(String t);
}

@UIPackage
package javax.swing.event;
