[sword-cvs] swordtools/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/GUI FileChoices.java, NONE, 1.1 GetDate.java, NONE, 1.1 Messages.java, NONE, 1.1 package.html, NONE, 1.1

sword at www.crosswire.org sword at www.crosswire.org
Fri Jun 4 02:14:54 MST 2004


Committed by: mgruner

Update of /cvs/core/swordtools/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/GUI
In directory www:/tmp/cvs-serv15120/modules/hebrew-wlc/WLC2OSIS/WLC2OSIS/GUI

Added Files:
	FileChoices.java GetDate.java Messages.java package.html 
Log Message:
initial import of source files for the new BHS-replacement WLC (Westminster Leningrad Codex).
Not functional yet at all.

--- NEW FILE: FileChoices.java ---
package WLC2OSIS.GUI ;

import WLC2OSIS.* ;
import Utilities.* ;

import java.awt.* ;
import java.util.* ;
import java.io.* ;
import java.awt.event.* ;
import javax.swing.*;
import javax.swing.event.* ;
import javax.swing.border.*;
//==============================================================================
/**
 * <b>Gets the input and output files.</b><p>
 */
//==============================================================================

public class FileChoices {

WLC2OSIS A ;

public FileChoices(WLC2OSIS A){
    this.A = A ;
    }
public String getInputFilename(String DefaultInputFilename){
    FileChooser inchooser = new FileChooser() ;
    inchooser.setSelectedFile(new File(DefaultInputFilename) ) ;
    inchooser.setDialogTitle("Give the input file") ;
    inchooser.setApproveButtonText("Set") ;
    inchooser.setSize( new Dimension( 500, 400 ) ) ;
    inchooser.setLocation(new Point(200, 200) );
    inchooser.revalidate() ;
    int returnValue = inchooser.showOpenDialog(A.OverallContainer) ;
    if(returnValue==JFileChooser.APPROVE_OPTION){
        String InputFilename = inchooser.getSelectedFile().getPath() ;
        return InputFilename ;
        }
    else{
        System.out.println("WLC2OSIS:FileChoices: Didn't choose the input file.") ;
        System.exit(0) ;
        return null ;}
    }
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
public String getOutputDirectory(String DefaultOutputDirectory){
    FileChooser outchooser = new FileChooser() ; 
    outchooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY) ;
    File InitialDirectory = new File(DefaultOutputDirectory ) ;
    outchooser.setSelectedFile(InitialDirectory) ;
    outchooser.setDialogTitle("Set the output directory") ;
    outchooser.setApproveButtonText("Set") ;
    outchooser.setSize( new Dimension( 500, 400 ) ) ;
    outchooser.setLocation(new Point(200, 200) );
    outchooser.revalidate() ;
    int returnValue = outchooser.showOpenDialog(A.OverallContainer) ;
    if(returnValue==JFileChooser.APPROVE_OPTION){
        String OutputDirectory = outchooser.getSelectedFile().getPath() ;
        return OutputDirectory ;
        }
    else{
        System.out.println("WLC2OSIS: Didn't choose the output directory.") ;
        System.exit(0) ;
        return null ;
        }
    }
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
}
//==============================================================================
//==============================================================================

--- NEW FILE: GetDate.java ---
package WLC2OSIS.GUI ;

import WLC2OSIS.* ;
import Utilities.* ;

import java.awt.* ;
import java.util.* ;
import java.io.* ;
import java.awt.event.* ;
import javax.swing.*;
import javax.swing.event.* ;
import javax.swing.border.*;
//==============================================================================
/**
 * <b>Gets the input file date.</b><p>
 */
//==============================================================================

public class GetDate extends JDialog 
         implements ActionListener, Stoppable {

WLC2OSIS A ;
JTextField DateField ;
JButton Set ;

public GetDate(WLC2OSIS A){
    super(A.SC.superFrame(), true) ; // A modal dialog
    this.A = A ;
    this.setTitle("Give the date of this input file") ;
    this.setLocation(new Point(300, 300) );
    this.addWindowListener(new WindowEventHandler((Stoppable) this)) ;
    
    Set = new JButton("Set") ;
    Set.addActionListener(this) ;

    int hs = 10 ;
    int vs = 10 ;
    
    JPanel p0 = new JPanel() ;
    p0.setLayout( new BoxLayout(p0, BoxLayout.Y_AXIS) ) ;
    p0.add(Box.createVerticalStrut(vs) ) ;
//------------------------------------------------------------------------------

// Data name

    JLabel DateLabel = new JLabel("Date of this input file:") ;
    DateField = new JTextField() ;
    DateField.setText(A.DefaultInputDate) ;
    Dimension TFD = new Dimension (100, 25) ;
    DateField.setPreferredSize(TFD) ;
    DateField.setMaximumSize(TFD) ;
    JPanel p1 = new JPanel() ;
    p1.setLayout( new BoxLayout(p1, BoxLayout.X_AXIS) ) ;
    p1.add(Box.createHorizontalStrut(hs) ) ;
    p1.add(DateLabel) ;
    p1.add(Box.createHorizontalStrut(hs) ) ;
    p1.add(DateField) ;
    p1.add(Box.createHorizontalGlue() ) ;
    p0.add(p1) ;
    p0.add(Box.createVerticalStrut(vs) ) ;
//------------------------------------------------------------------------------

// Set button

    JPanel p5 = new JPanel() ;
    p5.setLayout( new BoxLayout(p5, BoxLayout.X_AXIS) ) ;
    p5.add(Box.createHorizontalStrut(hs) ) ;
    p5.add(Box.createHorizontalGlue() ) ;
    p5.add(Set) ;
    p5.add(Box.createHorizontalStrut(hs) ) ;
    p0.add(p5) ;
    p0.add(Box.createVerticalStrut(vs) ) ;

//------------------------------------------------------------------------------
    p0.setPreferredSize(null) ;
    this.setSize(p0.getPreferredSize()) ;
    this.getContentPane().add(p0) ;
    this.pack() ;
    this.show() ;
    }
//------------------------------------------------------------------------------

public void done(){
    this.dispose() ;
    }
//------------------------------------------------------------------------------

public void actionPerformed(ActionEvent e){

    if (e.getActionCommand() == "Set"){
        String tname = DateField.getText() ;
        if(tname.length() !=0){
            A.Date = tname ;
            }
        done() ;
        }
    }
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
}
//==============================================================================
//==============================================================================

--- NEW FILE: Messages.java ---
package WLC2OSIS.GUI ;

import WLC2OSIS.* ;
import Utilities.* ;

import java.awt.* ;
import java.util.* ;
import java.io.* ;
import java.awt.event.* ;
import javax.swing.*;
import javax.swing.event.* ;
import javax.swing.border.*;
//==============================================================================
/**
 * <b>Outputs messages to operator.</b><p>
 */
//==============================================================================

public class Messages {

WLC2OSIS A ;

public Messages(WLC2OSIS A){
    this.A = A ;
    }
public void initialMessage(){
    String IntroMessage = "WLC2OSIS ("+ A.ProgramDate
       + "): Conversion of WHI text files to XML files.\n\n"
       + "Important messages will be written to command window.\n"
       + "Please be ready to write them down.\n\n" ;
    JOptionPane.showMessageDialog(A.OverallContainer, IntroMessage) ;
    }
public void doneMessage(){
    String DoneMessage = "The 40 output files appear to have been written\n"
    + "normally. Please examine the Java Console for possible errors.\n"
    + "If any errors have occured please make a careful note of them.\n\n"
    + "If no errors occurred and the 11 supporting files, \n\n"
    + "    CC.somerights.gif,\n"
    + "    Sarissa.js,\n"
    + "    SBL_Hebrew.ttf,\n"
    + "    SBL_Hebrew_readme.txt,\n"
    + "    Tanach.Counts.html,\n"
    + "    Tanach.License.html,\n"
    + "    Tanach.Version.html,\n"
    + "    Tanach.xsd,\n"
    + "    Tanach.xsl.xml,\n"
    + "    WHIbanner.gif,\n"
    + "    WLC2OSIS.jar,\n\n"
    + "are in the output directory, then press \"OK\" to see the index file.\n\n";
    JOptionPane.showMessageDialog(A.OverallContainer, DoneMessage) ;
    }
public void endMessage(){
    String EndMessage = "\nWLC2OSIS: Normal end.\n\n"
        + "Don't forget to update Tanach.Version.html to reflect\n"
        + "the fact that the text has been updated.\n\n"
        + "Then ZIP all 51 files into Tanach.zip\n"
        + "and place Tanach.zip in output directory.\n\n";
    JOptionPane.showMessageDialog(A.OverallContainer, EndMessage) ;
    }
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
}
//==============================================================================
//==============================================================================

--- NEW FILE: package.html ---
<HTML>
<BODY>
<b>Graphical user interface (GUI)</b>.
<p/>
<p align="right"> (<b><tt>BHS2XML/GUI/package.html</tt></b>)
</p>
Crude graphical interfaces.
</BODY>
</HTML>



More information about the sword-cvs mailing list