You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(111) |
Jul
(258) |
Aug
(21) |
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <sim...@us...> - 2002-07-30 02:26:20
|
Update of /cvsroot/cdchamber/CDChamber/src/org/cdchamber/util In directory usw-pr-cvs1:/tmp/cvs-serv17019/src/org/cdchamber/util Modified Files: DirPath.java Log Message: Beautify the GUI Index: DirPath.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/src/org/cdchamber/util/DirPath.java,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** DirPath.java 17 Jul 2002 10:55:22 -0000 1.7 --- DirPath.java 30 Jul 2002 02:26:17 -0000 1.8 *************** *** 13,15 **** --- 13,20 ---- public static final String BuildDir = BaseDir + SEP + "build"; public static final String DataDir = BaseDir + SEP + "data"; + public static final String ImagesDir = BaseDir + SEP + "images"; + + public static String getIconPath( String iconName) { + return ImagesDir+SEP+iconName; + } } |
From: <sim...@us...> - 2002-07-30 02:26:20
|
Update of /cvsroot/cdchamber/CDChamber/images In directory usw-pr-cvs1:/tmp/cvs-serv17019/images Added Files: about.jpg cdrom.gif closedFolder.jpg createNewCDRom.png deleteCDRom.png file.jpg helpAbout.png importCDRom.png openFolder.jpg openZipFile.jpg roots.jpg saveCDRom.png searchCDRom.png zipFile.jpg Log Message: Beautify the GUI --- NEW FILE: about.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: cdrom.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: closedFolder.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: createNewCDRom.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: deleteCDRom.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: file.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: helpAbout.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: importCDRom.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: openFolder.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: openZipFile.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: roots.jpg --- (This appears to be a binary file; contents omitted.) --- NEW FILE: saveCDRom.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: searchCDRom.png --- (This appears to be a binary file; contents omitted.) --- NEW FILE: zipFile.jpg --- (This appears to be a binary file; contents omitted.) |
From: <sim...@us...> - 2002-07-30 02:26:20
|
Update of /cvsroot/cdchamber/CDChamber In directory usw-pr-cvs1:/tmp/cvs-serv17019 Modified Files: TODO.txt Log Message: Beautify the GUI Index: TODO.txt =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/TODO.txt,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** TODO.txt 29 Jul 2002 08:42:35 -0000 1.15 --- TODO.txt 30 Jul 2002 02:26:16 -0000 1.16 *************** *** 14,17 **** x : Search result should contains the whole path message.. x : Double click on files table should open the directory(If it is). ! + : GUI need to be made more beautiful and friendly. + : Release one alpha version --- 14,18 ---- x : Search result should contains the whole path message.. x : Double click on files table should open the directory(If it is). ! x : GUI need to be made more beautiful and friendly. ! + : Let the table can be sorted. + : Release one alpha version |
From: <sim...@us...> - 2002-07-30 02:11:05
|
Update of /cvsroot/cdchamber/CDChamber/images In directory usw-pr-cvs1:/tmp/cvs-serv12938/images Log Message: Directory /cvsroot/cdchamber/CDChamber/images added to the repository |
From: <sim...@us...> - 2002-07-29 09:42:50
|
Update of /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/elements In directory usw-pr-cvs1:/tmp/cvs-serv28537/test/src/org/cdchamber/elements Modified Files: FileFiltersTest.java JarEntryParserTest.java Log Message: Minor bug fix at FileFiltersTest Index: FileFiltersTest.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/elements/FileFiltersTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** FileFiltersTest.java 27 Jul 2002 07:55:05 -0000 1.1 --- FileFiltersTest.java 29 Jul 2002 09:42:46 -0000 1.2 *************** *** 6,9 **** --- 6,10 ---- import junit.framework.TestCase; + import org.cdchamber.elements.SwungDashFileFilter; public class FileFiltersTest extends TestCase { *************** *** 26,29 **** --- 27,34 ---- FileFilters.addFilter( new CVSFileFilter()); assertEquals( "Should be 1 now", 1, FileFilters.filters.size()); + FileFilters.addFilter( new BakFileFilter()); + assertEquals( "Should be 1 now", 2, FileFilters.filters.size()); + FileFilters.addFilter( new SwungDashFileFilter()); + assertEquals( "Should be 1 now", 3, FileFilters.filters.size()); } Index: JarEntryParserTest.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/elements/JarEntryParserTest.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** JarEntryParserTest.java 28 Jul 2002 13:58:35 -0000 1.4 --- JarEntryParserTest.java 29 Jul 2002 09:42:46 -0000 1.5 *************** *** 8,18 **** import java.util.jar.JarFile; - import java.io.FileWriter; - import java.io.FileReader; import org.cdchamber.util.DirPath; - import org.cdchamber.util.testtools.FileComparator; import org.cdchamber.elements.EntryParser; import org.cdchamber.elements.DirectoryType; public class JarEntryParserTest extends TestCase { --- 8,16 ---- import java.util.jar.JarFile; import org.cdchamber.util.DirPath; import org.cdchamber.elements.EntryParser; import org.cdchamber.elements.DirectoryType; + import net.sf.jazzlib.ZipFile; public class JarEntryParserTest extends TestCase { *************** *** 36,61 **** parser.parseEntries(); assertEquals( "Should have 4 filetypes", 4, dir.getFilesCount()); - /* - dir.marshal( new FileWriter( DirPath.TestCaseDir + DirPath.SEP + "testcase.jar.xml")); - FileComparator.diff( - new FileReader( DirPath.TestCaseDir + DirPath.SEP + "testcase.jar.xml"), - new FileReader( DirPath.TestCaseDir + DirPath.SEP + "testcase.jar.result.xml") - ); - */ } public void testZipParser() throws Exception { ! JarFile zipFile = new JarFile( DirPath.TestCaseDir + DirPath.SEP + "testcase.zip"); DirectoryType dir = new DirectoryType(); EntryParser parser = new EntryParser( dir, EntryWrapper.getEntryWrapper(zipFile)); parser.parseEntries(); assertEquals( "Should have 3 filetypes", 3, dir.getFilesCount()); - /* - dir.marshal( new FileWriter( DirPath.TestCaseDir + DirPath.SEP + "testcase.zip.xml")); - FileComparator.diff( - new FileReader( DirPath.TestCaseDir + DirPath.SEP + "testcase.zip.xml"), - new FileReader( DirPath.TestCaseDir + DirPath.SEP + "testcase.zip.result.xml") - ); - */ } } --- 34,45 ---- parser.parseEntries(); assertEquals( "Should have 4 filetypes", 4, dir.getFilesCount()); } public void testZipParser() throws Exception { ! ZipFile zipFile = new ZipFile( DirPath.TestCaseDir + DirPath.SEP + "testcase.zip"); DirectoryType dir = new DirectoryType(); EntryParser parser = new EntryParser( dir, EntryWrapper.getEntryWrapper(zipFile)); parser.parseEntries(); assertEquals( "Should have 3 filetypes", 3, dir.getFilesCount()); } } |
From: <sim...@us...> - 2002-07-29 09:42:49
|
Update of /cvsroot/cdchamber/CDChamber/aspect/gen/org/cdchamber/elements In directory usw-pr-cvs1:/tmp/cvs-serv28537/aspect/gen/org/cdchamber/elements Modified Files: FileFilters.java Log Message: Minor bug fix at FileFiltersTest Index: FileFilters.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/aspect/gen/org/cdchamber/elements/FileFilters.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** FileFilters.java 29 Jul 2002 02:43:32 -0000 1.4 --- FileFilters.java 29 Jul 2002 09:42:45 -0000 1.5 *************** *** 17,21 **** } public static synchronized void addFilter( IFileFilter filter) { ! filters.add( filter); } --- 17,21 ---- } public static synchronized void addFilter( IFileFilter filter) { ! filters.addElement( filter); } |
From: <cry...@us...> - 2002-07-29 09:26:49
|
Update of /cvsroot/cdchamber/CDChamber/script In directory usw-pr-cvs1:/tmp/cvs-serv21431/script Modified Files: acceptance.sh Log Message: add one acceptance test Index: acceptance.sh =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/script/acceptance.sh,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** acceptance.sh 3 Jul 2002 09:38:05 -0000 1.4 --- acceptance.sh 29 Jul 2002 09:26:45 -0000 1.5 *************** *** 4,9 **** if [[ -f $BUILD_DIR/CDChamber/build/lib/CDChamber.jar ]] then ! cd $BUILD_DIR/CDChamber/acceptance/case1 ! $BUILD_DIR/CDChamber/acceptance/case1/execute 2>&1 else echo "BUILD FAILED,jar file is not successfully generated" --- 4,13 ---- if [[ -f $BUILD_DIR/CDChamber/build/lib/CDChamber.jar ]] then ! cases=`ls -1 | egrep '^case' ` ! for dir in $cases ! do ! cd $BUILD_DIR/CDChamber/acceptance/$dir ! $BUILD_DIR/CDChamber/acceptance/$dir/execute 2>&1 ! done else echo "BUILD FAILED,jar file is not successfully generated" |
From: <cry...@us...> - 2002-07-29 09:26:49
|
Update of /cvsroot/cdchamber/CDChamber/data In directory usw-pr-cvs1:/tmp/cvs-serv21431/data Modified Files: repository.xml Log Message: add one acceptance test Index: repository.xml =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/data/repository.xml,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** repository.xml 26 Jul 2002 07:54:33 -0000 1.2 --- repository.xml 29 Jul 2002 09:26:45 -0000 1.3 *************** *** 1,2 **** <?xml version="1.0" encoding="UTF-8"?> ! <CDRomType valid="true" date="1025685715000" files-count="2" size="2"><files files-count="1" date="1025685715000" size="1" valid="true" xsi:type="java:org.cdchamber.elements.DirectoryType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><name>bar</name><files date="1025685715000" size="1" valid="true"><name>world</name><desc>sssssssssssssss</desc></files><content></content></files><files date="1025685715000" size="1" valid="true"><name>hello</name></files><name>foo</name><content></content><data-file-name>D:\work\CDChamber\data\repository.xml</data-file-name></CDRomType> \ No newline at end of file --- 1,2 ---- <?xml version="1.0" encoding="UTF-8"?> ! <CDRomType valid="true" date="1025685715000" files-count="2" size="2"><files files-count="1" date="1025685715000" size="1" valid="true" xsi:type="java:org.cdchamber.elements.DirectoryType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><name>bar</name><files date="1025685715000" size="1" valid="true"><name>world</name><desc>sssssssssssssss</desc></files><content></content></files><files date="1025685715000" size="1" valid="true"><name>hello</name></files><name>foo</name><content></content><data-file-name>/u/yangjing/program/java/CDChamber/data/repository.xml</data-file-name></CDRomType> \ No newline at end of file |
From: <cry...@us...> - 2002-07-29 09:26:48
|
Update of /cvsroot/cdchamber/CDChamber/acceptance/case2/foo In directory usw-pr-cvs1:/tmp/cvs-serv21431/acceptance/case2/foo Added Files: testcase.jar testcase.zip Log Message: add one acceptance test --- NEW FILE: testcase.jar --- #!/bin/bash java -cp $BUILD_DIR/CDChamber/build/lib/CDChamber.jar:$CLASSPATH org.cdchamber.Main -i $PWD/foo -o $PWD/repository.xml 2>&1 if [[ -f $PWD/repository.xml && -z `diff $PWD/check/repository.xml $PWD/repository.xml` ]] then echo "BUILD SUCCESSFUL" rm -f $PWD/repository.xml else echo "BUILD FAILED difference occurred between $PWD/check/repository.xml $PWD/repository.xml" fi --- NEW FILE: testcase.zip --- (This appears to be a binary file; contents omitted.) |
From: <cry...@us...> - 2002-07-29 09:26:47
|
Update of /cvsroot/cdchamber/CDChamber/acceptance/case2 In directory usw-pr-cvs1:/tmp/cvs-serv21431/acceptance/case2 Added Files: execute Log Message: add one acceptance test --- NEW FILE: execute --- #!/bin/bash java -cp $BUILD_DIR/CDChamber/build/lib/CDChamber.jar:$CLASSPATH org.cdchamber.Main -i $PWD/foo -o $PWD/repository.xml 2>&1 if [[ -f $PWD/repository.xml && -z `diff $PWD/check/repository.xml $PWD/repository.xml` ]] then echo "BUILD SUCCESSFUL" rm -f $PWD/repository.xml else echo "BUILD FAILED difference occurred between $PWD/check/repository.xml $PWD/repository.xml" fi |
From: <cry...@us...> - 2002-07-29 09:26:47
|
Update of /cvsroot/cdchamber/CDChamber/acceptance/case2/check In directory usw-pr-cvs1:/tmp/cvs-serv21431/acceptance/case2/check Added Files: repository.xml Log Message: add one acceptance test --- NEW FILE: repository.xml --- <?xml version="1.0" encoding="UTF-8"?> <directory-type files-count="3" date="1027933840000" size="4760" valid="true"><name>foo</name><files files-count="0" date="1027933511000" size="0" valid="true" xsi:type="java:org.cdchamber.elements.DirectoryType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><name>bar</name><content></content></files><files date="1027933613000" size="388" valid="true"><name>testcase.jar</name></files><files files-count="3" date="1027933529000" size="4372" valid="true" xsi:type="java:org.cdchamber.elements.CompressedFileType" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><name>testcase.zip</name><content></content><files files-count="0" date="1027047944000" size="81" valid="true" xsi:type="java:org.cdchamber.elements.DirectoryType"><name>nulldir</name><content></content></files><files files-count="2" date="1024626104000" size="781" valid="true" xsi:type="java:org.cdchamber.elements.DirectoryType"><name>testtools</name><files files-count="2" date="1024626128000" size="334" valid="true" xsi:type="java:org.cdchamber.elements.DirectoryType"><name>difffiles</name><files date="1026898028000" size="78" valid="true"><name>file2.txt</name></files><files date="1026898016000" size="77" valid="true"><name>file1.txt</name></files><content></content></files><files files-count="2" date="1024626164000" size="333" valid="true" xsi:type="java:org.cdchamber.elements.DirectoryType"><name>samefiles</name><files date="1026898044000" size="77" valid="true"><name>file1.txt</name></files><files date="1026898046000" size="77" valid="true"><name>file2.txt</name></files><content></content></files><content></content></files><files date="1024999342000" size="0" valid="true"><name>nullFile</name></files></files><content></content></directory-type> |
From: <cry...@us...> - 2002-07-29 09:25:58
|
Update of /cvsroot/cdchamber/CDChamber/acceptance/case2/foo/bar In directory usw-pr-cvs1:/tmp/cvs-serv21198/foo/bar Log Message: Directory /cvsroot/cdchamber/CDChamber/acceptance/case2/foo/bar added to the repository |
From: <cry...@us...> - 2002-07-29 09:25:37
|
Update of /cvsroot/cdchamber/CDChamber/acceptance/case2/check In directory usw-pr-cvs1:/tmp/cvs-serv21106/check Log Message: Directory /cvsroot/cdchamber/CDChamber/acceptance/case2/check added to the repository |
From: <cry...@us...> - 2002-07-29 09:25:37
|
Update of /cvsroot/cdchamber/CDChamber/acceptance/case2/foo In directory usw-pr-cvs1:/tmp/cvs-serv21106/foo Log Message: Directory /cvsroot/cdchamber/CDChamber/acceptance/case2/foo added to the repository |
From: <cry...@us...> - 2002-07-29 09:25:23
|
Update of /cvsroot/cdchamber/CDChamber/acceptance/case2 In directory usw-pr-cvs1:/tmp/cvs-serv21050/case2 Log Message: Directory /cvsroot/cdchamber/CDChamber/acceptance/case2 added to the repository |
From: <sim...@us...> - 2002-07-29 08:54:24
|
Update of /cvsroot/cdchamber/CDChamber/aspect/gen/org/cdchamber/elements In directory usw-pr-cvs1:/tmp/cvs-serv11827/aspect/gen/org/cdchamber/elements Modified Files: EntryParser.java Log Message: Main method for EntryParser Index: EntryParser.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/aspect/gen/org/cdchamber/elements/EntryParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** EntryParser.java 28 Jul 2002 13:41:27 -0000 1.1 --- EntryParser.java 29 Jul 2002 08:54:21 -0000 1.2 *************** *** 5,10 **** package org.cdchamber.elements; import java.util.*; ! import java.io.IOException; public class EntryParser { --- 5,16 ---- package org.cdchamber.elements; + import org.cdchamber.elements.DirectoryType; + import org.cdchamber.elements.EntryWrapper; + import java.util.*; ! import java.util.jar.JarFile; ! import java.io.*; ! ! import net.sf.jazzlib.ZipFile; public class EntryParser { *************** *** 27,31 **** entryWrapper.nextElement(); String entryName = entryWrapper.getName(); - //System.out.println( entryName ); // Get the directory part if there is one --- 33,36 ---- *************** *** 114,125 **** public static void main( String[] args) throws Exception { ! /* ! DirectoryType dir = new DirectoryType(); ! JarFile jarFile = new JarFile( "D:/work/CDChamber/test/testcase/testcase.jar"); ! EntryParser parse = new EntryParser( dir, jarFile); ! parse.parseEntries(); ! dir.marshal( new FileWriter( "D:/work/CDChamber/data/a.xml")); ! */ } } --- 119,143 ---- public static void main( String[] args) throws Exception { ! if ( args.length != 4) reportUsage(); ! if ( !args[0].equalsIgnoreCase( "-i")) reportUsage(); ! if ( !args[2].equalsIgnoreCase( "-o")) reportUsage(); ! File inFile = new File( args[1]); ! File outFile = new File( args[3]); ! ! DirectoryType root = new DirectoryType(); ! EntryParser parser; ! if ( inFile.getName().toLowerCase().endsWith( ".jar")) ! parser = new EntryParser( root, EntryWrapper.getEntryWrapper( new JarFile(inFile))); ! else parser = new EntryParser( root, EntryWrapper.getEntryWrapper( new ZipFile(inFile))); ! parser.parseEntries(); ! root.marshal( new FileWriter( outFile)); } + + private static void reportUsage() { + System.out.println( "Usage: java org.elements.EntryParser -i inputfile -o outputfilename"); + System.out.println( "And make sure the inputdir can read, the outputfilename can write"); + System.exit( 1); + } + } |
From: <sim...@us...> - 2002-07-29 08:42:43
|
Update of /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/gui In directory usw-pr-cvs1:/tmp/cvs-serv8574/test/src/org/cdchamber/gui Modified Files: CDCMainFrameControllerTest.java CDCMainFrameTest.java Log Message: Double click on table will change the selected path in tree. Index: CDCMainFrameControllerTest.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/gui/CDCMainFrameControllerTest.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** CDCMainFrameControllerTest.java 29 Jul 2002 07:45:02 -0000 1.15 --- CDCMainFrameControllerTest.java 29 Jul 2002 08:42:36 -0000 1.16 *************** *** 199,204 **** --- 199,206 ---- TreeModel treeModel = null; + JTree tree; public void setDirectoryTreeModel(TreeModel model) { this.treeModel = model; + tree = new JTree( treeModel); } *************** *** 225,229 **** public JTree getDirectoryTree() { ! return null; } --- 227,231 ---- public JTree getDirectoryTree() { ! return tree; } Index: CDCMainFrameTest.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/gui/CDCMainFrameTest.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** CDCMainFrameTest.java 29 Jul 2002 07:45:02 -0000 1.12 --- CDCMainFrameTest.java 29 Jul 2002 08:42:36 -0000 1.13 *************** *** 17,20 **** --- 17,22 ---- import java.util.Vector; import java.io.*; + import java.awt.event.MouseEvent; + import java.awt.event.MouseListener; public class CDCMainFrameTest extends TestCase { *************** *** 78,81 **** --- 80,99 ---- FilesTableModel tableModel = (FilesTableModel)frame.filesTable.getModel(); if ( !selected.equals( tableModel.getDir())) fail( "The selected directory should be the table's directory"); + } + + public void testTableDoubleClick() { + frame.directoryTree.setSelectionRow(0); + frame.filesTable.changeSelection( 0, 0, false, false); + MouseEvent event = new MouseEvent( frame.filesTable, 0, 0, 0, 1, 1, 3, false); + MouseListener[] listeners = (MouseListener[])frame.filesTable.getListeners( MouseListener.class); + assertTrue( "Should be at least one listener", listeners.length > 0); + int num = 0; + for ( int i=0; i<listeners.length; i++) { + if ( listeners[i] instanceof CDCMainFrameController.TableMouseAdapter) num = i; + } + assertTrue( "Should have the TableMouseAdapter", num > 0); + listeners[ num].mouseClicked( event); + // do not know howto test mouse double click event. :( + assertTrue( "Selected row should not be 0 now" + frame.directoryTree.getSelectionRows()[0], frame.directoryTree.getSelectionRows()[0] != 0); } |
From: <sim...@us...> - 2002-07-29 08:42:43
|
Update of /cvsroot/cdchamber/CDChamber/src/org/cdchamber/gui In directory usw-pr-cvs1:/tmp/cvs-serv8574/src/org/cdchamber/gui Modified Files: CDCMainFrame.java CDCMainFrameController.java Log Message: Double click on table will change the selected path in tree. Index: CDCMainFrame.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/src/org/cdchamber/gui/CDCMainFrame.java,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** CDCMainFrame.java 29 Jul 2002 07:45:01 -0000 1.21 --- CDCMainFrame.java 29 Jul 2002 08:42:36 -0000 1.22 *************** *** 109,112 **** --- 109,113 ---- directoryTree.addTreeSelectionListener( controller); resultList.addListSelectionListener( controller); + filesTable.addMouseListener( controller.getTableMouseAdapter()); } Index: CDCMainFrameController.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/src/org/cdchamber/gui/CDCMainFrameController.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** CDCMainFrameController.java 29 Jul 2002 07:45:02 -0000 1.17 --- CDCMainFrameController.java 29 Jul 2002 08:42:36 -0000 1.18 *************** *** 18,23 **** import javax.swing.*; import java.io.*; ! import java.awt.event.ActionEvent; import java.util.Vector; public class CDCMainFrameController implements TreeSelectionListener, ListSelectionListener { --- 18,24 ---- import javax.swing.*; import java.io.*; ! import java.awt.event.*; import java.util.Vector; + import java.util.Enumeration; public class CDCMainFrameController implements TreeSelectionListener, ListSelectionListener { *************** *** 27,35 **** DirectoryType roots; ! public CDCMainFrameController( ICDCMainFrame frame) { this.frame = frame; roots = loadDataFiles(); ! frame.setDirectoryTreeModel( new FileTreeModel( roots)); ! frame.setFilesTableModel( new FilesTableModel( new DefaultMutableTreeNode(roots))); } --- 28,37 ---- DirectoryType roots; ! public CDCMainFrameController(ICDCMainFrame frame) { this.frame = frame; roots = loadDataFiles(); ! frame.setDirectoryTreeModel(new FileTreeModel(roots)); ! frame.setFilesTableModel(new FilesTableModel(new DefaultMutableTreeNode(roots))); ! selectedNode = (DefaultMutableTreeNode) frame.getDirectoryTree().getModel().getRoot(); } *************** *** 37,49 **** DirectoryType root = new DirectoryType(); ! File dataDir = new File( DirPath.DataDir); File[] rootFiles = dataDir.listFiles(); ! for ( int i=0; i<rootFiles.length; i++) { ! if ( rootFiles[i].isDirectory()) continue; try { ! DirectoryType vFiles = DirectoryType.unmarshalDirectoryType( new FileReader( rootFiles[i])); ! CDRomType cdrom = new CDRomType( vFiles); ! cdrom.setDataFileName( rootFiles[i].getAbsolutePath()); ! root.addFiles( cdrom); } catch (org.exolab.castor.xml.MarshalException e) { e.printStackTrace(); --- 39,51 ---- DirectoryType root = new DirectoryType(); ! File dataDir = new File(DirPath.DataDir); File[] rootFiles = dataDir.listFiles(); ! for (int i = 0; i < rootFiles.length; i++) { ! if (rootFiles[i].isDirectory()) continue; try { ! DirectoryType vFiles = DirectoryType.unmarshalDirectoryType(new FileReader(rootFiles[i])); ! CDRomType cdrom = new CDRomType(vFiles); ! cdrom.setDataFileName(rootFiles[i].getAbsolutePath()); ! root.addFiles(cdrom); } catch (org.exolab.castor.xml.MarshalException e) { e.printStackTrace(); *************** *** 55,59 **** } ! root.setName( "CDRoms"); return root; } --- 57,61 ---- } ! root.setName("CDRoms"); return root; } *************** *** 61,65 **** public void valueChanged(TreeSelectionEvent e) { ! JTree tree = (JTree)e.getSource(); DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent(); --- 63,67 ---- public void valueChanged(TreeSelectionEvent e) { ! JTree tree = (JTree) e.getSource(); DefaultMutableTreeNode node = (DefaultMutableTreeNode) tree.getLastSelectedPathComponent(); *************** *** 70,87 **** tree.expandPath(e.getNewLeadSelectionPath()); tree.scrollPathToVisible(e.getNewLeadSelectionPath()); ! frame.setFilesTableModel( new FilesTableModel(node)); } public void valueChanged(ListSelectionEvent e) { ! JList list = (JList)e.getSource(); ! SearchResult result = (SearchResult)list.getSelectedValue(); ! DefaultMutableTreeNode node = (DefaultMutableTreeNode)frame.getDirectoryTree().getModel().getRoot(); ! DefaultMutableTreeNode []nodes = new DefaultMutableTreeNode[ result.getPathDepth()]; nodes[0] = node; ! for ( int i=0; i<result.getPathDepth()-1; i++) { ! for ( int j=0; j<node.getChildCount(); j++) { ! DefaultMutableTreeNode childNode = (DefaultMutableTreeNode)node.getChildAt(j); ! if ( childNode.getUserObject() == result.getFileAt(i)) { ! nodes[i+1] = childNode; node = childNode; } --- 72,89 ---- tree.expandPath(e.getNewLeadSelectionPath()); tree.scrollPathToVisible(e.getNewLeadSelectionPath()); ! frame.setFilesTableModel(new FilesTableModel(node)); } public void valueChanged(ListSelectionEvent e) { ! JList list = (JList) e.getSource(); ! SearchResult result = (SearchResult) list.getSelectedValue(); ! DefaultMutableTreeNode node = (DefaultMutableTreeNode) frame.getDirectoryTree().getModel().getRoot(); ! DefaultMutableTreeNode[] nodes = new DefaultMutableTreeNode[result.getPathDepth()]; nodes[0] = node; ! for (int i = 0; i < result.getPathDepth() - 1; i++) { ! for (int j = 0; j < node.getChildCount(); j++) { ! DefaultMutableTreeNode childNode = (DefaultMutableTreeNode) node.getChildAt(j); ! if (childNode.getUserObject() == result.getFileAt(i)) { ! nodes[i + 1] = childNode; node = childNode; } *************** *** 94,102 **** JTable jTable = frame.getFilesTable(); for (int i = 0; i < jTable.getRowCount(); i++) { ! if ( result.getFileAt( result.getPathDepth()-1) == jTable.getValueAt(i, 0)) selected = i; } jTable.changeSelection(selected, 0, false, false); } public Action getCreateNewCDRomAction() { --- 96,107 ---- JTable jTable = frame.getFilesTable(); for (int i = 0; i < jTable.getRowCount(); i++) { ! if (result.getFileAt(result.getPathDepth() - 1) == jTable.getValueAt(i, 0)) selected = i; } jTable.changeSelection(selected, 0, false, false); } + public MouseAdapter getTableMouseAdapter() { + return new TableMouseAdapter(); + } public Action getCreateNewCDRomAction() { *************** *** 120,144 **** } public class CreateNewCDRomAction extends AbstractAction { public CreateNewCDRomAction() { ! putValue( Action.NAME, "Create"); ! putValue( Action.MNEMONIC_KEY, new Integer('C')); } public void actionPerformed(ActionEvent e) { String dirName = frame.getUserChoosedDirectory(); ! if ( dirName == null) return; DirectoryType dirType = new DirectoryType(); try { ! dirType.parse( dirName); String dataFileName = DirPath.DataDir + DirPath.SEP + System.currentTimeMillis() + ".xml"; ! FileWriter out = new FileWriter( dataFileName); ! dirType.marshal( out); out.close(); ! roots.addFiles( new CDRomType(dirType, dataFileName)); ! frame.setDirectoryTreeModel( new FileTreeModel( roots)); } catch (Exception e1) { ! frame.dealWithActionException( "Create New CDRom Error", e1); } --- 125,171 ---- } + public class TableMouseAdapter extends MouseAdapter { + public void mouseClicked(MouseEvent e) { + if (e.getClickCount() >= 2) { + FilesTableModel tableModel = (FilesTableModel) frame.getFilesTable().getModel(); + FileType fileType = tableModel.dir.getFiles(frame.getFilesTable().getSelectedRow()); + if (fileType instanceof DirectoryType) { + Enumeration enu = selectedNode.children(); + int count = 0; + while (enu.hasMoreElements()) { + DefaultMutableTreeNode next = (DefaultMutableTreeNode) enu.nextElement(); + + if (next.getUserObject() == fileType) break; + count++; + } + DefaultMutableTreeNode tn = (DefaultMutableTreeNode) selectedNode.getChildAt(count); + TreePath path = new TreePath(tn.getPath()); + frame.getDirectoryTree().setSelectionPath(path); + } + } + } + } + public class CreateNewCDRomAction extends AbstractAction { public CreateNewCDRomAction() { ! putValue(Action.NAME, "Create"); ! putValue(Action.MNEMONIC_KEY, new Integer('C')); } public void actionPerformed(ActionEvent e) { String dirName = frame.getUserChoosedDirectory(); ! if (dirName == null) return; DirectoryType dirType = new DirectoryType(); try { ! dirType.parse(dirName); String dataFileName = DirPath.DataDir + DirPath.SEP + System.currentTimeMillis() + ".xml"; ! FileWriter out = new FileWriter(dataFileName); ! dirType.marshal(out); out.close(); ! roots.addFiles(new CDRomType(dirType, dataFileName)); ! frame.setDirectoryTreeModel(new FileTreeModel(roots)); } catch (Exception e1) { ! frame.dealWithActionException("Create New CDRom Error", e1); } *************** *** 148,170 **** public class ImportCDRomAction extends AbstractAction { public ImportCDRomAction() { ! putValue( Action.NAME, "Import"); ! putValue( Action.MNEMONIC_KEY, new Integer('I')); } public void actionPerformed(ActionEvent e) { String fileName = frame.getUserChoosedDataFile(); ! if ( fileName == null) return; try { ! DirectoryType dirType = DirectoryType.unmarshalDirectoryType( new FileReader( fileName)); String dataFileName = DirPath.DataDir + DirPath.SEP + System.currentTimeMillis() + ".xml"; ! FileWriter out = new FileWriter( dataFileName); ! dirType.marshal( out); out.close(); ! roots.addFiles( new CDRomType(dirType, dataFileName)); ! frame.setDirectoryTreeModel( new FileTreeModel( roots)); } catch (Exception e1) { ! frame.dealWithActionException( "Can't import CDRom data", e1); } } --- 175,197 ---- public class ImportCDRomAction extends AbstractAction { public ImportCDRomAction() { ! putValue(Action.NAME, "Import"); ! putValue(Action.MNEMONIC_KEY, new Integer('I')); } public void actionPerformed(ActionEvent e) { String fileName = frame.getUserChoosedDataFile(); ! if (fileName == null) return; try { ! DirectoryType dirType = DirectoryType.unmarshalDirectoryType(new FileReader(fileName)); String dataFileName = DirPath.DataDir + DirPath.SEP + System.currentTimeMillis() + ".xml"; ! FileWriter out = new FileWriter(dataFileName); ! dirType.marshal(out); out.close(); ! roots.addFiles(new CDRomType(dirType, dataFileName)); ! frame.setDirectoryTreeModel(new FileTreeModel(roots)); } catch (Exception e1) { ! frame.dealWithActionException("Can't import CDRom data", e1); } } *************** *** 173,189 **** public class DeleteCDRomAction extends AbstractAction { public DeleteCDRomAction() { ! putValue( Action.NAME, "Delete"); ! putValue( Action.MNEMONIC_KEY, new Integer('D')); } public void actionPerformed(ActionEvent e) { ! if ( selectedNode == null) return; ! if ( selectedNode.isRoot()) return; ! DefaultMutableTreeNode cdromNode = (DefaultMutableTreeNode)selectedNode.getPath()[1]; ! CDRomType cdrom = (CDRomType)( cdromNode.getUserObject()); cdrom.delete(); ! roots.removeFiles( cdrom); ! frame.setDirectoryTreeModel( new FileTreeModel( loadDataFiles())); } } --- 200,216 ---- public class DeleteCDRomAction extends AbstractAction { public DeleteCDRomAction() { ! putValue(Action.NAME, "Delete"); ! putValue(Action.MNEMONIC_KEY, new Integer('D')); } public void actionPerformed(ActionEvent e) { ! if (selectedNode == null) return; ! if (selectedNode.isRoot()) return; ! DefaultMutableTreeNode cdromNode = (DefaultMutableTreeNode) selectedNode.getPath()[1]; ! CDRomType cdrom = (CDRomType) (cdromNode.getUserObject()); cdrom.delete(); ! roots.removeFiles(cdrom); ! frame.setDirectoryTreeModel(new FileTreeModel(loadDataFiles())); } } *************** *** 191,208 **** public class SaveCDRomAction extends AbstractAction { public SaveCDRomAction() { ! putValue( Action.NAME, "Save"); ! putValue( Action.MNEMONIC_KEY, new Integer('S')); } public void actionPerformed(ActionEvent e) { ! if ( selectedNode == null) return; ! if ( selectedNode.isRoot()) return; ! DefaultMutableTreeNode cdromNode = (DefaultMutableTreeNode)selectedNode.getPath()[1]; ! CDRomType cdrom = (CDRomType)( cdromNode.getUserObject()); try { cdrom.marshal(); ! } catch ( Exception e1) { ! frame.dealWithActionException( "Can't save cdrom file.", e1); } } --- 218,235 ---- public class SaveCDRomAction extends AbstractAction { public SaveCDRomAction() { ! putValue(Action.NAME, "Save"); ! putValue(Action.MNEMONIC_KEY, new Integer('S')); } public void actionPerformed(ActionEvent e) { ! if (selectedNode == null) return; ! if (selectedNode.isRoot()) return; ! DefaultMutableTreeNode cdromNode = (DefaultMutableTreeNode) selectedNode.getPath()[1]; ! CDRomType cdrom = (CDRomType) (cdromNode.getUserObject()); try { cdrom.marshal(); ! } catch (Exception e1) { ! frame.dealWithActionException("Can't save cdrom file.", e1); } } *************** *** 211,224 **** public class SearchCDRomAction extends AbstractAction { public SearchCDRomAction() { ! putValue( Action.NAME, "Search"); ! putValue( Action.MNEMONIC_KEY, new Integer('e')); } public void actionPerformed(ActionEvent e) { Searcher searcher = frame.getSearcher(); ! if ( searcher.getQueryCount() == 0) return; ! Vector result = searcher.search( roots.getFiles()); ! frame.setResultListData( result); } } --- 238,251 ---- public class SearchCDRomAction extends AbstractAction { public SearchCDRomAction() { ! putValue(Action.NAME, "Search"); ! putValue(Action.MNEMONIC_KEY, new Integer('e')); } public void actionPerformed(ActionEvent e) { Searcher searcher = frame.getSearcher(); ! if (searcher.getQueryCount() == 0) return; ! Vector result = searcher.search(roots.getFiles()); ! frame.setResultListData(result); } } |
From: <sim...@us...> - 2002-07-29 08:42:43
|
Update of /cvsroot/cdchamber/CDChamber In directory usw-pr-cvs1:/tmp/cvs-serv8574 Modified Files: TODO.txt Log Message: Double click on table will change the selected path in tree. Index: TODO.txt =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/TODO.txt,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** TODO.txt 29 Jul 2002 07:23:42 -0000 1.14 --- TODO.txt 29 Jul 2002 08:42:35 -0000 1.15 *************** *** 12,16 **** x : Add filter to ignore files/dirs like CVS, *.bak, *~, etc. x : GUI codes need refactored ! + : Search result should contains the whole path message.. + : GUI need to be made more beautiful and friendly. + : Release one alpha version --- 12,17 ---- x : Add filter to ignore files/dirs like CVS, *.bak, *~, etc. x : GUI codes need refactored ! x : Search result should contains the whole path message.. ! x : Double click on files table should open the directory(If it is). + : GUI need to be made more beautiful and friendly. + : Release one alpha version |
From: <sim...@us...> - 2002-07-29 07:45:05
|
Update of /cvsroot/cdchamber/CDChamber/src/org/cdchamber/gui In directory usw-pr-cvs1:/tmp/cvs-serv14972/src/org/cdchamber/gui Modified Files: CDCMainFrame.java CDCMainFrameController.java ICDCMainFrame.java Log Message: Add testcases to test list changed event. Index: CDCMainFrame.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/src/org/cdchamber/gui/CDCMainFrame.java,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** CDCMainFrame.java 29 Jul 2002 07:23:43 -0000 1.20 --- CDCMainFrame.java 29 Jul 2002 07:45:01 -0000 1.21 *************** *** 172,174 **** --- 172,178 ---- } + public JTable getFilesTable() { + return filesTable; + } + } Index: CDCMainFrameController.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/src/org/cdchamber/gui/CDCMainFrameController.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** CDCMainFrameController.java 29 Jul 2002 07:23:43 -0000 1.16 --- CDCMainFrameController.java 29 Jul 2002 07:45:02 -0000 1.17 *************** *** 89,93 **** } frame.getDirectoryTree().setSelectionPath(new TreePath(nodes)); ! // set table selection } --- 89,100 ---- } frame.getDirectoryTree().setSelectionPath(new TreePath(nodes)); ! ! ! int selected = -1; ! JTable jTable = frame.getFilesTable(); ! for (int i = 0; i < jTable.getRowCount(); i++) { ! if ( result.getFileAt( result.getPathDepth()-1) == jTable.getValueAt(i, 0)) selected = i; ! } ! jTable.changeSelection(selected, 0, false, false); } Index: ICDCMainFrame.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/src/org/cdchamber/gui/ICDCMainFrame.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ICDCMainFrame.java 29 Jul 2002 07:23:43 -0000 1.5 --- ICDCMainFrame.java 29 Jul 2002 07:45:02 -0000 1.6 *************** *** 59,61 **** --- 59,63 ---- public JTree getDirectoryTree(); + + public JTable getFilesTable(); } |
From: <sim...@us...> - 2002-07-29 07:45:05
|
Update of /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/gui In directory usw-pr-cvs1:/tmp/cvs-serv14972/test/src/org/cdchamber/gui Modified Files: CDCMainFrameControllerTest.java CDCMainFrameTest.java Log Message: Add testcases to test list changed event. Index: CDCMainFrameControllerTest.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/gui/CDCMainFrameControllerTest.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** CDCMainFrameControllerTest.java 29 Jul 2002 07:23:43 -0000 1.14 --- CDCMainFrameControllerTest.java 29 Jul 2002 07:45:02 -0000 1.15 *************** *** 228,230 **** --- 228,234 ---- } + public JTable getFilesTable() { + return null; + } + } Index: CDCMainFrameTest.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/gui/CDCMainFrameTest.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** CDCMainFrameTest.java 26 Jul 2002 05:02:06 -0000 1.11 --- CDCMainFrameTest.java 29 Jul 2002 07:45:02 -0000 1.12 *************** *** 11,14 **** --- 11,15 ---- import org.cdchamber.elements.FileType; import org.cdchamber.util.DirPath; + import org.cdchamber.searcher.SearchResult; import javax.swing.tree.DefaultMutableTreeNode; *************** *** 77,80 **** --- 78,95 ---- FilesTableModel tableModel = (FilesTableModel)frame.filesTable.getModel(); if ( !selected.equals( tableModel.getDir())) fail( "The selected directory should be the table's directory"); + } + + public void testListSelectedChanged() { + Vector result = new Vector(); + frame.directoryTree.setSelectionRow(1); + TreePath path = frame.directoryTree.getSelectionPath(); + Object selected = ((DefaultMutableTreeNode)path.getLastPathComponent()).getUserObject(); + result.addElement( new SearchResult( (FileType)selected)); + + frame.resultList.setListData( result); + frame.resultList.setSelectedIndex(0); + + assertEquals( "Root should be selected", 0, frame.directoryTree.getSelectionModel().getLeadSelectionRow()); + assertEquals( "First file in table be selected", 0, frame.filesTable.getSelectedRow()); } |
From: <sim...@us...> - 2002-07-29 07:23:49
|
Update of /cvsroot/cdchamber/CDChamber/src/org/cdchamber/gui In directory usw-pr-cvs1:/tmp/cvs-serv32053/src/org/cdchamber/gui Modified Files: CDCMainFrame.java CDCMainFrameController.java ICDCMainFrame.java Log Message: Select on search result will be reflect on the jlist Index: CDCMainFrame.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/src/org/cdchamber/gui/CDCMainFrame.java,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** CDCMainFrame.java 26 Jul 2002 06:56:57 -0000 1.19 --- CDCMainFrame.java 29 Jul 2002 07:23:43 -0000 1.20 *************** *** 19,23 **** public class CDCMainFrame extends JFrame implements ICDCMainFrame { JPanel contentPane; - BorderLayout borderLayout1 = new BorderLayout(); JMenuBar mainMenu = new JMenuBar(); JMenu cdromMenu = new JMenu(); --- 19,22 ---- *************** *** 89,93 **** contentPane = (JPanel) this.getContentPane(); ! contentPane.setLayout(borderLayout1); contentPane.add( BorderLayout.CENTER, realMainPane); --- 88,92 ---- contentPane = (JPanel) this.getContentPane(); ! contentPane.setLayout(new BorderLayout()); contentPane.add( BorderLayout.CENTER, realMainPane); *************** *** 109,112 **** --- 108,112 ---- directoryTree.addTreeSelectionListener( controller); + resultList.addListSelectionListener( controller); } *************** *** 166,169 **** --- 166,173 ---- CDChamber.showWinowAtCenter( searchDialog); return searchDialog.searcher; + } + + public JTree getDirectoryTree() { + return directoryTree; } Index: CDCMainFrameController.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/src/org/cdchamber/gui/CDCMainFrameController.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** CDCMainFrameController.java 26 Jul 2002 14:00:47 -0000 1.15 --- CDCMainFrameController.java 29 Jul 2002 07:23:43 -0000 1.16 *************** *** 7,20 **** package org.cdchamber.gui; ! import org.cdchamber.elements.DirectoryType; ! import org.cdchamber.elements.CDRomType; import org.cdchamber.util.DirPath; import org.cdchamber.searcher.Searcher; import org.exolab.castor.xml.MarshalException; import org.exolab.castor.xml.ValidationException; ! import javax.swing.event.TreeSelectionEvent; ! import javax.swing.event.TreeSelectionListener; ! import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.*; import java.io.*; --- 7,19 ---- package org.cdchamber.gui; ! import org.cdchamber.elements.*; import org.cdchamber.util.DirPath; import org.cdchamber.searcher.Searcher; + import org.cdchamber.searcher.SearchResult; import org.exolab.castor.xml.MarshalException; import org.exolab.castor.xml.ValidationException; ! import javax.swing.event.*; ! import javax.swing.tree.*; import javax.swing.*; import java.io.*; *************** *** 22,26 **** import java.util.Vector; ! public class CDCMainFrameController implements TreeSelectionListener { ICDCMainFrame frame; --- 21,25 ---- import java.util.Vector; ! public class CDCMainFrameController implements TreeSelectionListener, ListSelectionListener { ICDCMainFrame frame; *************** *** 69,76 **** if (node == null) return; ! if (!node.isLeaf()) tree.expandPath(e.getNewLeadSelectionPath()); frame.setFilesTableModel( new FilesTableModel(node)); } public Action getCreateNewCDRomAction() { return new CreateNewCDRomAction(); --- 68,96 ---- if (node == null) return; ! tree.expandPath(e.getNewLeadSelectionPath()); ! tree.scrollPathToVisible(e.getNewLeadSelectionPath()); frame.setFilesTableModel( new FilesTableModel(node)); } + public void valueChanged(ListSelectionEvent e) { + JList list = (JList)e.getSource(); + SearchResult result = (SearchResult)list.getSelectedValue(); + DefaultMutableTreeNode node = (DefaultMutableTreeNode)frame.getDirectoryTree().getModel().getRoot(); + DefaultMutableTreeNode []nodes = new DefaultMutableTreeNode[ result.getPathDepth()]; + nodes[0] = node; + for ( int i=0; i<result.getPathDepth()-1; i++) { + for ( int j=0; j<node.getChildCount(); j++) { + DefaultMutableTreeNode childNode = (DefaultMutableTreeNode)node.getChildAt(j); + if ( childNode.getUserObject() == result.getFileAt(i)) { + nodes[i+1] = childNode; + node = childNode; + } + } + } + frame.getDirectoryTree().setSelectionPath(new TreePath(nodes)); + // set table selection + } + + public Action getCreateNewCDRomAction() { return new CreateNewCDRomAction(); *************** *** 196,199 **** } } - } --- 216,218 ---- Index: ICDCMainFrame.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/src/org/cdchamber/gui/ICDCMainFrame.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ICDCMainFrame.java 26 Jul 2002 06:56:57 -0000 1.4 --- ICDCMainFrame.java 29 Jul 2002 07:23:43 -0000 1.5 *************** *** 9,12 **** --- 9,13 ---- import javax.swing.table.TableModel; import javax.swing.tree.TreeModel; + import javax.swing.*; import java.util.Vector; *************** *** 56,58 **** --- 57,61 ---- */ public Searcher getSearcher(); + + public JTree getDirectoryTree(); } |
From: <sim...@us...> - 2002-07-29 07:23:49
|
Update of /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/gui In directory usw-pr-cvs1:/tmp/cvs-serv32053/test/src/org/cdchamber/gui Modified Files: CDCMainFrameControllerTest.java Log Message: Select on search result will be reflect on the jlist Index: CDCMainFrameControllerTest.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/gui/CDCMainFrameControllerTest.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** CDCMainFrameControllerTest.java 26 Jul 2002 06:56:58 -0000 1.13 --- CDCMainFrameControllerTest.java 29 Jul 2002 07:23:43 -0000 1.14 *************** *** 224,226 **** --- 224,230 ---- } + public JTree getDirectoryTree() { + return null; + } + } |
From: <sim...@us...> - 2002-07-29 07:23:49
|
Update of /cvsroot/cdchamber/CDChamber/src/org/cdchamber/searcher In directory usw-pr-cvs1:/tmp/cvs-serv32053/src/org/cdchamber/searcher Modified Files: Searcher.java Added Files: SearchResult.java Log Message: Select on search result will be reflect on the jlist --- NEW FILE: SearchResult.java --- /* * User: Simon * $Id: SearchResult.java,v 1.1 2002/07/29 07:23:43 simon_lei Exp $ */ package org.cdchamber.searcher; import org.cdchamber.elements.FileType; import java.util.Vector; public class SearchResult { private Vector resultPath = new Vector(); public SearchResult( SearchResult result, FileType fileType) { resultPath.addAll( result.resultPath); resultPath.addElement( fileType); } public SearchResult( FileType fileType) { resultPath.addElement( fileType); } public SearchResult() { } public int getPathDepth() { return resultPath.size(); } public FileType getFileAt( int i) { return (FileType) resultPath.elementAt(i); } public String toString() { StringBuffer strBuff = new StringBuffer(); for (int i = 0; i < resultPath.size(); i++) { strBuff.append( "/"); FileType fileType = (FileType) resultPath.elementAt(i); strBuff.append( fileType.getName()); } return strBuff.toString(); } } Index: Searcher.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/src/org/cdchamber/searcher/Searcher.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Searcher.java 26 Jul 2002 09:19:18 -0000 1.6 --- Searcher.java 29 Jul 2002 07:23:43 -0000 1.7 *************** *** 26,29 **** --- 26,34 ---- public Vector search(FileType[] fileTypes) { + SearchResult searchResult = new SearchResult(); + return search( fileTypes, searchResult); + + } + public Vector search( FileType[] fileTypes, SearchResult searchResult) { Vector result = new Vector(); if ( queries.size() == 0) return result; *************** *** 34,41 **** if ( !query.isMatched( fileTypes[i])) matched=false; } ! if ( matched) result.add( fileTypes[i]); if ( fileTypes[i] instanceof DirectoryType) { DirectoryType dir = (DirectoryType) fileTypes[i]; ! result.addAll( search( dir.getFiles())); } } --- 39,46 ---- if ( !query.isMatched( fileTypes[i])) matched=false; } ! if ( matched) result.add( new SearchResult( searchResult, fileTypes[i])); if ( fileTypes[i] instanceof DirectoryType) { DirectoryType dir = (DirectoryType) fileTypes[i]; ! result.addAll( search( dir.getFiles(), new SearchResult( searchResult, dir))); } } *************** *** 43,46 **** return result; } - } --- 48,50 ---- |
From: <sim...@us...> - 2002-07-29 07:23:49
|
Update of /cvsroot/cdchamber/CDChamber In directory usw-pr-cvs1:/tmp/cvs-serv32053 Modified Files: TODO.txt Log Message: Select on search result will be reflect on the jlist Index: TODO.txt =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/TODO.txt,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** TODO.txt 28 Jul 2002 13:41:27 -0000 1.13 --- TODO.txt 29 Jul 2002 07:23:42 -0000 1.14 *************** *** 10,13 **** x : Add GUI Testcases x : Solve the chinese problem of Jar files. ! + : Add filter to ignore files/dirs like CVS, *.bak, *~, etc. ! + : GUI codes need refactored. --- 10,16 ---- x : Add GUI Testcases x : Solve the chinese problem of Jar files. ! x : Add filter to ignore files/dirs like CVS, *.bak, *~, etc. ! x : GUI codes need refactored ! + : Search result should contains the whole path message.. ! + : GUI need to be made more beautiful and friendly. ! + : Release one alpha version \ No newline at end of file |