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-25 09:48:47
|
Update of /cvsroot/cdchamber/CDChamber/src/org/cdchamber/searcher In directory usw-pr-cvs1:/tmp/cvs-serv7511/src/org/cdchamber/searcher Modified Files: StandardQuery.java Added Files: AdvanceQuery.java Log Message: Add advance query. --- NEW FILE: AdvanceQuery.java --- /* * User: Simon * $Id: AdvanceQuery.java,v 1.1 2002/07/25 09:48:44 simon_lei Exp $ */ package org.cdchamber.searcher; import org.cdchamber.elements.FileType; public class AdvanceQuery extends StandardQuery { private boolean noDesc; private boolean caseSense; private String queryString; public AdvanceQuery( boolean noDesc, boolean caseSense, String queryString) { super( queryString); this.noDesc = noDesc; this.caseSense = caseSense; this.queryString = queryString; } public boolean isMatched(FileType filetype) { if ( noDesc) { return super.matched( filetype.getName(), queryString, caseSense); } if ( caseSense) { if ( super.matched( filetype.getName(), queryString, caseSense)) return true; if ( super.matched( filetype.getDesc(), queryString, caseSense)) return true; return false; } return super.isMatched( filetype); } } Index: StandardQuery.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/src/org/cdchamber/searcher/StandardQuery.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StandardQuery.java 25 Jul 2002 09:11:08 -0000 1.1 --- StandardQuery.java 25 Jul 2002 09:48:44 -0000 1.2 *************** *** 15,20 **** } ! public boolean matched( String str, String queryString) { if ( str == null) return false; if ( str.indexOf( queryString) != -1) return true; return false; --- 15,25 ---- } ! public boolean matched( String str, String queryString, boolean caseSense) { if ( str == null) return false; + if ( !caseSense) { + if ( str.toLowerCase().indexOf( queryString.toLowerCase()) != -1) return true; + return false; + } + if ( str.indexOf( queryString) != -1) return true; return false; *************** *** 22,28 **** public boolean isMatched(FileType filetype) { ! ! if ( matched( filetype.getName(), queryString)) return true; ! if ( matched( filetype.getDesc(), queryString)) return true; return false; } --- 27,32 ---- public boolean isMatched(FileType filetype) { ! if ( matched( filetype.getName(), queryString, false)) return true; ! if ( matched( filetype.getDesc(), queryString, false)) return true; return false; } |
From: <sim...@us...> - 2002-07-25 09:48:47
|
Update of /cvsroot/cdchamber/CDChamber/src/org/cdchamber/gui In directory usw-pr-cvs1:/tmp/cvs-serv7511/src/org/cdchamber/gui Modified Files: SearchDialog.java Log Message: Add advance query. Index: SearchDialog.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/src/org/cdchamber/gui/SearchDialog.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** SearchDialog.java 24 Jul 2002 08:04:57 -0000 1.3 --- SearchDialog.java 25 Jul 2002 09:48:44 -0000 1.4 *************** *** 47,51 **** JPanel jPanelAdvance = new JPanel(); JCheckBox jCheckAdvance = new JCheckBox(); ! private JCheckBox jCheckrecursive = new JCheckBox(); private JCheckBox jCheckCaseSensitive = new JCheckBox(); --- 47,51 ---- JPanel jPanelAdvance = new JPanel(); JCheckBox jCheckAdvance = new JCheckBox(); ! private JCheckBox jCheckNoDesc = new JCheckBox(); private JCheckBox jCheckCaseSensitive = new JCheckBox(); *************** *** 184,193 **** jCheckAdvance.setText("Advance:"); ! jCheckrecursive.setText("Include Subdir"); jCheckCaseSensitive.setText("Case sensitive"); initFlowLayout(flowLayout4); jPanelAdvance.setLayout(flowLayout4); jPanelAdvance.add(jCheckCaseSensitive, null); ! jPanelAdvance.add(jCheckrecursive, null); } --- 184,193 ---- jCheckAdvance.setText("Advance:"); ! jCheckNoDesc.setText("No Describe"); jCheckCaseSensitive.setText("Case sensitive"); initFlowLayout(flowLayout4); jPanelAdvance.setLayout(flowLayout4); jPanelAdvance.add(jCheckCaseSensitive, null); ! jPanelAdvance.add(jCheckNoDesc, null); } |
From: <sim...@us...> - 2002-07-25 09:11:14
|
Update of /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/searcher In directory usw-pr-cvs1:/tmp/cvs-serv30114/test/src/org/cdchamber/searcher Added Files: StandardQueryTest.java Log Message: Add standard query --- NEW FILE: StandardQueryTest.java --- /* * User: Simon * $Id: StandardQueryTest.java,v 1.1 2002/07/25 09:11:08 simon_lei Exp $ */ package org.cdchamber.searcher; import junit.framework.TestCase; import org.cdchamber.elements.FileType; public class StandardQueryTest extends TestCase { protected void setUp() throws Exception { super.setUp(); fileType = new FileType(); } protected void tearDown() throws Exception { super.tearDown(); } public StandardQueryTest(String s) { super(s); } private FileType fileType; StandardQuery query = new StandardQuery( "abc"); public void testNameContains() { fileType.setName( "nameisabcdefg"); assertTrue( "Name contains abc", query.isMatched( fileType)); } public void testDescContains() { fileType.setDesc( "nameisabcdefg"); assertTrue( "Desc contains abc", query.isMatched( fileType)); } public void testNotContains() { assertTrue( "Not contains abc", !query.isMatched( fileType)); } } |
From: <sim...@us...> - 2002-07-25 09:11:14
|
Update of /cvsroot/cdchamber/CDChamber/src/org/cdchamber/searcher In directory usw-pr-cvs1:/tmp/cvs-serv30114/src/org/cdchamber/searcher Added Files: StandardQuery.java Log Message: Add standard query --- NEW FILE: StandardQuery.java --- /* * User: Simon * $Id: StandardQuery.java,v 1.1 2002/07/25 09:11:08 simon_lei Exp $ */ package org.cdchamber.searcher; import org.cdchamber.elements.FileType; public class StandardQuery implements IQueryCondition { private String queryString; public StandardQuery( String query) { this.queryString = query; } public boolean matched( String str, String queryString) { if ( str == null) return false; if ( str.indexOf( queryString) != -1) return true; return false; } public boolean isMatched(FileType filetype) { if ( matched( filetype.getName(), queryString)) return true; if ( matched( filetype.getDesc(), queryString)) return true; return false; } } |
From: <sim...@us...> - 2002-07-25 08:32:29
|
Update of /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/searcher In directory usw-pr-cvs1:/tmp/cvs-serv18330/test/src/org/cdchamber/searcher Modified Files: ScopeQueryTest.java Log Message: Add the scope query, and fix the build. Index: ScopeQueryTest.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/searcher/ScopeQueryTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ScopeQueryTest.java 25 Jul 2002 08:25:45 -0000 1.1 --- ScopeQueryTest.java 25 Jul 2002 08:32:27 -0000 1.2 *************** *** 6,11 **** import junit.framework.TestCase; ! import org.cdchamber.elements.FileType; ! import org.cdchamber.elements.CDRomType; public class ScopeQueryTest extends TestCase { --- 6,10 ---- import junit.framework.TestCase; ! import org.cdchamber.elements.*; public class ScopeQueryTest extends TestCase { *************** *** 26,29 **** --- 25,40 ---- public void testCDRom() { ScopeQuery query = new ScopeQuery( CDRomType.class); + fileType = new CDRomType( new DirectoryType()); + assertTrue( "It's a cdrom", query.isMatched( fileType)); + fileType = new FileType(); + assertTrue( "It's not a cdrom", !query.isMatched( fileType)); + } + + public void testDirType() { + ScopeQuery query = new ScopeQuery( DirectoryType.class); + fileType = new DirectoryType(); + assertTrue( "It's a dir", query.isMatched( fileType)); + fileType = new FileType(); + assertTrue( "It's not a dir", !query.isMatched( fileType)); } } |
From: <sim...@us...> - 2002-07-25 08:32:29
|
Update of /cvsroot/cdchamber/CDChamber/src/org/cdchamber/searcher In directory usw-pr-cvs1:/tmp/cvs-serv18330/src/org/cdchamber/searcher Added Files: ScopeQuery.java Log Message: Add the scope query, and fix the build. --- NEW FILE: ScopeQuery.java --- /* * User: Simon * $Id: ScopeQuery.java,v 1.1 2002/07/25 08:32:27 simon_lei Exp $ */ package org.cdchamber.searcher; import org.cdchamber.elements.FileType; public class ScopeQuery implements IQueryCondition { private Class scope; public ScopeQuery( Class scope) { this.scope = scope; } public boolean isMatched(FileType filetype) { if ( filetype.getClass().equals( scope)) return true; return false; } } |
From: <sim...@us...> - 2002-07-25 08:25:48
|
Update of /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/searcher In directory usw-pr-cvs1:/tmp/cvs-serv15975/test/src/org/cdchamber/searcher Added Files: ScopeQueryTest.java Log Message: Add the scope query testcase, and test the fail message of the continuous integrate server. --- NEW FILE: ScopeQueryTest.java --- /* * User: Simon * $Id: ScopeQueryTest.java,v 1.1 2002/07/25 08:25:45 simon_lei Exp $ */ package org.cdchamber.searcher; import junit.framework.TestCase; import org.cdchamber.elements.FileType; import org.cdchamber.elements.CDRomType; public class ScopeQueryTest extends TestCase { protected void setUp() throws Exception { super.setUp(); } protected void tearDown() throws Exception { super.tearDown(); } public ScopeQueryTest(String s) { super(s); } private FileType fileType; public void testCDRom() { ScopeQuery query = new ScopeQuery( CDRomType.class); } } |
From: <sim...@us...> - 2002-07-25 08:23:14
|
Update of /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/searcher In directory usw-pr-cvs1:/tmp/cvs-serv15117/test/src/org/cdchamber/searcher Added Files: SizeQueryTest.java Log Message: Add size query condition. --- NEW FILE: SizeQueryTest.java --- /* * User: Simon * $Id: SizeQueryTest.java,v 1.1 2002/07/25 08:23:11 simon_lei Exp $ */ package org.cdchamber.searcher; import junit.framework.TestCase; import org.cdchamber.elements.FileType; public class SizeQueryTest extends TestCase { protected void setUp() throws Exception { super.setUp(); fileType.setSize( 300); } protected void tearDown() throws Exception { super.tearDown(); } public SizeQueryTest(String s) { super(s); } FileType fileType = new FileType(); public void testAtLeast() { SizeQuery query = new SizeQuery( 400, -1); assertTrue( "Should not pass atLeast", !query.isMatched( fileType)); } public void testAtMost() { SizeQuery query = new SizeQuery( -1, 200); assertTrue( "Should not pass atMost", !query.isMatched( fileType)); } public void testBetween() { SizeQuery query = new SizeQuery( 200, 300); assertTrue( "Should pass", query.isMatched( fileType)); } } |
From: <sim...@us...> - 2002-07-25 08:23:14
|
Update of /cvsroot/cdchamber/CDChamber/src/org/cdchamber/searcher In directory usw-pr-cvs1:/tmp/cvs-serv15117/src/org/cdchamber/searcher Added Files: SizeQuery.java Log Message: Add size query condition. --- NEW FILE: SizeQuery.java --- /* * User: Simon * $Id: SizeQuery.java,v 1.1 2002/07/25 08:23:11 simon_lei Exp $ */ package org.cdchamber.searcher; import org.cdchamber.elements.FileType; public class SizeQuery implements IQueryCondition { private long atLeast; private long atMost; public SizeQuery( long atLeast, long atMost) { this.atLeast = atLeast; this.atMost = atMost; } public boolean isMatched(FileType filetype) { long size = filetype.getSize(); if ( atLeast>0 && size < atLeast) return false; if ( atMost>0 && size > atMost ) return false; return true; } } |
From: <sim...@us...> - 2002-07-25 08:13:05
|
Update of /cvsroot/cdchamber/CDChamber/src/org/cdchamber/searcher In directory usw-pr-cvs1:/tmp/cvs-serv12551/src/org/cdchamber/searcher Added Files: DateQuery.java IQueryCondition.java Log Message: Add query conditions. --- NEW FILE: DateQuery.java --- /* * User: Simon * $Id: DateQuery.java,v 1.1 2002/07/25 08:13:01 simon_lei Exp $ */ package org.cdchamber.searcher; import org.cdchamber.elements.FileType; import java.util.Date; public class DateQuery implements IQueryCondition { private Date beginDate; private Date endDate; public DateQuery( Date beginDate, Date endDate) { this.beginDate = beginDate; this.endDate = endDate; } public boolean isMatched(FileType filetype) { long fileTime = filetype.getDate(); if ( (fileTime<=endDate.getTime()) && (fileTime>=beginDate.getTime())) return true; if ( (fileTime>=endDate.getTime()) && (fileTime<=beginDate.getTime())) return true; return false; } } --- NEW FILE: IQueryCondition.java --- /* * User: Simon * $Id: IQueryCondition.java,v 1.1 2002/07/25 08:13:01 simon_lei Exp $ */ package org.cdchamber.searcher; import org.cdchamber.elements.FileType; public interface IQueryCondition { public boolean isMatched( FileType filetype); } |
From: <sim...@us...> - 2002-07-25 08:13:05
|
Update of /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/searcher In directory usw-pr-cvs1:/tmp/cvs-serv12551/test/src/org/cdchamber/searcher Added Files: DateQueryTest.java Log Message: Add query conditions. --- NEW FILE: DateQueryTest.java --- /* * User: Simon * $Id: DateQueryTest.java,v 1.1 2002/07/25 08:13:01 simon_lei Exp $ */ package org.cdchamber.searcher; import junit.framework.TestCase; import org.cdchamber.elements.FileType; import java.util.Calendar; public class DateQueryTest extends TestCase { protected void setUp() throws Exception { super.setUp(); calendar.set( 2002, 7, 25); fileType.setDate( calendar.getTime().getTime()); } protected void tearDown() throws Exception { super.tearDown(); } public DateQueryTest(String s) { super(s); } FileType fileType = new FileType(); Calendar calendar = Calendar.getInstance(); Calendar beginTime = Calendar.getInstance(); Calendar endTime = Calendar.getInstance(); public void testAllBefore() { beginTime.set( 2002, 6, 23); endTime.set( 2002, 7, 23); DateQuery query = new DateQuery( beginTime.getTime(), endTime.getTime()); assertTrue( "Should not matched1", !query.isMatched( fileType)); } public void testAllAfter() { beginTime.set( 2002, 7, 26); endTime.set( 2002, 8, 23); DateQuery query = new DateQuery( endTime.getTime(), beginTime.getTime()); assertTrue( "Should not matched2", !query.isMatched( fileType)); } public void testBetween() { beginTime.set( 2002, 7, 23); endTime.set( 2002, 8, 23); DateQuery query = new DateQuery( endTime.getTime(), beginTime.getTime()); assertTrue( "Should match1", query.isMatched( fileType)); query = new DateQuery( beginTime.getTime(), endTime.getTime()); assertTrue( "Should match2", query.isMatched( fileType)); } } |
From: <sim...@us...> - 2002-07-25 08:01:27
|
Update of /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/searcher In directory usw-pr-cvs1:/tmp/cvs-serv9464/searcher Log Message: Directory /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/searcher added to the repository |
From: <sim...@us...> - 2002-07-25 07:54:49
|
Update of /cvsroot/cdchamber/CDChamber/src/org/cdchamber/searcher In directory usw-pr-cvs1:/tmp/cvs-serv7769/searcher Log Message: Directory /cvsroot/cdchamber/CDChamber/src/org/cdchamber/searcher added to the repository |
From: <sim...@us...> - 2002-07-24 08:05:01
|
Update of /cvsroot/cdchamber/CDChamber/src/org/cdchamber/gui In directory usw-pr-cvs1:/tmp/cvs-serv17681/src/org/cdchamber/gui Modified Files: CDCMainFrame.java CDCMainFrameController.java SearchDialog.java Log Message: Add search dialog and search action in Main Frame. Index: CDCMainFrame.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/src/org/cdchamber/gui/CDCMainFrame.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** CDCMainFrame.java 21 Jul 2002 12:06:25 -0000 1.17 --- CDCMainFrame.java 24 Jul 2002 08:04:57 -0000 1.18 *************** *** 23,26 **** --- 23,27 ---- JMenuItem cdromDeleteMenuItem = new JMenuItem(); JMenuItem cdromSaveMenuItem = new JMenuItem(); + JMenuItem cdromSearchMenuItem = new JMenuItem(); JMenu helpMenu = new JMenu(); JMenuItem helpAboutMenuItem = new JMenuItem(); *************** *** 106,109 **** --- 107,111 ---- cdromDeleteMenuItem.setAction( controller.getDeleteCDRomAction()); cdromSaveMenuItem.setAction( controller.getSaveCDRomAction()); + cdromSearchMenuItem.setAction( controller.getSearchCDRomAction()); helpMenu.setMnemonic('H'); helpMenu.setText("Help"); *************** *** 123,126 **** --- 125,129 ---- cdromMenu.add(cdromDeleteMenuItem); cdromMenu.add(cdromSaveMenuItem); + cdromMenu.add(cdromSearchMenuItem); helpMenu.add(helpAboutMenuItem); cdromMenu.addSeparator(); Index: CDCMainFrameController.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/src/org/cdchamber/gui/CDCMainFrameController.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** CDCMainFrameController.java 22 Jul 2002 06:45:19 -0000 1.10 --- CDCMainFrameController.java 24 Jul 2002 08:04:57 -0000 1.11 *************** *** 81,84 **** --- 81,88 ---- } + public Action getSearchCDRomAction() { + return new SearchCDRomAction(); + } + public class CreateNewCDRomAction extends AbstractAction { public CreateNewCDRomAction() { *************** *** 159,162 **** --- 163,179 ---- frame.dealWithActionException( "Can't save cdrom file.", e1); } + } + } + + SearchDialog searchDialog = new SearchDialog(); + public class SearchCDRomAction extends AbstractAction { + public SearchCDRomAction() { + putValue( Action.NAME, "Search"); + putValue( Action.MNEMONIC_KEY, new Integer('e')); + } + + public void actionPerformed(ActionEvent e) { + searchDialog.setSize(500, 300); + CDChamber.showWinowAtCenter( searchDialog); } } Index: SearchDialog.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/src/org/cdchamber/gui/SearchDialog.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SearchDialog.java 24 Jul 2002 04:30:41 -0000 1.2 --- SearchDialog.java 24 Jul 2002 08:04:57 -0000 1.3 *************** *** 12,24 **** public class SearchDialog extends JDialog { ! private JPanel jPanel1 = new JPanel(); ! private JPanel jPanel2 = new JPanel(); ! private JButton jButton1 = new JButton(); ! private JButton jButton2 = new JButton(); ! private GridBagLayout gridBagLayout1 = new GridBagLayout(); private JLabel jLabel1 = new JLabel(); private JTextField jTextSearchWorld = new JTextField(); ! private JLabel jLabel6 = new JLabel(); JPanel jPanelDate = new JPanel(); private MyDateChooser jDateBegin; private MyDateChooser jDateEnd; --- 12,29 ---- public class SearchDialog extends JDialog { ! private JPanel jPanelMain = new JPanel(); ! ! private JPanel jPanelButtons = new JPanel(); ! private JButton jButtonSearch = new JButton(); ! private JButton jButtonCancel = new JButton(); ! ! private JPanel jPanelWords = new JPanel(); private JLabel jLabel1 = new JLabel(); private JTextField jTextSearchWorld = new JTextField(); ! ! private JPanel jPanelConditions = new JPanel(); ! JPanel jPanelDate = new JPanel(); + JCheckBox jCheckDate = new JCheckBox(); private MyDateChooser jDateBegin; private MyDateChooser jDateEnd; *************** *** 26,34 **** private JLabel jLabel2 = new JLabel(); private JLabel jLabel4 = new JLabel(); JPanel jPanelScope = new JPanel(); private JComboBox jComboScope = new JComboBox(); ! private FlowLayout flowLayout1 = new FlowLayout(); ! private FlowLayout flowLayout2 = new FlowLayout(); JPanel jPanelSize = new JPanel(); private JCheckBox jCheckBox5 = new JCheckBox(); private JLabel jLabel8 = new JLabel(); --- 31,41 ---- private JLabel jLabel2 = new JLabel(); private JLabel jLabel4 = new JLabel(); + JPanel jPanelScope = new JPanel(); + JCheckBox jCheckScope = new JCheckBox(); private JComboBox jComboScope = new JComboBox(); ! JPanel jPanelSize = new JPanel(); + JCheckBox jCheckSize = new JCheckBox(); private JCheckBox jCheckBox5 = new JCheckBox(); private JLabel jLabel8 = new JLabel(); *************** *** 37,50 **** private JLabel jLabel7 = new JLabel(); private JTextField jTextMoreThanSize = new JTextField(); ! private FlowLayout flowLayout3 = new FlowLayout(); JPanel jPanelAdvance = new JPanel(); private JCheckBox jCheckrecursive = new JCheckBox(); private JCheckBox jCheckCaseSensitive = new JCheckBox(); ! private TitledBorder titledBorder1; private FlowLayout flowLayout4 = new FlowLayout(); - JCheckBox jCheckDate = new JCheckBox(); - JCheckBox jCheckScope = new JCheckBox(); - JCheckBox jCheckSize = new JCheckBox(); - JCheckBox jCheckAdvance = new JCheckBox(); public SearchDialog(Frame owner) { --- 44,57 ---- private JLabel jLabel7 = new JLabel(); private JTextField jTextMoreThanSize = new JTextField(); ! JPanel jPanelAdvance = new JPanel(); + JCheckBox jCheckAdvance = new JCheckBox(); private JCheckBox jCheckrecursive = new JCheckBox(); private JCheckBox jCheckCaseSensitive = new JCheckBox(); ! ! private FlowLayout flowLayout1 = new FlowLayout(); ! private FlowLayout flowLayout2 = new FlowLayout(); ! private FlowLayout flowLayout3 = new FlowLayout(); private FlowLayout flowLayout4 = new FlowLayout(); public SearchDialog(Frame owner) { *************** *** 56,59 **** --- 63,67 ---- e.printStackTrace(); } + this.getRootPane().setDefaultButton( jButtonSearch); } *************** *** 63,150 **** private void jbInit() throws Exception { - Calendar calendar = Calendar.getInstance(); - calendar.set( Calendar.MONTH, calendar.get( Calendar.MONTH)-1); - jDateBegin = new MyDateChooser( calendar); - jDateEnd = new MyDateChooser(); ! titledBorder1 = new TitledBorder(BorderFactory.createEtchedBorder(Color.white, new Color(148, 145, 140)), "Search Files"); ! jButton1.setText("Search"); ! jButton2.setText("Cancel"); ! jPanel1.setLayout(gridBagLayout1); ! jLabel1.setText("Words:"); ! jLabel6.setText("More conditions:"); ! jLabel3.setText("And"); ! jLabel2.setText("Between"); ! jLabel4.setText(""); ! jPanelDate.setLayout(flowLayout2); ! jPanelScope.setLayout(flowLayout1); ! flowLayout1.setAlignment(FlowLayout.LEFT); ! flowLayout1.setHgap(3); ! flowLayout1.setVgap(0); ! jCheckBox5.setText("MoreThan"); ! jLabel8.setText("KB"); ! jCheckBox4.setText("LessThan"); ! jLabel7.setText("KB"); ! jPanelSize.setLayout(flowLayout3); ! jPanelSize.setToolTipText(""); ! flowLayout3.setAlignment(FlowLayout.LEFT); ! flowLayout3.setHgap(3); ! flowLayout3.setVgap(0); ! jTextLessThanSize.setText(" "); ! jTextMoreThanSize.setText(" "); ! jCheckrecursive.setText("Include Subdir"); ! jCheckCaseSensitive.setText("Case sensitive"); ! jPanelAdvance.setLayout(flowLayout4); ! jPanel1.setBorder(titledBorder1); ! flowLayout4.setAlignment(FlowLayout.LEFT); ! flowLayout4.setHgap(3); ! flowLayout4.setVgap(0); ! jCheckDate.setText("Date:"); ! jCheckScope.setText("Scope:"); ! jCheckSize.setText("Size:"); ! jCheckAdvance.setText("Advance:"); ! flowLayout2.setAlignment(FlowLayout.LEFT); ! flowLayout2.setHgap(3); ! flowLayout2.setVgap(0); ! this.getContentPane().add(jPanel1, BorderLayout.WEST); ! jPanel1.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 ! , GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); ! jPanel1.add(jTextSearchWorld, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 ! , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 350, 0)); ! jPanel1.add(jLabel6, new GridBagConstraints(0, 1, 2, 1, 0.0, 0.0 ! , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); ! jPanel1.add(jPanelDate, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 ! , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); ! jPanelDate.add(jLabel2, null); ! jPanelDate.add(jDateBegin, null); ! jPanelDate.add(jLabel3, null); ! jPanelDate.add(jDateEnd, null); ! jPanelDate.add(jLabel4, null); ! jPanel1.add(jPanelScope, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 ! , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); ! jPanelScope.add(jComboScope, null); ! jPanel1.add(jPanelSize, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0 ! , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); ! jPanelSize.add(jCheckBox4, null); ! jPanelSize.add(jTextLessThanSize, null); ! jPanelSize.add(jLabel8, null); ! jPanelSize.add(jCheckBox5, null); ! jPanelSize.add(jTextMoreThanSize, null); ! jPanelSize.add(jLabel7, null); ! jPanel1.add(jPanelAdvance, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0 ! , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); ! jPanelAdvance.add(jCheckCaseSensitive, null); ! jPanelAdvance.add(jCheckrecursive, null); ! jPanel1.add(jCheckDate, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 ! , GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); ! jPanel1.add(jCheckScope, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 ! , GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); ! jPanel1.add(jCheckSize, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 ! , GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); ! jPanel1.add(jCheckAdvance, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0 ! , GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); ! this.getContentPane().add(jPanel2, BorderLayout.SOUTH); ! jPanel2.add(jButton1, null); ! jPanel2.add(jButton2, null); jPanelAdvance.setVisible(false); --- 71,90 ---- private void jbInit() throws Exception { ! initDatePanel(); ! initSizePanel(); ! initScopePanel(); ! initAdvancePanel(); ! ! initConditionsPanel(); ! ! initWordsPanel(); ! ! initMainPanel(); ! ! initButtonsPanel(); ! ! this.getContentPane().add(jPanelMain, BorderLayout.CENTER); ! this.getContentPane().add(jPanelButtons, BorderLayout.SOUTH); jPanelAdvance.setVisible(false); *************** *** 186,195 **** --- 126,253 ---- }); + } + + private void initButtonsPanel() { + jButtonSearch.setText("Search"); + jButtonCancel.setText("Cancel"); + jPanelButtons.add(jButtonSearch, null); + jPanelButtons.add(jButtonCancel, null); + } + + private void initConditionsPanel() { + jPanelConditions.setBorder(new TitledBorder(BorderFactory.createEtchedBorder(Color.white, new Color(148, 145, 140)), "More Conditions")); + jPanelConditions.setLayout(new GridBagLayout()); + jPanelConditions.add(jCheckDate, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 + , GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); + jPanelConditions.add(jPanelDate, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 + , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); + + jPanelConditions.add(jCheckSize, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 + , GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); + jPanelConditions.add(jPanelSize, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0 + , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); + + jPanelConditions.add(jCheckScope, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 + , GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); + jPanelConditions.add(jPanelScope, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 + , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); + + jPanelConditions.add(jCheckAdvance, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 + , GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); + jPanelConditions.add(jPanelAdvance, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 + , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); + } + + private void initScopePanel() { + jCheckScope.setText("Scope:"); + + initFlowLayout(flowLayout1); + jPanelScope.setLayout(flowLayout1); + jPanelScope.add(jComboScope, null); + } + + private void initWordsPanel() { + jLabel1.setText("Words:"); + jPanelWords.setLayout(new BorderLayout()); + jPanelWords.add(jLabel1, BorderLayout.WEST); + jPanelWords.add(jTextSearchWorld, BorderLayout.CENTER); + } + + private void initMainPanel() { + jPanelMain.setLayout(new BorderLayout()); + jPanelMain.setBorder(new TitledBorder(BorderFactory.createEtchedBorder(Color.white, new Color(148, 145, 140)), "Search Files")); + jPanelMain.add(jPanelWords, BorderLayout.NORTH); + jPanelMain.add(jPanelConditions, BorderLayout.WEST); + } + + private void initAdvancePanel() { + jCheckAdvance.setText("Advance:"); + + jCheckrecursive.setText("Include Subdir"); + jCheckCaseSensitive.setText("Case sensitive"); + initFlowLayout(flowLayout4); + jPanelAdvance.setLayout(flowLayout4); + jPanelAdvance.add(jCheckCaseSensitive, null); + jPanelAdvance.add(jCheckrecursive, null); + } + + private void initSizePanel() { + jCheckSize.setText("Size:"); + + jCheckBox5.setText("MoreThan"); + jLabel8.setText("KB"); + jCheckBox4.setText("LessThan"); + jLabel7.setText("KB"); + jTextLessThanSize.setColumns(7); jTextMoreThanSize.setColumns(7); + jTextLessThanSize.setHorizontalAlignment(JTextField.RIGHT); + jTextMoreThanSize.setHorizontalAlignment(JTextField.RIGHT); DigitInputVerifier inputVerifier = new DigitInputVerifier(); jTextLessThanSize.setInputVerifier(inputVerifier); jTextMoreThanSize.setInputVerifier(inputVerifier); + + + initFlowLayout(flowLayout3); + jPanelSize.setLayout(flowLayout3); + + jPanelSize.add(jCheckBox4, null); + jPanelSize.add(jTextLessThanSize, null); + jPanelSize.add(jLabel8, null); + jPanelSize.add(jCheckBox5, null); + jPanelSize.add(jTextMoreThanSize, null); + jPanelSize.add(jLabel7, null); + } + + private void initDatePanel() { + jCheckDate.setText("Date:"); + + initialCalendar(); + jLabel2.setText("Between"); + jLabel3.setText("And"); + jLabel4.setText(""); + + initFlowLayout(flowLayout2); + jPanelDate.setLayout(flowLayout2); + jPanelDate.add(jLabel2, null); + jPanelDate.add(jDateBegin, null); + jPanelDate.add(jLabel3, null); + jPanelDate.add(jDateEnd, null); + jPanelDate.add(jLabel4, null); + + } + + private void initFlowLayout(FlowLayout layout) { + layout.setAlignment(FlowLayout.LEFT); + layout.setHgap(3); + layout.setVgap(0); + } + + private void initialCalendar() { + Calendar calendar = Calendar.getInstance(); + calendar.set(Calendar.MONTH, calendar.get(Calendar.MONTH) - 1); + jDateBegin = new MyDateChooser(calendar); + jDateEnd = new MyDateChooser(); } |
From: <sim...@us...> - 2002-07-24 04:30:45
|
Update of /cvsroot/cdchamber/CDChamber/lib In directory usw-pr-cvs1:/tmp/cvs-serv14841/lib Added Files: jcalendar.jar Log Message: Add one date chooser to the search dialog. --- NEW FILE: jcalendar.jar --- (This appears to be a binary file; contents omitted.) |
From: <sim...@us...> - 2002-07-24 04:30:45
|
Update of /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/gui In directory usw-pr-cvs1:/tmp/cvs-serv14841/test/src/org/cdchamber/gui Modified Files: SearchDialogTest.java Added Files: MyDateChooserTest.java Log Message: Add one date chooser to the search dialog. --- NEW FILE: MyDateChooserTest.java --- /* * User: Simon * $Id: MyDateChooserTest.java,v 1.1 2002/07/24 04:30:41 simon_lei Exp $ */ package org.cdchamber.gui; import junit.framework.TestCase; import java.util.Calendar; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeEvent; public class MyDateChooserTest extends TestCase implements PropertyChangeListener { protected void tearDown() throws Exception { super.tearDown(); } protected void setUp() throws Exception { super.setUp(); chooser = new MyDateChooser(); calendar = Calendar.getInstance(); date=null; chooser.addPropertyChangeListener( this); } public MyDateChooserTest(String s) { super(s); } MyDateChooser chooser ; Calendar calendar; Calendar date; public void testPropertyChange() { calendar.set( 2001, 0, 1); chooser.setDate( calendar); assertTrue( "Textfield should right"+chooser.field.getText(), chooser.field.getText().equals( "2001-01-01")); assertEquals( "JCalendar should right", chooser.calendar.getCalendar(), calendar); } public void testRightListener() { chooser.field.setText( "2003-4-4"); chooser.field.getInputVerifier().verify(chooser.field); assertNotNull( "date should not be null ", date); } public void testWrongListener() { chooser.field.setText( "20x03-4-4x"); chooser.field.getInputVerifier().verify(chooser.field); assertNull( "date should be null "+date, date); } public void propertyChange(PropertyChangeEvent evt) { date = (Calendar)evt.getNewValue(); } } Index: SearchDialogTest.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/gui/SearchDialogTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SearchDialogTest.java 22 Jul 2002 10:41:50 -0000 1.1 --- SearchDialogTest.java 24 Jul 2002 04:30:41 -0000 1.2 *************** *** 12,18 **** } ! SearchDialog dialog = new SearchDialog(); protected void setUp() throws Exception { super.setUp(); } --- 12,19 ---- } ! SearchDialog dialog; protected void setUp() throws Exception { super.setUp(); + dialog = new SearchDialog(); } |
From: <sim...@us...> - 2002-07-24 04:30:45
|
Update of /cvsroot/cdchamber/CDChamber/src/org/cdchamber/gui In directory usw-pr-cvs1:/tmp/cvs-serv14841/src/org/cdchamber/gui Modified Files: SearchDialog.java Added Files: MyDateChooser.java Log Message: Add one date chooser to the search dialog. --- NEW FILE: MyDateChooser.java --- /* * User: Simon * $Id: MyDateChooser.java,v 1.1 2002/07/24 04:30:41 simon_lei Exp $ */ package org.cdchamber.gui; import com.toedter.calendar.JCalendar; import javax.swing.*; import javax.swing.plaf.metal.MetalComboBoxIcon; import java.util.Calendar; import java.text.SimpleDateFormat; import java.text.ParseException; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.awt.*; import java.beans.*; public class MyDateChooser extends JPanel implements PropertyChangeListener { SimpleDateFormat format = new SimpleDateFormat( "yyyy-MM-dd"); JTextField field = new JTextField(); JButton button = new JButton( new MetalComboBoxIcon()); JCalendar calendar = new JCalendar(); PropertyChangeSupport dateChange = new PropertyChangeSupport( this); public MyDateChooser( ) { this( Calendar.getInstance()); } public void addPropertyChangeListener( PropertyChangeListener listener) { dateChange.addPropertyChangeListener( listener); } public void removePropertyChangeListener( PropertyChangeListener listener ) { dateChange.removePropertyChangeListener( listener); } public void propertyChange(PropertyChangeEvent evt) { calendar.setCalendar( date); field.setText( format.format( date.getTime())); } private Calendar date; public Calendar getDate() { return date; } public void setDate(Calendar date) { Object oldValue = this.date; this.date = date; dateChange.firePropertyChange( "Date", oldValue, this.date); } public MyDateChooser( Calendar date) { super (new BorderLayout ()); this.addPropertyChangeListener( this); setDate( date); this.setLayout( new FlowLayout( FlowLayout.LEFT, 0, 0)); this.add( field, BorderLayout.CENTER); button.setMargin (new Insets (5, 3, 5, 3)); this.add( button, BorderLayout.EAST); button.addActionListener( new ActionListener() { public void actionPerformed(ActionEvent e) { if ( JOptionPane.showOptionDialog( null, calendar, "Select one date", JOptionPane.OK_CANCEL_OPTION, JOptionPane.INFORMATION_MESSAGE, null, null, null) == JOptionPane.OK_OPTION) { setDate( calendar.getCalendar()); } } }); field.setInputVerifier( new InputVerifier() { public boolean verify(JComponent input) { String str = ((JTextField)input).getText(); try { Calendar instance = Calendar.getInstance(); instance.setTime( format.parse( str)); setDate( instance); return true; } catch (ParseException e) { return false; } } }); } } Index: SearchDialog.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/src/org/cdchamber/gui/SearchDialog.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** SearchDialog.java 22 Jul 2002 10:41:50 -0000 1.1 --- SearchDialog.java 24 Jul 2002 04:30:41 -0000 1.2 *************** *** 9,12 **** --- 9,13 ---- import javax.swing.border.*; import java.awt.event.*; + import java.util.Calendar; public class SearchDialog extends JDialog { *************** *** 20,25 **** private JLabel jLabel6 = new JLabel(); JPanel jPanelDate = new JPanel(); ! private JComboBox jDateBegin = new JComboBox(); ! private JComboBox jDateEnd = new JComboBox(); private JLabel jLabel3 = new JLabel(); private JLabel jLabel2 = new JLabel(); --- 21,26 ---- private JLabel jLabel6 = new JLabel(); JPanel jPanelDate = new JPanel(); ! private MyDateChooser jDateBegin; ! private MyDateChooser jDateEnd; private JLabel jLabel3 = new JLabel(); private JLabel jLabel2 = new JLabel(); *************** *** 50,56 **** super(owner); this.setModal(true); - } - - public SearchDialog() { try { jbInit(); --- 51,54 ---- *************** *** 60,64 **** --- 58,71 ---- } + public SearchDialog() { + this(null); + } + private void jbInit() throws Exception { + Calendar calendar = Calendar.getInstance(); + calendar.set( Calendar.MONTH, calendar.get( Calendar.MONTH)-1); + jDateBegin = new MyDateChooser( calendar); + jDateEnd = new MyDateChooser(); + titledBorder1 = new TitledBorder(BorderFactory.createEtchedBorder(Color.white, new Color(148, 145, 140)), "Search Files"); jButton1.setText("Search"); *************** *** 73,78 **** jPanelScope.setLayout(flowLayout1); flowLayout1.setAlignment(FlowLayout.LEFT); ! flowLayout1.setHgap(3); ! flowLayout1.setVgap(0); jCheckBox5.setText("MoreThan"); jLabel8.setText("KB"); --- 80,85 ---- jPanelScope.setLayout(flowLayout1); flowLayout1.setAlignment(FlowLayout.LEFT); ! flowLayout1.setHgap(3); ! flowLayout1.setVgap(0); jCheckBox5.setText("MoreThan"); jLabel8.setText("KB"); *************** *** 82,87 **** jPanelSize.setToolTipText(""); flowLayout3.setAlignment(FlowLayout.LEFT); ! flowLayout3.setHgap(3); ! flowLayout3.setVgap(0); jTextLessThanSize.setText(" "); jTextMoreThanSize.setText(" "); --- 89,94 ---- jPanelSize.setToolTipText(""); flowLayout3.setAlignment(FlowLayout.LEFT); ! flowLayout3.setHgap(3); ! flowLayout3.setVgap(0); jTextLessThanSize.setText(" "); jTextMoreThanSize.setText(" "); *************** *** 91,96 **** jPanel1.setBorder(titledBorder1); flowLayout4.setAlignment(FlowLayout.LEFT); ! flowLayout4.setHgap(3); ! flowLayout4.setVgap(0); jCheckDate.setText("Date:"); jCheckScope.setText("Scope:"); --- 98,103 ---- jPanel1.setBorder(titledBorder1); flowLayout4.setAlignment(FlowLayout.LEFT); ! flowLayout4.setHgap(3); ! flowLayout4.setVgap(0); jCheckDate.setText("Date:"); jCheckScope.setText("Scope:"); *************** *** 98,112 **** jCheckAdvance.setText("Advance:"); flowLayout2.setAlignment(FlowLayout.LEFT); ! flowLayout2.setHgap(3); ! flowLayout2.setVgap(0); ! this.getContentPane().add(jPanel1, BorderLayout.WEST); jPanel1.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 , GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); ! jPanel1.add(jTextSearchWorld, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 ! ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 350, 0)); ! jPanel1.add(jLabel6, new GridBagConstraints(0, 1, 2, 1, 0.0, 0.0 ! ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); ! jPanel1.add(jPanelDate, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 ! ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); jPanelDate.add(jLabel2, null); jPanelDate.add(jDateBegin, null); --- 105,119 ---- jCheckAdvance.setText("Advance:"); flowLayout2.setAlignment(FlowLayout.LEFT); ! flowLayout2.setHgap(3); ! flowLayout2.setVgap(0); ! this.getContentPane().add(jPanel1, BorderLayout.WEST); jPanel1.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 , GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); ! jPanel1.add(jTextSearchWorld, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 ! , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 350, 0)); ! jPanel1.add(jLabel6, new GridBagConstraints(0, 1, 2, 1, 0.0, 0.0 ! , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); ! jPanel1.add(jPanelDate, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 ! , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); jPanelDate.add(jLabel2, null); jPanelDate.add(jDateBegin, null); *************** *** 114,122 **** jPanelDate.add(jDateEnd, null); jPanelDate.add(jLabel4, null); ! jPanel1.add(jPanelScope, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 ! ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); jPanelScope.add(jComboScope, null); ! jPanel1.add(jPanelSize, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0 ! ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); jPanelSize.add(jCheckBox4, null); jPanelSize.add(jTextLessThanSize, null); --- 121,129 ---- jPanelDate.add(jDateEnd, null); jPanelDate.add(jLabel4, null); ! jPanel1.add(jPanelScope, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 ! , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); jPanelScope.add(jComboScope, null); ! jPanel1.add(jPanelSize, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0 ! , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); jPanelSize.add(jCheckBox4, null); jPanelSize.add(jTextLessThanSize, null); *************** *** 125,130 **** jPanelSize.add(jTextMoreThanSize, null); jPanelSize.add(jLabel7, null); ! jPanel1.add(jPanelAdvance, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0 ! ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); jPanelAdvance.add(jCheckCaseSensitive, null); jPanelAdvance.add(jCheckrecursive, null); --- 132,137 ---- jPanelSize.add(jTextMoreThanSize, null); jPanelSize.add(jLabel7, null); ! jPanel1.add(jPanelAdvance, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0 ! , GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); jPanelAdvance.add(jCheckCaseSensitive, null); jPanelAdvance.add(jCheckrecursive, null); *************** *** 141,179 **** jPanel2.add(jButton2, null); ! jPanelAdvance.setVisible( false); ! jPanelDate.setVisible( false); ! jPanelScope.setVisible( false); ! jPanelSize.setVisible( false); ! jCheckAdvance.addItemListener( new ItemListener() { public void itemStateChanged(ItemEvent e) { ! if ( e.getStateChange() == ItemEvent.SELECTED) jPanelAdvance.setVisible( true); ! else jPanelAdvance.setVisible( false); } }); ! jCheckDate.addItemListener( new ItemListener() { public void itemStateChanged(ItemEvent e) { ! if ( e.getStateChange() == ItemEvent.SELECTED) jPanelDate.setVisible( true); ! else jPanelDate.setVisible( false); } }); ! jCheckScope.addItemListener( new ItemListener() { public void itemStateChanged(ItemEvent e) { ! if ( e.getStateChange() == ItemEvent.SELECTED) jPanelScope.setVisible( true); ! else jPanelScope.setVisible( false); } }); ! jCheckSize.addItemListener( new ItemListener() { public void itemStateChanged(ItemEvent e) { ! if ( e.getStateChange() == ItemEvent.SELECTED) jPanelSize.setVisible( true); ! else jPanelSize.setVisible( false); } }); } ! public static void main( String []args) { SearchDialog dialog = new SearchDialog(); ! dialog.setSize( 500, 300); dialog.show(); } } --- 148,219 ---- jPanel2.add(jButton2, null); ! jPanelAdvance.setVisible(false); ! jPanelDate.setVisible(false); ! jPanelScope.setVisible(false); ! jPanelSize.setVisible(false); ! jCheckAdvance.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { ! if (e.getStateChange() == ItemEvent.SELECTED) ! jPanelAdvance.setVisible(true); ! else ! jPanelAdvance.setVisible(false); } }); ! jCheckDate.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { ! if (e.getStateChange() == ItemEvent.SELECTED) ! jPanelDate.setVisible(true); ! else ! jPanelDate.setVisible(false); } }); ! jCheckScope.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { ! if (e.getStateChange() == ItemEvent.SELECTED) ! jPanelScope.setVisible(true); ! else ! jPanelScope.setVisible(false); } }); ! jCheckSize.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent e) { ! if (e.getStateChange() == ItemEvent.SELECTED) ! jPanelSize.setVisible(true); ! else ! jPanelSize.setVisible(false); } }); + + jTextLessThanSize.setColumns(7); + jTextMoreThanSize.setColumns(7); + + DigitInputVerifier inputVerifier = new DigitInputVerifier(); + jTextLessThanSize.setInputVerifier(inputVerifier); + jTextMoreThanSize.setInputVerifier(inputVerifier); } ! public static void main(String[] args) { SearchDialog dialog = new SearchDialog(); ! dialog.setSize(500, 300); dialog.show(); } + + private class DigitInputVerifier extends InputVerifier { + public boolean verify(JComponent input) { + JTextField field = (JTextField) input; + try { + Integer.parseInt(field.getText().trim()); + } catch (NumberFormatException e) { + return false; + } + + return true; + } + } + } + + + + |
From: <sim...@us...> - 2002-07-22 10:41:56
|
Update of /cvsroot/cdchamber/CDChamber/src/org/cdchamber/gui In directory usw-pr-cvs1:/tmp/cvs-serv11019/src/org/cdchamber/gui Added Files: SearchDialog.java Log Message: Add search dialog and the testcase. --- NEW FILE: SearchDialog.java --- /* * User: Simon * $Id: SearchDialog.java,v 1.1 2002/07/22 10:41:50 simon_lei Exp $ */ package org.cdchamber.gui; import javax.swing.*; import java.awt.*; import javax.swing.border.*; import java.awt.event.*; public class SearchDialog extends JDialog { private JPanel jPanel1 = new JPanel(); private JPanel jPanel2 = new JPanel(); private JButton jButton1 = new JButton(); private JButton jButton2 = new JButton(); private GridBagLayout gridBagLayout1 = new GridBagLayout(); private JLabel jLabel1 = new JLabel(); private JTextField jTextSearchWorld = new JTextField(); private JLabel jLabel6 = new JLabel(); JPanel jPanelDate = new JPanel(); private JComboBox jDateBegin = new JComboBox(); private JComboBox jDateEnd = new JComboBox(); private JLabel jLabel3 = new JLabel(); private JLabel jLabel2 = new JLabel(); private JLabel jLabel4 = new JLabel(); JPanel jPanelScope = new JPanel(); private JComboBox jComboScope = new JComboBox(); private FlowLayout flowLayout1 = new FlowLayout(); private FlowLayout flowLayout2 = new FlowLayout(); JPanel jPanelSize = new JPanel(); private JCheckBox jCheckBox5 = new JCheckBox(); private JLabel jLabel8 = new JLabel(); private JTextField jTextLessThanSize = new JTextField(); private JCheckBox jCheckBox4 = new JCheckBox(); private JLabel jLabel7 = new JLabel(); private JTextField jTextMoreThanSize = new JTextField(); private FlowLayout flowLayout3 = new FlowLayout(); JPanel jPanelAdvance = new JPanel(); private JCheckBox jCheckrecursive = new JCheckBox(); private JCheckBox jCheckCaseSensitive = new JCheckBox(); private TitledBorder titledBorder1; private FlowLayout flowLayout4 = new FlowLayout(); JCheckBox jCheckDate = new JCheckBox(); JCheckBox jCheckScope = new JCheckBox(); JCheckBox jCheckSize = new JCheckBox(); JCheckBox jCheckAdvance = new JCheckBox(); public SearchDialog(Frame owner) { super(owner); this.setModal(true); } public SearchDialog() { try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { titledBorder1 = new TitledBorder(BorderFactory.createEtchedBorder(Color.white, new Color(148, 145, 140)), "Search Files"); jButton1.setText("Search"); jButton2.setText("Cancel"); jPanel1.setLayout(gridBagLayout1); jLabel1.setText("Words:"); jLabel6.setText("More conditions:"); jLabel3.setText("And"); jLabel2.setText("Between"); jLabel4.setText(""); jPanelDate.setLayout(flowLayout2); jPanelScope.setLayout(flowLayout1); flowLayout1.setAlignment(FlowLayout.LEFT); flowLayout1.setHgap(3); flowLayout1.setVgap(0); jCheckBox5.setText("MoreThan"); jLabel8.setText("KB"); jCheckBox4.setText("LessThan"); jLabel7.setText("KB"); jPanelSize.setLayout(flowLayout3); jPanelSize.setToolTipText(""); flowLayout3.setAlignment(FlowLayout.LEFT); flowLayout3.setHgap(3); flowLayout3.setVgap(0); jTextLessThanSize.setText(" "); jTextMoreThanSize.setText(" "); jCheckrecursive.setText("Include Subdir"); jCheckCaseSensitive.setText("Case sensitive"); jPanelAdvance.setLayout(flowLayout4); jPanel1.setBorder(titledBorder1); flowLayout4.setAlignment(FlowLayout.LEFT); flowLayout4.setHgap(3); flowLayout4.setVgap(0); jCheckDate.setText("Date:"); jCheckScope.setText("Scope:"); jCheckSize.setText("Size:"); jCheckAdvance.setText("Advance:"); flowLayout2.setAlignment(FlowLayout.LEFT); flowLayout2.setHgap(3); flowLayout2.setVgap(0); this.getContentPane().add(jPanel1, BorderLayout.WEST); jPanel1.add(jLabel1, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 , GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); jPanel1.add(jTextSearchWorld, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 350, 0)); jPanel1.add(jLabel6, new GridBagConstraints(0, 1, 2, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); jPanel1.add(jPanelDate, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); jPanelDate.add(jLabel2, null); jPanelDate.add(jDateBegin, null); jPanelDate.add(jLabel3, null); jPanelDate.add(jDateEnd, null); jPanelDate.add(jLabel4, null); jPanel1.add(jPanelScope, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); jPanelScope.add(jComboScope, null); jPanel1.add(jPanelSize, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); jPanelSize.add(jCheckBox4, null); jPanelSize.add(jTextLessThanSize, null); jPanelSize.add(jLabel8, null); jPanelSize.add(jCheckBox5, null); jPanelSize.add(jTextMoreThanSize, null); jPanelSize.add(jLabel7, null); jPanel1.add(jPanelAdvance, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 0, 0), 0, 0)); jPanelAdvance.add(jCheckCaseSensitive, null); jPanelAdvance.add(jCheckrecursive, null); jPanel1.add(jCheckDate, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0 , GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); jPanel1.add(jCheckScope, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0 , GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); jPanel1.add(jCheckSize, new GridBagConstraints(0, 4, 1, 1, 0.0, 0.0 , GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); jPanel1.add(jCheckAdvance, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0 , GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0)); this.getContentPane().add(jPanel2, BorderLayout.SOUTH); jPanel2.add(jButton1, null); jPanel2.add(jButton2, null); jPanelAdvance.setVisible( false); jPanelDate.setVisible( false); jPanelScope.setVisible( false); jPanelSize.setVisible( false); jCheckAdvance.addItemListener( new ItemListener() { public void itemStateChanged(ItemEvent e) { if ( e.getStateChange() == ItemEvent.SELECTED) jPanelAdvance.setVisible( true); else jPanelAdvance.setVisible( false); } }); jCheckDate.addItemListener( new ItemListener() { public void itemStateChanged(ItemEvent e) { if ( e.getStateChange() == ItemEvent.SELECTED) jPanelDate.setVisible( true); else jPanelDate.setVisible( false); } }); jCheckScope.addItemListener( new ItemListener() { public void itemStateChanged(ItemEvent e) { if ( e.getStateChange() == ItemEvent.SELECTED) jPanelScope.setVisible( true); else jPanelScope.setVisible( false); } }); jCheckSize.addItemListener( new ItemListener() { public void itemStateChanged(ItemEvent e) { if ( e.getStateChange() == ItemEvent.SELECTED) jPanelSize.setVisible( true); else jPanelSize.setVisible( false); } }); } public static void main( String []args) { SearchDialog dialog = new SearchDialog(); dialog.setSize( 500, 300); dialog.show(); } } |
From: <sim...@us...> - 2002-07-22 10:41:56
|
Update of /cvsroot/cdchamber/CDChamber/test/src/org/cdchamber/gui In directory usw-pr-cvs1:/tmp/cvs-serv11019/test/src/org/cdchamber/gui Added Files: SearchDialogTest.java Log Message: Add search dialog and the testcase. --- NEW FILE: SearchDialogTest.java --- /* * User: Simon * $Id: SearchDialogTest.java,v 1.1 2002/07/22 10:41:50 simon_lei Exp $ */ package org.cdchamber.gui; import junit.framework.TestCase; public class SearchDialogTest extends TestCase { protected void tearDown() throws Exception { super.tearDown(); } SearchDialog dialog = new SearchDialog(); protected void setUp() throws Exception { super.setUp(); } public SearchDialogTest(String s) { super(s); } public void testPanelUnvisable() { assertTrue( "Not visiable at startup1", !dialog.jPanelAdvance.isVisible() ); assertTrue( "Not visiable at startup2", !dialog.jPanelDate.isVisible() ); assertTrue( "Not visiable at startup3", !dialog.jPanelScope.isVisible() ); assertTrue( "Not visiable at startup4", !dialog.jPanelSize.isVisible() ); } public void testPanelVisiable() { dialog.jCheckAdvance.setSelected( true); assertTrue( "Should visiable after selected1", dialog.jPanelAdvance.isVisible() ); dialog.jCheckDate.setSelected( true); assertTrue( "Should visiable after selected2", dialog.jPanelDate.isVisible() ); dialog.jCheckScope.setSelected( true); assertTrue( "Should visiable after selected3", dialog.jPanelScope.isVisible() ); dialog.jCheckSize.setSelected( true); assertTrue( "Should visiable after selected4", dialog.jPanelSize.isVisible() ); } } |
From: <cry...@us...> - 2002-07-22 08:32:49
|
Update of /cvsroot/cdchamber/CDChamber In directory usw-pr-cvs1:/tmp/cvs-serv23918 Modified Files: build.xml Log Message: split aspect to gen & src Index: build.xml =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/build.xml,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** build.xml 22 Jul 2002 06:45:19 -0000 1.29 --- build.xml 22 Jul 2002 08:32:46 -0000 1.30 *************** *** 13,18 **** <property name="test.src" value="${test.dir}/src"/> <property name="aspect.src" value="${aspect.dir}/src"/> - <property name="build.dest" value="${build.dir}/classes"/> <property name="test.classes" value="${build.dir}/test"/> --- 13,18 ---- <property name="test.src" value="${test.dir}/src"/> + <property name="aspect.gen" value="${aspect.dir}/gen"/> <property name="aspect.src" value="${aspect.dir}/src"/> <property name="build.dest" value="${build.dir}/classes"/> <property name="test.classes" value="${build.dir}/test"/> *************** *** 45,52 **** <condition property="xmlBuild.notRequired"> <and> ! <uptodate property="xsdUptodate" targetfile="${aspect.src}/org/cdchamber/elements/FileType.java"> <srcfiles dir="${src.dir}" includes="cdchamber.xsd"/> </uptodate> ! <uptodate property="propertiesUptodate" targetfile="${aspect.src}/org/cdchamber/elements/FileType.java"> <srcfiles dir="${basedir}/lib/" includes="castorbuilder.properties"/> </uptodate> --- 45,52 ---- <condition property="xmlBuild.notRequired"> <and> ! <uptodate property="xsdUptodate" targetfile="${aspect.gen}/org/cdchamber/elements/FileType.java"> <srcfiles dir="${src.dir}" includes="cdchamber.xsd"/> </uptodate> ! <uptodate property="propertiesUptodate" targetfile="${aspect.gen}/org/cdchamber/elements/FileType.java"> <srcfiles dir="${basedir}/lib/" includes="castorbuilder.properties"/> </uptodate> *************** *** 55,64 **** <condition property="ajc_gen.notRequired"> <uptodate targetfile="${src.dir}/org/cdchamber/elements/FileType.java"> ! <srcfiles dir="${aspect.src}/org" includes="**/*.*"/> </uptodate> </condition> <condition property="ajc.notRequired"> <uptodate targetfile="${aspect.classes}/AspectCDCMainFrameControllerTest.class"> ! <srcfiles dir="${aspect.src}" includes="*.*"/> <srcfiles dir="${aspect.dir}" includes="file.lst"/> </uptodate> --- 55,64 ---- <condition property="ajc_gen.notRequired"> <uptodate targetfile="${src.dir}/org/cdchamber/elements/FileType.java"> ! <srcfiles dir="${aspect.gen}" includes="**/*.*"/> </uptodate> </condition> <condition property="ajc.notRequired"> <uptodate targetfile="${aspect.classes}/AspectCDCMainFrameControllerTest.class"> ! <srcfiles dir="${aspect.src}" includes="**/*.*"/> <srcfiles dir="${aspect.dir}" includes="file.lst"/> </uptodate> *************** *** 72,76 **** <target name="castor_gen" depends="init" description="Generate src files from xsd files" unless="xmlBuild.notRequired"> <java classname="org.exolab.castor.builder.SourceGenerator" fork="true"> ! <arg line="-i ${src.dir}/cdchamber.xsd -dest ${aspect.src} -package org.cdchamber.elements -verbose -types j2 -nodesc -f"/> <classpath> <path refid="classpath" /> --- 72,76 ---- <target name="castor_gen" depends="init" description="Generate src files from xsd files" unless="xmlBuild.notRequired"> <java classname="org.exolab.castor.builder.SourceGenerator" fork="true"> ! <arg line="-i ${src.dir}/cdchamber.xsd -dest ${aspect.gen} -package org.cdchamber.elements -verbose -types j2 -nodesc -f"/> <classpath> <path refid="classpath" /> *************** *** 83,87 **** <ajc preprocess="yes" workingdir="${src.dir}" nocomments="yes"> <src> ! <pathelement path="${aspect.src}/org"/> </src> </ajc> --- 83,87 ---- <ajc preprocess="yes" workingdir="${src.dir}" nocomments="yes"> <src> ! <pathelement path="${aspect.gen}"/> </src> </ajc> |
From: <cry...@us...> - 2002-07-22 08:32:17
|
Update of /cvsroot/cdchamber/CDChamber/aspect/src/org/cdchamber/elements In directory usw-pr-cvs1:/tmp/cvs-serv23711/src/org/cdchamber/elements Removed Files: DirectoryTypeWrapper.java FileTypeFactory.java FileTypeWrapper.java Log Message: split aspect to gen & src --- DirectoryTypeWrapper.java DELETED --- --- FileTypeFactory.java DELETED --- --- FileTypeWrapper.java DELETED --- |
From: <cry...@us...> - 2002-07-22 08:32:17
|
Update of /cvsroot/cdchamber/CDChamber/aspect/src/org/cdchamber/parser In directory usw-pr-cvs1:/tmp/cvs-serv23711/src/org/cdchamber/parser Removed Files: FileParseException.java Log Message: split aspect to gen & src --- FileParseException.java DELETED --- |
From: <cry...@us...> - 2002-07-22 08:32:17
|
Update of /cvsroot/cdchamber/CDChamber/aspect/src In directory usw-pr-cvs1:/tmp/cvs-serv23711/src Modified Files: AspectCDCMainFrameControllerTest.java Log Message: split aspect to gen & src Index: AspectCDCMainFrameControllerTest.java =================================================================== RCS file: /cvsroot/cdchamber/CDChamber/aspect/src/AspectCDCMainFrameControllerTest.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** AspectCDCMainFrameControllerTest.java 22 Jul 2002 03:04:05 -0000 1.1 --- AspectCDCMainFrameControllerTest.java 22 Jul 2002 08:32:12 -0000 1.2 *************** *** 12,16 **** for ( int i = 0; i < newFiles.length; i++ ) { System.out.println(newFiles[i].getName() + " " + newFiles[i].exists() ); ! } // end of for () } --- 12,16 ---- for ( int i = 0; i < newFiles.length; i++ ) { System.out.println(newFiles[i].getName() + " " + newFiles[i].exists() ); ! } // end of for () } |
From: <cry...@us...> - 2002-07-22 08:32:17
|
Update of /cvsroot/cdchamber/CDChamber/aspect/gen/org/cdchamber/parser In directory usw-pr-cvs1:/tmp/cvs-serv23711/gen/org/cdchamber/parser Added Files: FileParseException.java Log Message: split aspect to gen & src --- NEW FILE: FileParseException.java --- /* * User: Simon * Date: 2002-6-25 * Time: 15:50:54 * $Id: FileParseException.java,v 1.1 2002/07/22 08:32:12 crystal_y Exp $ */ package org.cdchamber.parser; public class FileParseException extends Exception { public FileParseException() { } public FileParseException(String s) { super(s); } } |
From: <cry...@us...> - 2002-07-22 08:32:16
|
Update of /cvsroot/cdchamber/CDChamber/aspect/gen/org/cdchamber/elements In directory usw-pr-cvs1:/tmp/cvs-serv23711/gen/org/cdchamber/elements Added Files: DirectoryTypeWrapper.java FileTypeFactory.java FileTypeWrapper.java Log Message: split aspect to gen & src --- NEW FILE: DirectoryTypeWrapper.java --- /* * User: Simon * Date: 2002-6-25 * Time: 15:38:34 * $Id: DirectoryTypeWrapper.java,v 1.1 2002/07/22 08:32:12 crystal_y Exp $ */ package org.cdchamber.elements; import org.cdchamber.parser.FileParseException; import java.io.*; public aspect DirectoryTypeWrapper { public void DirectoryType.parse( String dirName) throws FileParseException { super.parse( dirName); File dir = new File( dirName); File[] files = dir.listFiles(); int sumSize = 0; for ( int i=0; i<files.length; i++) { if ( files[i].getName().equals( "CVS")) continue; FileType fileType = FileTypeFactory.createFileType( files[i]); fileType.parse( files[i].getAbsolutePath()); this.addFiles( fileType); sumSize += fileType.getSize(); } this.setSize( sumSize); } } --- NEW FILE: FileTypeFactory.java --- /* * User: Simon * Date: 2002-6-27 * Time: 12:51:55 * $Id: FileTypeFactory.java,v 1.1 2002/07/22 08:32:12 crystal_y Exp $ */ package org.cdchamber.elements; import java.io.File; public class FileTypeFactory { public static FileType createFileType( File file) { if ( file.isDirectory()) return new DirectoryType(); return new FileType(); } } --- NEW FILE: FileTypeWrapper.java --- // $Id: FileTypeWrapper.java,v 1.1 2002/07/22 08:32:12 crystal_y Exp $ package org.cdchamber.elements; import org.cdchamber.parser.FileParseException; import java.io.File; public aspect FileTypeWrapper { public void FileType.parse( String fileName) throws FileParseException { File file = new File( fileName); if ( !file.exists()) throw new FileParseException( "File not exist"+fileName); setName( file.getName()); setSize( file.length()); setDate( file.lastModified()); } public String FileType.toString() { return getName(); } } |