Package CalendarWidgets

Source Code of CalendarWidgets.OneMonth

package CalendarWidgets;

import DisplayProject.Array_Of_Panel;
import DisplayProject.CloseHideAdaptor;
import DisplayProject.Constants;
import DisplayProject.CursorMgr;
import DisplayProject.GridField;
import DisplayProject.UDSWindow;
import DisplayProject.UIutils;
import DisplayProject.WindowManager;
import DisplayProject.WindowUsageMap;
import DisplayProject.actions.Children;
import DisplayProject.actions.Column;
import DisplayProject.actions.FrameColor;
import DisplayProject.actions.FrameWeight;
import DisplayProject.actions.Height;
import DisplayProject.actions.HeightPolicy;
import DisplayProject.actions.Parent;
import DisplayProject.actions.Row;
import DisplayProject.actions.TextAlignment;
import DisplayProject.actions.UserWindow;
import DisplayProject.actions.WidgetSelected;
import DisplayProject.actions.WidgetState;
import DisplayProject.actions.Width;
import DisplayProject.actions.WidthPolicy;
import DisplayProject.binding.BindingManager;
import DisplayProject.binding.beans.ExtendedPropertyChangeSupport;
import DisplayProject.binding.beans.Observable;
import DisplayProject.controls.Panel;
import DisplayProject.controls.TextGraphic;
import DisplayProject.events.ClientEventManager;
import DisplayProject.factory.CompoundFieldFactory;
import DisplayProject.factory.GraphicFactory;
import DisplayProject.plaf.Win32LookAndFeel;
import Framework.DateFormat;
import Framework.DateTimeData;
import Framework.ErrorMgr;
import Framework.EventHandle;
import Framework.EventManager;
import Framework.EventRegistration;
import Framework.File;
import Framework.ForteKeyboardFocusManager;
import Framework.RuntimeProperties;
import Framework.TextData;
import Framework.UsageException;
import java.awt.Dimension;
import java.awt.Font;
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.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.ToolTipManager;
import javax.swing.UIManager;

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

    // ----------
    // Attributes
    // ----------
    protected File DefaultHelpFile;
    protected BindingManager bindingManager = null;
    public PropertyChangeSupport qq_Listeners = new ExtendedPropertyChangeSupport(this, true);
    private Array_Of_Panel<Panel> aDayArray;
    private int aBaseYear;
    private int aBaseMonth;
    private DateTimeData aDate;
    private int aSelectedValue;
    private Panel aLastSelect;

    // ------------
    // Constructors
    // ------------
    public OneMonth() {
        // Explicitly call the superclass constructor to prevent the implicit call
        super();
        this.initialize();
        this.setADayArray(new Array_Of_Panel<Panel>());
        this.setADate(new DateTimeData());
        this.getADate().setCurrent();

    }

    // ----------------------
    // 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 setADayArray(Array_Of_Panel<Panel> aDayArray) {
        Array_Of_Panel<Panel> oldValue = this.aDayArray;
        this.aDayArray = aDayArray;
        this.qq_Listeners.firePropertyChange("ADayArray", oldValue, this.aDayArray);
    }

    public Array_Of_Panel<Panel> getADayArray() {
        return this.aDayArray;
    }

    public void setABaseYear(int aBaseYear) {
        int oldValue = this.aBaseYear;
        this.aBaseYear = aBaseYear;
        this.qq_Listeners.firePropertyChange("ABaseYear", oldValue, this.aBaseYear);
    }

    public int getABaseYear() {
        return this.aBaseYear;
    }

    public void setABaseMonth(int aBaseMonth) {
        int oldValue = this.aBaseMonth;
        this.aBaseMonth = aBaseMonth;
        this.qq_Listeners.firePropertyChange("ABaseMonth", oldValue, this.aBaseMonth);
    }

    public int getABaseMonth() {
        return this.aBaseMonth;
    }

    public void setADate(DateTimeData aDate) {
        DateTimeData oldValue = this.aDate;
        this.aDate = aDate;
        this.qq_Listeners.firePropertyChange("ADate", oldValue, this.aDate);
    }

    public DateTimeData getADate() {
        return this.aDate;
    }

    public void setASelectedValue(int aSelectedValue) {
        int oldValue = this.aSelectedValue;
        this.aSelectedValue = aSelectedValue;
        this.qq_Listeners.firePropertyChange("ASelectedValue", oldValue, this.aSelectedValue);
    }

    public int getASelectedValue() {
        return this.aSelectedValue;
    }

    public void setALastSelect(Panel aLastSelect) {
        Panel oldValue = this.aLastSelect;
        this.aLastSelect = aLastSelect;
        this.qq_Listeners.firePropertyChange("ALastSelect", oldValue, this.aLastSelect);
    }

    public Panel getALastSelect() {
        return this.aLastSelect;
    }

    // -------
    // 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);
    }

    /**
     * buildDayMatrix<p>
     * :  Copyright 1998 - Marriott International, Inc.<br>
     * :<br>
     * :  Class:  WO_CalendarOneMonth<br>
     * :<br>
     * :  Method: buildDayMatrix<br>
     * :<br>
     * :  Member Access:  Public<br>
     * :<br>
     * :  Purpose:<br>
     * :    Build the matrix of calendar days.<br>
     * :<br>
     * :  Parameters:<br>
     * :    None<br>
     * :<br>
     * :  Exceptions Raised:<br>
     * :    None<br>
     * :<br>
     * :  Returns:<br>
     * :    None<br>
     * :<br>
     * :  Subclass Requirements:<br>
     * :    None<br>
     * :<br>
     * :  Modification History (Last on top):<br>
     * :    A0  05/31/99  MARV# 5486  Al Stark<br>
     * :      #MC - Message Catalog Automated Changes<br>
     * :    A0  09/20/97  MARV# 5486  Framework Development Team<br>
     * :      Original Version<br>
     * : ----------------------------------------------------------------------*<br>
     * <p>
     */
    public void buildDayMatrix() {
        int lColumn = 1;
        int lRow = 2;

        for (int lOneDay = 1; lOneDay <= 42; lOneDay++) {
            Panel wPanel = CompoundFieldFactory.newPanel();
            TextGraphic wText = new TextGraphic();
            Parent.set(wText, wPanel);
            Row.set((JComponent)wPanel, lRow);
            Column.set((JComponent)wPanel, lColumn);
            TextData.bind(wText, "text").setValue( lOneDay );
            TextAlignment.set(wText, Constants.TA_RIGHT);
            FrameWeight.set((JComponent)wPanel, Constants.W_DEFAULT);
            WidthPolicy.set((JComponent)wPanel, Constants.SP_EXPLICIT);
            HeightPolicy.set((JComponent)wPanel, Constants.SP_EXPLICIT);
            Width.set((JComponent)wPanel, 220);
            Height.set((JComponent)wPanel, 190);
            WidgetState.set((JComponent)wPanel, Constants.FS_SELECTONLY);
            FrameWeight.set((JComponent)wPanel, Constants.W_DEFAULT);
            Parent.set(wPanel, this.getqq_theMatrix());
            this.getADayArray().add(wPanel);
            lColumn = lColumn+1;
            if (lColumn == 8) {
                lColumn = 1;
                lRow = lRow+1;
            }
        }

        return;
    }

    /**
     * buildMonth<p>
     * :  Copyright 1998 - Marriott International, Inc.<br>
     * :<br>
     * :  Class:  WO_CalendarOneMonth<br>
     * :<br>
     * :  Method: buildMonthInfo<br>
     * :<br>
     * :  Member Access:  Public<br>
     * :<br>
     * :  Purpose:<br>
     * :    Build the month to have the correct number of rows<br>
     * :    and days distributed into those rows.<br>
     * :<br>
     * :  Parameters:<br>
     * :    None<br>
     * :<br>
     * :  Exceptions Raised:<br>
     * :    None<br>
     * :<br>
     * :  Returns:<br>
     * :    None<br>
     * :<br>
     * :  Subclass Requirements:<br>
     * :    None<br>
     * :<br>
     * :  Modification History (Last on top):<br>
     * :    A0  05/31/99  MARV# 5486  Al Stark<br>
     * :      #MC - Message Catalog Automated Changes<br>
     * :    A0  09/20/97  MARV# 5486  Framework Development Team<br>
     * :      Original Version<br>
     * : ----------------------------------------------------------------------*<br>
     * <p>
     * preserve the day of the month..<br>
     * <p>
     * 4/1/98 pdavis -- PR100; no need for this, aSelectedDay not changed<br>
     * except by explicit selection -or- old date not valid this month.<br>
     * aSelectedValue = getDay();<br>
     * <p>
     */
    public void buildMonth() {
        int lStartColumn = this.getDayOfWeek(this.getABaseMonth(), this.getABaseYear());

        int lColumn = lStartColumn;
        int lRow = 2;

        int lDays = this.getDaysInMonth(this.getABaseMonth(), this.getABaseYear());
        // 4/1/98 pdavis -- PR 100; if aSelectedValue out of range for this month,
        // kill it *and* assume aLastSelect will also be invalidated
        if (this.getASelectedValue() > lDays) {
            this.setASelectedValue(0);
            if (this.getALastSelect() != null) {
                WidgetSelected.set(this.getALastSelect(), false);
            }
            this.setALastSelect(null);
        }

        for (int lOneDay = 1; lOneDay <= 42; lOneDay++) {
            Panel wPanel = (Panel)this.getADayArray().get(lOneDay-1);
            if (lOneDay < lStartColumn || lOneDay >= lStartColumn+lDays) {
                WidgetState.set((JComponent)wPanel, Constants.FS_INVISIBLE);
            }
            else {
                TextData txt = new TextData();
                txt.setValue( lOneDay-lStartColumn+1 );
                TextData.bind(((TextGraphic)(Children.get(wPanel).get(0))), "text").setValue( lOneDay-lStartColumn+1 );
                WidgetState.set((JComponent)wPanel, Constants.FS_SELECTONLY);
            }
            FrameColor.set((JComponent)wPanel, Constants.C_GRAY2);
        }

        //if (aLastSelect<>NIL) then
        //  aLastSelect.isSelected = false;
        //  aSelectedValue = getDay();
        //end if;

        this.selectDay(this.getASelectedValue());
    }

    /**
     * display<p>
     * <p>
     */
    public void display() {
        UserWindow.open(this);
        // ----------
        // Event Loop
        // ----------
        EventManager.startEventLoop();
        try {
            EventRegistration TaskHandle_Shutdown_langThreadcurrentThread = ClientEventManager.register( Thread.currentThread(), "Shutdown" );

            while (true) {

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

                // -------------
                // task.Shutdown
                // -------------
                if (qq_currentEvent.isEvent(TaskHandle_Shutdown_langThreadcurrentThread)) {
                    try {
                        CursorMgr.startEvent();
                        // ================ Begin Forte Event Handler Translation ================
                        break;
                        // ================ End Forte Event Handler Translation ================
                    }
                    finally {
                        CursorMgr.endEvent();
                    }
                }
            }
            EventManager.deregister( TaskHandle_Shutdown_langThreadcurrentThread );
        }
        //catch (Exception qq_error) {
            //Logger.getLogger("task.part.Event").error("Event loop terminated by unhandled exception: " + qq_error.getMessage(), qq_error );
            //throw qq_error;
        //}
        finally {
            EventManager.endEventLoop();
            UserWindow.close(this);
        }
    }

    /**
     * getDayOfWeek<p>
     * :  Copyright 1998 - Marriott International, Inc.<br>
     * :<br>
     * :  Class:  WO_CalendarOneMonth<br>
     * :<br>
     * :  Method: getDayOfWeek<br>
     * :<br>
     * :  Member Access:  Public<br>
     * :<br>
     * :  Purpose:<br>
     * :    Return the numeric equivalent of the day of week.<br>
     * :    i.e. Sunday = 1, Monday = 2, etc.<br>
     * :<br>
     * :  Parameters:<br>
     * :    None<br>
     * :<br>
     * :  Exceptions Raised:<br>
     * :    None<br>
     * :<br>
     * :  Returns:<br>
     * :    -- integer<br>
     * :      The day of week.<br>
     * :<br>
     * :  Subclass Requirements:<br>
     * :    None<br>
     * :<br>
     * :  Modification History (Last on top):<br>
     * :    A0  05/31/99  MARV# 5486  Al Stark<br>
     * :      #MC - Message Catalog Automated Changes<br>
     * :    A0  09/20/97  MARV# 5486  Framework Development Team<br>
     * :      Original Version<br>
     * : ----------------------------------------------------------------------*<br>
     * <p>
     * @param pMonth Type: int
     * @param pYear Type: int
     * @return int
     */
    public int getDayOfWeek(int pMonth, int pYear) {
        DateTimeData lDate = new DateTimeData();
        DateFormat lFormat = new DateFormat(new TextData("m/d/yyyy"), DateFormat.qq_Resolver.cTEMPLATE);
        TextData tt = new TextData();
        tt.concat(pMonth).concat("/1/").concat(pYear);
        lDate.decodeValue(tt, lFormat);

        return lDate.dayOfWeek();
    }

    /**
     * getDaysInMonth<p>
     * :  Copyright 1998 - Marriott International, Inc.<br>
     * :<br>
     * :  Class:  WO_CalendarOneMonth<br>
     * :<br>
     * :  Method: buildDayMatrix<br>
     * :<br>
     * :  Member Access:  Public<br>
     * :<br>
     * :  Purpose:<br>
     * :    Return the number of days in the given month and year.<br>
     * :    Year is important for determining whether February has<br>
     * :    28 or 29 days (leap year).<br>
     * :<br>
     * :  Parameters:<br>
     * :    -- pMonth : integer<br>
     * :    -- pYear : integer<br>
     * :<br>
     * :  Exceptions Raised:<br>
     * :    None<br>
     * :<br>
     * :  Returns:<br>
     * :    -- integer<br>
     * :      The number of days in the month and year.<br>
     * :<br>
     * :  Subclass Requirements:<br>
     * :    None<br>
     * :<br>
     * :  Modification History (Last on top):<br>
     * :    A0  05/31/99  MARV# 5486  Al Stark<br>
     * :      #MC - Message Catalog Automated Changes<br>
     * :    A0  09/20/97  MARV# 5486  Framework Development Team<br>
     * :      Original Version<br>
     * : ----------------------------------------------------------------------*<br>
     * <p>
     * I tried using Forte's date thing, but it is way too much work..<br>
     * <p>
     * @param pMonth Type: int
     * @param pYear Type: int
     * @return int
     */
    public int getDaysInMonth(int pMonth, int pYear) {
        if (pMonth == 1 || pMonth == 3 || pMonth == 5 || pMonth == 7 || pMonth == 8 || pMonth == 10 || pMonth == 12) {
            return 31;
        }
        else if (pMonth == 2) {
            if (pYear % 4 == 0) {
                return 29;
            }
            else {
                return 28;
            }
        }
        else {
            return 30;
        }
    }

    /**
     * selectDay<p>
     * :  Copyright 1998 - Marriott International, Inc.<br>
     * :<br>
     * :  Class:  WO_CalendarOneMonth<br>
     * :<br>
     * :  Method: selectDay<br>
     * :<br>
     * :  Member Access:  Public<br>
     * :<br>
     * :  Purpose:<br>
     * :    Highlight a day.<br>
     * :<br>
     * :  Parameters:<br>
     * :    -- pValue : integer<br>
     * :      The day to be highlighted.<br>
     * :<br>
     * :  Exceptions Raised:<br>
     * :    None<br>
     * :<br>
     * :  Returns:<br>
     * :    None<br>
     * :<br>
     * :  Subclass Requirements:<br>
     * :    None<br>
     * :<br>
     * :  Modification History (Last on top):<br>
     * :    A0  05/31/99  MARV# 5486  Al Stark<br>
     * :      #MC - Message Catalog Automated Changes<br>
     * :    A0  09/20/97  MARV# 5486  Framework Development Team<br>
     * :      Original Version<br>
     * : ----------------------------------------------------------------------*<br>
     * <p>
     * @param pValue Type: int
     */
    public void selectDay(int pValue) {
        if (this.getALastSelect() != null) {
            WidgetSelected.set(this.getALastSelect(), false);
        }

        if (pValue == 0) {
            return;
        }

        int lIndex = pValue+this.getDayOfWeek(this.getABaseMonth(), this.getABaseYear())-1;

        WidgetSelected.set(((Panel)this.getADayArray().get(lIndex-1)), true);
        // ((Panel)this.getADayArray().get(lIndex-1)).updateFieldFromData()
        this.setALastSelect((Panel)this.getADayArray().get(lIndex-1));
        this.setASelectedValue(pValue);

        return;
    }

    /**
     * setup<p>
     * <p>
     */
    public void setup() {
        this.buildDayMatrix();
        this.buildMonth();
    }

    // ------------------
    // 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 GridField qq_theMatrix;
    public JPanel Form;
    public TextGraphic qq_FrLbl;
    public TextGraphic qq_MoLbl;
    public TextGraphic qq_SaLbl;
    public TextGraphic qq_SuLbl;
    public TextGraphic qq_ThLbl;
    public TextGraphic qq_TuLbl;
    public TextGraphic qq_WeLbl;

    /**
     * qq_SuLbl: transformed from: qqds_TextGraphic
     * TagId=13
     * isInherited=FALSE
     */
    public TextGraphic getqq_SuLbl() {
        if (qq_SuLbl == null) {
            qq_SuLbl = GraphicFactory.newTextGraphic("Su\n", "");
            qq_SuLbl.setHorizontalAlignment( SwingConstants.LEFT );
            qq_SuLbl.setFont(new Font("Tahoma", Font.BOLD, 16));
            // OPTIONAL UIutils.reloadLabelText(qq_SuLbl, mcat);
            WidthPolicy.set(qq_SuLbl, Constants.SP_NATURAL);
            HeightPolicy.set(qq_SuLbl, Constants.SP_NATURAL);
            qq_SuLbl.setMinimumSize(new Dimension(31, 24));
        }
        return qq_SuLbl;
    }

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

    /**
     * qq_MoLbl: transformed from: qqds_TextGraphic
     * TagId=14
     * isInherited=FALSE
     */
    public TextGraphic getqq_MoLbl() {
        if (qq_MoLbl == null) {
            qq_MoLbl = GraphicFactory.newTextGraphic("Mo\n", "");
            qq_MoLbl.setFont(new Font("Tahoma", Font.BOLD, 16));
            // OPTIONAL UIutils.reloadLabelText(qq_MoLbl, mcat);
            WidthPolicy.set(qq_MoLbl, Constants.SP_NATURAL);
            HeightPolicy.set(qq_MoLbl, Constants.SP_NATURAL);
            qq_MoLbl.setMinimumSize(new Dimension(33, 24));
        }
        return qq_MoLbl;
    }

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

    /**
     * qq_TuLbl: transformed from: qqds_TextGraphic
     * TagId=15
     * isInherited=FALSE
     */
    public TextGraphic getqq_TuLbl() {
        if (qq_TuLbl == null) {
            qq_TuLbl = GraphicFactory.newTextGraphic("Tu\n", "");
            qq_TuLbl.setFont(new Font("Tahoma", Font.BOLD, 16));
            // OPTIONAL UIutils.reloadLabelText(qq_TuLbl, mcat);
            WidthPolicy.set(qq_TuLbl, Constants.SP_NATURAL);
            HeightPolicy.set(qq_TuLbl, Constants.SP_NATURAL);
            qq_TuLbl.setMinimumSize(new Dimension(30, 24));
        }
        return qq_TuLbl;
    }

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

    /**
     * qq_WeLbl: transformed from: qqds_TextGraphic
     * TagId=16
     * isInherited=FALSE
     */
    public TextGraphic getqq_WeLbl() {
        if (qq_WeLbl == null) {
            qq_WeLbl = GraphicFactory.newTextGraphic("We\n", "");
            qq_WeLbl.setFont(new Font("Tahoma", Font.BOLD, 16));
            // OPTIONAL UIutils.reloadLabelText(qq_WeLbl, mcat);
            WidthPolicy.set(qq_WeLbl, Constants.SP_NATURAL);
            HeightPolicy.set(qq_WeLbl, Constants.SP_NATURAL);
            qq_WeLbl.setMinimumSize(new Dimension(36, 24));
        }
        return qq_WeLbl;
    }

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

    /**
     * qq_ThLbl: transformed from: qqds_TextGraphic
     * TagId=17
     * isInherited=FALSE
     */
    public TextGraphic getqq_ThLbl() {
        if (qq_ThLbl == null) {
            qq_ThLbl = GraphicFactory.newTextGraphic("Th\n", "");
            qq_ThLbl.setFont(new Font("Tahoma", Font.BOLD, 16));
            // OPTIONAL UIutils.reloadLabelText(qq_ThLbl, mcat);
            WidthPolicy.set(qq_ThLbl, Constants.SP_NATURAL);
            HeightPolicy.set(qq_ThLbl, Constants.SP_NATURAL);
            qq_ThLbl.setMinimumSize(new Dimension(30, 24));
        }
        return qq_ThLbl;
    }

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

    /**
     * qq_FrLbl: transformed from: qqds_TextGraphic
     * TagId=18
     * isInherited=FALSE
     */
    public TextGraphic getqq_FrLbl() {
        if (qq_FrLbl == null) {
            qq_FrLbl = GraphicFactory.newTextGraphic("Fr\n", "");
            qq_FrLbl.setFont(new Font("Tahoma", Font.BOLD, 16));
            // OPTIONAL UIutils.reloadLabelText(qq_FrLbl, mcat);
            WidthPolicy.set(qq_FrLbl, Constants.SP_NATURAL);
            HeightPolicy.set(qq_FrLbl, Constants.SP_NATURAL);
            qq_FrLbl.setMinimumSize(new Dimension(26, 24));
        }
        return qq_FrLbl;
    }

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

    /**
     * qq_SaLbl: transformed from: qqds_TextGraphic
     * TagId=19
     * isInherited=FALSE
     */
    public TextGraphic getqq_SaLbl() {
        if (qq_SaLbl == null) {
            qq_SaLbl = GraphicFactory.newTextGraphic("Sa\n", "");
            qq_SaLbl.setFont(new Font("Tahoma", Font.BOLD, 16));
            // OPTIONAL UIutils.reloadLabelText(qq_SaLbl, mcat);
            WidthPolicy.set(qq_SaLbl, Constants.SP_NATURAL);
            HeightPolicy.set(qq_SaLbl, Constants.SP_NATURAL);
            qq_SaLbl.setMinimumSize(new Dimension(31, 24));
        }
        return qq_SaLbl;
    }

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

    /**
     * qq_theMatrix: transformed from: qqds_GridField
     * TagId=12
     * isInherited=FALSE
     * In forte this was a 7x1 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_theMatrixProperties() {
        FrameWeight.set(qq_theMatrix, Constants.W_DEFAULT);
        qq_theMatrix.setCollapsed(true);
        qq_theMatrix.setHeightPolicy(Constants.SP_NATURAL);
        qq_theMatrix.setWidthPolicy(Constants.SP_NATURAL);
        qq_theMatrix.setBackground(null);
        qq_theMatrix.setLocation(26, 24);
    }

    public GridField getqq_theMatrix() {
        if (qq_theMatrix == null) {
            qq_theMatrix = CompoundFieldFactory.newGridField("theMatrix", false);
            setqq_theMatrixProperties();
            qq_theMatrix.setMinimumSize(new Dimension(225, 28));
            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_theMatrix.add( getqq_SuLbl(), 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_theMatrix.add( getqq_MoLbl(), 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(0, 0, 0, 0); // Top, Left, Bottom, Right Margin
            qq_theMatrix.add( getqq_TuLbl(), qq_gbc2 );

            GridBagConstraints qq_gbc3 = new GridBagConstraints();
            qq_gbc3.gridx = 3; // Column 4
            qq_gbc3.gridy = 0; // Row 1
            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_theMatrix.add( getqq_WeLbl(), qq_gbc3 );

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

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

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

        }
        return qq_theMatrix;
    }

    public void setqq_theMatrix(GridField value) {
        GridField oldValue = qq_theMatrix;
        qq_theMatrix = value;
        this.qq_Listeners.firePropertyChange("qq_theMatrix", 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_theMatrix() );
        }
        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( "OneMonth" );
            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_theMatrix(), Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
        this.usage.add(getqq_SuLbl(), Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
        this.usage.add(getqq_MoLbl(), Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
        this.usage.add(getqq_TuLbl(), Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
        this.usage.add(getqq_WeLbl(), Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
        this.usage.add(getqq_ThLbl(), Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
        this.usage.add(getqq_FrLbl(), Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
        this.usage.add(getqq_SaLbl(), Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
    }
    // </editor-fold>

    // -----------
    // Main method
    // -----------
    public static void main(String []args) {
        KeyboardFocusManager.setCurrentKeyboardFocusManager(new ForteKeyboardFocusManager());
        try {
            UIManager.setLookAndFeel(new Win32LookAndFeel());
        }
        catch (Exception e) {}
        ToolTipManager.sharedInstance().setDismissDelay(Integer.MAX_VALUE);
        OneMonth myClass = new OneMonth();
        myClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        myClass.setVisible(true);
        UIutils.processGUIActions();
    }
// end class OneMonth
// c Pass 2 Conversion Time: 780 milliseconds
TOP

Related Classes of CalendarWidgets.OneMonth

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.