package CharacterFields;
import DisplayProject.CharacterField;
import DisplayProject.CloseHideAdaptor;
import DisplayProject.Constants;
import DisplayProject.CursorMgr;
import DisplayProject.DataField;
import DisplayProject.DropListModel;
import DisplayProject.RadioList;
import DisplayProject.ScrollListModel;
import DisplayProject.UDSWindow;
import DisplayProject.UIutils;
import DisplayProject.WindowManager;
import DisplayProject.WindowUsageMap;
import DisplayProject.actions.AppletConnectionInfo;
import DisplayProject.actions.ColourChange;
import DisplayProject.actions.ExitOnTab;
import DisplayProject.actions.HeightPolicy;
import DisplayProject.actions.LineNumbers;
import DisplayProject.actions.Parent;
import DisplayProject.actions.SkipOnTab;
import DisplayProject.actions.TextValue;
import DisplayProject.actions.UserWindow;
import DisplayProject.actions.WidgetState;
import DisplayProject.actions.WidthPolicy;
import DisplayProject.binding.BindingManager;
import DisplayProject.binding.beans.ExtendedPropertyChangeSupport;
import DisplayProject.binding.beans.Observable;
import DisplayProject.controls.DropList;
import DisplayProject.controls.FillInField;
import DisplayProject.controls.MultiLineTextField;
import DisplayProject.controls.ScrollList;
import DisplayProject.events.ClientEventManager;
import DisplayProject.factory.CompoundFieldFactory;
import DisplayProject.factory.DataFieldFactory;
import DisplayProject.factory.DropFillinFactory;
import DisplayProject.factory.ListFieldFactory;
import DisplayProject.factory.TextEditFactory;
import DisplayProject.plaf.Win32LookAndFeel;
import Framework.Array_Of_ListElement;
import Framework.ErrorMgr;
import Framework.EventHandle;
import Framework.EventManager;
import Framework.EventRegistration;
import Framework.File;
import Framework.ForteKeyboardFocusManager;
import Framework.FrameworkUtils;
import Framework.ListElement;
import Framework.RuntimeProperties;
import Framework.UsageException;
import java.awt.Dimension;
import java.awt.KeyboardFocusManager;
import java.awt.Window;
import java.awt.event.ComponentListener;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.lang.String;
import java.net.MalformedURLException;
import java.net.URL;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.UIManager;
/**
* Main<p>
* <p>
* @author Generated from Forte
* @since 19-Nov-2008
*/
@RuntimeProperties(isDistributed=false, isAnchored=false, isShared=false, isTransactional=false)
@UDSWindow()
@SuppressWarnings("serial")
public class Main
extends JFrame
implements Serializable, Observable
{
// ----------
// Attributes
// ----------
protected File DefaultHelpFile;
protected BindingManager bindingManager = null;
public PropertyChangeSupport qq_Listeners = new ExtendedPropertyChangeSupport(this, true);
private String aDataField;
private String aTextField;
private String aTextEditField;
private String aFillinField;
private int aRadioList;
private int aScrollList;
private int aDropList;
// ------------
// Constructors
// ------------
public Main() {
// Explicitly call the superclass constructor to prevent the implicit call
super();
this.initialize();
}
// ----------------------
// Accessors and Mutators
// ----------------------
public File getDefaultHelpFile() {
return DefaultHelpFile;
}
public void setDefaultHelpFile(File defaultHelpFile) {
DefaultHelpFile = defaultHelpFile;
UserWindow.createHelp(this, defaultHelpFile);
}
public void setHelpURL(String urlString) {
try {
URL url = new URL(urlString);
UserWindow.createHelp(this, url);
} catch (MalformedURLException e) {
UsageException err = new UsageException("Cannot create help URL", e);
ErrorMgr.addError(err);
throw err;
}
}
protected BindingManager getBindingManager() {
if (this.bindingManager == null) {
this.bindingManager = new BindingManager(this);
}
return bindingManager;
}
public void setADataField(String aDataField) {
String oldValue = this.aDataField;
this.aDataField = aDataField;
this.qq_Listeners.firePropertyChange("ADataField", oldValue, this.aDataField);
}
public String getADataField() {
return this.aDataField;
}
public void setATextField(String aTextField) {
String oldValue = this.aTextField;
this.aTextField = aTextField;
this.qq_Listeners.firePropertyChange("ATextField", oldValue, this.aTextField);
}
public String getATextField() {
return this.aTextField;
}
public void setATextEditField(String aTextEditField) {
String oldValue = this.aTextEditField;
this.aTextEditField = aTextEditField;
this.qq_Listeners.firePropertyChange("ATextEditField", oldValue, this.aTextEditField);
}
public String getATextEditField() {
return this.aTextEditField;
}
public void setAFillinField(String aFillinField) {
String oldValue = this.aFillinField;
this.aFillinField = aFillinField;
this.qq_Listeners.firePropertyChange("AFillinField", oldValue, this.aFillinField);
}
public String getAFillinField() {
return this.aFillinField;
}
public void setARadioList(int aRadioList) {
int oldValue = this.aRadioList;
this.aRadioList = aRadioList;
this.qq_Listeners.firePropertyChange("ARadioList", oldValue, this.aRadioList);
}
public int getARadioList() {
return this.aRadioList;
}
public void setAScrollList(int aScrollList) {
int oldValue = this.aScrollList;
this.aScrollList = aScrollList;
this.qq_Listeners.firePropertyChange("AScrollList", oldValue, this.aScrollList);
}
public int getAScrollList() {
return this.aScrollList;
}
public void setADropList(int aDropList) {
int oldValue = this.aDropList;
this.aDropList = aDropList;
this.qq_Listeners.firePropertyChange("ADropList", oldValue, this.aDropList);
}
public int getADropList() {
return this.aDropList;
}
// -------
// 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);
}
/**
* display<p>
* <p>
*/
public void display() {
UserWindow.open(this);
TextValue.get(this.getqq_aDataField()).setValue( "Data Field" );
TextValue.get(this.getqq_aTextField()).setValue( "Text Field" );
TextValue.get(this.getqq_aTextEditField()).setValue( "TextEdit Field" );
TextValue.get(this.getqq_aFillinField()).setValue( "Fillin Field" );
TextValue.get(this.getqq_aDropList()).setValue( "Three" );
TextValue.get(this.getqq_aRadioList()).setValue( "Three" );
TextValue.get(this.getqq_aScrollList()).setValue( "Three" );
CharacterField aCharacterField = this.getqq_aFillinField();
TextValue.getWithCharacterField(aCharacterField).setValue( " changed " );
aCharacterField = this.getqq_aTextField();
TextValue.getWithCharacterField(aCharacterField).setValue( " changed as well " );
ColourChange.setBackground((JComponent)aCharacterField, Constants.C_YELLOW);
WidgetState.set((JComponent)aCharacterField, Constants.FS_UPDATE);
UIutils.setDataChanged((JComponent)aCharacterField, true);
Parent.set((JComponent)aCharacterField, Parent.get((JComponent)aCharacterField));
SkipOnTab.set((JComponent)aCharacterField, true);
// ----------
// 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;
protected Window primaryWindow = null;
protected int initialX;
protected int initialY;
protected int qq_SystemClosePolicy = Constants.SC_ENABLEDSHUTDOWN;
protected int qq_initialPositionPolicy = Constants.PP_SYSTEMDEFAULT;
public DataField qq_aDataField;
public DropList qq_aDropList;
public FillInField qq_aFillinField;
public JPanel Form;
public JScrollPane qq_aScrollList_sp;
public JScrollPane qq_aTextEditField_sp;
public JScrollPane qq_aTextField_sp;
public MultiLineTextField qq_aTextEditField;
public MultiLineTextField qq_aTextField;
public RadioList qq_aRadioList;
public ScrollList qq_aScrollList;
/**
* qq_aDataField: transformed from: qqds_DataField
* TagId=12
* isInherited=FALSE
*/
public DataField getqq_aDataField() {
if (qq_aDataField == null) {
// Mask type: MK_NONE
qq_aDataField = DataFieldFactory.newDataField("aDataField", 17, Constants.MK_NONE);
qq_aDataField.setOriginalFormatText(null);
qq_aDataField.setHorizontalAlignment(JTextField.LEFT);
getBindingManager().bindComponent(qq_aDataField, "ADataField");
WidthPolicy.set(qq_aDataField, Constants.SP_EXPLICIT);
HeightPolicy.set(qq_aDataField, Constants.SP_NATURAL);
qq_aDataField.setMinimumSize(new Dimension(112, 19));
qq_aDataField.setSize(new Dimension(112, 19));
qq_aDataField.setLocation(84, 31);
}
return qq_aDataField;
}
public void setqq_aDataField(DataField value) {
DataField oldValue = qq_aDataField;
qq_aDataField = value;
this.qq_Listeners.firePropertyChange("qq_aDataField", oldValue, value);
}
/**
* qq_aTextField_sp: transformed from: qqds_TextField
* TagId=13
* isInherited=FALSE
*/
public JScrollPane getqq_aTextField_sp() {
if (qq_aTextField_sp == null) {
qq_aTextField_sp = CompoundFieldFactory.newScrollPane();
qq_aTextField_sp.setName("aTextField");
qq_aTextField_sp.setViewportView(getqq_aTextField());
qq_aTextField_sp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
qq_aTextField_sp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
WidthPolicy.set(qq_aTextField_sp, Constants.SP_EXPLICIT);
HeightPolicy.set(qq_aTextField_sp, Constants.SP_EXPLICIT);
qq_aTextField_sp.setSize(new Dimension(147, 67));
qq_aTextField_sp.setMinimumSize(new Dimension(147, 67));
qq_aTextField_sp.setPreferredSize(new Dimension(147, 67));
qq_aTextField_sp.setLocation(84, 62);
}
return qq_aTextField_sp;
}
public void setqq_aTextField_sp(JScrollPane value) {
JScrollPane oldValue = qq_aTextField_sp;
qq_aTextField_sp = value;
this.qq_Listeners.firePropertyChange("qq_aTextField_sp", oldValue, value);
}
/**
* qq_aTextField: transformed from: qqds_TextField
* TagId=13
* isInherited=FALSE
*/
public MultiLineTextField getqq_aTextField() {
if (qq_aTextField == null) {
qq_aTextField = TextEditFactory.newTextField("aTextField", 4, 16);
getBindingManager().bindComponent(qq_aTextField, "ATextField");
ExitOnTab.set(qq_aTextField, true);
WidthPolicy.set(qq_aTextField, Constants.SP_EXPLICIT);
HeightPolicy.set(qq_aTextField, Constants.SP_EXPLICIT);
qq_aTextField.setLocation(84, 62);
}
return qq_aTextField;
}
public void setqq_aTextField(MultiLineTextField value) {
MultiLineTextField oldValue = qq_aTextField;
qq_aTextField = value;
this.qq_Listeners.firePropertyChange("qq_aTextField", oldValue, value);
}
/**
* qq_aTextEditField_sp: transformed from: qqds_TextEditField
* TagId=14
* isInherited=FALSE
*/
public JScrollPane getqq_aTextEditField_sp() {
if (qq_aTextEditField_sp == null) {
qq_aTextEditField_sp = CompoundFieldFactory.newScrollPane();
qq_aTextEditField_sp.setName("aTextEditField");
qq_aTextEditField_sp.setViewportView(getqq_aTextEditField());
qq_aTextEditField_sp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_ALWAYS);
qq_aTextEditField_sp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
WidthPolicy.set(qq_aTextEditField_sp, Constants.SP_EXPLICIT);
HeightPolicy.set(qq_aTextEditField_sp, Constants.SP_EXPLICIT);
qq_aTextEditField_sp.setSize(new Dimension(151, 77));
qq_aTextEditField_sp.setMinimumSize(new Dimension(151, 77));
qq_aTextEditField_sp.setPreferredSize(new Dimension(151, 77));
qq_aTextEditField_sp.setLocation(84, 146);
}
return qq_aTextEditField_sp;
}
public void setqq_aTextEditField_sp(JScrollPane value) {
JScrollPane oldValue = qq_aTextEditField_sp;
qq_aTextEditField_sp = value;
this.qq_Listeners.firePropertyChange("qq_aTextEditField_sp", oldValue, value);
}
/**
* qq_aTextEditField: transformed from: qqds_TextEditField
* TagId=14
* isInherited=FALSE
*/
public MultiLineTextField getqq_aTextEditField() {
if (qq_aTextEditField == null) {
qq_aTextEditField = TextEditFactory.newTextEditField("aTextEditField", 4, 10);
LineNumbers.set(qq_aTextEditField, true );
getBindingManager().bindComponent(qq_aTextEditField, "ATextEditField");
WidthPolicy.set(qq_aTextEditField, Constants.SP_EXPLICIT);
HeightPolicy.set(qq_aTextEditField, Constants.SP_EXPLICIT);
qq_aTextEditField.setLocation(84, 146);
}
return qq_aTextEditField;
}
public void setqq_aTextEditField(MultiLineTextField value) {
MultiLineTextField oldValue = qq_aTextEditField;
qq_aTextEditField = value;
this.qq_Listeners.firePropertyChange("qq_aTextEditField", oldValue, value);
}
/**
* qq_aFillinField: transformed from: qqds_FillInField
* TagId=15
* isInherited=FALSE
*/
public FillInField getqq_aFillinField() {
if (qq_aFillinField == null) {
Array_Of_ListElement<ListElement> elements = new Array_Of_ListElement<ListElement>();
elements.add( new ListElement( 1, "One", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE ) );
elements.add( new ListElement( 2, "Two", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE ) );
elements.add( new ListElement( 3, "Three", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE ) );
elements.add( new ListElement( 4, "Four", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE ) );
qq_aFillinField = DropFillinFactory.newFillinField();
qq_aFillinField.setName("aFillinField");
getBindingManager().bindComponent(qq_aFillinField, "AFillinField", elements);
qq_aFillinField.addActionListener( (DropListModel)qq_aFillinField.getModel() );
// OPTIONAL UIutils.reloadLabelText(qq_aFillinField, mcat);
qq_aFillinField.setMaximumRowCount(4);
qq_aFillinField.setVisibleColumns(18);
WidthPolicy.set(qq_aFillinField, Constants.SP_EXPLICIT);
HeightPolicy.set(qq_aFillinField, Constants.SP_NATURAL);
qq_aFillinField.setMinimumSize(new Dimension(146, 21));
qq_aFillinField.setSize(new Dimension(146, 21));
qq_aFillinField.setLocation(84, 245);
}
return qq_aFillinField;
}
public void setqq_aFillinField(FillInField value) {
FillInField oldValue = qq_aFillinField;
qq_aFillinField = value;
this.qq_Listeners.firePropertyChange("qq_aFillinField", oldValue, value);
}
/**
* qq_aRadioList: transformed from: qqds_RadioList
* TagId=16
* isInherited=FALSE
*/
public RadioList getqq_aRadioList() {
if (qq_aRadioList == null) {
String[] names = {"One", "Two", "Three", "Four"};
qq_aRadioList = ListFieldFactory.newRadioList(Constants.FO_VERTICAL, "", names, 1, Constants.LP_CONSTANT);
Array_Of_ListElement<ListElement> elements = new Array_Of_ListElement<ListElement>();
elements.add( new ListElement( 1, names[0], ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE ) );
elements.add( new ListElement( 2, names[1], ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE ) );
elements.add( new ListElement( 3, names[2], ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE ) );
elements.add( new ListElement( 4, names[3], ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE ) );
qq_aRadioList.setName("aRadioList");
getBindingManager().bindComponent(qq_aRadioList, "ARadioList", elements);
if (qq_aRadioList.getSelectedIndex() == -1)
qq_aRadioList.setSelectedIndex(0);
// OPTIONAL UIutils.reloadLabelText(qq_aRadioList, mcat);
qq_aRadioList.setLocation(295, 52);
}
return qq_aRadioList;
}
public void setqq_aRadioList(RadioList value) {
RadioList oldValue = qq_aRadioList;
qq_aRadioList = value;
this.qq_Listeners.firePropertyChange("qq_aRadioList", oldValue, value);
}
/**
* qq_aScrollList_sp: transformed from: qqds_ScrollList
* TagId=17
* isInherited=FALSE
*/
public JScrollPane getqq_aScrollList_sp() {
if (qq_aScrollList_sp == null) {
qq_aScrollList_sp = CompoundFieldFactory.newScrollPane();
qq_aScrollList_sp.setName("aScrollList");
qq_aScrollList_sp.setViewportView(getqq_aScrollList());
qq_aScrollList_sp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
qq_aScrollList_sp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
WidthPolicy.set(qq_aScrollList_sp, Constants.SP_NATURAL);
HeightPolicy.set(qq_aScrollList_sp, Constants.SP_NATURAL);
qq_aScrollList_sp.setSize(new Dimension(67, 55));
qq_aScrollList_sp.setMinimumSize(new Dimension(67, 55));
qq_aScrollList_sp.setPreferredSize(new Dimension(67, 55));
qq_aScrollList_sp.setLocation(292, 156);
}
return qq_aScrollList_sp;
}
public void setqq_aScrollList_sp(JScrollPane value) {
JScrollPane oldValue = qq_aScrollList_sp;
qq_aScrollList_sp = value;
this.qq_Listeners.firePropertyChange("qq_aScrollList_sp", oldValue, value);
}
/**
* qq_aScrollList: transformed from: qqds_ScrollList
* TagId=17
* isInherited=FALSE
*/
public ScrollList getqq_aScrollList() {
if (qq_aScrollList == null) {
qq_aScrollList = ListFieldFactory.newScrollList();
qq_aScrollList.setName("aScrollList");
Array_Of_ListElement<ListElement> elements = new Array_Of_ListElement<ListElement>();
elements.add( new ListElement( 1, "One", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE ) );
elements.add( new ListElement( 2, "Two", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE ) );
elements.add( new ListElement( 3, "Three", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE ) );
elements.add( new ListElement( 4, "Four", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE ) );
getBindingManager().bindComponent(qq_aScrollList, "AScrollList", elements, true);
qq_aScrollList.addListSelectionListener((ScrollListModel)qq_aScrollList.getModel());
qq_aScrollList.setLocation(292, 156);
}
return qq_aScrollList;
}
public void setqq_aScrollList(ScrollList value) {
ScrollList oldValue = qq_aScrollList;
qq_aScrollList = value;
this.qq_Listeners.firePropertyChange("qq_aScrollList", oldValue, value);
}
/**
* qq_aDropList: transformed from: qqds_DropList
* TagId=18
* isInherited=FALSE
*/
public DropList getqq_aDropList() {
if (qq_aDropList == null) {
Array_Of_ListElement<ListElement> elements = new Array_Of_ListElement<ListElement>();
elements.add( new ListElement( 1, "One", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE ) );
elements.add( new ListElement( 2, "Two", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE ) );
elements.add( new ListElement( 3, "Three", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE ) );
elements.add( new ListElement( 4, "Four", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE ) );
qq_aDropList = DropFillinFactory.newDropList();
qq_aDropList.setName("aDropList");
getBindingManager().bindComponent(qq_aDropList, "ADropList", elements);
qq_aDropList.addActionListener( (DropListModel)qq_aDropList.getModel() );
// OPTIONAL UIutils.reloadLabelText(qq_aDropList, mcat);
qq_aDropList.setMaximumRowCount(4);
WidthPolicy.set(qq_aDropList, Constants.SP_NATURAL);
HeightPolicy.set(qq_aDropList, Constants.SP_NATURAL);
qq_aDropList.setMinimumSize(new Dimension(63, 21));
qq_aDropList.setLocation(295, 232);
}
return qq_aDropList;
}
public void setqq_aDropList(DropList value) {
DropList oldValue = qq_aDropList;
qq_aDropList = value;
this.qq_Listeners.firePropertyChange("qq_aDropList", oldValue, value);
}
/**
* Form: transformed from: qqds_Panel
* TagId=1
* isInherited=FALSE
*/
protected void setFormProperties() {
Form.setOpaque( true );
}
public JPanel getForm() {
if (Form == null) {
Form = CompoundFieldFactory.newForm();
this.setFormProperties();
Form.add( getqq_aDropList() );
Form.add( getqq_aScrollList_sp() );
Form.add( getqq_aRadioList() );
Form.add( getqq_aFillinField() );
Form.add( getqq_aTextEditField_sp() );
Form.add( getqq_aTextField_sp() );
Form.add( getqq_aDataField() );
}
return Form;
}
public void setForm(JPanel value) {
JPanel oldValue = Form;
Form = value;
this.qq_Listeners.firePropertyChange("Form", oldValue, value);
}
/**
* Gets the system close policy
*
* The SystemClosePolicy property determines how a window responds to user attempts to close it by using the native window system through the window close box or a window system menu command.
* SystemClosePolicy responds to window closure attempts according to the following parameters:
* <li>Constants.SC_DISABLED Does not allow window closure through window system.</li>
* <li>Constants.SC_ENABLEDNOFINALIZE Window can be closed, but the contents are not verified, guaranteeing that the window will close (for example, the user clicks the Cancel button).</li>
* <li>Constants.SC_ENABLEDFINALIZE Posts the RequestFinalize method on the window, with a reason code of zero.</li>
* <li>Constants.SC_ENABLEDSHUTDOWN Posts Shutdown event to window�s task and to all tasks started by that task. This is the default value.</li>
*/
public int getSystemClosePolicy() {
return qq_SystemClosePolicy;
}
/**
* Sets the system close policy
*
* The SystemClosePolicy property determines how a window responds to user attempts to close it by using the native window system through the window close box or a window system menu command.
* SystemClosePolicy responds to window closure attempts according to the following parameters:
* <li>Constants.SC_DISABLED Does not allow window closure through window system.</li>
* <li>Constants.SC_ENABLEDNOFINALIZE Window can be closed, but the contents are not verified, guaranteeing that the window will close (for example, the user clicks the Cancel button).</li>
* <li>Constants.SC_ENABLEDFINALIZE Posts the RequestFinalize method on the window, with a reason code of zero.</li>
* <li>Constants.SC_ENABLEDSHUTDOWN Posts Shutdown event to window�s task and to all tasks started by that task. This is the default value.</li>
*/
public void setSystemClosePolicy(int policy) {
this.qq_SystemClosePolicy = policy;
if (policy == Constants.SC_DISABLED) {
this.addComponentListener(new CloseHideAdaptor(this));
} else {
for (ComponentListener cl : this.getComponentListeners()) {
if (cl instanceof CloseHideAdaptor) {
this.removeComponentListener(cl);
break;
}
}
}
}
/**
* Gets the initial position policy
*
* The InitialPositionPolicy property sets the position of a main window when it is first displayed, relative to a primary window or the screen.
* You use the InitialPositionPolicy property in conjunction with the InitialX, InitialY properties.
* InitialPositionPolicy sets the position of a window according to the following values:
* <li>Constants.PP_SYSTEMDEFAULT Accepts the default window system placement specification.</li>
* <li>Constants.PP_PRIMARYCENTERED Centers the window relative to the window specified as the PrimaryWindow property.</li>
* <li>Constants.PP_PRIMARYRELATIVE Positions the window relative to the primary window, using the PrimaryWindow, InitialX and InitialY attributes.</li>
* <li>Constants.PP_SCREENCENTERED Centers the window relative to the screen.</li>
* <li>Constants.PP_SCREENRELATIVE Positions the window relative to the screen, using the InitialX and InitialY properties.</li>
*/
public int getInitialPositionPolicy() {
return qq_initialPositionPolicy;
}
/**
* Sets the initial position policy
*
* The InitialPositionPolicy property sets the position of a main window when it is first displayed, relative to a primary window or the screen.
* You use the InitialPositionPolicy property in conjunction with the InitialX, InitialY properties.
* InitialPositionPolicy sets the position of a window according to the following values:
* <li>Constants.PP_SYSTEMDEFAULT Accepts the default window system placement specification.</li>
* <li>Constants.PP_PRIMARYCENTERED Centers the window relative to the window specified as the PrimaryWindow property.</li>
* <li>Constants.PP_PRIMARYRELATIVE Positions the window relative to the primary window, using the PrimaryWindow, InitialX and InitialY attributes.</li>
* <li>Constants.PP_SCREENCENTERED Centers the window relative to the screen.</li>
* <li>Constants.PP_SCREENRELATIVE Positions the window relative to the screen, using the InitialX and InitialY properties.</li>
*/
public void setInitialPositionPolicy(int policy) {
this.qq_initialPositionPolicy = policy;
}
/**
* Gets the primary window
*
* The primary window property designates a window, known as a primary window, to serve as an initial position reference for the current window.
* When a main window first realizes itself through the Open method on the UserWindow, it assumes a position according to the InitialPositionPolicy attribute.
* When the InitialPositionPolicy property is set to PP_PRIMARYRELATIVE (relative to the primary window) or PP_PRIMARYCENTERED (centered on the primary window),
* the window realizes itself in a position relative to the designated primary window.<p>
* <p>
* To take a position relative to the primary window, a window uses the PrimaryWindow attribute in conjunction with the InitialX and InitialY properties, which specify the window�s horizontal and vertical coordinates.
*/
public Window getPrimaryWindow() {
return this.primaryWindow;
}
/**
* Sets the primary window
*
* The primary window property designates a window, known as a primary window, to serve as an initial position reference for the current window.
* When a main window first realizes itself through the Open method on the UserWindow, it assumes a position according to the InitialPositionPolicy attribute.
* When the InitialPositionPolicy property is set to PP_PRIMARYRELATIVE (relative to the primary window) or PP_PRIMARYCENTERED (centered on the primary window),
* the window realizes itself in a position relative to the designated primary window.<p>
* <p>
* To take a position relative to the primary window, a window uses the PrimaryWindow attribute in conjunction with the InitialX and InitialY properties, which specify the window�s horizontal and vertical coordinates.
*/
public void setPrimaryWindow(Window value) {
this.primaryWindow = value;
}
/**
* Gets the InitialX value
*
* The InitialX property (integer) is the window�s initial horizontal screen position, relative to a primary window or the screen. It is specified in mils.
* InitialX applies only to main windows and only when a window�s InitialPositionPolicy attribute is set to PP_PRIMARYRELATIVE (relative to the primary window) or PP_SCREENRELATIVE (relative to the screen).
* InitialX, and its corollary, InitialY, work in conjunction with the PrimaryWindow and InitialPositionPolicy attributes to determine the position of a main window when it is first realized.
*/
public int getInitialX() {
return initialX;
}
/**
* Sets the InitialX value
*
* The InitialX property (integer) is the window�s initial horizontal screen position, relative to a primary window or the screen. It is specified in mils.
* InitialX applies only to main windows and only when a window�s InitialPositionPolicy attribute is set to PP_PRIMARYRELATIVE (relative to the primary window) or PP_SCREENRELATIVE (relative to the screen).
* InitialX, and its corollary, InitialY, work in conjunction with the PrimaryWindow and InitialPositionPolicy attributes to determine the position of a main window when it is first realized.
*/
public void setInitialX(int value) {
this.initialX = value;
}
/**
* Gets the InitialY value
*
* The InitialY property (integer) is the window�s initial vertical screen position, relative to a primary window or the screen. It is specified in mils.
* InitialY applies only to main windows and only when a window�s InitialPositionPolicy attribute is set to PP_PRIMARYRELATIVE (relative to the primary window) or PP_SCREENRELATIVE (relative to the screen).
* InitialY, and its corollary, InitialX, work in conjunction with the PrimaryWindow and InitialPositionPolicy attributes to determine the position of a main window when it is first realized.
*/
public int getInitialY() {
return initialY;
}
/**
* Sets the InitialY value
*
* The InitialY property (integer) is the window�s initial vertical screen position, relative to a primary window or the screen. It is specified in mils.
* InitialY applies only to main windows and only when a window�s InitialPositionPolicy attribute is set to PP_PRIMARYRELATIVE (relative to the primary window) or PP_SCREENRELATIVE (relative to the screen).
* InitialY, and its corollary, InitialX, work in conjunction with the PrimaryWindow and InitialPositionPolicy attributes to determine the position of a main window when it is first realized.
*/
public void setInitialY(int value) {
this.initialY = 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( "Main" );
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
//-----------------
protected WindowUsageMap usage = new WindowUsageMap();
public int getUsage() {
return this.usage.getUsage();
}
public WindowUsageMap getUsageMap() {
return this.usage;
}
/**
* Sets the window usage
*
* The Usage property sets the state for all a window�s child widgets at once, providing collective widget state changes on a predefined basis. A widget�s state determines how the widget reacts to mouse actions and how it displays itself. A window�s Usage property provides a convenient way to control the states of a group of widgets in the context of their parent window. With the Usage attribute, you can synchronize widget states to conform to a pattern you establish for the window.
* The Usage attribute accepts the following values:
* <li>Constants.WU_EDIT Edit usage: widgets themselves are editable, but not underlying data.</li>
* <li>Constants.WU_QUERY Query only usage: widget data is editable, but not widgets themselves.</li>
* <li>Constants.WU_UPDATE Update usage: mouse actions and keyboard input accepted. Widgets themselves are changeable. This is the default.</li>
* <li>Constants.WU_USER1 A user-defined usage. Default values same as WU_UPDATE.</li>
* <li>Constants.WU_USER2 A user-defined usage. Default values same as WU_UPDATE.</li>
* <li>Constants.WU_USER3 A user-defined usage. Default values same as WU_UPDATE.</li>
* <li>Constants.WU_VIEW View-only usage: no keyboard input is accepted. Widget posts Click events for mouse clicks.</li>
*/
public void setUsage(int usage) {
this.usage.setUsage(usage);
}
public void qq_setupWindowUsage() {
this.usage = new WindowUsageMap();
this.usage.add(getqq_aDataField(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_aTextField(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_aTextEditField(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_aFillinField(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_aRadioList(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_aScrollList(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_aDropList(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
}
// </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();
Main main_start = new Main();
main_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 Main
// c Pass 2 Conversion Time: 375 milliseconds