package WindowSubclassedError;
import DisplayProject.Constants;
import DisplayProject.CursorMgr;
import DisplayProject.GridField;
import DisplayProject.UDSWindow;
import DisplayProject.UIutils;
import DisplayProject.WindowManager;
import DisplayProject.WindowUsageMap;
import DisplayProject.actions.AppletConnectionInfo;
import DisplayProject.actions.HeightPolicy;
import DisplayProject.actions.UserWindow;
import DisplayProject.actions.WidthPolicy;
import DisplayProject.binding.BindingManager;
import DisplayProject.binding.beans.Observable;
import DisplayProject.controls.TextGraphic;
import DisplayProject.events.ClientEventManager;
import DisplayProject.factory.CompoundFieldFactory;
import DisplayProject.factory.GraphicFactory;
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 WindowSubclassedError.FrameworkWin;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.Insets;
import java.awt.KeyboardFocusManager;
import java.io.Serializable;
import javax.swing.JPanel;
import javax.swing.UIManager;
/**
* MainWin<p>
* <p>
* @author Generated from Forte
* @since 19-Nov-2008
*/
@RuntimeProperties(isDistributed=false, isAnchored=false, isShared=false, isTransactional=false)
@UDSWindow()
@SuppressWarnings("serial")
public class MainWin
extends FrameworkWin
implements Serializable, Observable
{
// ----------
// Attributes
// ----------
protected BindingManager bindingManager = null;
// ------------
// Constructors
// ------------
public MainWin() {
// Explicitly call the superclass constructor to prevent the implicit call
super();
this.initialize();
}
// ----------------------
// Accessors and Mutators
// ----------------------
protected BindingManager getBindingManager() {
if (this.bindingManager == null) {
this.bindingManager = new BindingManager(this);
}
return bindingManager;
}
// -------
// Methods
// -------
/**
* display<p>
* <p>
*/
public void display() {
UserWindow.open(this);
// ----------
// Event Loop
// ----------
EventManager.startEventLoop();
try {
EventRegistration TaskHandle_Shutdown_langThreadcurrentThread = ClientEventManager.register( Thread.currentThread(), "Shutdown" );
while (true) {
UIutils.processGUIActions();
EventHandle qq_currentEvent = EventManager.waitForEvent();
if (qq_currentEvent == null)
break;
// -------------
// task.Shutdown
// -------------
if (qq_currentEvent.isEvent(TaskHandle_Shutdown_langThreadcurrentThread)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
break;
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
}
EventManager.deregister( TaskHandle_Shutdown_langThreadcurrentThread );
}
//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();
UserWindow.close(this);
}
}
// ------------------
// Window Definitions
// ------------------
// <editor-fold defaultstate="collapsed" desc="Window Definitions">
private int qq_defaultSet = 1;
private int qq_msgNumber = 0;
private int qq_msgSet = 0;
public TextGraphic qq_HoorayLbl;
/**
* qq_HoorayLbl: transformed from: qqds_TextGraphic
* TagId=65548
* isInherited=FALSE
*/
public TextGraphic getqq_HoorayLbl() {
if (qq_HoorayLbl == null) {
qq_HoorayLbl = GraphicFactory.newTextGraphic("Hooray!\n", "");
// OPTIONAL UIutils.reloadLabelText(qq_HoorayLbl, mcat);
WidthPolicy.set(qq_HoorayLbl, Constants.SP_NATURAL);
HeightPolicy.set(qq_HoorayLbl, Constants.SP_NATURAL);
qq_HoorayLbl.setMinimumSize(new Dimension(48, 16));
}
return qq_HoorayLbl;
}
public void setqq_HoorayLbl(TextGraphic value) {
TextGraphic oldValue = qq_HoorayLbl;
qq_HoorayLbl = value;
this.qq_Listeners.firePropertyChange("qq_HoorayLbl", oldValue, value);
}
/**
* qq_frameworkGrid: transformed from: qqds_GridField
* TagId=12
* isInherited=TRUE
* In forte this was a 1x1 grid field.
* There are no cell margins set
* The width policy is set to Natural, and the height policy is set to Natural.
*/
protected void setqq_frameworkGridProperties() {
super.setqq_frameworkGridProperties();
qq_frameworkGrid.setHeightPolicy(Constants.SP_NATURAL);
qq_frameworkGrid.setWidthPolicy(Constants.SP_NATURAL);
qq_frameworkGrid.setBackground(null);
}
public GridField getqq_frameworkGrid() {
if (qq_frameworkGrid == null) {
qq_frameworkGrid = CompoundFieldFactory.newGridField("frameworkGrid", false);
setqq_frameworkGridProperties();
qq_frameworkGrid.setMinimumSize(new Dimension(52, 23));
GridBagConstraints qq_gbc = new GridBagConstraints();
qq_gbc.gridx = 0; // Column 1
qq_gbc.gridy = 0; // Row 1
qq_gbc.weightx = 0;
qq_gbc.weighty = 0;
qq_gbc.anchor = GridBagConstraints.CENTER; // Gravity - original: CG_DEFAULT gf
qq_gbc.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
qq_gbc.insets = new Insets(0, 0, 0, 0); // Top, Left, Bottom, Right Margin
qq_frameworkGrid.add( getqq_HoorayLbl(), qq_gbc );
}
return qq_frameworkGrid;
}
public void setqq_frameworkGrid(GridField value) {
GridField oldValue = qq_frameworkGrid;
qq_frameworkGrid = value;
this.qq_Listeners.firePropertyChange("qq_frameworkGrid", oldValue, value);
}
/**
* Form: transformed from: qqds_Panel
* TagId=1
* isInherited=FALSE
*/
protected void setFormProperties() {
super.setFormProperties();
}
public JPanel getForm() {
if (Form == null) {
Form = CompoundFieldFactory.newForm();
this.setFormProperties();
Form.add( getqq_frameworkGrid() );
}
return Form;
}
public void setForm(JPanel value) {
JPanel oldValue = Form;
Form = value;
this.qq_Listeners.firePropertyChange("Form", oldValue, value);
}
/**
* Gets the default message set number for the window and its widgets.
*/
public int getSetNum() {
return this.qq_defaultSet;
}
/**
* Sets the default message set number for the window and its widgets.
*/
public void setSetNum(int value) {
this.qq_defaultSet = value;
}
/**
* Gets the message set number for the message number of the window's title.
*/
public int getTitleSetNum() {
return this.qq_msgSet;
}
/**
* Sets the message set number for the message number of the window's title.
*/
public void setTitleSetNum(int value) {
this.qq_msgSet = value;
}
/**
* Gets the message number for the message number of the window's title.
*/
public int getTitleMsgNum() {
return this.qq_msgNumber;
}
/**
* Sets the message number for the message number of the window's title.
*/
public void setTitleMsgNum(int value) {
this.qq_msgNumber = value;
}
/**
* Initialise the window and all its children.
*/
protected void initialize() {
if (this.Form == null) {
this.setName( "MainWin" );
this.setTitle( "" );
this.setSystemClosePolicy(Constants.SC_ENABLEDSHUTDOWN);
if (this.getContentPane() != this.getForm()) {
this.setContentPane(getForm());
}
this.qq_setupWindowUsage();
this.setResizable( false );
this.setAlwaysOnTop(false);
UserWindow.setIconizeEnabled(this, true);
WindowManager.addWindowListener(this);
this.setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
this.setUsage(DisplayProject.Constants.WU_UPDATE);
UIutils.processGUIActions();
this.pack();
this.setInitialX(0);
this.setInitialY(0);
this.setInitialPositionPolicy(Constants.PP_SYSTEMDEFAULT);
}
}
// ----------------
// Window usage
//-----------------
public void qq_setupWindowUsage() {
this.usage = new WindowUsageMap();
this.usage.add(getqq_frameworkGrid(), Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_HoorayLbl(), Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
}
// </editor-fold>
// -----------
// 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();
MainWin mainWin_start = new MainWin();
mainWin_start.display();
UserWindow.postAPPLETStopped(client);
System.exit(0);
} catch (Throwable e) {
ErrorMgr.showErrors(null, "Unhandled exception", e);
UserWindow.postAPPLETStopped(client);
System.exit(0);
}
}
} // end class MainWin
// c Pass 2 Conversion Time: 202 milliseconds