|
From: Gerry D. <gd...@us...> - 2002-06-11 15:50:07
|
Update of /cvsroot/swapdv/swapdv
In directory usw-pr-cvs1:/tmp/cvs-serv29659
Modified Files:
ReplayTV.form ReplayTV.java SwapDV.form SwapDV.java
Log Message:
Changed all println()'s over the Logger.logs, added --debug switch and initial deleteShowActions
Index: ReplayTV.form
===================================================================
RCS file: /cvsroot/swapdv/swapdv/ReplayTV.form,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- ReplayTV.form 11 Jun 2002 00:14:49 -0000 1.13
+++ ReplayTV.form 11 Jun 2002 15:50:03 -0000 1.14
@@ -220,6 +220,7 @@
<SyntheticProperty name="generatePosition" type="boolean" value="true"/>
<SyntheticProperty name="generateSize" type="boolean" value="true"/>
<SyntheticProperty name="generateCenter" type="boolean" value="true"/>
+ <SyntheticProperty name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
</SyntheticProperties>
<Events>
@@ -259,7 +260,10 @@
</Properties>
<Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription">
- <JTabbedPaneConstraints tabName="Shows & Channels" toolTip=""/>
+ <JTabbedPaneConstraints tabName="Shows & Channels" toolTip="">
+ <Property name="tabTitle" type="java.lang.String" value="Shows & Channels"/>
+ <Property name="tabToolTip" type="java.lang.String" value=""/>
+ </JTabbedPaneConstraints>
</Constraint>
</Constraints>
Index: ReplayTV.java
===================================================================
RCS file: /cvsroot/swapdv/swapdv/ReplayTV.java,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -r1.30 -r1.31
--- ReplayTV.java 11 Jun 2002 00:14:50 -0000 1.30
+++ ReplayTV.java 11 Jun 2002 15:50:03 -0000 1.31
@@ -214,7 +214,7 @@
return;
long size = Long.parseLong((String)fstat.get("size"));
String localfile = Util.getSaveFileName(swapDV, path, defName);
- System.out.println("Savefile: " + localfile);
+ Logger.log(0, LoggerI.LEVEL_DEBUG, "Savefile: " + localfile);
if (localfile == null)
return;
new Downloader(swapDV,rrs.name, rrs.ipAddr, rrs.port, path, localfile, size, desc);
Index: SwapDV.form
===================================================================
RCS file: /cvsroot/swapdv/swapdv/SwapDV.form,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -r1.23 -r1.24
--- SwapDV.form 8 Jun 2002 21:29:05 -0000 1.23
+++ SwapDV.form 11 Jun 2002 15:50:04 -0000 1.24
@@ -662,13 +662,13 @@
</Properties>
<SyntheticProperties>
<SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/>
- <SyntheticProperty name="formSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
+ <SyntheticProperty name="formSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-91,0,0,2,-121"/>
<SyntheticProperty name="formPosition" type="java.awt.Point" value="-84,-19,0,5,115,114,0,14,106,97,118,97,46,97,119,116,46,80,111,105,110,116,-74,-60,-118,114,52,126,-56,38,2,0,2,73,0,1,120,73,0,1,121,120,112,0,0,0,0,0,0,0,0"/>
<SyntheticProperty name="formSizePolicy" type="int" value="0"/>
<SyntheticProperty name="generatePosition" type="boolean" value="true"/>
<SyntheticProperty name="generateSize" type="boolean" value="true"/>
<SyntheticProperty name="generateCenter" type="boolean" value="true"/>
- <SyntheticProperty name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,44,0,0,1,-112"/>
+ <SyntheticProperty name="designerSize" type="java.awt.Dimension" value="-84,-19,0,5,115,114,0,18,106,97,118,97,46,97,119,116,46,68,105,109,101,110,115,105,111,110,65,-114,-39,-41,-84,95,68,20,2,0,2,73,0,6,104,101,105,103,104,116,73,0,5,119,105,100,116,104,120,112,0,0,1,-91,0,0,2,-121"/>
</SyntheticProperties>
<Events>
Index: SwapDV.java
===================================================================
RCS file: /cvsroot/swapdv/swapdv/SwapDV.java,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- SwapDV.java 10 Jun 2002 21:34:58 -0000 1.58
+++ SwapDV.java 11 Jun 2002 15:50:04 -0000 1.59
@@ -95,13 +95,17 @@
public SwapDVStatusBar statusBar = null;
private static boolean daemonMode = false;
+ private static boolean debugMode = false;
+
private schdEventQueue schdQueue = null;
private schdEventListFrame schdListing = null;
private static SwapDV thisSwapDV = null;
private schdWizardFrame eventWizardFrame = null;
+ private StringBuffer loggerBuffer = new StringBuffer(128);
public static boolean isDaemonMode() { return daemonMode; }
+ public static boolean isDebugMode() { return debugMode; }
public static SwapDV getSwapDV() { return thisSwapDV; }
public SwapDV(String args[]) {
@@ -203,8 +207,7 @@
}
}
- if (autoRestart)
- startServer();
+ if (autoRestart) startServer();
/**
if (jtellaConfig.enabled)
@@ -358,9 +361,51 @@
}
public void log(int channel, int level, String msg) {
- /* We're only going to log broadcast messages here */
- if (channel == 0)
- System.out.println(msg);
+
+
+ /* We're only going to log broadcast messages here */
+ if (channel == 0) {
+ if (level == LoggerI.LEVEL_DEBUG) {
+ if (debugMode) {
+ loggerBuffer.setLength(0);
+ loggerBuffer.append("DEBUG: ");
+ loggerBuffer.append(msg);
+ System.err.println(loggerBuffer.toString());
+ }
+ return;
+ }
+
+ loggerBuffer.setLength(0);
+ switch(level) {
+ case LoggerI.LEVEL_INFO:
+ loggerBuffer.append("info: ");
+ break;
+ case LoggerI.LEVEL_ERR:
+ loggerBuffer.append("ERROR: ");
+ break;
+ case LoggerI.LEVEL_WARN:
+ loggerBuffer.append("Warn: ");
+ break;
+ case LoggerI.LEVEL_ALERT:
+ loggerBuffer.append("Alert: ");
+ break;
+ case LoggerI.LEVEL_CRIT:
+ loggerBuffer.append("Critical: ");
+ break;
+ case LoggerI.LEVEL_NOTICE:
+ loggerBuffer.append("Notice: ");
+ break;
+ default:
+ break;
+ }
+ loggerBuffer.append(msg);
+ System.out.println(loggerBuffer.toString());
+
+ }
+ }
+
+ public static void debug(String debugMsg) {
+ Logger.log(0, LoggerI.LEVEL_DEBUG, debugMsg);
}
/**
@@ -378,7 +423,7 @@
pStore = new pStoreManager(pStoreFile);
pStore.openStore();
} catch (IOException openError) {
- System.out.println("Unable to open persistant store");
+ Logger.log(0, LoggerI.LEVEL_DEBUG, "Unable to open persistant store");
openError.printStackTrace();
System.exit(1);
}
@@ -386,7 +431,7 @@
// Install/restore previous values for each module
pStoreNodeI downloadAttrs = pStore.getDomain("download");
DownloadCounter.setProperties(downloadAttrs);
- jtellaConfig.setProperties(pStore.getDomain("jtella"));
+ //jtellaConfig.setProperties(pStore.getDomain("jtella"));
swapdv.ReplayClient.ThrottledInputStream.setProperties(downloadAttrs);
details.setProperties(pStore.getDomain("replayServer"));
@@ -427,7 +472,7 @@
public void storeValues() {
pStoreNodeI downloadAttrs = pStore.getDomain("download");
DownloadCounter.getProperties(downloadAttrs);
- jtellaConfig.getProperties(pStore.getDomain("jtella"));
+ //jtellaConfig.getProperties(pStore.getDomain("jtella"));
swapdv.ReplayClient.ThrottledInputStream.getProperties(downloadAttrs);
details.getProperties(pStore.getDomain("replayServer"));
schdQueue.preserveEventQueue(pStore.getDomain("eventScheduler").getChild("eventQueue"));
@@ -467,7 +512,7 @@
try {
pStore.flushStore();
} catch (IOException flushError) {
- System.out.println("Error flushing persistant store!");
+ Logger.log(0, LoggerI.LEVEL_DEBUG, "Error flushing persistant store!");
flushError.printStackTrace();
}
}
@@ -491,7 +536,7 @@
if (guide.getCategoryId(info.dstCategory) == -1) {
guide.addCategory(info.dstCategory);
treeModel.addCategory(info.dstCategory);
- System.out.println("** Importing show, category " + info.dstCategory + " did not exist locally - added to local guide");
+ Logger.log(0, LoggerI.LEVEL_DEBUG, "** Importing show, category " + info.dstCategory + " did not exist locally - added to local guide");
}
// see if we can find the channel we're supposed to add the show to
boolean addChannel = false;
@@ -504,7 +549,7 @@
Channel importChannel = importGuide.getChannel(importShow.created);
chan = guide.addChannel(importChannel,importGuide,false);
guide.setCategory(chan, guide.getCategoryId(info.dstCategory));
- System.out.println("** Importing show, channel ID " + info.dstChannelID + " didn't exist - added");
+ Logger.log(0, LoggerI.LEVEL_DEBUG, "** Importing show, channel ID " + info.dstChannelID + " didn't exist - added");
}
// add the show...
@@ -722,6 +767,7 @@
// Create each possible command line option
CmdLineParser.Option storeFileOption = cmdLine.addStringOption('s', "store");
CmdLineParser.Option daemonModeOption = cmdLine.addBooleanOption('d', "daemon");
+ CmdLineParser.Option debugModeOption = cmdLine.addBooleanOption('x', "debug");
CmdLineParser.Option helpOption = cmdLine.addBooleanOption('?', "help");
// Parse the command line
@@ -742,9 +788,11 @@
// Handle daemon mode
Boolean daemonModeFlag = (Boolean) cmdLine.getOptionValue(daemonModeOption);
- if ((daemonModeFlag != null) && (daemonModeFlag.booleanValue()))
- daemonMode = true;
+ daemonMode = ((daemonModeFlag != null) && (daemonModeFlag.booleanValue()));
+ Boolean debugModeFlag = (Boolean) cmdLine.getOptionValue(debugModeOption);
+ debugMode = ((debugModeFlag != null) && (debugModeFlag.booleanValue()));
+
// Handle a file spec
String theStoreFile = (String) cmdLine.getOptionValue(storeFileOption);
if (theStoreFile != null) {
@@ -772,7 +820,7 @@
}
public boolean canAddCategory() {
- System.out.println("count = "+guide.getCategoryCount()+" max = "+guide.MAXCATEGORIES);
+ Logger.log(0, LoggerI.LEVEL_DEBUG, "count = "+guide.getCategoryCount()+" max = "+guide.MAXCATEGORIES);
return (guide.getCategoryCount() < guide.MAXCATEGORIES);
}
@@ -1419,8 +1467,8 @@
pack();
java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize();
- setSize(new java.awt.Dimension(400, 300));
- setLocation((screenSize.width-400)/2,(screenSize.height-300)/2);
+ setSize(new java.awt.Dimension(647, 421));
+ setLocation((screenSize.width-647)/2,(screenSize.height-421)/2);
}//GEN-END:initComponents
private void jNewEventActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jNewEventActionPerformed
@@ -1786,7 +1834,7 @@
private void jMenuItemShowDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItemShowDeleteActionPerformed
int items[] = jTableShows.getSelectedRows();
for (int i=0; i<items.length; i++) {
- System.out.println("Deleting from row "+items[i]);
+ Logger.log(0, LoggerI.LEVEL_DEBUG, "Deleting from row "+items[i]);
int showID = listShows.getShowID(items[i]);
Show show = guide.getShow(showID);
boolean r = guide.deleteShow(guide.getShow(showID));
@@ -2072,7 +2120,7 @@
Show shows [] = null;
int rows[] = null;
Channel channels [] = null;
- System.out.println("Drop from swapdv:"+drag+" into "+drop);
+ Logger.log(0, LoggerI.LEVEL_DEBUG, "Drop from swapdv:"+drag+" into "+drop);
if (!drop.equals("tree")) return;
if (drag.equals("tree")) {
TreePath paths [] = jTree1.getSelectionPaths();
@@ -2088,7 +2136,7 @@
channels = new Channel[paths.length];
for (int i=0; i<paths.length; i++) {
ChannelTreeNode chanNode = (ChannelTreeNode)paths[i].getLastPathComponent();
- System.out.println("channel dragged "+chanNode);
+ Logger.log(0, LoggerI.LEVEL_DEBUG, "channel dragged "+chanNode);
channels[i] = chanNode.getChannel();
}
break;
@@ -2097,7 +2145,7 @@
}
}
if (drag.equals("shows")) {
- System.out.println("show dragged");
+ Logger.log(0, LoggerI.LEVEL_DEBUG, "show dragged");
rows = jTableShows.getSelectedRows();
jTableShows.clearSelection();
shows = new Show[rows.length];
@@ -2110,20 +2158,20 @@
TreeNode node = (TreeNode)dropPath.getLastPathComponent();
switch(dropPath.getPathCount()) {
case 2: // category
- System.out.println("Dropped on category "+node);
+ Logger.log(0, LoggerI.LEVEL_DEBUG, "Dropped on category "+node);
if (channels != null || shows != null)
toCategory = ((CategoryTreeNode)node).getName();
else return;
break;
case 3: // channel
- System.out.println("Dropped on channel "+node);
+ Logger.log(0, LoggerI.LEVEL_DEBUG, "Dropped on channel "+node);
if (shows != null)
toChannel = ((ChannelTreeNode)node).getChannel();
else return;
break;
case 4: // show
- System.out.println("Dropped on show "+node);
+ Logger.log(0, LoggerI.LEVEL_DEBUG, "Dropped on show "+node);
toChannel = ((ChannelTreeNode)(node.getParent())).getChannel();
break;
}
|