package SimpleOutline;
import DisplayProject.Array_Of_OutlineColumnDesc;
import DisplayProject.CloseHideAdaptor;
import DisplayProject.Constants;
import DisplayProject.CursorMgr;
import DisplayProject.DataField;
import DisplayProject.DisplayNode;
import DisplayProject.GridField;
import DisplayProject.LayoutManagerHelper;
import DisplayProject.OutlineColumnDesc;
import DisplayProject.UDSWindow;
import DisplayProject.UIutils;
import DisplayProject.WindowManager;
import DisplayProject.WindowUsageMap;
import DisplayProject.actions.AppletConnectionInfo;
import DisplayProject.actions.HasControls;
import DisplayProject.actions.Height;
import DisplayProject.actions.HeightPolicy;
import DisplayProject.actions.RootNode;
import DisplayProject.actions.TreeField;
import DisplayProject.actions.TreeFieldCurrentNode;
import DisplayProject.actions.TreeRootVisible;
import DisplayProject.actions.UserWindow;
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.OutlineField;
import DisplayProject.controls.TreeViewWidget;
import DisplayProject.events.ClientEventManager;
import DisplayProject.factory.CompoundFieldFactory;
import DisplayProject.factory.DataFieldFactory;
import DisplayProject.factory.PushButtonFactory;
import DisplayProject.factory.TableFactory;
import DisplayProject.factory.ToggleFieldFactory;
import DisplayProject.factory.TreeFieldFactory;
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.ListElement;
import Framework.ParameterHolder;
import Framework.RuntimeProperties;
import Framework.TextData;
import Framework.UsageException;
import SimpleOutline.BrowserDisplayNode;
import SimpleOutline.DataEntryDialog;
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.Object;
import java.lang.String;
import java.net.MalformedURLException;
import java.net.URL;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComponent;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.UIManager;
/**
* BrowserWindow<p>
* <p>
* @author Generated from Forte
* @since 19-Nov-2008
*/
@RuntimeProperties(isDistributed=false, isAnchored=false, isShared=false, isTransactional=false)
@UDSWindow()
@SuppressWarnings("serial")
public class BrowserWindow
extends JFrame
implements Serializable, Observable
{
// ----------
// Attributes
// ----------
protected File DefaultHelpFile;
protected BindingManager bindingManager = null;
public PropertyChangeSupport qq_Listeners = new ExtendedPropertyChangeSupport(this, true);
private int outlineFieldNodeCounter;
private int treeNodeCounter;
private TextData statusLine;
private BrowserDisplayNode browser;
private boolean showRoot;
private boolean hasControls;
private DisplayNode tree;
private boolean showRootTree;
private boolean hasControlsTree;
// ------------
// Constructors
// ------------
public BrowserWindow() {
// Explicitly call the superclass constructor to prevent the implicit call
super();
this.initialize();
this.outlineFieldNodeCounter = 0;
this.treeNodeCounter = 0;
this.statusLine = null;
this.browser = null;
this.showRoot = false;
this.hasControls = false;
this.tree = null;
this.showRootTree = false;
this.hasControlsTree = false;
}
// ----------------------
// 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;
}
private void setOutlineFieldNodeCounter(int outlineFieldNodeCounter) {
int oldValue = this.outlineFieldNodeCounter;
this.outlineFieldNodeCounter = outlineFieldNodeCounter;
this.qq_Listeners.firePropertyChange("outlineFieldNodeCounter", oldValue, this.outlineFieldNodeCounter);
}
private void setTreeNodeCounter(int treeNodeCounter) {
int oldValue = this.treeNodeCounter;
this.treeNodeCounter = treeNodeCounter;
this.qq_Listeners.firePropertyChange("treeNodeCounter", oldValue, this.treeNodeCounter);
}
public void setStatusLine(TextData statusLine) {
TextData oldValue = this.statusLine;
this.statusLine = statusLine;
this.qq_Listeners.firePropertyChange("statusLine", oldValue, this.statusLine);
}
public TextData getStatusLine() {
return this.statusLine;
}
public void setBrowser(BrowserDisplayNode browser) {
BrowserDisplayNode oldValue = this.browser;
this.browser = browser;
RootNode.set(this.getqq_Browser(), browser);
this.qq_Listeners.firePropertyChange("browser", oldValue, this.browser);
}
public BrowserDisplayNode getBrowser() {
return this.browser;
}
public void setShowRoot(boolean showRoot) {
boolean oldValue = this.showRoot;
this.showRoot = showRoot;
this.qq_Listeners.firePropertyChange("showRoot", oldValue, this.showRoot);
}
public boolean getShowRoot() {
return this.showRoot;
}
public void setHasControls(boolean hasControls) {
boolean oldValue = this.hasControls;
this.hasControls = hasControls;
this.qq_Listeners.firePropertyChange("hasControls", oldValue, this.hasControls);
}
public boolean getHasControls() {
return this.hasControls;
}
public void setTree(DisplayNode tree) {
DisplayNode oldValue = this.tree;
this.tree = tree;
RootNode.set(this.getqq_tree(), tree);
this.qq_Listeners.firePropertyChange("tree", oldValue, this.tree);
}
public DisplayNode getTree() {
return this.tree;
}
public void setShowRootTree(boolean showRootTree) {
boolean oldValue = this.showRootTree;
this.showRootTree = showRootTree;
this.qq_Listeners.firePropertyChange("showRootTree", oldValue, this.showRootTree);
}
public boolean getShowRootTree() {
return this.showRootTree;
}
public void setHasControlsTree(boolean hasControlsTree) {
boolean oldValue = this.hasControlsTree;
this.hasControlsTree = hasControlsTree;
this.qq_Listeners.firePropertyChange("hasControlsTree", oldValue, this.hasControlsTree);
}
public boolean getHasControlsTree() {
return this.hasControlsTree;
}
// -------
// 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>
* This is a full-featured example of using the<br>
* OutlineField Widget in a TOOL program.<br>
* <p>
* Most of the features and events that are typically<br>
* used for OutlineField are demonstrated, including:<br>
* <p>
* Inserting and deleting nodes<br>
* Using folders and adding child nodes<br>
* Updating nodes<br>
* Enabling and disabling commands based on selections<br>
* Drag & drop in OutlineFields<br>
* Images displayed in OutlineField<br>
* Resizing of OutlineFields when the Window is resized<br>
* Status Line resized with window<br>
* <p>
* Three classes are defined:<br>
* <p>
* BrowserWindow -- Main Window for the Application.<br>
* BrowserDisplayNode -- Subclass of DisplayNode used for<br>
* representing rows in the<br>
* OutlineField.<br>
* DataEntryDialog -- Dialog box for updating rows.<br>
* <p>
* Copyright Forte Sortware, 1993<br>
* Example written by Mark Wallace, Dec 1993<br>
* <p>
*/
public void display() {
try {
this.outlineFieldNodeCounter = 1;
this.treeNodeCounter = 1;
DisplayNode treeNode = null;
this.setTree(new DisplayNode(new TextData("Tree ROOT NODE"), true, true, true, DisplayNode.qq_Resolver.cDVNODETEXT_ISFILLED_ISFOLDER_ISOPENED));
WidgetState.set(this.getqq_AddAfterTree(), Constants.FS_DISABLE);
WidgetState.set(this.getqq_AddBeforeTree(), Constants.FS_DISABLE);
WidgetState.set(this.getqq_DeleteTree(), Constants.FS_DISABLE);
BrowserDisplayNode node = null;
// BrowserDisplayNode is a
// subclass of DisplayNode
// that we have created for
// this OutlineField. This
// variable 'Node' will be used
// by several of the event
// handlers.
this.setBrowser(new BrowserDisplayNode());
// The mapped attribute 'Browser'
// corresponds to the
// OutlineField Widget's Root Node.
// The Root Node is the top node of
// the tree structure of DisplayNode
// objects.
this.getBrowser().setFolder(true);
// These three attributes must
this.getBrowser().setIsFilled(true);
// always be set to 'TRUE' for
this.getBrowser().setOpened(true);
// the Root Node of an
// OutlineField.
this.getBrowser().setText(new TextData("ROOT NODE"));
// Root Displayed is set to
// FALSE on the OutlineField
// property sheet, so we will
// not see the text displayed.
WidgetState.set(this.getqq_Browser_Text(), Constants.FS_DRAG);
WidgetState.set(this.getqq_Browser_Image(), Constants.FS_DRAG);
// This enables the 'drag' part of drag & drop.
// The 'drop' is handled
// in the event loop below. Note that <Browser.Text>.State
// is not a real Widget, but is simply a syntax to refer to
// the 'Text' column of the BrowserDisplayNode that we have
// defined for this OutlineField. Setting this column to
// FS_DRAG makes it so we can drag a row by clicking on
// the text.
WidgetState.set(this.getqq_AddAfter(), Constants.FS_DISABLE);
// These buttons are dimmed
WidgetState.set(this.getqq_AddBefore(), Constants.FS_DISABLE);
// to begin with. They're
WidgetState.set(this.getqq_Delete(), Constants.FS_DISABLE);
// enabled when a node is
// selected.
this.setStatusLine(new TextData());
// Instantiate empty status line.
// Give the window an initial size.
Height.set(this, 4000);
Width.set(this, 4000);
UserWindow.open(this);
// The user window must be opened before the
// event loop.
this.setShowRoot(this.getqq_Browser().getTree().isRootVisible());
this.setHasControls(HasControls.get(this.getqq_Browser()));
this.setShowRootTree(TreeRootVisible.is(this.getqq_tree()));
this.setHasControlsTree(HasControls.get(this.getqq_tree()));
// ----------
// Event Loop
// ----------
EventManager.startEventLoop();
try {
EventRegistration ToggleField_AfterValueChange_getqq_ShowRoot = ClientEventManager.register( this.getqq_ShowRoot(), "AfterValueChange" );
EventRegistration ToggleField_AfterValueChange_getqq_HasControls = ClientEventManager.register( this.getqq_HasControls(), "AfterValueChange" );
EventRegistration PushButton_Click_getqq_AddBefore = ClientEventManager.register( this.getqq_AddBefore(), "Click" );
EventRegistration PushButton_Click_getqq_AddAfter = ClientEventManager.register( this.getqq_AddAfter(), "Click" );
EventRegistration PushButton_Click_getqq_AddChild = ClientEventManager.register( this.getqq_AddChild(), "Click" );
EventRegistration PushButton_Click_getqq_Delete = ClientEventManager.register( this.getqq_Delete(), "Click" );
EventRegistration OutlineField_DoubleClick_getqq_Browser = ClientEventManager.register( this.getqq_Browser(), "DoubleClick" );
EventRegistration OutlineField_AfterCurrentNodeChange_getqq_Browser = ClientEventManager.register( this.getqq_Browser(), "AfterCurrentNodeChange" );
EventRegistration OutlineField_ObjectDrop_getqq_Browser = ClientEventManager.register( this.getqq_Browser(), "ObjectDrop" );
EventRegistration TaskHandle_Shutdown_langThreadcurrentThread = ClientEventManager.register( Thread.currentThread(), "Shutdown" );
EventRegistration ToggleField_AfterValueChange_getqq_ShowRootTree = ClientEventManager.register( this.getqq_ShowRootTree(), "AfterValueChange" );
EventRegistration ToggleField_AfterValueChange_getqq_HasControlsTree = ClientEventManager.register( this.getqq_HasControlsTree(), "AfterValueChange" );
EventRegistration PushButton_Click_getqq_AddBeforeTree = ClientEventManager.register( this.getqq_AddBeforeTree(), "Click" );
EventRegistration PushButton_Click_getqq_AddAfterTree = ClientEventManager.register( this.getqq_AddAfterTree(), "Click" );
EventRegistration PushButton_Click_getqq_AddChildTree = ClientEventManager.register( this.getqq_AddChildTree(), "Click" );
EventRegistration PushButton_Click_getqq_DeleteTree = ClientEventManager.register( this.getqq_DeleteTree(), "Click" );
EventRegistration TreeView_AfterCurrentNodeChange_getqq_tree = ClientEventManager.register( this.getqq_tree(), "AfterCurrentNodeChange" );
while (true) {
UIutils.processGUIActions();
EventHandle qq_currentEvent = EventManager.waitForEvent();
if (qq_currentEvent == null)
break;
// ---------------------------
// <ShowRoot>.AfterValueChange
// ---------------------------
if (qq_currentEvent.isEvent(ToggleField_AfterValueChange_getqq_ShowRoot)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
TreeRootVisible.set(this.getqq_Browser(), this.getShowRoot());
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
// ------------------------------
// <HasControls>.AfterValueChange
// ------------------------------
else if (qq_currentEvent.isEvent(ToggleField_AfterValueChange_getqq_HasControls)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
HasControls.set(this.getqq_Browser(), this.getHasControls());
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
// -----------------
// <AddBefore>.Click
// -----------------
else if (qq_currentEvent.isEvent(PushButton_Click_getqq_AddBefore)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
node = new BrowserDisplayNode();
// Create a new BrowserDisplayNode object.
node.setText(new TextData("New Node Before ").concat(this.outlineFieldNodeCounter));
this.outlineFieldNodeCounter = this.outlineFieldNodeCounter+1;
node.setNextSibling(TreeFieldCurrentNode.get(this.getqq_Browser()));
//
// Note: NextSibling is a virtual attribute that causes
// many other attributes to be set. When we set
// NextSibling for this new node, it will cause
// PrevSibling for CurrentNode to be set to this node,
// and this node's Parent will be set to CurrentNode's
// Parent. Ths idea is that these Virtual Attributes
// on DisplayNode are 'assertions' that 'Make it so.'
// When any one gets set, the other's are rearranged
// to comply.
//
this.getStatusLine().setValue( "Node Added Before" );
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
// ----------------
// <AddAfter>.Click
// ----------------
else if (qq_currentEvent.isEvent(PushButton_Click_getqq_AddAfter)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
node = new BrowserDisplayNode();
// Create a new BrowserDisplayNode object.
node.setText(new TextData("New Node After ").concat(this.outlineFieldNodeCounter));
this.outlineFieldNodeCounter = this.outlineFieldNodeCounter+1;
node.setPrevSibling(TreeFieldCurrentNode.get(this.getqq_Browser()));
//
// Note: PrevSibling is a virtual attribute that causes
// many other attributes to be set. It functions
// similarly to NextSibling. See comment above.
//
this.getStatusLine().setValue( "Node Added After" );
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
// ----------------
// <AddChild>.Click
// ----------------
else if (qq_currentEvent.isEvent(PushButton_Click_getqq_AddChild)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
if (TreeFieldCurrentNode.get(this.getqq_Browser()) != null) {
// There is a node selected.
// The following attributes must be set for a node
// to have children added to it. If they are aready
// set, then this won't have any effect.
TreeFieldCurrentNode.get(this.getqq_Browser()).setFolder(true);
TreeFieldCurrentNode.get(this.getqq_Browser()).setIsFilled(true);
TreeFieldCurrentNode.get(this.getqq_Browser()).setOpened(true);
// Note that 'IsFolder' must be set before
// 'IsOpened,' because setting 'IsOpened' only has
// an effect on DisplayNodes that are Folders. Also
// 'IsFilled' must be set before 'IsOpened.'
// Whatever the reason, always set them in the
// order shown here!
node = new BrowserDisplayNode();
// Create a new BrowserDisplayNode
// object.
node.setText(new TextData("New Child Node ").concat(this.outlineFieldNodeCounter));
this.outlineFieldNodeCounter = this.outlineFieldNodeCounter+1;
node.setParent(TreeFieldCurrentNode.get(this.getqq_Browser()));
// Note: Parent is a virtual attribute that causes
// many other attributes to be set. It functions
// similarly to NextSibling. See comment above.
// (We could have done this in several
// other ways, for instance, we could have set:
// <Browser>.CurrentNode.LastChild = Node;
// and it would have done the same thing.)
}
else {
// If there is no CurrentNode, we'll add a child
// to the Root Node.
node = new BrowserDisplayNode();
// Create new BrowserDisplayNode object.
node.setText(new TextData("New Child Node ").concat(this.outlineFieldNodeCounter));
this.outlineFieldNodeCounter = this.outlineFieldNodeCounter+1;
node.setParent(this.getBrowser());
// Note: Browser is the BrowserDisplayNode that is
// the RootNode of <Browser> the OutlineField.
}
this.getStatusLine().setValue( "Child Node Added" );
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
// --------------
// <Delete>.Click
// --------------
else if (qq_currentEvent.isEvent(PushButton_Click_getqq_Delete)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
if (TreeFieldCurrentNode.get(this.getqq_Browser()) != null) {
// There is a node selected.
TreeFieldCurrentNode.get(this.getqq_Browser()).setParent(null);
// Setting the Parent to NIL removes the Node
// from the OutlineField. Nothing else is
// needed.
this.getStatusLine().setValue( "Node Deleted" );
}
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
// ---------------------
// <Browser>.DoubleClick
// ---------------------
else if (qq_currentEvent.isEvent(OutlineField_DoubleClick_getqq_Browser)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
DataEntryDialog dialog = new DataEntryDialog();
// The DataEntryDialog is a simple dialog
// that allows the user to enter a single line
// of text, then click OK or Cancel.
node = (BrowserDisplayNode)TreeFieldCurrentNode.get(this.getqq_Browser());
// The attribute CurrentNode is of type DisplayNode.
// We need to cast it to BrowserDisplayNode in order
// to access the Text attribute.
if (node != null) {
dialog.setText(node.getText());
// Load the node's text into the dialog.
}
else {
dialog.setText(new TextData());
}
if (dialog.displayDialog() == true) {
// TRUE means OK.
node.setText(dialog.getText());
// Dialog.Text is the
// text the user typed.
// The user may select an image from the PaletteList
// on the dialog. Dialog.Image will be an integer
// corresponding to the image the user selected.
// Then we grap the ImageData from the PaletteList
// by 'looking inside' the Widget with
// 'GetElementList.'
Array_Of_ListElement<ListElement> imageList = dialog.getqq_Image().getElementList();
node.setImage(imageList.get(dialog.getImage()-1).getImageValue());
// This method on DisplayNode must be invoked to
// update the OutlineField on the screen.
node.updateFieldFromData();
}
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
// --------------------------------
// <Browser>.AfterCurrentNodeChange
// --------------------------------
else if (qq_currentEvent.isEvent(OutlineField_AfterCurrentNodeChange_getqq_Browser)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
// This event is received whenever the value of
// CurrentNode has changed.
if (TreeFieldCurrentNode.get(this.getqq_Browser()) == null) {
// If this a CurrentNode is not selected, disable
// the AddAfter, AddBefore, and Delete buttons.
WidgetState.set(this.getqq_AddAfter(), Constants.FS_DISABLE);
WidgetState.set(this.getqq_AddBefore(), Constants.FS_DISABLE);
WidgetState.set(this.getqq_Delete(), Constants.FS_DISABLE);
}
else {
// Otherwise, enable them.
WidgetState.set(this.getqq_AddAfter(), Constants.FS_UPDATE);
WidgetState.set(this.getqq_AddBefore(), Constants.FS_UPDATE);
WidgetState.set(this.getqq_Delete(), Constants.FS_UPDATE);
}
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
// --------------------
// <Browser>.ObjectDrop
// --------------------
else if (qq_currentEvent.isEvent(OutlineField_ObjectDrop_getqq_Browser)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
JComponent sF = (JComponent)((ParameterHolder)qq_currentEvent.getParameter("sourceField")).getObject();
JComponent dF = (JComponent)((ParameterHolder)qq_currentEvent.getParameter("dropField")).getObject();
Object sD = (Object)((ParameterHolder)qq_currentEvent.getParameter("sourceData")).getObject();
int dX = ((ParameterHolder)qq_currentEvent.getParameter("dropX")).getInt();
int dY = ((ParameterHolder)qq_currentEvent.getParameter("dropY")).getInt();
// This event is recieved whenever any draggable field
// is dropped on any widget. The code below figures out
// the details.
// The source data is the object dropped, for our drag &
// drop feature, it must be not NIL and be a
// BrowserDisplayNode. The SourceField is the widget
// where the drag started. The DropField is the where
// the drop happens. For this example the SourceField
// and the DropField must be the same. (In other
// applications, there may be a more complex set of
// rules for drag & drop.)
this.getStatusLine().setValue( "" );
// Good time to blank the
// status line.
if (sD != null && sD instanceof BrowserDisplayNode && sF == dF) {
int column = 0;
BrowserDisplayNode sourceNode = (BrowserDisplayNode)sD;
BrowserDisplayNode destNode = null;
ParameterHolder qq_column = new ParameterHolder(column);
DisplayNode qq_tempNode = TreeField.locateNode(this.getqq_Browser(), UIutils.milsToPixels(dX), UIutils.milsToPixels(dY), qq_column);
column = qq_column.getInt();
destNode = (BrowserDisplayNode)qq_tempNode;
// LocateNode is the method used to determine which
// row the drop occured on. It returns a DisplayNode
// which we cast into a BrowserDisplayNode. Column
// is returned also, but isn't used in this example.
// Can't be dropped
// on itself.
// IsChildOf was written to protect against the
// case of dropping a node on one of it's own
// children. This would otherwise cause serious
// trouble.
if (destNode != null && destNode != sourceNode && !(destNode.isChildOf(sourceNode))) {
sourceNode.setParent(null);
// Remove the dragged node from the tree.
sourceNode.setPrevSibling(destNode);
// Add it right after the node it was
// dropped on.
this.getStatusLine().setValue( "Node Moved" );
}
}
// ================ 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;
// This is the only way out of the example
// The 'Close' box in the upper left corner
// of the window issues a Task.Shutdown event.
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
// -------------------------------
// <ShowRootTree>.AfterValueChange
// -------------------------------
else if (qq_currentEvent.isEvent(ToggleField_AfterValueChange_getqq_ShowRootTree)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
TreeRootVisible.set(this.getqq_tree(), this.getShowRootTree());
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
// ----------------------------------
// <HasControlsTree>.AfterValueChange
// ----------------------------------
else if (qq_currentEvent.isEvent(ToggleField_AfterValueChange_getqq_HasControlsTree)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
HasControls.set(this.getqq_tree(), this.getHasControlsTree());
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
// ---------------------
// <AddBeforeTree>.Click
// ---------------------
else if (qq_currentEvent.isEvent(PushButton_Click_getqq_AddBeforeTree)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
treeNode = new DisplayNode();
treeNode.setDVNodeText(new TextData("New Node Before ").concat(this.treeNodeCounter));
this.treeNodeCounter = this.treeNodeCounter+1;
treeNode.setNextSibling(TreeFieldCurrentNode.get(this.getqq_tree()));
this.getStatusLine().setValue( "Node Added Before" );
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
// --------------------
// <AddAfterTree>.Click
// --------------------
else if (qq_currentEvent.isEvent(PushButton_Click_getqq_AddAfterTree)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
treeNode = new DisplayNode();
treeNode.setDVNodeText(new TextData("New Node After ").concat(this.treeNodeCounter));
this.treeNodeCounter = this.treeNodeCounter+1;
treeNode.setPrevSibling(TreeFieldCurrentNode.get(this.getqq_tree()));
this.getStatusLine().setValue( "Node Added After" );
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
// --------------------
// <AddChildTree>.Click
// --------------------
else if (qq_currentEvent.isEvent(PushButton_Click_getqq_AddChildTree)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
if (TreeFieldCurrentNode.get(this.getqq_tree()) != null) {
TreeFieldCurrentNode.get(this.getqq_tree()).setFolder(true);
TreeFieldCurrentNode.get(this.getqq_tree()).setIsFilled(true);
TreeFieldCurrentNode.get(this.getqq_tree()).setOpened(true);
treeNode = new DisplayNode();
treeNode.setDVNodeText(new TextData("New Child Node ").concat(this.treeNodeCounter));
this.treeNodeCounter = this.treeNodeCounter+1;
treeNode.setParent(TreeFieldCurrentNode.get(this.getqq_tree()));
}
else {
treeNode = new DisplayNode();
treeNode.setDVNodeText(new TextData("New Child Node ").concat(this.treeNodeCounter));
this.treeNodeCounter = this.treeNodeCounter+1;
treeNode.setParent(this.getTree());
}
this.getStatusLine().setValue( "Child Node Added" );
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
// ------------------
// <DeleteTree>.Click
// ------------------
else if (qq_currentEvent.isEvent(PushButton_Click_getqq_DeleteTree)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
if (TreeFieldCurrentNode.get(this.getqq_tree()) != null) {
TreeFieldCurrentNode.get(this.getqq_tree()).setParent(null);
this.getStatusLine().setValue( "Node Deleted" );
}
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
// -----------------------------
// <tree>.AfterCurrentNodeChange
// -----------------------------
else if (qq_currentEvent.isEvent(TreeView_AfterCurrentNodeChange_getqq_tree)) {
try {
CursorMgr.startEvent();
// ================ Begin Forte Event Handler Translation ================
if (TreeFieldCurrentNode.get(this.getqq_tree()) == null) {
WidgetState.set(this.getqq_AddAfterTree(), Constants.FS_DISABLE);
WidgetState.set(this.getqq_AddBeforeTree(), Constants.FS_DISABLE);
WidgetState.set(this.getqq_DeleteTree(), Constants.FS_DISABLE);
}
else {
WidgetState.set(this.getqq_AddAfterTree(), Constants.FS_UPDATE);
WidgetState.set(this.getqq_AddBeforeTree(), Constants.FS_UPDATE);
WidgetState.set(this.getqq_DeleteTree(), Constants.FS_UPDATE);
}
// ================ End Forte Event Handler Translation ================
}
finally {
CursorMgr.endEvent();
}
}
}
EventManager.deregister( ToggleField_AfterValueChange_getqq_ShowRoot );
EventManager.deregister( ToggleField_AfterValueChange_getqq_HasControls );
EventManager.deregister( PushButton_Click_getqq_AddBefore );
EventManager.deregister( PushButton_Click_getqq_AddAfter );
EventManager.deregister( PushButton_Click_getqq_AddChild );
EventManager.deregister( PushButton_Click_getqq_Delete );
EventManager.deregister( OutlineField_DoubleClick_getqq_Browser );
EventManager.deregister( OutlineField_AfterCurrentNodeChange_getqq_Browser );
EventManager.deregister( OutlineField_ObjectDrop_getqq_Browser );
EventManager.deregister( TaskHandle_Shutdown_langThreadcurrentThread );
EventManager.deregister( ToggleField_AfterValueChange_getqq_ShowRootTree );
EventManager.deregister( ToggleField_AfterValueChange_getqq_HasControlsTree );
EventManager.deregister( PushButton_Click_getqq_AddBeforeTree );
EventManager.deregister( PushButton_Click_getqq_AddAfterTree );
EventManager.deregister( PushButton_Click_getqq_AddChildTree );
EventManager.deregister( PushButton_Click_getqq_DeleteTree );
EventManager.deregister( TreeView_AfterCurrentNodeChange_getqq_tree );
}
//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);
}
}
catch (Throwable qq_ElseException) {
ErrorMgr.addChain(qq_ElseException);
ErrorMgr.showErrors(true);
}
}
// ------------------
// 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_statusLine;
public GridField qq_GridField12;
public GridField qq_GridField15;
public GridField qq_GridField23;
public JButton qq_AddAfter;
public JButton qq_AddAfterTree;
public JButton qq_AddBefore;
public JButton qq_AddBeforeTree;
public JButton qq_AddChild;
public JButton qq_AddChildTree;
public JButton qq_Delete;
public JButton qq_DeleteTree;
public JCheckBox qq_HasControls;
public JCheckBox qq_HasControlsTree;
public JCheckBox qq_ShowRoot;
public JCheckBox qq_ShowRootTree;
public JPanel Form;
public JScrollPane qq_tree_sp;
public OutlineColumnDesc qq_Browser_Image;
public OutlineColumnDesc qq_Browser_Text;
public OutlineField qq_Browser;
public TreeViewWidget qq_tree;
/**
* qq_statusLine: transformed from: qqds_DataField
* TagId=13
* isInherited=FALSE
*/
public DataField getqq_statusLine() {
if (qq_statusLine == null) {
// Mask type: MK_NONE
qq_statusLine = DataFieldFactory.newDataField("statusLine", 49, TextData.class, Constants.MK_NONE);
qq_statusLine.setValue("");
qq_statusLine.setOriginalFormatText(null);
qq_statusLine.setHorizontalAlignment(JTextField.LEFT);
getBindingManager().bindComponent(qq_statusLine, "statusLine");
WidthPolicy.set(qq_statusLine, Constants.SP_EXPLICIT);
HeightPolicy.set(qq_statusLine, Constants.SP_NATURAL);
qq_statusLine.setMinimumSize(new Dimension(304, 19));
qq_statusLine.setSize(new Dimension(304, 19));
}
return qq_statusLine;
}
public void setqq_statusLine(DataField value) {
DataField oldValue = qq_statusLine;
qq_statusLine = value;
this.qq_Listeners.firePropertyChange("qq_statusLine", oldValue, value);
}
/**
* qq_Browser: transformed from: qqds_OutlineField
* TagId=14
* isInherited=FALSE
*/
public OutlineField getqq_Browser() {
if (qq_Browser == null) {
Array_Of_OutlineColumnDesc<OutlineColumnDesc> columns = new Array_Of_OutlineColumnDesc<OutlineColumnDesc>();
columns.add(getqq_Browser_Image());
columns.add(getqq_Browser_Text());
qq_Browser = TableFactory.newOutlineField("Browser", columns);
qq_Browser.setShowHeader(true);
qq_Browser.setControlsDisplayed(true);
qq_Browser.setVertScrollBar(true);
qq_Browser.setHorzScrollBar(true);
qq_Browser.setFont(new Font("MonoSpaced", Font.PLAIN, 1));
TreeRootVisible.set(qq_Browser, false);
qq_Browser.setTitleSetNum(0);
qq_Browser.setFont(new Font("MonoSpaced", Font.PLAIN, 1));
WidthPolicy.set(qq_Browser, Constants.SP_TO_PARENT);
HeightPolicy.set(qq_Browser, Constants.SP_TO_PARENT);
qq_Browser.setSize(new Dimension(483, 235));
qq_Browser.setMinimumSize(new Dimension(483, 235));
qq_Browser.setPreferredSize(new Dimension(483, 235));
}
return qq_Browser;
}
public void setqq_Browser(OutlineField value) {
OutlineField oldValue = qq_Browser;
qq_Browser = value;
this.qq_Listeners.firePropertyChange("qq_Browser", oldValue, value);
}
public OutlineColumnDesc getqq_Browser_Image() {
if (qq_Browser_Image == null) {
qq_Browser_Image = new OutlineColumnDesc(Constants.TA_LEFT, false, false, 1, "image", Constants.FP_DEFAULT, Constants.FS_VISIBLE, "", 0);
}
return qq_Browser_Image;
}
public OutlineColumnDesc getqq_Browser_Text() {
if (qq_Browser_Text == null) {
qq_Browser_Text = new OutlineColumnDesc(Constants.TA_LEFT, true, false, 1, "text", Constants.FP_DEFAULT, Constants.FS_VISIBLE, "Text", 0);
}
return qq_Browser_Text;
}
/**
* qq_AddBefore: transformed from: qqds_PushButton
* TagId=16
* isInherited=FALSE
*/
public JButton getqq_AddBefore() {
if (qq_AddBefore == null) {
qq_AddBefore = PushButtonFactory.newInstance("AddBefore", "Add Before");
qq_AddBefore.setVerifyInputWhenFocusTarget(true);
WidthPolicy.set(qq_AddBefore, Constants.SP_TO_PARTNER);
HeightPolicy.set(qq_AddBefore, Constants.SP_TO_PARTNER);
LayoutManagerHelper.setHeightPartner(qq_AddBefore, getqq_AddAfter());
LayoutManagerHelper.setWidthPartner(qq_AddBefore, getqq_AddAfter());
qq_AddBefore.setMinimumSize(new Dimension(0, 0));
}
return qq_AddBefore;
}
public void setqq_AddBefore(JButton value) {
JButton oldValue = qq_AddBefore;
qq_AddBefore = value;
this.qq_Listeners.firePropertyChange("qq_AddBefore", oldValue, value);
}
/**
* qq_AddAfter: transformed from: qqds_PushButton
* TagId=17
* isInherited=FALSE
*/
public JButton getqq_AddAfter() {
if (qq_AddAfter == null) {
qq_AddAfter = PushButtonFactory.newInstance("AddAfter", "Add After");
qq_AddAfter.setVerifyInputWhenFocusTarget(true);
WidthPolicy.set(qq_AddAfter, Constants.SP_TO_PARTNER);
HeightPolicy.set(qq_AddAfter, Constants.SP_TO_PARTNER);
LayoutManagerHelper.setHeightPartner(qq_AddAfter, getqq_Delete());
LayoutManagerHelper.setWidthPartner(qq_AddAfter, getqq_Delete());
qq_AddAfter.setMinimumSize(new Dimension(0, 0));
}
return qq_AddAfter;
}
public void setqq_AddAfter(JButton value) {
JButton oldValue = qq_AddAfter;
qq_AddAfter = value;
this.qq_Listeners.firePropertyChange("qq_AddAfter", oldValue, value);
}
/**
* qq_AddChild: transformed from: qqds_PushButton
* TagId=18
* isInherited=FALSE
*/
public JButton getqq_AddChild() {
if (qq_AddChild == null) {
qq_AddChild = PushButtonFactory.newInstance("AddChild", "Add Child");
qq_AddChild.setVerifyInputWhenFocusTarget(true);
WidthPolicy.set(qq_AddChild, Constants.SP_TO_PARTNER);
HeightPolicy.set(qq_AddChild, Constants.SP_TO_PARTNER);
LayoutManagerHelper.setHeightPartner(qq_AddChild, getqq_AddBefore());
LayoutManagerHelper.setWidthPartner(qq_AddChild, getqq_AddBefore());
qq_AddChild.setMinimumSize(new Dimension(0, 0));
}
return qq_AddChild;
}
public void setqq_AddChild(JButton value) {
JButton oldValue = qq_AddChild;
qq_AddChild = value;
this.qq_Listeners.firePropertyChange("qq_AddChild", oldValue, value);
}
/**
* qq_Delete: transformed from: qqds_PushButton
* TagId=19
* isInherited=FALSE
*/
public JButton getqq_Delete() {
if (qq_Delete == null) {
qq_Delete = PushButtonFactory.newInstance("Delete", "Delete");
qq_Delete.setVerifyInputWhenFocusTarget(true);
WidthPolicy.set(qq_Delete, Constants.SP_TO_PARTNER);
HeightPolicy.set(qq_Delete, Constants.SP_TO_PARTNER);
LayoutManagerHelper.setHeightPartner(qq_Delete, getqq_AddChild());
LayoutManagerHelper.setWidthPartner(qq_Delete, getqq_AddChild());
qq_Delete.setMinimumSize(new Dimension(0, 0));
}
return qq_Delete;
}
public void setqq_Delete(JButton value) {
JButton oldValue = qq_Delete;
qq_Delete = value;
this.qq_Listeners.firePropertyChange("qq_Delete", oldValue, value);
}
/**
* qq_ShowRoot: transformed from: qqds_ToggleField
* TagId=20
* isInherited=FALSE
*/
public JCheckBox getqq_ShowRoot() {
if (qq_ShowRoot == null) {
qq_ShowRoot = ToggleFieldFactory.newToggleField("Show Root", "ShowRoot");
getBindingManager().bindComponent(qq_ShowRoot, "showRoot");
// OPTIONAL UIutils.reloadLabelText(qq_ShowRoot, mcat);
}
return qq_ShowRoot;
}
public void setqq_ShowRoot(JCheckBox value) {
JCheckBox oldValue = qq_ShowRoot;
qq_ShowRoot = value;
this.qq_Listeners.firePropertyChange("qq_ShowRoot", oldValue, value);
}
/**
* qq_HasControls: transformed from: qqds_ToggleField
* TagId=21
* isInherited=FALSE
*/
public JCheckBox getqq_HasControls() {
if (qq_HasControls == null) {
qq_HasControls = ToggleFieldFactory.newToggleField("Has Controls", "HasControls");
getBindingManager().bindComponent(qq_HasControls, "hasControls");
// OPTIONAL UIutils.reloadLabelText(qq_HasControls, mcat);
}
return qq_HasControls;
}
public void setqq_HasControls(JCheckBox value) {
JCheckBox oldValue = qq_HasControls;
qq_HasControls = value;
this.qq_Listeners.firePropertyChange("qq_HasControls", oldValue, value);
}
/**
* qq_GridField15: transformed from: qqds_GridField
* TagId=15
* isInherited=FALSE
* In forte this was a 5x2 grid field.
* Neither the top nor the bottom cell margins are set, but the left and right cell margins are both 100 mils.
* The width policy is set to Natural, and the height policy is set to Natural.
*/
protected void setqq_GridField15Properties() {
qq_GridField15.setCellLeftMargin(50);
qq_GridField15.setCellRightMargin(50);
qq_GridField15.setCellGravity(Constants.CG_CENTER);
qq_GridField15.setCollapsed(true);
qq_GridField15.setHeightPolicy(Constants.SP_NATURAL);
qq_GridField15.setWidthPolicy(Constants.SP_NATURAL);
qq_GridField15.setBackground(null);
}
public GridField getqq_GridField15() {
if (qq_GridField15 == null) {
qq_GridField15 = CompoundFieldFactory.newGridField("qq_GridField15", true);
setqq_GridField15Properties();
qq_GridField15.setMinimumSize(new Dimension(463, 45));
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.WEST; // Gravity - original: CG_MIDDLELEFT
qq_gbc.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
qq_gbc.insets = new Insets(0, 4, 0, 4); // Top, Left, Bottom, Right Margin
qq_GridField15.add( getqq_ShowRoot(), 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_CENTER gf
qq_gbc1.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
qq_gbc1.insets = new Insets(0, 4, 0, 4); // Top, Left, Bottom, Right Margin
qq_GridField15.add( getqq_AddChild(), 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_CENTER gf
qq_gbc2.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
qq_gbc2.insets = new Insets(0, 4, 0, 4); // Top, Left, Bottom, Right Margin
qq_GridField15.add( getqq_AddBefore(), 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_CENTER gf
qq_gbc3.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
qq_gbc3.insets = new Insets(0, 4, 0, 4); // Top, Left, Bottom, Right Margin
qq_GridField15.add( getqq_AddAfter(), 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_CENTER gf
qq_gbc4.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
qq_gbc4.insets = new Insets(0, 4, 0, 4); // Top, Left, Bottom, Right Margin
qq_GridField15.add( getqq_Delete(), qq_gbc4 );
GridBagConstraints qq_gbc5 = new GridBagConstraints();
qq_gbc5.gridx = 0; // Column 1
qq_gbc5.gridy = 1; // Row 2
qq_gbc5.weightx = 0;
qq_gbc5.weighty = 0;
qq_gbc5.anchor = GridBagConstraints.WEST; // Gravity - original: CG_MIDDLELEFT
qq_gbc5.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
qq_gbc5.insets = new Insets(0, 4, 0, 4); // Top, Left, Bottom, Right Margin
qq_GridField15.add( getqq_HasControls(), qq_gbc5 );
}
return qq_GridField15;
}
public void setqq_GridField15(GridField value) {
GridField oldValue = qq_GridField15;
qq_GridField15 = value;
this.qq_Listeners.firePropertyChange("qq_GridField15", oldValue, value);
}
/**
* qq_tree_sp: transformed from: qqds_TreeView
* TagId=22
* isInherited=FALSE
*/
public JScrollPane getqq_tree_sp() {
if (qq_tree_sp == null) {
qq_tree_sp = CompoundFieldFactory.newScrollPane();
qq_tree_sp.setName("tree");
qq_tree_sp.setViewportView(getqq_tree());
qq_tree_sp.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
qq_tree_sp.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
WidthPolicy.set(qq_tree_sp, Constants.SP_EXPLICIT);
HeightPolicy.set(qq_tree_sp, Constants.SP_EXPLICIT);
// OPTIONAL qq_tree_sp.setSize(new Dimension(480, 232));
qq_tree_sp.setMinimumSize(new Dimension(480, 232));
qq_tree_sp.setPreferredSize(new Dimension(480, 232));
}
return qq_tree_sp;
}
public void setqq_tree_sp(JScrollPane value) {
JScrollPane oldValue = qq_tree_sp;
qq_tree_sp = value;
this.qq_Listeners.firePropertyChange("qq_tree_sp", oldValue, value);
}
/**
* qq_tree: transformed from: qqds_TreeView
* TagId=22
* isInherited=FALSE
*/
public TreeViewWidget getqq_tree() {
if (qq_tree == null) {
qq_tree = TreeFieldFactory.newTreeView(getTree());
qq_tree.setName("tree");
qq_tree.setRootVisible(false);
qq_tree.setDragEnabled(false);
}
return qq_tree;
}
public void setqq_tree(TreeViewWidget value) {
TreeViewWidget oldValue = qq_tree;
qq_tree = value;
this.qq_Listeners.firePropertyChange("qq_tree", oldValue, value);
}
/**
* qq_AddBeforeTree: transformed from: qqds_PushButton
* TagId=24
* isInherited=FALSE
*/
public JButton getqq_AddBeforeTree() {
if (qq_AddBeforeTree == null) {
qq_AddBeforeTree = PushButtonFactory.newInstance("AddBeforeTree", "Add Before");
qq_AddBeforeTree.setVerifyInputWhenFocusTarget(true);
WidthPolicy.set(qq_AddBeforeTree, Constants.SP_TO_PARTNER);
HeightPolicy.set(qq_AddBeforeTree, Constants.SP_TO_PARTNER);
LayoutManagerHelper.setHeightPartner(qq_AddBeforeTree, getqq_AddAfterTree());
LayoutManagerHelper.setWidthPartner(qq_AddBeforeTree, getqq_AddAfterTree());
qq_AddBeforeTree.setMinimumSize(new Dimension(0, 0));
}
return qq_AddBeforeTree;
}
public void setqq_AddBeforeTree(JButton value) {
JButton oldValue = qq_AddBeforeTree;
qq_AddBeforeTree = value;
this.qq_Listeners.firePropertyChange("qq_AddBeforeTree", oldValue, value);
}
/**
* qq_AddAfterTree: transformed from: qqds_PushButton
* TagId=25
* isInherited=FALSE
*/
public JButton getqq_AddAfterTree() {
if (qq_AddAfterTree == null) {
qq_AddAfterTree = PushButtonFactory.newInstance("AddAfterTree", "Add After");
qq_AddAfterTree.setVerifyInputWhenFocusTarget(true);
WidthPolicy.set(qq_AddAfterTree, Constants.SP_TO_PARTNER);
HeightPolicy.set(qq_AddAfterTree, Constants.SP_TO_PARTNER);
LayoutManagerHelper.setHeightPartner(qq_AddAfterTree, getqq_DeleteTree());
LayoutManagerHelper.setWidthPartner(qq_AddAfterTree, getqq_DeleteTree());
qq_AddAfterTree.setMinimumSize(new Dimension(0, 0));
}
return qq_AddAfterTree;
}
public void setqq_AddAfterTree(JButton value) {
JButton oldValue = qq_AddAfterTree;
qq_AddAfterTree = value;
this.qq_Listeners.firePropertyChange("qq_AddAfterTree", oldValue, value);
}
/**
* qq_AddChildTree: transformed from: qqds_PushButton
* TagId=26
* isInherited=FALSE
*/
public JButton getqq_AddChildTree() {
if (qq_AddChildTree == null) {
qq_AddChildTree = PushButtonFactory.newInstance("AddChildTree", "Add Child");
qq_AddChildTree.setVerifyInputWhenFocusTarget(true);
WidthPolicy.set(qq_AddChildTree, Constants.SP_TO_PARTNER);
HeightPolicy.set(qq_AddChildTree, Constants.SP_TO_PARTNER);
LayoutManagerHelper.setHeightPartner(qq_AddChildTree, getqq_AddBeforeTree());
LayoutManagerHelper.setWidthPartner(qq_AddChildTree, getqq_AddBeforeTree());
qq_AddChildTree.setMinimumSize(new Dimension(0, 0));
}
return qq_AddChildTree;
}
public void setqq_AddChildTree(JButton value) {
JButton oldValue = qq_AddChildTree;
qq_AddChildTree = value;
this.qq_Listeners.firePropertyChange("qq_AddChildTree", oldValue, value);
}
/**
* qq_DeleteTree: transformed from: qqds_PushButton
* TagId=27
* isInherited=FALSE
*/
public JButton getqq_DeleteTree() {
if (qq_DeleteTree == null) {
qq_DeleteTree = PushButtonFactory.newInstance("DeleteTree", "Delete");
qq_DeleteTree.setVerifyInputWhenFocusTarget(true);
WidthPolicy.set(qq_DeleteTree, Constants.SP_TO_PARTNER);
HeightPolicy.set(qq_DeleteTree, Constants.SP_TO_PARTNER);
LayoutManagerHelper.setHeightPartner(qq_DeleteTree, getqq_AddChildTree());
LayoutManagerHelper.setWidthPartner(qq_DeleteTree, getqq_AddChildTree());
qq_DeleteTree.setMinimumSize(new Dimension(0, 0));
}
return qq_DeleteTree;
}
public void setqq_DeleteTree(JButton value) {
JButton oldValue = qq_DeleteTree;
qq_DeleteTree = value;
this.qq_Listeners.firePropertyChange("qq_DeleteTree", oldValue, value);
}
/**
* qq_ShowRootTree: transformed from: qqds_ToggleField
* TagId=28
* isInherited=FALSE
*/
public JCheckBox getqq_ShowRootTree() {
if (qq_ShowRootTree == null) {
qq_ShowRootTree = ToggleFieldFactory.newToggleField("Show Root", "ShowRootTree");
getBindingManager().bindComponent(qq_ShowRootTree, "showRootTree");
// OPTIONAL UIutils.reloadLabelText(qq_ShowRootTree, mcat);
}
return qq_ShowRootTree;
}
public void setqq_ShowRootTree(JCheckBox value) {
JCheckBox oldValue = qq_ShowRootTree;
qq_ShowRootTree = value;
this.qq_Listeners.firePropertyChange("qq_ShowRootTree", oldValue, value);
}
/**
* qq_HasControlsTree: transformed from: qqds_ToggleField
* TagId=29
* isInherited=FALSE
*/
public JCheckBox getqq_HasControlsTree() {
if (qq_HasControlsTree == null) {
qq_HasControlsTree = ToggleFieldFactory.newToggleField("Has Controls", "HasControlsTree");
getBindingManager().bindComponent(qq_HasControlsTree, "hasControlsTree");
// OPTIONAL UIutils.reloadLabelText(qq_HasControlsTree, mcat);
}
return qq_HasControlsTree;
}
public void setqq_HasControlsTree(JCheckBox value) {
JCheckBox oldValue = qq_HasControlsTree;
qq_HasControlsTree = value;
this.qq_Listeners.firePropertyChange("qq_HasControlsTree", oldValue, value);
}
/**
* qq_GridField23: transformed from: qqds_GridField
* TagId=23
* isInherited=FALSE
* In forte this was a 5x2 grid field.
* Neither the top nor the bottom cell margins are set, but the left and right cell margins are both 100 mils.
* The width policy is set to Natural, and the height policy is set to Natural.
*/
protected void setqq_GridField23Properties() {
qq_GridField23.setCellLeftMargin(50);
qq_GridField23.setCellRightMargin(50);
qq_GridField23.setCellGravity(Constants.CG_CENTER);
qq_GridField23.setCollapsed(true);
qq_GridField23.setHeightPolicy(Constants.SP_NATURAL);
qq_GridField23.setWidthPolicy(Constants.SP_NATURAL);
qq_GridField23.setBackground(null);
}
public GridField getqq_GridField23() {
if (qq_GridField23 == null) {
qq_GridField23 = CompoundFieldFactory.newGridField("qq_GridField23", true);
setqq_GridField23Properties();
qq_GridField23.setMinimumSize(new Dimension(463, 45));
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.WEST; // Gravity - original: CG_MIDDLELEFT
qq_gbc.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
qq_gbc.insets = new Insets(0, 4, 0, 4); // Top, Left, Bottom, Right Margin
qq_GridField23.add( getqq_ShowRootTree(), 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_CENTER gf
qq_gbc1.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
qq_gbc1.insets = new Insets(0, 4, 0, 4); // Top, Left, Bottom, Right Margin
qq_GridField23.add( getqq_AddChildTree(), 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_CENTER gf
qq_gbc2.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
qq_gbc2.insets = new Insets(0, 4, 0, 4); // Top, Left, Bottom, Right Margin
qq_GridField23.add( getqq_AddBeforeTree(), 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_CENTER gf
qq_gbc3.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
qq_gbc3.insets = new Insets(0, 4, 0, 4); // Top, Left, Bottom, Right Margin
qq_GridField23.add( getqq_AddAfterTree(), 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_CENTER gf
qq_gbc4.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
qq_gbc4.insets = new Insets(0, 4, 0, 4); // Top, Left, Bottom, Right Margin
qq_GridField23.add( getqq_DeleteTree(), qq_gbc4 );
GridBagConstraints qq_gbc5 = new GridBagConstraints();
qq_gbc5.gridx = 0; // Column 1
qq_gbc5.gridy = 1; // Row 2
qq_gbc5.weightx = 0;
qq_gbc5.weighty = 0;
qq_gbc5.anchor = GridBagConstraints.WEST; // Gravity - original: CG_MIDDLELEFT
qq_gbc5.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
qq_gbc5.insets = new Insets(0, 4, 0, 4); // Top, Left, Bottom, Right Margin
qq_GridField23.add( getqq_HasControlsTree(), qq_gbc5 );
}
return qq_GridField23;
}
public void setqq_GridField23(GridField value) {
GridField oldValue = qq_GridField23;
qq_GridField23 = value;
this.qq_Listeners.firePropertyChange("qq_GridField23", oldValue, value);
}
/**
* qq_GridField12: transformed from: qqds_GridField
* TagId=12
* isInherited=FALSE
* In forte this was a 2x3 grid field.
* The cell margins are all 100 mils
* The width policy is set to Parent, and the height policy is set to Parent.
*/
protected void setqq_GridField12Properties() {
qq_GridField12.setCellTopMargin(50);
qq_GridField12.setCellBottomMargin(50);
qq_GridField12.setCellLeftMargin(50);
qq_GridField12.setCellRightMargin(50);
qq_GridField12.setCellGravity(Constants.CG_CENTER);
qq_GridField12.setCollapsed(true);
qq_GridField12.setMinWidth(192);
qq_GridField12.setMinHeight(192);
qq_GridField12.setHeightPolicy(Constants.SP_TO_PARENT);
qq_GridField12.setWidthPolicy(Constants.SP_TO_PARENT);
qq_GridField12.setBackground(null);
}
public GridField getqq_GridField12() {
if (qq_GridField12 == null) {
qq_GridField12 = CompoundFieldFactory.newGridField("qq_GridField12", true);
setqq_GridField12Properties();
qq_GridField12.setMinimumSize(new Dimension(192, 192));
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_CENTER gf
qq_gbc.fill = GridBagConstraints.BOTH; // Size to parent - original: H & W = SP_TO_PARENT
qq_gbc.insets = new Insets(4, 4, 4, 4); // Top, Left, Bottom, Right Margin
qq_GridField12.add( getqq_Browser(), 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_CENTER gf
qq_gbc1.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
qq_gbc1.insets = new Insets(4, 4, 4, 4); // Top, Left, Bottom, Right Margin
qq_GridField12.add( getqq_tree_sp(), qq_gbc1 );
GridBagConstraints qq_gbc2 = new GridBagConstraints();
qq_gbc2.gridx = 0; // Column 1
qq_gbc2.gridy = 1; // Row 2
qq_gbc2.weightx = 0;
qq_gbc2.weighty = 1;
qq_gbc2.anchor = GridBagConstraints.CENTER; // Gravity - original: CG_CENTER gf
qq_gbc2.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
qq_gbc2.insets = new Insets(4, 4, 4, 4); // Top, Left, Bottom, Right Margin
qq_GridField12.add( getqq_GridField15(), qq_gbc2 );
GridBagConstraints qq_gbc3 = new GridBagConstraints();
qq_gbc3.gridx = 1; // Column 2
qq_gbc3.gridy = 1; // Row 2
qq_gbc3.weightx = 0;
qq_gbc3.weighty = 1;
qq_gbc3.anchor = GridBagConstraints.CENTER; // Gravity - original: CG_CENTER gf
qq_gbc3.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
qq_gbc3.insets = new Insets(4, 4, 4, 4); // Top, Left, Bottom, Right Margin
qq_GridField12.add( getqq_GridField23(), qq_gbc3 );
GridBagConstraints qq_gbc4 = new GridBagConstraints();
qq_gbc4.gridx = 0; // Column 1
qq_gbc4.gridy = 2; // Row 3
qq_gbc4.weightx = 0;
qq_gbc4.weighty = 0;
qq_gbc4.anchor = GridBagConstraints.CENTER; // Gravity - original: CG_CENTER gf
qq_gbc4.fill = GridBagConstraints.NONE; // Size to parent - original: No size to parent
qq_gbc4.insets = new Insets(4, 4, 4, 4); // Top, Left, Bottom, Right Margin
qq_GridField12.add( getqq_statusLine(), qq_gbc4 );
}
return qq_GridField12;
}
public void setqq_GridField12(GridField value) {
GridField oldValue = qq_GridField12;
qq_GridField12 = value;
this.qq_Listeners.firePropertyChange("qq_GridField12", oldValue, value);
}
/**
* Form: transformed from: qqds_Panel
* TagId=1
* isInherited=FALSE
*/
protected void setFormProperties() {
Form.setOpaque( true );
}
public JPanel getForm() {
if (Form == null) {
Form = CompoundFieldFactory.newForm();
this.setFormProperties();
Form.add( getqq_GridField12() );
}
return Form;
}
public void setForm(JPanel value) {
JPanel oldValue = Form;
Form = value;
this.qq_Listeners.firePropertyChange("Form", oldValue, value);
}
/**
* Gets the system close policy
*
* The SystemClosePolicy property determines how a window responds to user attempts to close it by using the native window system through the window close box or a window system menu command.
* SystemClosePolicy responds to window closure attempts according to the following parameters:
* <li>Constants.SC_DISABLED Does not allow window closure through window system.</li>
* <li>Constants.SC_ENABLEDNOFINALIZE Window can be closed, but the contents are not verified, guaranteeing that the window will close (for example, the user clicks the Cancel button).</li>
* <li>Constants.SC_ENABLEDFINALIZE Posts the RequestFinalize method on the window, with a reason code of zero.</li>
* <li>Constants.SC_ENABLEDSHUTDOWN Posts Shutdown event to window�s task and to all tasks started by that task. This is the default value.</li>
*/
public int getSystemClosePolicy() {
return qq_SystemClosePolicy;
}
/**
* Sets the system close policy
*
* The SystemClosePolicy property determines how a window responds to user attempts to close it by using the native window system through the window close box or a window system menu command.
* SystemClosePolicy responds to window closure attempts according to the following parameters:
* <li>Constants.SC_DISABLED Does not allow window closure through window system.</li>
* <li>Constants.SC_ENABLEDNOFINALIZE Window can be closed, but the contents are not verified, guaranteeing that the window will close (for example, the user clicks the Cancel button).</li>
* <li>Constants.SC_ENABLEDFINALIZE Posts the RequestFinalize method on the window, with a reason code of zero.</li>
* <li>Constants.SC_ENABLEDSHUTDOWN Posts Shutdown event to window�s task and to all tasks started by that task. This is the default value.</li>
*/
public void setSystemClosePolicy(int policy) {
this.qq_SystemClosePolicy = policy;
if (policy == Constants.SC_DISABLED) {
this.addComponentListener(new CloseHideAdaptor(this));
} else {
for (ComponentListener cl : this.getComponentListeners()) {
if (cl instanceof CloseHideAdaptor) {
this.removeComponentListener(cl);
break;
}
}
}
}
/**
* Gets the initial position policy
*
* The InitialPositionPolicy property sets the position of a main window when it is first displayed, relative to a primary window or the screen.
* You use the InitialPositionPolicy property in conjunction with the InitialX, InitialY properties.
* InitialPositionPolicy sets the position of a window according to the following values:
* <li>Constants.PP_SYSTEMDEFAULT Accepts the default window system placement specification.</li>
* <li>Constants.PP_PRIMARYCENTERED Centers the window relative to the window specified as the PrimaryWindow property.</li>
* <li>Constants.PP_PRIMARYRELATIVE Positions the window relative to the primary window, using the PrimaryWindow, InitialX and InitialY attributes.</li>
* <li>Constants.PP_SCREENCENTERED Centers the window relative to the screen.</li>
* <li>Constants.PP_SCREENRELATIVE Positions the window relative to the screen, using the InitialX and InitialY properties.</li>
*/
public int getInitialPositionPolicy() {
return qq_initialPositionPolicy;
}
/**
* Sets the initial position policy
*
* The InitialPositionPolicy property sets the position of a main window when it is first displayed, relative to a primary window or the screen.
* You use the InitialPositionPolicy property in conjunction with the InitialX, InitialY properties.
* InitialPositionPolicy sets the position of a window according to the following values:
* <li>Constants.PP_SYSTEMDEFAULT Accepts the default window system placement specification.</li>
* <li>Constants.PP_PRIMARYCENTERED Centers the window relative to the window specified as the PrimaryWindow property.</li>
* <li>Constants.PP_PRIMARYRELATIVE Positions the window relative to the primary window, using the PrimaryWindow, InitialX and InitialY attributes.</li>
* <li>Constants.PP_SCREENCENTERED Centers the window relative to the screen.</li>
* <li>Constants.PP_SCREENRELATIVE Positions the window relative to the screen, using the InitialX and InitialY properties.</li>
*/
public void setInitialPositionPolicy(int policy) {
this.qq_initialPositionPolicy = policy;
}
/**
* Gets the primary window
*
* The primary window property designates a window, known as a primary window, to serve as an initial position reference for the current window.
* When a main window first realizes itself through the Open method on the UserWindow, it assumes a position according to the InitialPositionPolicy attribute.
* When the InitialPositionPolicy property is set to PP_PRIMARYRELATIVE (relative to the primary window) or PP_PRIMARYCENTERED (centered on the primary window),
* the window realizes itself in a position relative to the designated primary window.<p>
* <p>
* To take a position relative to the primary window, a window uses the PrimaryWindow attribute in conjunction with the InitialX and InitialY properties, which specify the window�s horizontal and vertical coordinates.
*/
public Window getPrimaryWindow() {
return this.primaryWindow;
}
/**
* Sets the primary window
*
* The primary window property designates a window, known as a primary window, to serve as an initial position reference for the current window.
* When a main window first realizes itself through the Open method on the UserWindow, it assumes a position according to the InitialPositionPolicy attribute.
* When the InitialPositionPolicy property is set to PP_PRIMARYRELATIVE (relative to the primary window) or PP_PRIMARYCENTERED (centered on the primary window),
* the window realizes itself in a position relative to the designated primary window.<p>
* <p>
* To take a position relative to the primary window, a window uses the PrimaryWindow attribute in conjunction with the InitialX and InitialY properties, which specify the window�s horizontal and vertical coordinates.
*/
public void setPrimaryWindow(Window value) {
this.primaryWindow = value;
}
/**
* Gets the InitialX value
*
* The InitialX property (integer) is the window�s initial horizontal screen position, relative to a primary window or the screen. It is specified in mils.
* InitialX applies only to main windows and only when a window�s InitialPositionPolicy attribute is set to PP_PRIMARYRELATIVE (relative to the primary window) or PP_SCREENRELATIVE (relative to the screen).
* InitialX, and its corollary, InitialY, work in conjunction with the PrimaryWindow and InitialPositionPolicy attributes to determine the position of a main window when it is first realized.
*/
public int getInitialX() {
return initialX;
}
/**
* Sets the InitialX value
*
* The InitialX property (integer) is the window�s initial horizontal screen position, relative to a primary window or the screen. It is specified in mils.
* InitialX applies only to main windows and only when a window�s InitialPositionPolicy attribute is set to PP_PRIMARYRELATIVE (relative to the primary window) or PP_SCREENRELATIVE (relative to the screen).
* InitialX, and its corollary, InitialY, work in conjunction with the PrimaryWindow and InitialPositionPolicy attributes to determine the position of a main window when it is first realized.
*/
public void setInitialX(int value) {
this.initialX = value;
}
/**
* Gets the InitialY value
*
* The InitialY property (integer) is the window�s initial vertical screen position, relative to a primary window or the screen. It is specified in mils.
* InitialY applies only to main windows and only when a window�s InitialPositionPolicy attribute is set to PP_PRIMARYRELATIVE (relative to the primary window) or PP_SCREENRELATIVE (relative to the screen).
* InitialY, and its corollary, InitialX, work in conjunction with the PrimaryWindow and InitialPositionPolicy attributes to determine the position of a main window when it is first realized.
*/
public int getInitialY() {
return initialY;
}
/**
* Sets the InitialY value
*
* The InitialY property (integer) is the window�s initial vertical screen position, relative to a primary window or the screen. It is specified in mils.
* InitialY applies only to main windows and only when a window�s InitialPositionPolicy attribute is set to PP_PRIMARYRELATIVE (relative to the primary window) or PP_SCREENRELATIVE (relative to the screen).
* InitialY, and its corollary, InitialX, work in conjunction with the PrimaryWindow and InitialPositionPolicy attributes to determine the position of a main window when it is first realized.
*/
public void setInitialY(int value) {
this.initialY = value;
}
/**
* Gets the default message set number for the window and its widgets.
*/
public int getSetNum() {
return this.qq_defaultSet;
}
/**
* Sets the default message set number for the window and its widgets.
*/
public void setSetNum(int value) {
this.qq_defaultSet = value;
}
/**
* Gets the message set number for the message number of the window's title.
*/
public int getTitleSetNum() {
return this.qq_msgSet;
}
/**
* Sets the message set number for the message number of the window's title.
*/
public void setTitleSetNum(int value) {
this.qq_msgSet = value;
}
/**
* Gets the message number for the message number of the window's title.
*/
public int getTitleMsgNum() {
return this.qq_msgNumber;
}
/**
* Sets the message number for the message number of the window's title.
*/
public void setTitleMsgNum(int value) {
this.qq_msgNumber = value;
}
/**
* Initialise the window and all its children.
*/
protected void initialize() {
if (this.Form == null) {
this.setName( "BrowserWindow" );
this.setTitle( "Outline Field Example" );
this.setSystemClosePolicy(Constants.SC_ENABLEDSHUTDOWN);
if (this.getContentPane() != this.getForm()) {
this.setContentPane(getForm());
}
this.qq_setupWindowUsage();
this.setResizable( true );
this.setAlwaysOnTop(false);
UserWindow.setIconizeEnabled(this, true);
UserWindow.setMaximizeEnabled(this, true);
WindowManager.addWindowListener(this);
this.setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
this.setUsage(DisplayProject.Constants.WU_UPDATE);
UIutils.processGUIActions();
this.pack();
this.setInitialX(0);
this.setInitialY(0);
this.setInitialPositionPolicy(Constants.PP_SYSTEMDEFAULT);
}
}
// ----------------
// Window usage
//-----------------
protected WindowUsageMap usage = new WindowUsageMap();
public int getUsage() {
return this.usage.getUsage();
}
public WindowUsageMap getUsageMap() {
return this.usage;
}
/**
* Sets the window usage
*
* The Usage property sets the state for all a window�s child widgets at once, providing collective widget state changes on a predefined basis. A widget�s state determines how the widget reacts to mouse actions and how it displays itself. A window�s Usage property provides a convenient way to control the states of a group of widgets in the context of their parent window. With the Usage attribute, you can synchronize widget states to conform to a pattern you establish for the window.
* The Usage attribute accepts the following values:
* <li>Constants.WU_EDIT Edit usage: widgets themselves are editable, but not underlying data.</li>
* <li>Constants.WU_QUERY Query only usage: widget data is editable, but not widgets themselves.</li>
* <li>Constants.WU_UPDATE Update usage: mouse actions and keyboard input accepted. Widgets themselves are changeable. This is the default.</li>
* <li>Constants.WU_USER1 A user-defined usage. Default values same as WU_UPDATE.</li>
* <li>Constants.WU_USER2 A user-defined usage. Default values same as WU_UPDATE.</li>
* <li>Constants.WU_USER3 A user-defined usage. Default values same as WU_UPDATE.</li>
* <li>Constants.WU_VIEW View-only usage: no keyboard input is accepted. Widget posts Click events for mouse clicks.</li>
*/
public void setUsage(int usage) {
this.usage.setUsage(usage);
}
public void qq_setupWindowUsage() {
this.usage = new WindowUsageMap();
this.usage.add(getqq_GridField12(), Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_statusLine(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_Browser(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_GridField15(), Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_AddBefore(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_UPDATE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
this.usage.add(getqq_AddAfter(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_UPDATE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
this.usage.add(getqq_AddChild(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_UPDATE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
this.usage.add(getqq_Delete(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_UPDATE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
this.usage.add(getqq_ShowRoot(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_HasControls(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_tree(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_GridField23(), Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_AddBeforeTree(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_UPDATE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
this.usage.add(getqq_AddAfterTree(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_UPDATE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
this.usage.add(getqq_AddChildTree(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_UPDATE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
this.usage.add(getqq_DeleteTree(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_UPDATE, Constants.FS_INACTIVE, Constants.FS_INACTIVE, Constants.FS_INACTIVE);
this.usage.add(getqq_ShowRootTree(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
this.usage.add(getqq_HasControlsTree(), Constants.FS_UPDATE, Constants.FS_VIEWONLY, Constants.FS_QUERY, Constants.FS_UPDATE, Constants.FS_UPDATE, Constants.FS_UPDATE);
}
// </editor-fold>
// -----------
// Main method
// -----------
public static void main( String[] args ) {
FrameworkUtils.setCmdLineArgs(args);
AppletConnectionInfo client = null;
try {
// Install our own focus manager. MUST be done prior to setting the
// UIManager, otherwise you'll run into issues like things have the wrong focus.
KeyboardFocusManager.setCurrentKeyboardFocusManager(new ForteKeyboardFocusManager());
UIManager.setLookAndFeel(new Win32LookAndFeel());
client = UserWindow.postAPPLETStarted();
BrowserWindow browserWindow_start = new BrowserWindow();
browserWindow_start.display();
UserWindow.postAPPLETStopped(client);
System.exit(0);
} catch (Throwable e) {
ErrorMgr.showErrors(null, "Unhandled exception", e);
UserWindow.postAPPLETStopped(client);
System.exit(0);
}
}
} // end class BrowserWindow
// c Pass 2 Conversion Time: 1670 milliseconds