package win;
import DisplayProject.ArrayColumn;
import DisplayProject.CloseHideAdaptor;
import DisplayProject.Constants;
import DisplayProject.CursorMgr;
import DisplayProject.DataField;
import DisplayProject.GridField;
import DisplayProject.UDSWindow;
import DisplayProject.UIutils;
import DisplayProject.WindowManager;
import DisplayProject.WindowUsageMap;
import DisplayProject.actions.ArrayTopRow;
import DisplayProject.actions.ArrayVisibleRows;
import DisplayProject.actions.FrameColor;
import DisplayProject.actions.HeightPolicy;
import DisplayProject.actions.UserWindow;
import DisplayProject.actions.WidthPolicy;
import DisplayProject.binding.BindingManager;
import DisplayProject.binding.beans.ExtendedPropertyChangeSupport;
import DisplayProject.binding.beans.Observable;
import DisplayProject.controls.ArrayField;
import DisplayProject.controls.DropList;
import DisplayProject.events.ClientEventManager;
import DisplayProject.factory.CompoundFieldFactory;
import DisplayProject.factory.DataFieldFactory;
import DisplayProject.factory.DropFillinFactory;
import DisplayProject.factory.PushButtonFactory;
import DisplayProject.factory.TableFactory;
import DisplayProject.factory.ToggleFieldFactory;
import DisplayProject.plaf.Win32LookAndFeel;
import DisplayProject.table.ArrayFieldCellHelper;
import DisplayProject.table.CheckBoxCellEditor;
import DisplayProject.table.CheckBoxCellRenderer;
import DisplayProject.table.ComboBoxCellRenderer;
import DisplayProject.table.FormattedCellEditor;
import DisplayProject.table.FormattedCellRenderer;
import Framework.AsyncStarter;
import Framework.DecimalData;
import Framework.ErrorMgr;
import Framework.EventHandle;
import Framework.EventManager;
import Framework.EventRegistration;
import Framework.File;
import Framework.ForteKeyboardFocusManager;
import Framework.ListElement;
import Framework.RuntimeProperties;
import Framework.TextData;
import Framework.UsageException;
import Services.interfaces.*;
import entities.Array_Of_Bra;
import entities.Bra;
import java.awt.Dimension;
import java.awt.GridBagConstraints;
import java.awt.Insets;
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.BorderFactory;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.ToolTipManager;
import javax.swing.UIManager;
import org.apache.log4j.Logger;
import win.CarvilComp;
/**
* BraSort<p>
* <p>
* @author Generated from Forte
* @since 19-Nov-2008
*/
@RuntimeProperties(isDistributed=false, isAnchored=false, isShared=false, isTransactional=false)
@UDSWindow()
@SuppressWarnings("serial")
public class BraSort
extends JFrame
implements Serializable, Observable
{
// -------------
// Inner classes
// -------------
/**
* This class contains routines to be able to start threads for the methods on this class in a manner
* similar to that allowed by Forte. This includes:<p>
* <ul>
* <li>Arbitrary parameters</li>
* <li>Starting threads as daemon threads</li>
* <li>Naming the thread for easy debugging</li>
* </ul>
*/
public static class AsyncRunner extends AsyncStarter {
/**
* Create an async runner which does not fire completion events nor begin a transaction
*/
public AsyncRunner() {
super();
}
/**
* display<p>
* <p>
*/
public Thread display(final BraSort pBraSort) {
return startTask(pBraSort, "BraSort.Display",
new AsyncStarter.AsyncInvoker() {
@Override public void runWithNoReturn() {
pBraSort.display();
}
});
}
}
// ----------
// Attributes
// ----------
protected File DefaultHelpFile;
protected BindingManager bindingManager = null;
public PropertyChangeSupport qq_Listeners = new ExtendedPropertyChangeSupport(this, true);
private Array_Of_Bra<Bra> list;
// ------------
// Constructors
// ------------
public BraSort() {
// Explicitly call the superclass constructor to prevent the implicit call
super();
this.initialize();
this.setList(BraShop_proxy.getInstance().getAll());
//list[1] = new(name = 'Show em', Style = 2, frontHook = false, cost = 35.00, color = 1);
//list[2] = new(name = 'Modest', Style = 1, frontHook = false, cost = 35.00, color = 3);
//list[3] = new(name = 'Hot', Style = 4, frontHook = true, cost = 35.00, color = 2);
//list[4] = new(name = 'Seductive', Style = 3, frontHook = false, cost = 35.00, color = 4);
}
// ----------------------
// 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 setList(Array_Of_Bra<Bra> list) {
Array_Of_Bra<Bra> oldValue = this.list;
this.list = list;
this.qq_Listeners.firePropertyChange("list", oldValue, this.list);
}
public Array_Of_Bra<Bra> getList() {
return this.list;
}
// -------
// 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);
int top = ArrayTopRow.get(this.getqq_list());
Logger.getLogger("task.part.logmgr").info( Integer.toString(top));
int vis = ArrayVisibleRows.get(this.getqq_list());
Logger.getLogger("task.part.logmgr").info( Integer.toString(vis));
int total = this.getqq_list().getRowCount();
Logger.getLogger("task.part.logmgr").info( Integer.toString(total));
// ----------
// Event Loop
// ----------
EventManager.startEventLoop();
try {
EventRegistration TaskHandle_Shutdown_langThreadcurrentThread = ClientEventManager.register( Thread.currentThread(), "Shutdown" );
EventRegistration PushButton_Click_getqq_sortit = ClientEventManager.register( this.getqq_sortit(), "Click" );
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();
}
}
// --------------
// <sortit>.click
// --------------
else if (qq_currentEvent.isEvent(PushButton_Click_getqq_sortit)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
this.getList().sort(new CarvilComp(), true);
TextData.bind(this, "title").setValue( "**Sorted**" );
TextData.bind(this.getqq_sortit(), "text").setValue( "**Sorted**" );
top = ArrayTopRow.get(this.getqq_list());
Logger.getLogger("task.part.logmgr").info( Integer.toString(top));
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
}
EventManager.deregister( TaskHandle_Shutdown_langThreadcurrentThread );
EventManager.deregister( PushButton_Click_getqq_sortit );
}
//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 ArrayField qq_list;
public DataField qq_listArray_Name;
public DataField qq_listArray_cost;
public DropList qq_listArray_Color;
public DropList qq_listArray_Style;
public GridField qq_GridField26;
public JButton qq_sortit;
public JCheckBox qq_listArray_frontHook;
public JPanel Form;
public JScrollPane qq_list_sp;
/**
* qq_list_sp: transformed from: qqds_ArrayField
* TagId=12
* isInherited=FALSE
*/
public JScrollPane getqq_list_sp() {
if (qq_list_sp == null) {
qq_list_sp = CompoundFieldFactory.newScrollPane();
qq_list_sp.setName("list");
qq_list_sp.setViewportView(getqq_list());
qq_list_sp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
qq_list_sp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
qq_list_sp.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
qq_list_sp.setBackground(null);
qq_list_sp.getViewport().setBackground(null);
FrameColor.set(qq_list_sp, Constants.C_INHERIT);
WidthPolicy.set(qq_list_sp, Constants.SP_NATURAL);
HeightPolicy.set(qq_list_sp, Constants.SP_NATURAL);
// OPTIONAL qq_list_sp.setSize(new Dimension(415, 108));
qq_list_sp.setMinimumSize(new Dimension(415, 108));
qq_list_sp.setPreferredSize(new Dimension(415, 108));
}
return qq_list_sp;
}
public void setqq_list_sp(JScrollPane value) {
JScrollPane oldValue = qq_list_sp;
qq_list_sp = value;
this.qq_Listeners.firePropertyChange("qq_list_sp", oldValue, value);
}
/**
* qq_list: transformed from: qqds_ArrayField
* TagId=12
* isInherited=FALSE
*/
public ArrayField getqq_list() {
if (qq_list == null) {
qq_list = TableFactory.newArrayField("list", 21);
this.getBindingManager().bindComponent(qq_list, "list", Bra.class,
new String[] { "name",
"style",
"frontHook",
"cost",
"color" });
qq_list.setVisibleRows(4);
// === Column model setup ===
// Name converted from qqds_DataField
ArrayColumn qq_listArray_Name_Column = new ArrayColumn("Name", 0, 119, new FormattedCellRenderer(getqq_listArray_Name()), new FormattedCellEditor(getqq_listArray_Name()), true);
qq_listArray_Name_Column.setHeaderValue("Name");
qq_listArray_Name_Column.setVisible(true);
qq_list.addColumn(qq_listArray_Name_Column);
// Style converted from qqds_DropList
ArrayColumn qq_listArray_Style_Column = new ArrayColumn("Style", 1, getqq_listArray_Style().getMinimumSize().width, new ComboBoxCellRenderer(getqq_listArray_Style()), DropFillinFactory.newDropListEditor(getqq_listArray_Style()), true);
qq_listArray_Style_Column.setHeaderValue("Style");
qq_listArray_Style_Column.setVisible(true);
qq_list.addColumn(qq_listArray_Style_Column);
// frontHook converted from qqds_ToggleField
ArrayColumn qq_listArray_frontHook_Column = new ArrayColumn("frontHook", 2, 59, new CheckBoxCellRenderer(getqq_listArray_frontHook()), new CheckBoxCellEditor(getqq_listArray_frontHook()), true);
qq_listArray_frontHook_Column.setHeaderValue("Front Hook");
qq_listArray_frontHook_Column.setVisible(true);
qq_list.addColumn(qq_listArray_frontHook_Column);
// cost converted from qqds_DataField
ArrayColumn qq_listArray_cost_Column = new ArrayColumn("cost", 3, 100, new FormattedCellRenderer(getqq_listArray_cost()), new FormattedCellEditor(getqq_listArray_cost()), true);
qq_listArray_cost_Column.setHeaderValue("cost");
qq_listArray_cost_Column.setVisible(true);
qq_list.addColumn(qq_listArray_cost_Column);
// Color converted from qqds_DropList
ArrayColumn qq_listArray_Color_Column = new ArrayColumn("Color", 4, getqq_listArray_Color().getMinimumSize().width, new ComboBoxCellRenderer(getqq_listArray_Color()), DropFillinFactory.newDropListEditor(getqq_listArray_Color()), true);
qq_listArray_Color_Column.setHeaderValue("Color");
qq_listArray_Color_Column.setVisible(true);
qq_list.addColumn(qq_listArray_Color_Column);
// === End column model ===
TableFactory.postModelArrayField(qq_list);
}
return qq_list;
}
public void setqq_list(ArrayField value) {
ArrayField oldValue = qq_list;
qq_list = value;
this.qq_Listeners.firePropertyChange("qq_list", oldValue, value);
}
/**
* qq_sortit: transformed from: qqds_PushButton
* TagId=25
* isInherited=FALSE
*/
public JButton getqq_sortit() {
if (qq_sortit == null) {
qq_sortit = PushButtonFactory.newInstance("sortit", "Sort");
qq_sortit.setVerifyInputWhenFocusTarget(true);
WidthPolicy.set(qq_sortit, Constants.SP_NATURAL);
HeightPolicy.set(qq_sortit, Constants.SP_NATURAL);
qq_sortit.setMinimumSize(new Dimension(33, 21));
}
return qq_sortit;
}
public void setqq_sortit(JButton value) {
JButton oldValue = qq_sortit;
qq_sortit = value;
this.qq_Listeners.firePropertyChange("qq_sortit", oldValue, value);
}
/**
* qq_GridField26: transformed from: qqds_GridField
* TagId=26
* isInherited=FALSE
* In forte this was a 1x2 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_GridField26Properties() {
qq_GridField26.setCollapsed(true);
qq_GridField26.setHeightPolicy(Constants.SP_NATURAL);
qq_GridField26.setWidthPolicy(Constants.SP_NATURAL);
qq_GridField26.setBackground(null);
qq_GridField26.setLocation(9, 9);
}
public GridField getqq_GridField26() {
if (qq_GridField26 == null) {
qq_GridField26 = CompoundFieldFactory.newGridField("qq_GridField26", true);
setqq_GridField26Properties();
qq_GridField26.setMinimumSize(new Dimension(415, 139));
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_GridField26.add( getqq_list_sp(), qq_gbc );
GridBagConstraints qq_gbc1 = new GridBagConstraints();
qq_gbc1.gridx = 0; // Column 1
qq_gbc1.gridy = 1; // Row 2
qq_gbc1.weightx = 0;
qq_gbc1.weighty = 0;
qq_gbc1.anchor = GridBagConstraints.CENTER; // Gravity - original: CG_DEFAULT gf
qq_gbc1.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
qq_gbc1.insets = new Insets(9, 0, 0, 0); // Top, Left, Bottom, Right Margin
qq_GridField26.add( getqq_sortit(), qq_gbc1 );
}
return qq_GridField26;
}
public void setqq_GridField26(GridField value) {
GridField oldValue = qq_GridField26;
qq_GridField26 = value;
this.qq_Listeners.firePropertyChange("qq_GridField26", 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_GridField26() );
}
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;
}
/**
* qq_listArray_Name: transformed from: qqds_DataField
* TagId=13
* isInherited=FALSE
*/
public DataField getqq_listArray_Name() {
if (qq_listArray_Name == null) {
// Mask type: MK_NONE
qq_listArray_Name = DataFieldFactory.newDataField("Name", 18, TextData.class, Constants.MK_NONE);
qq_listArray_Name.setOriginalFormatText(null);
qq_listArray_Name.setHorizontalAlignment(JTextField.LEFT);
WidthPolicy.set(qq_listArray_Name, Constants.SP_EXPLICIT);
HeightPolicy.set(qq_listArray_Name, Constants.SP_NATURAL);
qq_listArray_Name.setMinimumSize(new Dimension(119, 19));
qq_listArray_Name.setSize(new Dimension(119, 19));
qq_listArray_Name.setLocation(23, 30);
ArrayFieldCellHelper.setUpCellEditor(qq_listArray_Name, qq_list, 0, false);
}
return qq_listArray_Name;
}
public void setqq_listArray_Name(DataField value) {
DataField oldValue = qq_listArray_Name;
qq_listArray_Name = value;
this.qq_Listeners.firePropertyChange("qq_listArray_Name", oldValue, value);
}
/**
* qq_listArray_Style: transformed from: qqds_DropList
* TagId=15
* isInherited=FALSE
*/
public DropList getqq_listArray_Style() {
if (qq_listArray_Style == null) {
ListElement[] elements = new ListElement[4];
elements[0] = new ListElement( 1, "Full cup", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE );
elements[1] = new ListElement( 2, "Padded", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE );
elements[2] = new ListElement( 3, "Half cup", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE );
elements[3] = new ListElement( 4, "Demi", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE );
qq_listArray_Style = DropFillinFactory.newDropList(elements);
qq_listArray_Style.setName("Style");
// OPTIONAL UIutils.reloadLabelText(qq_listArray_Style, mcat);
qq_listArray_Style.setMaximumRowCount(4);
ArrayFieldCellHelper.setUpCellEditor(qq_listArray_Style, qq_list, 1, false);
WidthPolicy.set(qq_listArray_Style, Constants.SP_NATURAL);
HeightPolicy.set(qq_listArray_Style, Constants.SP_NATURAL);
qq_listArray_Style.setMinimumSize(new Dimension(71, 21));
qq_listArray_Style.setLocation(161, 30);
}
return qq_listArray_Style;
}
public void setqq_listArray_Style(DropList value) {
DropList oldValue = qq_listArray_Style;
qq_listArray_Style = value;
this.qq_Listeners.firePropertyChange("qq_listArray_Style", oldValue, value);
}
/**
* qq_listArray_frontHook: transformed from: qqds_ToggleField
* TagId=17
* isInherited=FALSE
*/
public JCheckBox getqq_listArray_frontHook() {
if (qq_listArray_frontHook == null) {
qq_listArray_frontHook = ToggleFieldFactory.newToggleField("", "frontHook");
// OPTIONAL UIutils.reloadLabelText(qq_listArray_frontHook, mcat);
ArrayFieldCellHelper.setUpCellEditor(qq_listArray_frontHook, qq_list, 2, false);
qq_listArray_frontHook.setLocation(249, 33);
}
return qq_listArray_frontHook;
}
public void setqq_listArray_frontHook(JCheckBox value) {
JCheckBox oldValue = qq_listArray_frontHook;
qq_listArray_frontHook = value;
this.qq_Listeners.firePropertyChange("qq_listArray_frontHook", oldValue, value);
}
/**
* qq_listArray_cost: transformed from: qqds_DataField
* TagId=19
* isInherited=FALSE
*/
public DataField getqq_listArray_cost() {
if (qq_listArray_cost == null) {
// Mask type: MK_TEMPLATE
// original Forte format string -->$#,##0.00<--
this.qq_listArray_cost = DataFieldFactory.newDataField("cost", 15, "$#,##0.00", DecimalData.class);
qq_listArray_cost.setOriginalFormatText("$#,##0.00");
qq_listArray_cost.setHorizontalAlignment(JTextField.RIGHT);
WidthPolicy.set(qq_listArray_cost, Constants.SP_EXPLICIT);
HeightPolicy.set(qq_listArray_cost, Constants.SP_NATURAL);
qq_listArray_cost.setMinimumSize(new Dimension(100, 19));
qq_listArray_cost.setSize(new Dimension(100, 19));
qq_listArray_cost.setLocation(333, 36);
ArrayFieldCellHelper.setUpCellEditor(qq_listArray_cost, qq_list, 3, false);
}
return qq_listArray_cost;
}
public void setqq_listArray_cost(DataField value) {
DataField oldValue = qq_listArray_cost;
qq_listArray_cost = value;
this.qq_Listeners.firePropertyChange("qq_listArray_cost", oldValue, value);
}
/**
* qq_listArray_Color: transformed from: qqds_DropList
* TagId=21
* isInherited=FALSE
*/
public DropList getqq_listArray_Color() {
if (qq_listArray_Color == null) {
ListElement[] elements = new ListElement[4];
elements[0] = new ListElement( 1, "Red", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE );
elements[1] = new ListElement( 2, "Black", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE );
elements[2] = new ListElement( 3, "White", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE );
elements[3] = new ListElement( 4, "Ivory", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE );
qq_listArray_Color = DropFillinFactory.newDropList(elements);
qq_listArray_Color.setName("Color");
// OPTIONAL UIutils.reloadLabelText(qq_listArray_Color, mcat);
qq_listArray_Color.setMaximumRowCount(4);
ArrayFieldCellHelper.setUpCellEditor(qq_listArray_Color, qq_list, 4, false);
WidthPolicy.set(qq_listArray_Color, Constants.SP_NATURAL);
HeightPolicy.set(qq_listArray_Color, Constants.SP_NATURAL);
qq_listArray_Color.setMinimumSize(new Dimension(59, 21));
qq_listArray_Color.setLocation(456, 35);
}
return qq_listArray_Color;
}
public void setqq_listArray_Color(DropList value) {
DropList oldValue = qq_listArray_Color;
qq_listArray_Color = value;
this.qq_Listeners.firePropertyChange("qq_listArray_Color", oldValue, value);
}
/**
* Initialise the window and all its children.
*/
protected void initialize() {
if (this.Form == null) {
this.setName( "BraSort" );
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_GridField26(), Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_list(), Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_listArray_Name(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_listArray_Style(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_listArray_frontHook(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_listArray_cost(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_listArray_Color(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_sortit(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
}
// </editor-fold>
// -----------
// Main method
// -----------
public static void main(String []args) {
KeyboardFocusManager.setCurrentKeyboardFocusManager(new ForteKeyboardFocusManager());
try {
UIManager.setLookAndFeel(new Win32LookAndFeel());
}
catch (Exception e) {}
ToolTipManager.sharedInstance().setDismissDelay(Integer.MAX_VALUE);
BraSort myClass = new BraSort();
myClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
myClass.setVisible(true);
UIutils.processGUIActions();
}
} // end class BraSort
// c Pass 2 Conversion Time: 390 milliseconds