package WindowFrameButtons;
import DisplayProject.actions.AppletConnectionInfo;
import DisplayProject.actions.UserWindow;
import DisplayProject.binding.beans.ExtendedPropertyChangeSupport;
import DisplayProject.binding.beans.Observable;
import DisplayProject.plaf.Win32LookAndFeel;
import Framework.ErrorMgr;
import Framework.EventHandle;
import Framework.EventManager;
import Framework.EventRegistration;
import Framework.ForteKeyboardFocusManager;
import Framework.FrameworkUtils;
import Framework.RuntimeProperties;
import WindowFrameButtons.CloseDisabled;
import WindowFrameButtons.IconizableDisabled;
import WindowFrameButtons.MaximizedDisabled;
import WindowFrameButtons.NonResizableCloseButton;
import java.awt.KeyboardFocusManager;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.lang.String;
import javax.swing.UIManager;
/**
* Runner<p>
* <p>
* @author Generated from Forte
* @since 19-Nov-2008
*/
@RuntimeProperties(isDistributed=false, isAnchored=false, isShared=false, isTransactional=false)
@SuppressWarnings("serial")
public class Runner
implements Serializable, Observable
{
// ----------
// Attributes
// ----------
public PropertyChangeSupport qq_Listeners = new ExtendedPropertyChangeSupport(this, true);
// ------------
// Constructors
// ------------
public Runner() {
// Explicitly call the superclass constructor to prevent the implicit call
super();
}
// -------
// Methods
// -------
public void addPropertyChangeListener(String property, PropertyChangeListener listener) {
qq_Listeners.addPropertyChangeListener(property, listener);
}
public void addPropertyChangeListener(PropertyChangeListener listener) {
qq_Listeners.addPropertyChangeListener(listener);
}
public void removePropertyChangeListener(String property, PropertyChangeListener listener) {
qq_Listeners.removePropertyChangeListener(property, listener);
}
public void removePropertyChangeListener(PropertyChangeListener listener) {
qq_Listeners.removePropertyChangeListener(listener);
}
/**
* runnit<p>
* <p>
*/
public void runnit() {
CloseDisabled cl = new CloseDisabled();
IconizableDisabled min = new IconizableDisabled();
MaximizedDisabled max = new MaximizedDisabled();
NonResizableCloseButton clfixed = new NonResizableCloseButton();
new CloseDisabled.AsyncRunner(true).display(cl);
new IconizableDisabled.AsyncRunner(true).display(min);
new MaximizedDisabled.AsyncRunner(true).display(max);
new NonResizableCloseButton.AsyncRunner(true).display(clfixed);
int count = 0;
// ----------
// Event Loop
// ----------
EventManager.startEventLoop();
try {
EventRegistration CloseDisabled_return_event_cl = EventManager.register( cl, CloseDisabled.cEVENT_RETURN_EVENT );
EventRegistration IconizableDisabled_return_event_min = EventManager.register( min, IconizableDisabled.cEVENT_RETURN_EVENT );
EventRegistration MaximizedDisabled_return_event_max = EventManager.register( max, MaximizedDisabled.cEVENT_RETURN_EVENT );
EventRegistration NonResizableCloseButton_return_event_clfixed = EventManager.register( clfixed, NonResizableCloseButton.cEVENT_RETURN_EVENT );
while (true) {
EventHandle qq_currentEvent = EventManager.waitForEvent();
if (qq_currentEvent == null)
break;
// ---------------
// cl.return_event
// ---------------
if (qq_currentEvent.isEvent(CloseDisabled_return_event_cl)) {
// ================ Begin Forte Event Handler Translation ================
count = count+1;
if (count == 4) {
break;
}
// ================ End Forte Event Handler Translation ================
}
// ----------------
// min.return_event
// ----------------
else if (qq_currentEvent.isEvent(IconizableDisabled_return_event_min)) {
// ================ Begin Forte Event Handler Translation ================
count = count+1;
if (count == 4) {
break;
}
// ================ End Forte Event Handler Translation ================
}
// ----------------
// max.return_event
// ----------------
else if (qq_currentEvent.isEvent(MaximizedDisabled_return_event_max)) {
// ================ Begin Forte Event Handler Translation ================
count = count+1;
if (count == 4) {
break;
}
// ================ End Forte Event Handler Translation ================
}
// --------------------
// clfixed.return_event
// --------------------
else if (qq_currentEvent.isEvent(NonResizableCloseButton_return_event_clfixed)) {
// ================ Begin Forte Event Handler Translation ================
count = count+1;
if (count == 4) {
break;
}
// ================ End Forte Event Handler Translation ================
}
}
EventManager.deregister( CloseDisabled_return_event_cl );
EventManager.deregister( IconizableDisabled_return_event_min );
EventManager.deregister( MaximizedDisabled_return_event_max );
EventManager.deregister( NonResizableCloseButton_return_event_clfixed );
}
//catch (Exception qq_error) {
//Logger.getLogger("task.part.Event").error("Event loop terminated by unhandled exception: " + qq_error.getMessage(), qq_error );
//throw qq_error;
//}
finally {
EventManager.endEventLoop();
}
}
// -----------
// Main method
// -----------
public static void main( String[] args ) {
FrameworkUtils.setCmdLineArgs(args);
AppletConnectionInfo client = null;
try {
// Install our own focus manager. MUST be done prior to setting the
// UIManager, otherwise you'll run into issues like things have the wrong focus.
KeyboardFocusManager.setCurrentKeyboardFocusManager(new ForteKeyboardFocusManager());
UIManager.setLookAndFeel(new Win32LookAndFeel());
client = UserWindow.postAPPLETStarted();
Runner runner_start = new Runner();
runner_start.runnit();
UserWindow.postAPPLETStopped(client);
System.exit(0);
} catch (Throwable e) {
ErrorMgr.showErrors(null, "Unhandled exception", e);
UserWindow.postAPPLETStopped(client);
System.exit(0);
}
}
} // end class Runner
// c Pass 2 Conversion Time: 78 milliseconds