Package ArrayFindWidgetByName

Source Code of ArrayFindWidgetByName.Main

package ArrayFindWidgetByName;

import ArrayFindWidgetByName.Array_Of_Thing;
import ArrayFindWidgetByName.Thing;
import DisplayProject.ArrayColumn;
import DisplayProject.ArrayFieldModel;
import DisplayProject.CloseHideAdaptor;
import DisplayProject.Constants;
import DisplayProject.CursorMgr;
import DisplayProject.DataField;
import DisplayProject.GridField;
import DisplayProject.RadioList;
import DisplayProject.RadioListModel;
import DisplayProject.UDSWindow;
import DisplayProject.UIutils;
import DisplayProject.WindowManager;
import DisplayProject.WindowUsageMap;
import DisplayProject.actions.AppletConnectionInfo;
import DisplayProject.actions.DefaultButton;
import DisplayProject.actions.FrameColor;
import DisplayProject.actions.HeightPolicy;
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.binding.list.SelectionInList;
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.ListFieldFactory;
import DisplayProject.factory.PushButtonFactory;
import DisplayProject.factory.TableFactory;
import DisplayProject.plaf.Win32LookAndFeel;
import DisplayProject.table.ArrayFieldCellHelper;
import DisplayProject.table.ComboBoxCellRenderer;
import DisplayProject.table.FormattedCellEditor;
import DisplayProject.table.FormattedCellRenderer;
import DisplayProject.table.RadioListCellEditor;
import DisplayProject.table.RadioListCellRenderer;
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.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.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 Array_Of_Thing<Thing> things;

    // ------------
    // Constructors
    // ------------
    public Main() {
        // Explicitly call the superclass constructor to prevent the implicit call
        super();
        this.initialize();
        this.setThings(new Array_Of_Thing<Thing>());
        this.getThings().set(0, new Thing());

    }

    // ----------------------
    // 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 setThings(Array_Of_Thing<Thing> things) {
        Array_Of_Thing<Thing> oldValue = this.things;
        this.things = things;
        this.qq_Listeners.firePropertyChange("things", oldValue, this.things);
    }

    public Array_Of_Thing<Thing> getThings() {
        return this.things;
    }

    // -------
    // 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);
        // ----------
        // Event Loop
        // ----------
        EventManager.startEventLoop();
        try {
            EventRegistration TaskHandle_Shutdown_langThreadcurrentThread = ClientEventManager.register( Thread.currentThread(), "Shutdown" );
            EventRegistration PushButton_Click_getqq_ShowHide = ClientEventManager.register( this.getqq_ShowHide(), "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();
                    }
                }

                // ----------------
                // <ShowHide>.click
                // ----------------
                else if (qq_currentEvent.isEvent(PushButton_Click_getqq_ShowHide)) {
                    try {
                        CursorMgr.startEvent();
                        // ================ Begin Forte Event Handler Translation ================
                        JComponent target = (JComponent)UIutils.getFieldByName("things[*].Colour", (JComponent)UIutils.getForm(this));
                        WidgetState.set((JComponent)target, Constants.FS_INVISIBLE);
                        // ================ End Forte Event Handler Translation ================
                    }
                    finally {
                        CursorMgr.endEvent();
                    }
                }
            }
            EventManager.deregister( TaskHandle_Shutdown_langThreadcurrentThread );
            EventManager.deregister( PushButton_Click_getqq_ShowHide );
        }
        //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_things;
    public DataField qq_thingsArray_name;
    public DropList qq_thingsArray_size;
    public GridField qq_GridField12;
    public JButton qq_ShowHide;
    public JPanel Form;
    public JScrollPane qq_things_sp;
    public RadioList qq_thingsArray_Colour;

    /**
     * qq_things_sp: transformed from: qqds_ArrayField
     * TagId=13
     * isInherited=FALSE
     */
    public JScrollPane getqq_things_sp() {
        if (qq_things_sp == null) {
            qq_things_sp = CompoundFieldFactory.newScrollPane();
            qq_things_sp.setName("things");
            qq_things_sp.setViewportView(getqq_things());
            qq_things_sp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
            qq_things_sp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
            qq_things_sp.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));
            qq_things_sp.setBackground(null);
            qq_things_sp.getViewport().setBackground(null);
            FrameColor.set(qq_things_sp, Constants.C_INHERIT);
            WidthPolicy.set(qq_things_sp, Constants.SP_NATURAL);
            HeightPolicy.set(qq_things_sp, Constants.SP_NATURAL);
            // OPTIONAL qq_things_sp.setSize(new Dimension(420, 129));
            qq_things_sp.setMinimumSize(new Dimension(420, 129));
            qq_things_sp.setPreferredSize(new Dimension(420, 129));
        }
        return qq_things_sp;
    }

    public void setqq_things_sp(JScrollPane value) {
        JScrollPane oldValue = qq_things_sp;
        qq_things_sp = value;
        this.qq_Listeners.firePropertyChange("qq_things_sp", oldValue, value);
    }

    /**
     * qq_things: transformed from: qqds_ArrayField
     * TagId=13
     * isInherited=FALSE
     */
    public ArrayField getqq_things() {
        if (qq_things == null) {
            qq_things = TableFactory.newArrayField("things", 35);
            this.getBindingManager().bindComponent(qq_things, "things", Thing.class,
                    new String[] {"name", "size", "colour"});
            qq_things.setVisibleRows(3);
            ((ArrayFieldModel)qq_things.getModel()).setAllowsAppend(true);

            //  === Column model setup ===

            // name converted from qqds_DataField
            ArrayColumn qq_thingsArray_name_Column = new ArrayColumn("name", 0, 131, new FormattedCellRenderer(getqq_thingsArray_name()), new FormattedCellEditor(getqq_thingsArray_name()), true);
            qq_thingsArray_name_Column.setHeaderValue("name");
            qq_thingsArray_name_Column.setVisible(true);
            qq_things.addColumn(qq_thingsArray_name_Column);

            // size converted from qqds_DropList
            ArrayColumn qq_thingsArray_size_Column = new ArrayColumn("size", 1, getqq_thingsArray_size().getMinimumSize().width, new ComboBoxCellRenderer(getqq_thingsArray_size()), DropFillinFactory.newDropListEditor(getqq_thingsArray_size()), true);
            qq_thingsArray_size_Column.setHeaderValue("size");
            qq_thingsArray_size_Column.setVisible(true);
            qq_things.addColumn(qq_thingsArray_size_Column);

            // Colour converted from qqds_RadioList
            ArrayColumn qq_thingsArray_Colour_Column = new ArrayColumn("Colour", 2, 206, new RadioListCellRenderer(getqq_thingsArray_Colour()), new RadioListCellEditor(getqq_thingsArray_Colour()), true);
            qq_thingsArray_Colour_Column.setHeaderValue("Colour");
            qq_thingsArray_Colour_Column.setVisible(true);
            qq_things.addColumn(qq_thingsArray_Colour_Column);

            //  === End column model ===

            TableFactory.postModelArrayField(qq_things);
        }
        return qq_things;
    }

    public void setqq_things(ArrayField value) {
        ArrayField oldValue = qq_things;
        qq_things = value;
        this.qq_Listeners.firePropertyChange("qq_things", oldValue, value);
    }

    /**
     * qq_ShowHide: transformed from: qqds_PushButton
     * TagId=22
     * isInherited=FALSE
     */
    public JButton getqq_ShowHide() {
        if (qq_ShowHide == null) {
            qq_ShowHide = PushButtonFactory.newInstance("ShowHide", "Show / Hide");
            DefaultButton.set(qq_ShowHide, true);
            qq_ShowHide.setVerifyInputWhenFocusTarget(true);
            WidthPolicy.set(qq_ShowHide, Constants.SP_NATURAL);
            HeightPolicy.set(qq_ShowHide, Constants.SP_NATURAL);
            qq_ShowHide.setMinimumSize(new Dimension(72, 21));
        }
        return qq_ShowHide;
    }

    public void setqq_ShowHide(JButton value) {
        JButton oldValue = qq_ShowHide;
        qq_ShowHide = value;
        this.qq_Listeners.firePropertyChange("qq_ShowHide", oldValue, value);
    }

    /**
     * qq_GridField12: transformed from: qqds_GridField
     * TagId=12
     * isInherited=FALSE
     * In forte this was a 1x2 grid field.
     * The cell margins are all 100 mils
     * The width policy is set to Natural, and the height policy is set to Natural.
     */
    protected void setqq_GridField12Properties() {
        qq_GridField12.setCellTopMargin(50);
        qq_GridField12.setCellBottomMargin(50);
        qq_GridField12.setCellLeftMargin(50);
        qq_GridField12.setCellRightMargin(50);
        qq_GridField12.setCollapsed(true);
        qq_GridField12.setHeightPolicy(Constants.SP_NATURAL);
        qq_GridField12.setWidthPolicy(Constants.SP_NATURAL);
        qq_GridField12.setBackground(null);
    }

    public GridField getqq_GridField12() {
        if (qq_GridField12 == null) {
            qq_GridField12 = CompoundFieldFactory.newGridField("qq_GridField12", true);
            setqq_GridField12Properties();
            qq_GridField12.setMinimumSize(new Dimension(441, 180));
            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(4, 4, 4, 4); // Top, Left, Bottom, Right Margin
            qq_GridField12.add( getqq_things_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(4, 4, 4, 4); // Top, Left, Bottom, Right Margin
            qq_GridField12.add( getqq_ShowHide(), qq_gbc1 );

        }
        return qq_GridField12;
    }

    public void setqq_GridField12(GridField value) {
        GridField oldValue = qq_GridField12;
        qq_GridField12 = value;
        this.qq_Listeners.firePropertyChange("qq_GridField12", 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_GridField12() );
        }
        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_thingsArray_name: transformed from: qqds_DataField
     * TagId=14
     * isInherited=FALSE
     */
    public DataField getqq_thingsArray_name() {
        if (qq_thingsArray_name == null) {
            // Mask type: MK_NONE
            qq_thingsArray_name = DataFieldFactory.newDataField("name", 20, Constants.MK_NONE);
            qq_thingsArray_name.setOriginalFormatText(null);
            qq_thingsArray_name.setHorizontalAlignment(JTextField.LEFT);
            WidthPolicy.set(qq_thingsArray_name, Constants.SP_EXPLICIT);
            HeightPolicy.set(qq_thingsArray_name, Constants.SP_NATURAL);
            qq_thingsArray_name.setMinimumSize(new Dimension(131, 19));
            qq_thingsArray_name.setSize(new Dimension(131, 19));
            qq_thingsArray_name.setLocation(19, 24);
            ArrayFieldCellHelper.setUpCellEditor(qq_thingsArray_name, qq_things, 0, false);
        }
        return qq_thingsArray_name;
    }

    public void setqq_thingsArray_name(DataField value) {
        DataField oldValue = qq_thingsArray_name;
        qq_thingsArray_name = value;
        this.qq_Listeners.firePropertyChange("qq_thingsArray_name", oldValue, value);
    }

    /**
     * qq_thingsArray_size: transformed from: qqds_DropList
     * TagId=16
     * isInherited=FALSE
     */
    public DropList getqq_thingsArray_size() {
        if (qq_thingsArray_size == null) {
            ListElement[] elements = new ListElement[3];
            elements[0] = new ListElement( 1, "Small", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE );
            elements[1] = new ListElement( 2, "Medium", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE );
            elements[2] = new ListElement( 3, "Large", ListElement.qq_Resolver.cINTEGERVALUE_TEXTVALUE );

            qq_thingsArray_size = DropFillinFactory.newDropList(elements);
            qq_thingsArray_size.setName("size");
            // OPTIONAL UIutils.reloadLabelText(qq_thingsArray_size, mcat);
            qq_thingsArray_size.setMaximumRowCount(4);
            ArrayFieldCellHelper.setUpCellEditor(qq_thingsArray_size, qq_things, 1, false);
            WidthPolicy.set(qq_thingsArray_size, Constants.SP_NATURAL);
            HeightPolicy.set(qq_thingsArray_size, Constants.SP_NATURAL);
            qq_thingsArray_size.setMinimumSize(new Dimension(70, 21));
            qq_thingsArray_size.setLocation(156, 24);
        }
        return qq_thingsArray_size;
    }

    public void setqq_thingsArray_size(DropList value) {
        DropList oldValue = qq_thingsArray_size;
        qq_thingsArray_size = value;
        this.qq_Listeners.firePropertyChange("qq_thingsArray_size", oldValue, value);
    }

    /**
     * qq_thingsArray_Colour: transformed from: qqds_RadioList
     * TagId=18
     * isInherited=FALSE
     */
    public RadioList getqq_thingsArray_Colour() {
        if (qq_thingsArray_Colour == null) {
            String[] names = {"Yellow", "Blue", "Green", "Red"};
            qq_thingsArray_Colour = ListFieldFactory.newRadioList(Constants.FO_HORIZONTAL, "", 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_thingsArray_Colour.setName("Colour");
            qq_thingsArray_Colour.setModel(new RadioListModel(new SelectionInList(elements), qq_thingsArray_Colour) );
            if (qq_thingsArray_Colour.getSelectedIndex() == -1)
                qq_thingsArray_Colour.setSelectedIndex(0);
            // OPTIONAL UIutils.reloadLabelText(qq_thingsArray_Colour, mcat);
            ArrayFieldCellHelper.setUpCellEditor(qq_thingsArray_Colour, qq_things, 2, false);
            qq_thingsArray_Colour.setLocation(230, 30);
        }
        return qq_thingsArray_Colour;
    }

    public void setqq_thingsArray_Colour(RadioList value) {
        RadioList oldValue = qq_thingsArray_Colour;
        qq_thingsArray_Colour = value;
        this.qq_Listeners.firePropertyChange("qq_thingsArray_Colour", oldValue, 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_GridField12(), Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
        this.usage.add(getqq_things(), Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
        this.usage.add(getqq_thingsArray_name(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
        this.usage.add(getqq_thingsArray_size(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
        this.usage.add(getqq_thingsArray_Colour(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
        this.usage.add(getqq_ShowHide(), 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 ) {
            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: 297 milliseconds
TOP

Related Classes of ArrayFindWidgetByName.Main

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.