Package WindowTester

Source Code of WindowTester.MappedObjectsTester

package WindowTester;

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.Caption;
import DisplayProject.actions.FrameWeight;
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.TextGraphic;
import DisplayProject.events.ClientEventManager;
import DisplayProject.factory.CompoundFieldFactory;
import DisplayProject.factory.DataFieldFactory;
import DisplayProject.factory.GraphicFactory;
import DisplayProject.factory.PushButtonFactory;
import DisplayProject.plaf.Win32LookAndFeel;
import Framework.ErrorMgr;
import Framework.EventHandle;
import Framework.EventManager;
import Framework.EventRegistration;
import Framework.File;
import Framework.ForteKeyboardFocusManager;
import Framework.RuntimeProperties;
import Framework.UsageException;
import WindowTester.X;
import WindowTester.Y;
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.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.SwingConstants;
import javax.swing.ToolTipManager;
import javax.swing.UIManager;

/**
* MappedObjectsTester<p>
* <p>
* @author Generated from Forte
* @since  19-Nov-2008
*/
@RuntimeProperties(isDistributed=false, isAnchored=false, isShared=false, isTransactional=false)
@UDSWindow()
@SuppressWarnings("serial")
public class MappedObjectsTester
        extends JFrame
        implements Serializable, Observable
{

    // ----------
    // Attributes
    // ----------
    protected File DefaultHelpFile;
    protected BindingManager bindingManager = null;
    public PropertyChangeSupport qq_Listeners = new ExtendedPropertyChangeSupport(this, true);
    private Y _Y;
    private X aX;

    // ------------
    // Constructors
    // ------------
    public MappedObjectsTester() {
        // Explicitly call the superclass constructor to prevent the implicit call
        super();
        this.initialize();

        this.setAX(new X());
        this.set_Y(new Y());

    }

    // ----------------------
    // 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 set_Y(Y _Y) {
        Y oldValue = this._Y;
        this._Y = _Y;
        this.qq_Listeners.firePropertyChange("_Y", oldValue, this._Y);
    }

    public Y get_Y() {
        return this._Y;
    }

    public void setAX(X aX) {
        X oldValue = this.aX;
        this.aX = aX;
        this.qq_Listeners.firePropertyChange("AX", oldValue, this.aX);
    }

    public X getAX() {
        return this.aX;
    }

    // -------
    // 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 PushButton_Click_getqq_Map_YZBtn = ClientEventManager.register( this.getqq_Map_YZBtn(), "Click" );
            EventRegistration PushButton_Click_getqq_MapXYZBtn = ClientEventManager.register( this.getqq_MapXYZBtn(), "Click" );
            EventRegistration PushButton_Click_getqq_MapXYBtn = ClientEventManager.register( this.getqq_MapXYBtn(), "Click" );
            EventRegistration PushButton_Click_getqq_MapXBtn = ClientEventManager.register( this.getqq_MapXBtn(), "Click" );
            EventRegistration TaskHandle_Shutdown_langThreadcurrentThread = ClientEventManager.register( Thread.currentThread(), "Shutdown" );

            while (true) {

                UIutils.processGUIActions();
                EventHandle qq_currentEvent = EventManager.waitForEvent();
                if (qq_currentEvent == null)
                    break;

                // ----------------------
                // self.<Map_YZBtn>.click
                // ----------------------
                if (qq_currentEvent.isEvent(PushButton_Click_getqq_Map_YZBtn)) {
                    try {
                        CursorMgr.startEvent();
                        // ================ Begin Forte Event Handler Translation ================
                        this.set_Y(new Y("_Y.Z mapped!"));
                        UIutils.processGUIActions();

                        // ================ End Forte Event Handler Translation ================
                    }
                    finally {
                        CursorMgr.endEvent();
                    }
                }

                // ----------------------
                // self.<MapXYZBtn>.click
                // ----------------------
                else if (qq_currentEvent.isEvent(PushButton_Click_getqq_MapXYZBtn)) {
                    try {
                        CursorMgr.startEvent();
                        // ================ Begin Forte Event Handler Translation ================
                        this.getAX().getAY().setZ("X.Y.Z mapped");
                        UIutils.processGUIActions();

                        // ================ End Forte Event Handler Translation ================
                    }
                    finally {
                        CursorMgr.endEvent();
                    }
                }

                // ---------------------
                // self.<MapXYBtn>.click
                // ---------------------
                else if (qq_currentEvent.isEvent(PushButton_Click_getqq_MapXYBtn)) {
                    try {
                        CursorMgr.startEvent();
                        // ================ Begin Forte Event Handler Translation ================
                        this.getAX().setAY(new Y("X.Y mapped"));
                        UIutils.processGUIActions();

                        // ================ End Forte Event Handler Translation ================
                    }
                    finally {
                        CursorMgr.endEvent();
                    }
                }

                // --------------------
                // self.<MapXBtn>.click
                // --------------------
                else if (qq_currentEvent.isEvent(PushButton_Click_getqq_MapXBtn)) {
                    try {
                        CursorMgr.startEvent();
                        // ================ Begin Forte Event Handler Translation ================
                        this.setAX(new X(new Y("X mapped")));

                        // ================ End Forte Event Handler Translation ================
                    }
                    finally {
                        CursorMgr.endEvent();
                    }
                }

                // -------------
                // task.Shutdown
                // -------------
                else 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( PushButton_Click_getqq_Map_YZBtn );
            EventManager.deregister( PushButton_Click_getqq_MapXYZBtn );
            EventManager.deregister( PushButton_Click_getqq_MapXYBtn );
            EventManager.deregister( PushButton_Click_getqq_MapXBtn );
            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__Y_Z;
    public DataField qq_aX_aY_Z;
    public GridField qq_ButtonGrid;
    public GridField qq_GridField20;
    public GridField qq_OuterGrid;
    public GridField qq_aX;
    public JButton qq_MapXBtn;
    public JButton qq_MapXYBtn;
    public JButton qq_MapXYZBtn;
    public JButton qq_Map_YZBtn;
    public JPanel Form;
    public TextGraphic qq_FieldYZLbl;
    public TextGraphic qq_NonMappedYYZLbl;

    /**
     * qq_aX_aY_Z: transformed from: qqds_DataField
     * TagId=14
     * isInherited=FALSE
     */
    public DataField getqq_aX_aY_Z() {
        if (qq_aX_aY_Z == null) {
            // Mask type: MK_NONE
            qq_aX_aY_Z = DataFieldFactory.newDataField("aY.Z", 19, Constants.MK_NONE);
            qq_aX_aY_Z.setOriginalFormatText(null);
            qq_aX_aY_Z.setHorizontalAlignment(JTextField.LEFT);
            getBindingManager().bindComponent(qq_aX_aY_Z, "AX.AY.z");
            WidthPolicy.set(qq_aX_aY_Z, Constants.SP_EXPLICIT);
            HeightPolicy.set(qq_aX_aY_Z, Constants.SP_NATURAL);
            qq_aX_aY_Z.setMinimumSize(new Dimension(135, 19));
            qq_aX_aY_Z.setSize(new Dimension(135, 19));
        }
        return qq_aX_aY_Z;
    }

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

    /**
     * qq_FieldYZLbl: transformed from: qqds_TextGraphic
     * TagId=15
     * isInherited=FALSE
     */
    public TextGraphic getqq_FieldYZLbl() {
        if (qq_FieldYZLbl == null) {
            qq_FieldYZLbl = GraphicFactory.newTextGraphic("Field Y.Z\n", "");
            // OPTIONAL UIutils.reloadLabelText(qq_FieldYZLbl, mcat);
            WidthPolicy.set(qq_FieldYZLbl, Constants.SP_NATURAL);
            HeightPolicy.set(qq_FieldYZLbl, Constants.SP_NATURAL);
            qq_FieldYZLbl.setMinimumSize(new Dimension(46, 16));
        }
        return qq_FieldYZLbl;
    }

    public void setqq_FieldYZLbl(TextGraphic value) {
        TextGraphic oldValue = qq_FieldYZLbl;
        qq_FieldYZLbl = value;
        this.qq_Listeners.firePropertyChange("qq_FieldYZLbl", oldValue, value);
    }

    /**
     * qq_aX: transformed from: qqds_GridField
     * TagId=13
     * isInherited=FALSE
     * In forte this was a 2x1 grid field, displaying a X object.
     * 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_aXProperties() {
        Caption.set(qq_aX, "X");
        FrameWeight.set(qq_aX, Constants.W_DEFAULT);
        qq_aX.setCellTopMargin(50);
        qq_aX.setCellBottomMargin(50);
        qq_aX.setCellLeftMargin(50);
        qq_aX.setCellRightMargin(50);
        qq_aX.setCollapsed(true);
        qq_aX.setHeightPolicy(Constants.SP_NATURAL);
        qq_aX.setWidthPolicy(Constants.SP_NATURAL);
        qq_aX.setBackground(null);
    }

    public GridField getqq_aX() {
        if (qq_aX == null) {
            qq_aX = CompoundFieldFactory.newGridField("aX", false);
            getBindingManager().bindComponent(qq_aX, "AX");
            setqq_aXProperties();
            qq_aX.setMinimumSize(new Dimension(213, 54));
            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_aX.add( getqq_FieldYZLbl(), qq_gbc );

            GridBagConstraints qq_gbc1 = new GridBagConstraints();
            qq_gbc1.gridx = 1; // Column 2
            qq_gbc1.gridy = 0; // Row 1
            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_aX.add( getqq_aX_aY_Z(), qq_gbc1 );

        }
        return qq_aX;
    }

    public void setqq_aX(GridField value) {
        GridField oldValue = qq_aX;
        qq_aX = value;
        this.qq_Listeners.firePropertyChange("qq_aX", oldValue, value);
    }

    /**
     * qq_MapXYZBtn: transformed from: qqds_PushButton
     * TagId=17
     * isInherited=FALSE
     */
    public JButton getqq_MapXYZBtn() {
        if (qq_MapXYZBtn == null) {
            qq_MapXYZBtn = PushButtonFactory.newInstance("MapXYZBtn", "Map X.Y.Z");
            qq_MapXYZBtn.setVerifyInputWhenFocusTarget(true);
            WidthPolicy.set(qq_MapXYZBtn, Constants.SP_NATURAL);
            HeightPolicy.set(qq_MapXYZBtn, Constants.SP_NATURAL);
            qq_MapXYZBtn.setMinimumSize(new Dimension(63, 23));
        }
        return qq_MapXYZBtn;
    }

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

    /**
     * qq_MapXYBtn: transformed from: qqds_PushButton
     * TagId=18
     * isInherited=FALSE
     */
    public JButton getqq_MapXYBtn() {
        if (qq_MapXYBtn == null) {
            qq_MapXYBtn = PushButtonFactory.newInstance("MapXYBtn", "Map X.Y");
            qq_MapXYBtn.setVerifyInputWhenFocusTarget(true);
            WidthPolicy.set(qq_MapXYBtn, Constants.SP_NATURAL);
            HeightPolicy.set(qq_MapXYBtn, Constants.SP_NATURAL);
            qq_MapXYBtn.setMinimumSize(new Dimension(53, 23));
        }
        return qq_MapXYBtn;
    }

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

    /**
     * qq_MapXBtn: transformed from: qqds_PushButton
     * TagId=19
     * isInherited=FALSE
     */
    public JButton getqq_MapXBtn() {
        if (qq_MapXBtn == null) {
            qq_MapXBtn = PushButtonFactory.newInstance("MapXBtn", "Map X");
            qq_MapXBtn.setVerifyInputWhenFocusTarget(true);
            WidthPolicy.set(qq_MapXBtn, Constants.SP_NATURAL);
            HeightPolicy.set(qq_MapXBtn, Constants.SP_NATURAL);
            qq_MapXBtn.setMinimumSize(new Dimension(43, 23));
        }
        return qq_MapXBtn;
    }

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

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

    public GridField getqq_ButtonGrid() {
        if (qq_ButtonGrid == null) {
            qq_ButtonGrid = CompoundFieldFactory.newGridField("ButtonGrid", false);
            setqq_ButtonGridProperties();
            qq_ButtonGrid.setMinimumSize(new Dimension(180, 32));
            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(2, 2, 2, 2); // Top, Left, Bottom, Right Margin
            qq_ButtonGrid.add( getqq_MapXYZBtn(), qq_gbc );

            GridBagConstraints qq_gbc1 = new GridBagConstraints();
            qq_gbc1.gridx = 1; // Column 2
            qq_gbc1.gridy = 0; // Row 1
            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(2, 2, 2, 2); // Top, Left, Bottom, Right Margin
            qq_ButtonGrid.add( getqq_MapXYBtn(), qq_gbc1 );

            GridBagConstraints qq_gbc2 = new GridBagConstraints();
            qq_gbc2.gridx = 2; // Column 3
            qq_gbc2.gridy = 0; // Row 1
            qq_gbc2.weightx = 0;
            qq_gbc2.weighty = 0;
            qq_gbc2.anchor = GridBagConstraints.CENTER; // Gravity - original: CG_DEFAULT gf
            qq_gbc2.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
            qq_gbc2.insets = new Insets(2, 2, 2, 2); // Top, Left, Bottom, Right Margin
            qq_ButtonGrid.add( getqq_MapXBtn(), qq_gbc2 );

        }
        return qq_ButtonGrid;
    }

    public void setqq_ButtonGrid(GridField value) {
        GridField oldValue = qq_ButtonGrid;
        qq_ButtonGrid = value;
        this.qq_Listeners.firePropertyChange("qq_ButtonGrid", oldValue, value);
    }

    /**
     * qq__Y_Z: transformed from: qqds_DataField
     * TagId=21
     * isInherited=FALSE
     */
    public DataField getqq__Y_Z() {
        if (qq__Y_Z == null) {
            // Mask type: MK_NONE
            qq__Y_Z = DataFieldFactory.newDataField("_Y.Z", 12, Constants.MK_NONE);
            qq__Y_Z.setOriginalFormatText(null);
            qq__Y_Z.setHorizontalAlignment(JTextField.LEFT);
            getBindingManager().bindComponent(qq__Y_Z, "_Y.z");
            WidthPolicy.set(qq__Y_Z, Constants.SP_EXPLICIT);
            HeightPolicy.set(qq__Y_Z, Constants.SP_NATURAL);
            qq__Y_Z.setMinimumSize(new Dimension(90, 19));
            qq__Y_Z.setSize(new Dimension(90, 19));
        }
        return qq__Y_Z;
    }

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

    /**
     * qq_NonMappedYYZLbl: transformed from: qqds_TextGraphic
     * TagId=22
     * isInherited=FALSE
     */
    public TextGraphic getqq_NonMappedYYZLbl() {
        if (qq_NonMappedYYZLbl == null) {
            qq_NonMappedYYZLbl = GraphicFactory.newTextGraphic("(Non Mapped _Y) _Y.Z\n", "");
            qq_NonMappedYYZLbl.setHorizontalAlignment( SwingConstants.LEFT );
            // OPTIONAL UIutils.reloadLabelText(qq_NonMappedYYZLbl, mcat);
            WidthPolicy.set(qq_NonMappedYYZLbl, Constants.SP_NATURAL);
            HeightPolicy.set(qq_NonMappedYYZLbl, Constants.SP_NATURAL);
            qq_NonMappedYYZLbl.setMinimumSize(new Dimension(117, 16));
        }
        return qq_NonMappedYYZLbl;
    }

    public void setqq_NonMappedYYZLbl(TextGraphic value) {
        TextGraphic oldValue = qq_NonMappedYYZLbl;
        qq_NonMappedYYZLbl = value;
        this.qq_Listeners.firePropertyChange("qq_NonMappedYYZLbl", oldValue, value);
    }

    /**
     * qq_GridField20: transformed from: qqds_GridField
     * TagId=20
     * isInherited=FALSE
     * In forte this was a 2x1 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_GridField20Properties() {
        qq_GridField20.setCollapsed(true);
        qq_GridField20.setHeightPolicy(Constants.SP_NATURAL);
        qq_GridField20.setWidthPolicy(Constants.SP_NATURAL);
        qq_GridField20.setBackground(null);
    }

    public GridField getqq_GridField20() {
        if (qq_GridField20 == null) {
            qq_GridField20 = CompoundFieldFactory.newGridField("qq_GridField20", true);
            setqq_GridField20Properties();
            qq_GridField20.setMinimumSize(new Dimension(208, 19));
            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_GridField20.add( getqq_NonMappedYYZLbl(), qq_gbc );

            GridBagConstraints qq_gbc1 = new GridBagConstraints();
            qq_gbc1.gridx = 1; // Column 2
            qq_gbc1.gridy = 0; // Row 1
            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(0, 0, 0, 0); // Top, Left, Bottom, Right Margin
            qq_GridField20.add( getqq__Y_Z(), qq_gbc1 );

        }
        return qq_GridField20;
    }

    public void setqq_GridField20(GridField value) {
        GridField oldValue = qq_GridField20;
        qq_GridField20 = value;
        this.qq_Listeners.firePropertyChange("qq_GridField20", oldValue, value);
    }

    /**
     * qq_Map_YZBtn: transformed from: qqds_PushButton
     * TagId=23
     * isInherited=FALSE
     */
    public JButton getqq_Map_YZBtn() {
        if (qq_Map_YZBtn == null) {
            qq_Map_YZBtn = PushButtonFactory.newInstance("Map_YZBtn", "Map _Y.Z");
            qq_Map_YZBtn.setVerifyInputWhenFocusTarget(true);
            WidthPolicy.set(qq_Map_YZBtn, Constants.SP_NATURAL);
            HeightPolicy.set(qq_Map_YZBtn, Constants.SP_NATURAL);
            qq_Map_YZBtn.setMinimumSize(new Dimension(60, 23));
        }
        return qq_Map_YZBtn;
    }

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

    /**
     * qq_OuterGrid: transformed from: qqds_GridField
     * TagId=12
     * isInherited=FALSE
     * In forte this was a 1x4 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_OuterGridProperties() {
        qq_OuterGrid.setCollapsed(true);
        qq_OuterGrid.setHeightPolicy(Constants.SP_NATURAL);
        qq_OuterGrid.setWidthPolicy(Constants.SP_NATURAL);
        qq_OuterGrid.setBackground(null);
        qq_OuterGrid.setLocation(12, 7);
    }

    public GridField getqq_OuterGrid() {
        if (qq_OuterGrid == null) {
            qq_OuterGrid = CompoundFieldFactory.newGridField("OuterGrid", false);
            setqq_OuterGridProperties();
            qq_OuterGrid.setMinimumSize(new Dimension(213, 130));
            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_OuterGrid.add( getqq_aX(), 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.EAST; // Gravity - original: CG_MIDDLERIGHT
            qq_gbc1.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
            qq_gbc1.insets = new Insets(0, 0, 0, 0); // Top, Left, Bottom, Right Margin
            qq_OuterGrid.add( getqq_ButtonGrid(), qq_gbc1 );

            GridBagConstraints qq_gbc2 = new GridBagConstraints();
            qq_gbc2.gridx = 0; // Column 1
            qq_gbc2.gridy = 2; // Row 3
            qq_gbc2.weightx = 0;
            qq_gbc2.weighty = 0;
            qq_gbc2.anchor = GridBagConstraints.CENTER; // Gravity - original: CG_DEFAULT gf
            qq_gbc2.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
            qq_gbc2.insets = new Insets(0, 0, 0, 0); // Top, Left, Bottom, Right Margin
            qq_OuterGrid.add( getqq_GridField20(), qq_gbc2 );

            GridBagConstraints qq_gbc3 = new GridBagConstraints();
            qq_gbc3.gridx = 0; // Column 1
            qq_gbc3.gridy = 3; // Row 4
            qq_gbc3.weightx = 0;
            qq_gbc3.weighty = 0;
            qq_gbc3.anchor = GridBagConstraints.CENTER; // Gravity - original: CG_DEFAULT gf
            qq_gbc3.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
            qq_gbc3.insets = new Insets(0, 0, 0, 0); // Top, Left, Bottom, Right Margin
            qq_OuterGrid.add( getqq_Map_YZBtn(), qq_gbc3 );

        }
        return qq_OuterGrid;
    }

    public void setqq_OuterGrid(GridField value) {
        GridField oldValue = qq_OuterGrid;
        qq_OuterGrid = value;
        this.qq_Listeners.firePropertyChange("qq_OuterGrid", 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_OuterGrid() );
        }
        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( "MappedObjectsTester" );
            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_OuterGrid(), Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
        this.usage.add(getqq_aX(), Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
        this.usage.add(getqq_aX_aY_Z(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
        this.usage.add(getqq_FieldYZLbl(), Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
        this.usage.add(getqq_ButtonGrid(), Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
        this.usage.add(getqq_MapXYZBtn(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
        this.usage.add(getqq_MapXYBtn(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
        this.usage.add(getqq_MapXBtn(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
        this.usage.add(getqq_GridField20(), Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
        this.usage.add(getqq__Y_Z(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
        this.usage.add(getqq_NonMappedYYZLbl(), Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
        this.usage.add(getqq_Map_YZBtn(), 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);
            MappedObjectsTester myClass = new MappedObjectsTester();
            myClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            myClass.setVisible(true);
            UIutils.processGUIActions();
        }
// end class MappedObjectsTester
// c Pass 2 Conversion Time: 359 milliseconds
TOP

Related Classes of WindowTester.MappedObjectsTester

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.