|
From: Gerry D. <gd...@us...> - 2002-06-11 18:27:01
|
Update of /cvsroot/swapdv/swapdv/Scheduler/ui
In directory usw-pr-cvs1:/tmp/cvs-serv3068/Scheduler/ui
Modified Files:
schdActionEditorFrame.java schdActionListPanel.java
schdEventEditorFrame.java schdEventListFrame.java
schdWizardFrame.java
Log Message:
Replaced deprecated calls, added Util.ReadLine and modified position and sizing for first time Frame displays
Index: schdActionEditorFrame.java
===================================================================
RCS file: /cvsroot/swapdv/swapdv/Scheduler/ui/schdActionEditorFrame.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- schdActionEditorFrame.java 11 Jun 2002 00:07:40 -0000 1.4
+++ schdActionEditorFrame.java 11 Jun 2002 18:26:58 -0000 1.5
@@ -50,6 +50,7 @@
schdEventEditor schdEditor = null;
boolean editFrameInUse = false;
boolean newAction = false;
+ boolean attrsRestored = false;
/** Creates new form schdEventEditorFrame */
public schdActionEditorFrame(schdEventI theEvent) {
@@ -83,8 +84,7 @@
return;
}
- // Restore geometr, if needed
- this.pack();
+
}
// Install new event to edit
@@ -94,6 +94,12 @@
actionEditor.setAction(currentAction);
this.pack();
+ if (!attrsRestored) {
+ this.setIconImage(swapdv.SwapDV.getSwapDV().iconSwapdv32);
+ actionUtils.restoreActionEditorAttrs(this);
+ attrsRestored = true;
+ }
+
this.setVisible(true);
editFrameInUse = true;
if (newAction)
Index: schdActionListPanel.java
===================================================================
RCS file: /cvsroot/swapdv/swapdv/Scheduler/ui/schdActionListPanel.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- schdActionListPanel.java 9 Jun 2002 04:31:31 -0000 1.5
+++ schdActionListPanel.java 11 Jun 2002 18:26:58 -0000 1.6
@@ -66,25 +66,6 @@
}
public schdEventI getEvent() { return currentEvent; }
- public schdEventActionI promptForAction() {
- String actionTypes[] = actionUtils.getKnownActionsTypes();
- String selectedType;
-
- // If there are no actions, skip it. If there is only
- // one, silently pick it. if there is more than one,
- // let the user choose one
- if (actionTypes.length == 0) return null;
- if (actionTypes.length > 1) {
- selectedType = (String) JOptionPane.showInputDialog(this, "Choose which sort of action you wish to add", "Action selection", JOptionPane.QUESTION_MESSAGE, null, actionTypes, actionTypes[0]);
- if (selectedType == null) return null;
- } else {
- selectedType = actionTypes[0];
- }
-
- // Allocate and return a class of that type
- return actionUtils.getNewAction(selectedType);
- }
-
private schdActionEditorFrame getCurrentEditFrame(schdEventActionI theAction) {
schdActionEditorFrame theFrame = null;
@@ -123,7 +104,7 @@
// Allocate a new action, if needed
if (theAction == null) {
- if ((theAction = promptForAction()) == null) return false;
+ if ((theAction = actionUtils.selectAction(this)) == null) return false;
newAction = true;
}
@@ -134,7 +115,6 @@
theFrame.setNewAction(newAction);
theFrame.startEdit();
- actionUtils.restoreActionEditorAttrs(theFrame);
return true;
}
}
Index: schdEventEditorFrame.java
===================================================================
RCS file: /cvsroot/swapdv/swapdv/Scheduler/ui/schdEventEditorFrame.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- schdEventEditorFrame.java 11 Jun 2002 00:07:40 -0000 1.7
+++ schdEventEditorFrame.java 11 Jun 2002 18:26:58 -0000 1.8
@@ -33,9 +33,9 @@
package swapdv.Scheduler.ui;
-
import swapdv.Scheduler.*;
import swapdv.Scheduler.queue.*;
+import java.awt.*;
import javax.swing.*;
import swapdv.Persistance.*;
@@ -93,7 +93,23 @@
schdEditor.resetEditorLayout();
this.pack();
if (!attrsRestored) {
- if (!pStoreUtils.restoreFrameAttrs(this, prefsStore, currentEvent.getUniqueID())) this.pack();
+ if (!pStoreUtils.restoreFrameAttrs(this, prefsStore, currentEvent.getUniqueID())) {
+ Dimension theScreen = Toolkit.getDefaultToolkit().getScreenSize();
+ Dimension theFrame = this.getSize();
+
+ // Have to manually prime this sometimes - I think it's due to the tab
+ // set panel
+ if ((theFrame.width > theScreen.width) || (theFrame.height > theScreen.height)) {
+ theFrame.width = 714;
+ theFrame.height = 497;
+ }
+
+ theFrame.width = (theScreen.width - theFrame.width) / 2;
+ theFrame.height = (theScreen.height - theFrame.height) / 2;
+ this.setLocation(theFrame.width, theFrame.height);
+ this.setIconImage(swapdv.SwapDV.getSwapDV().iconSwapdv32);
+ }
+
attrsRestored = true;
}
Index: schdEventListFrame.java
===================================================================
RCS file: /cvsroot/swapdv/swapdv/Scheduler/ui/schdEventListFrame.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- schdEventListFrame.java 11 Jun 2002 15:50:04 -0000 1.8
+++ schdEventListFrame.java 11 Jun 2002 18:26:58 -0000 1.9
@@ -38,6 +38,7 @@
import swapdv.Scheduler.*;
import swapdv.Scheduler.actions.*;
import swapdv.Persistance.*;
+import java.awt.*;
import java.util.*;
import javax.swing.*;
@@ -101,6 +102,14 @@
if (!pStoreUtils.restoreFrameAttrs(this, prefsStore)) {
((pStoreJTable) eventListing).restoreTableLayout(prefsStore);
this.pack();
+
+ Dimension theScreen = Toolkit.getDefaultToolkit().getScreenSize();
+ Dimension theFrame = this.getSize();
+
+ theFrame.width = (theScreen.width - theFrame.width) / 2;
+ theFrame.height = (theScreen.height - theFrame.height) / 2;
+ this.setLocation(theFrame.width, theFrame.height);
+ this.setIconImage(swapdv.SwapDV.getSwapDV().iconSwapdv32);
} else
((pStoreJTable) eventListing).restoreTableLayout(prefsStore);
Index: schdWizardFrame.java
===================================================================
RCS file: /cvsroot/swapdv/swapdv/Scheduler/ui/schdWizardFrame.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- schdWizardFrame.java 11 Jun 2002 00:07:40 -0000 1.3
+++ schdWizardFrame.java 11 Jun 2002 18:26:58 -0000 1.4
@@ -94,7 +94,6 @@
// Attempt to restore the layout
if (!pStoreUtils.restoreFrameAttrs(this, wizardUtils.getWizardStore(), "FRAME_")) {
-
// Set starting size and center it
this.setSize(600, 400);
Dimension theScreen = Toolkit.getDefaultToolkit().getScreenSize();
@@ -103,6 +102,8 @@
theFrame.width = (theScreen.width - theFrame.width) / 2;
theFrame.height = (theScreen.height - theFrame.height) / 2;
this.setLocation(theFrame.width, theFrame.height);
+
+ this.setIconImage(swapdv.SwapDV.getSwapDV().iconSwapdv32);
}
// Lay things out
|