package win;
import DisplayProject.CloseHideAdaptor;
import DisplayProject.Constants;
import DisplayProject.CursorMgr;
import DisplayProject.UDSWindow;
import DisplayProject.UIutils;
import DisplayProject.WindowManager;
import DisplayProject.WindowUsageMap;
import DisplayProject.actions.CommandType;
import DisplayProject.actions.HeightPolicy;
import DisplayProject.actions.MenuText;
import DisplayProject.actions.Name;
import DisplayProject.actions.Parent;
import DisplayProject.actions.UserWindow;
import DisplayProject.actions.WidgetState;
import DisplayProject.actions.WidthPolicy;
import DisplayProject.binding.BindingManager;
import DisplayProject.binding.beans.ExtendedPropertyChangeSupport;
import DisplayProject.binding.beans.Observable;
import DisplayProject.controls.MenuList;
import DisplayProject.controls.MenuSeparator;
import DisplayProject.controls.PictureGraphic;
import DisplayProject.controls.TextGraphic;
import DisplayProject.events.ClientEventManager;
import DisplayProject.factory.CompoundFieldFactory;
import DisplayProject.factory.GraphicFactory;
import DisplayProject.factory.MenuFactory;
import DisplayProject.plaf.Win32LookAndFeel;
import Framework.Array_Of_ListElement;
import Framework.ErrorMgr;
import Framework.EventHandle;
import Framework.EventManager;
import Framework.EventRegistration;
import Framework.File;
import Framework.ForteKeyboardFocusManager;
import Framework.FrameworkUtils;
import Framework.ImageData;
import Framework.ListElement;
import Framework.RuntimeProperties;
import Framework.TextData;
import Framework.UsageException;
import java.awt.Dimension;
import java.awt.KeyboardFocusManager;
import java.awt.Window;
import java.awt.event.ComponentListener;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import java.lang.String;
import java.net.MalformedURLException;
import java.net.URL;
import javax.swing.ImageIcon;
import javax.swing.JCheckBoxMenuItem;
import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.ToolTipManager;
import javax.swing.UIManager;
import org.apache.log4j.Logger;
import win.BraDefinition;
import win.BraSort;
import win.IconWin;
import win.One;
import win.interfaces.Time_proxy;
/**
* Menu<p>
* <p>
* @author Generated from Forte
* @since 19-Nov-2008
*/
@RuntimeProperties(isDistributed=false, isAnchored=false, isShared=false, isTransactional=false)
@UDSWindow()
@SuppressWarnings("serial")
public class Menu
extends JFrame
implements Serializable, Observable
{
// ----------
// Attributes
// ----------
protected File DefaultHelpFile;
protected BindingManager bindingManager = null;
public PropertyChangeSupport qq_Listeners = new ExtendedPropertyChangeSupport(this, true);
private int menu_List;
private boolean check_1;
private boolean check_2;
// ------------
// Constructors
// ------------
public Menu() {
// Explicitly call the superclass constructor to prevent the implicit call
super();
this.initialize();
this.setCheck_2(true);
this.setMenu_List(3);
}
// ----------------------
// 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 setMenu_List(int menu_List) {
int oldValue = this.menu_List;
this.menu_List = menu_List;
this.qq_Listeners.firePropertyChange("menu_List", oldValue, this.menu_List);
}
public int getMenu_List() {
return this.menu_List;
}
public void setCheck_1(boolean check_1) {
boolean oldValue = this.check_1;
this.check_1 = check_1;
this.qq_Listeners.firePropertyChange("check_1", oldValue, this.check_1);
}
public boolean getCheck_1() {
return this.check_1;
}
public void setCheck_2(boolean check_2) {
boolean oldValue = this.check_2;
this.check_2 = check_2;
this.qq_Listeners.firePropertyChange("check_2", oldValue, this.check_2);
}
public boolean getCheck_2() {
return this.check_2;
}
// -------
// 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() {
boolean vis = true;
this.setTitle(Time_proxy.getInstance().getTime().getTextValue().toString());
TextData.bind(this, "title").concat(" - yup");
FrameworkUtils.setAppContext("tits", new TextData("tits"));
MenuSeparator s = new MenuSeparator();
this.getqq_mainMenu().add(s);
JMenuItem m = MenuFactory.newMenuItem();
MenuText.set(m, "New Menu");
Name.set(m, "newMenu");
Parent.set(m, this.getqq_mainMenu());
TextData.bind(this.getqq_tg(), "text").setValue( "cbcbcbcbc" );
UserWindow.open(this);
// ----------
// Event Loop
// ----------
EventManager.startEventLoop();
try {
EventRegistration TaskHandle_Shutdown_langThreadcurrentThread = ClientEventManager.register( Thread.currentThread(), "Shutdown" );
EventRegistration MenuCommand_Activate_getqq_one = ClientEventManager.register( this.getqq_one(), "Activate" );
EventRegistration MenuCommand_Activate_getqq_Definition = ClientEventManager.register( this.getqq_Definition(), "Activate" );
EventRegistration MenuCommand_Activate_getqq_Sort = ClientEventManager.register( this.getqq_Sort(), "Activate" );
EventRegistration MenuCommand_Activate_getqq_showhide = ClientEventManager.register( this.getqq_showhide(), "Activate" );
EventRegistration MenuToggle_Activate_getqq_Check_1 = ClientEventManager.register( this.getqq_Check_1(), "Activate" );
EventRegistration MenuToggle_AfterValueChange_getqq_Check_1 = ClientEventManager.register( this.getqq_Check_1(), "AfterValueChange" );
EventRegistration MenuList_AfterValueChange_getqq_Menu_List = ClientEventManager.register( this.getqq_Menu_List(), "AfterValueChange" );
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();
}
}
// --------------
// <one>.activate
// --------------
else if (qq_currentEvent.isEvent(MenuCommand_Activate_getqq_one)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
new One().display();
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
// ---------------------
// <Definition>.activate
// ---------------------
else if (qq_currentEvent.isEvent(MenuCommand_Activate_getqq_Definition)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
new BraDefinition.AsyncRunner().display(new BraDefinition());
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
// ---------------
// <Sort>.activate
// ---------------
else if (qq_currentEvent.isEvent(MenuCommand_Activate_getqq_Sort)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
new BraSort.AsyncRunner().display(new BraSort());
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
// -------------------
// <showhide>.activate
// -------------------
else if (qq_currentEvent.isEvent(MenuCommand_Activate_getqq_showhide)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
if (vis) {
this.setUsage(Constants.WU_VIEW);
vis = false;
WidgetState.set(this.getqq_Menu_List(), Constants.MS_DISABLED);
}
else {
this.setUsage(Constants.WU_UPDATE);
vis = true;
WidgetState.set(this.getqq_Menu_List(), Constants.MS_ENABLED);
}
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
// ------------------
// <Check_1>.activate
// ------------------
else if (qq_currentEvent.isEvent(MenuToggle_Activate_getqq_Check_1)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
new IconWin().display();
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
// --------------------------
// <Check_1>.aftervaluechange
// --------------------------
else if (qq_currentEvent.isEvent(MenuToggle_AfterValueChange_getqq_Check_1)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
Logger.getLogger("task.part.logmgr").info("Check 1: ");
Logger.getLogger("task.part.logmgr").info( Boolean.toString(this.getCheck_1()));
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
// ----------------------------
// <Menu_List>.aftervaluechange
// ----------------------------
else if (qq_currentEvent.isEvent(MenuList_AfterValueChange_getqq_Menu_List)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
Logger.getLogger("task.part.logmgr").info("Menu List: ");
Logger.getLogger("task.part.logmgr").info( Integer.toString(this.getMenu_List()));
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
}
EventManager.deregister( TaskHandle_Shutdown_langThreadcurrentThread );
EventManager.deregister( MenuCommand_Activate_getqq_one );
EventManager.deregister( MenuCommand_Activate_getqq_Definition );
EventManager.deregister( MenuCommand_Activate_getqq_Sort );
EventManager.deregister( MenuCommand_Activate_getqq_showhide );
EventManager.deregister( MenuToggle_Activate_getqq_Check_1 );
EventManager.deregister( MenuToggle_AfterValueChange_getqq_Check_1 );
EventManager.deregister( MenuList_AfterValueChange_getqq_Menu_List );
}
//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 JCheckBoxMenuItem qq_Check_1;
public JCheckBoxMenuItem qq_Check_2;
public JMenu qq_mainMenu;
public JMenu qq_wierdMenu;
public JMenuBar qq_MainMenuBar;
public JMenuItem qq_Definition;
public JMenuItem qq_Sort;
public JMenuItem qq_one;
public JMenuItem qq_showhide;
public JPanel Form;
public MenuList qq_Menu_List;
public MenuSeparator qq_separator1;
public MenuSeparator qq_separator;
public PictureGraphic qq_PictureGraphic19;
public PictureGraphic qq_pic;
public TextGraphic qq_tg;
/**
* qq_Definition: transformed from: qqds_MenuCommand
*/
public JMenuItem getqq_Definition() {
if (qq_Definition == null) {
qq_Definition = MenuFactory.newMenuItem("Definition", true);
qq_Definition.setVerifyInputWhenFocusTarget(true);
CommandType.set(qq_Definition, Constants.CT_CUSTOM);
qq_Definition.setText( "Definition" );
qq_Definition.setVisible(true);
}
return qq_Definition;
}
public void setqq_Definition(JMenuItem value) {
JMenuItem oldValue = qq_Definition;
qq_Definition = value;
this.qq_Listeners.firePropertyChange("qq_Definition", oldValue, value);
}
/**
* qq_Sort: transformed from: qqds_MenuCommand
*/
public JMenuItem getqq_Sort() {
if (qq_Sort == null) {
qq_Sort = MenuFactory.newMenuItem("Sort", true);
qq_Sort.setVerifyInputWhenFocusTarget(true);
CommandType.set(qq_Sort, Constants.CT_CUSTOM);
qq_Sort.setText( "Sort" );
qq_Sort.setVisible(true);
}
return qq_Sort;
}
public void setqq_Sort(JMenuItem value) {
JMenuItem oldValue = qq_Sort;
qq_Sort = value;
this.qq_Listeners.firePropertyChange("qq_Sort", oldValue, value);
}
/**
* qq_one: transformed from: qqds_MenuCommand
*/
public JMenuItem getqq_one() {
if (qq_one == null) {
qq_one = MenuFactory.newMenuItem("one", true);
qq_one.setVerifyInputWhenFocusTarget(true);
CommandType.set(qq_one, Constants.CT_CUSTOM);
qq_one.setText( "one" );
qq_one.setVisible(true);
}
return qq_one;
}
public void setqq_one(JMenuItem value) {
JMenuItem oldValue = qq_one;
qq_one = value;
this.qq_Listeners.firePropertyChange("qq_one", oldValue, value);
}
/**
* qq_separator: transformed from: qqds_MenuSeparator
*/
public MenuSeparator getqq_separator() {
if (qq_separator == null) {
qq_separator = new MenuSeparator();
qq_separator.setName("");
qq_separator.setVisible( true );
}
return qq_separator;
}
public void setqq_separator(MenuSeparator value) {
MenuSeparator oldValue = qq_separator;
qq_separator = value;
this.qq_Listeners.firePropertyChange("qq_separator", oldValue, value);
}
/**
* qq_showhide: transformed from: qqds_MenuCommand
*/
public JMenuItem getqq_showhide() {
if (qq_showhide == null) {
qq_showhide = MenuFactory.newMenuItem("showhide", true);
qq_showhide.setVerifyInputWhenFocusTarget(true);
CommandType.set(qq_showhide, Constants.CT_CUSTOM);
qq_showhide.setText( "Show / Hide" );
qq_showhide.setVisible(true);
}
return qq_showhide;
}
public void setqq_showhide(JMenuItem value) {
JMenuItem oldValue = qq_showhide;
qq_showhide = value;
this.qq_Listeners.firePropertyChange("qq_showhide", oldValue, value);
}
/**
* qq_mainMenu: transformed from: qqds_Submenu
*/
public JMenu getqq_mainMenu() {
if (qq_mainMenu == null) {
qq_mainMenu = new JMenu();
qq_mainMenu.setName("mainMenu");
qq_mainMenu.setText( "Main" );
qq_mainMenu.setVisible(true);
qq_mainMenu.add(getqq_Definition());
qq_mainMenu.add(getqq_Sort());
qq_mainMenu.add(getqq_one());
qq_mainMenu.add(getqq_separator());
qq_mainMenu.add(getqq_showhide());
}
return qq_mainMenu;
}
/**
* qq_Menu_List: transformed from: qqds_MenuList
*/
public MenuList getqq_Menu_List() {
if (qq_Menu_List == null) {
qq_Menu_List = new MenuList();
qq_Menu_List.setName("Menu_List");
String[] names = {"One", "Two", "Three"};
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 ) );
getBindingManager().bindComponent(qq_Menu_List, "menu_List", elements);
}
return qq_Menu_List;
}
public void setqq_Menu_List(MenuList value) {
MenuList oldValue = qq_Menu_List;
qq_Menu_List = value;
this.qq_Listeners.firePropertyChange("qq_Menu_List", oldValue, value);
}
/**
* qq_separator1: transformed from: qqds_MenuSeparator
*/
public MenuSeparator getqq_separator1() {
if (qq_separator1 == null) {
qq_separator1 = new MenuSeparator();
qq_separator1.setName("");
qq_separator1.setVisible( true );
}
return qq_separator1;
}
public void setqq_separator1(MenuSeparator value) {
MenuSeparator oldValue = qq_separator1;
qq_separator1 = value;
this.qq_Listeners.firePropertyChange("qq_separator1", oldValue, value);
}
/**
* qq_Check_1: transformed from: qqds_MenuToggle
*/
public JCheckBoxMenuItem getqq_Check_1() {
if (qq_Check_1 == null) {
qq_Check_1 = MenuFactory.newMenuToggle("Check_1");
getBindingManager().bindComponent(qq_Check_1, "check_1");
this.qq_Check_1.setText("Check One");
this.qq_Check_1.setVisible(true);
this.qq_Check_1.setState(false);
}
return qq_Check_1;
}
public void setqq_Check_1(JCheckBoxMenuItem value) {
JCheckBoxMenuItem oldValue = qq_Check_1;
qq_Check_1 = value;
this.qq_Listeners.firePropertyChange("qq_Check_1", oldValue, value);
}
/**
* qq_Check_2: transformed from: qqds_MenuToggle
*/
public JCheckBoxMenuItem getqq_Check_2() {
if (qq_Check_2 == null) {
qq_Check_2 = MenuFactory.newMenuToggle("Check_2");
getBindingManager().bindComponent(qq_Check_2, "check_2");
this.qq_Check_2.setText("Check Two");
this.qq_Check_2.setVisible(true);
this.qq_Check_2.setState(false);
}
return qq_Check_2;
}
public void setqq_Check_2(JCheckBoxMenuItem value) {
JCheckBoxMenuItem oldValue = qq_Check_2;
qq_Check_2 = value;
this.qq_Listeners.firePropertyChange("qq_Check_2", oldValue, value);
}
/**
* qq_wierdMenu: transformed from: qqds_Submenu
*/
public JMenu getqq_wierdMenu() {
if (qq_wierdMenu == null) {
qq_wierdMenu = new JMenu();
qq_wierdMenu.setName("wierdMenu");
qq_wierdMenu.setText( "Wierd" );
qq_wierdMenu.setVisible(true);
qq_wierdMenu.add(getqq_Menu_List());
qq_wierdMenu.add(getqq_separator1());
qq_wierdMenu.add(getqq_Check_1());
qq_wierdMenu.add(getqq_Check_2());
}
return qq_wierdMenu;
}
/**
* qq_MainMenuBar: transformed from: qqds_MenuBar
*/
public JMenuBar getqq_MenuBar() {
if (qq_MainMenuBar == null) {
qq_MainMenuBar = MenuFactory.newMenuBar();
qq_MainMenuBar.setName("MainMenuBar");
qq_MainMenuBar.setBorderPainted(false);
this.qq_MainMenuBar.add(getqq_mainMenu());
this.qq_MainMenuBar.add(getqq_wierdMenu());
}
return qq_MainMenuBar;
}
public void setqq_MainMenuBar(JMenuBar value) {
JMenuBar oldValue = qq_MainMenuBar;
qq_MainMenuBar = value;
this.qq_Listeners.firePropertyChange("qq_MainMenuBar", oldValue, value);
}
/**
* qq_pic: transformed from: qqds_PictureGraphic
* TagId=16
* isInherited=FALSE
*/
public PictureGraphic getqq_pic() {
if (qq_pic == null) {
qq_pic = GraphicFactory.newPictureGraphic("", Constants.CG_CENTER);
qq_pic.setImageValue(new ImageData(new ImageIcon(Menu.class.getResource("menu.qq_pic.png"))));
qq_pic.setWidthPolicy(Constants.SP_NATURAL);
qq_pic.setHeightPolicy(Constants.SP_NATURAL);
qq_pic.setImageSizePolicy(Constants.IS_NATURAL);
qq_pic.setOpaque( true );
qq_pic.setSize(new Dimension(112, 150));
qq_pic.setMinimumSize(new Dimension(112, 150));
qq_pic.setPreferredSize(new Dimension(112, 150));
qq_pic.setLocation(17, 14);
}
return qq_pic;
}
public void setqq_pic(PictureGraphic value) {
PictureGraphic oldValue = qq_pic;
qq_pic = value;
this.qq_Listeners.firePropertyChange("qq_pic", oldValue, value);
}
/**
* qq_PictureGraphic19: transformed from: qqds_PictureGraphic
* TagId=19
* isInherited=FALSE
*/
public PictureGraphic getqq_PictureGraphic19() {
if (qq_PictureGraphic19 == null) {
qq_PictureGraphic19 = GraphicFactory.newPictureGraphic("", Constants.CG_CENTER);
qq_PictureGraphic19.setImageValue(new ImageData(new ImageIcon(Menu.class.getResource("menu.qq_PictureGraphic19.png"))));
qq_PictureGraphic19.setWidthPolicy(Constants.SP_NATURAL);
qq_PictureGraphic19.setHeightPolicy(Constants.SP_NATURAL);
qq_PictureGraphic19.setImageSizePolicy(Constants.IS_NATURAL);
qq_PictureGraphic19.setOpaque( true );
qq_PictureGraphic19.setSize(new Dimension(149, 100));
qq_PictureGraphic19.setMinimumSize(new Dimension(149, 100));
qq_PictureGraphic19.setPreferredSize(new Dimension(149, 100));
qq_PictureGraphic19.setLocation(16, 14);
}
return qq_PictureGraphic19;
}
public void setqq_PictureGraphic19(PictureGraphic value) {
PictureGraphic oldValue = qq_PictureGraphic19;
qq_PictureGraphic19 = value;
this.qq_Listeners.firePropertyChange("qq_PictureGraphic19", oldValue, value);
}
/**
* qq_tg: transformed from: qqds_TextGraphic
* TagId=20
* isInherited=FALSE
*/
public TextGraphic getqq_tg() {
if (qq_tg == null) {
qq_tg = GraphicFactory.newTextGraphic("Text Graphic", "tg");
qq_tg.setHorizontalAlignment( SwingConstants.LEFT );
// OPTIONAL UIutils.reloadLabelText(qq_tg, mcat);
WidthPolicy.set(qq_tg, Constants.SP_NATURAL);
HeightPolicy.set(qq_tg, Constants.SP_NATURAL);
qq_tg.setMinimumSize(new Dimension(67, 14));
qq_tg.setLocation(38, 184);
}
return qq_tg;
}
public void setqq_tg(TextGraphic value) {
TextGraphic oldValue = qq_tg;
qq_tg = value;
this.qq_Listeners.firePropertyChange("qq_tg", 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_tg() );
Form.add( getqq_PictureGraphic19() );
Form.add( getqq_pic() );
}
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( "menu" );
this.setTitle( "" );
this.setSystemClosePolicy(Constants.SC_ENABLEDSHUTDOWN);
this.setJMenuBar( getqq_MenuBar() );
if (this.getContentPane() != this.getForm()) {
this.setContentPane(getForm());
}
this.qq_setupWindowUsage();
this.setResizable( true );
this.setAlwaysOnTop(false);
UserWindow.setIconizeEnabled(this, true);
UserWindow.setMaximizeEnabled(this, false);
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_Definition(), Constants.MS_ENABLED, Constants.MS_DISABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED);
this.usage.add(getqq_Sort(), Constants.MS_ENABLED, Constants.MS_INVISIBLE, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED);
this.usage.add(getqq_one(), Constants.MS_ENABLED, Constants.MS_INVISIBLE, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED);
this.usage.add(getqq_separator(), Constants.MS_ENABLED, Constants.MS_INVISIBLE, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED);
this.usage.add(getqq_showhide(), Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED);
this.usage.add(getqq_mainMenu(), Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED);
this.usage.add(getqq_Menu_List(), Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED);
this.usage.add(getqq_separator1(), Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED);
this.usage.add(getqq_Check_1(), Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED);
this.usage.add(getqq_Check_2(), Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED);
this.usage.add(getqq_wierdMenu(), Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED, Constants.MS_ENABLED);
this.usage.add(getqq_pic(), Constants.FS_INACTIVE, Constants.FS_INVISIBLE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
this.usage.add(getqq_PictureGraphic19(), Constants.FS_INVISIBLE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
this.usage.add(getqq_tg(), 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);
Menu myClass = new Menu();
myClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
myClass.setVisible(true);
UIutils.processGUIActions();
}
} // end class menu
// c Pass 2 Conversion Time: 639 milliseconds