Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
schyzo99 committed Mar 2, 2009
1 parent f3c6db5 commit a83977b
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 19 deletions.
8 changes: 5 additions & 3 deletions RoFage/src/rofage/toolkits/FileToolkit.java
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
package rofage.toolkits;


import javax.swing.filechooser.FileFilter;
import javax.swing.filechooser.FileNameExtensionFilter;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
* This toolkit provides useful method to work on File(or related) objects
* @author Pierre Chastagner
*/
public class FileToolkit {
public abstract class FileToolkit {
private final static Log logger = LogFactory.getLog(FileToolkit.class);

public FileToolkit () {
// TODO : Create constructor
FileFilter getFileChooserFilter (String description, String extension) {
return new FileNameExtensionFilter(description, extension);
}
}
12 changes: 9 additions & 3 deletions RoFage/src/rofage/wizards/WizardFirstUse.form
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,6 @@
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Load a dat file (.dat) from the file system"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="rBtnLoadDatActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JRadioButton" name="rBtnDlDat">
<Properties>
Expand Down Expand Up @@ -394,16 +391,25 @@
<Properties>
<Property name="text" type="java.lang.String" value="Browse..."/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="jButton3">
<Properties>
<Property name="text" type="java.lang.String" value="Browse..."/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JButton" name="jButton4">
<Properties>
<Property name="text" type="java.lang.String" value="Browse..."/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton4ActionPerformed"/>
</Events>
</Component>
<Component class="javax.swing.JTextField" name="fldIconsFolder">
</Component>
Expand Down
61 changes: 48 additions & 13 deletions RoFage/src/rofage/wizards/WizardFirstUse.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import javax.swing.JFileChooser;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import rofage.toolkits.PropertiesToolkit;
Expand All @@ -26,6 +27,7 @@ public class WizardFirstUse extends javax.swing.JDialog {
private final static String SUMMARY_DAT = "# Import of the first dat\n";
private static String [] tabDatNames;
private static List<String> listErrors = new ArrayList<String>();
private JFileChooser fc = new JFileChooser();

private int currentPage = 1;
private String[] tabSummary = new String[LAST_PAGE-1];
Expand Down Expand Up @@ -239,15 +241,15 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {

jTextArea1.setBackground(javax.swing.UIManager.getDefaults().getColor("Panel.background"));
jTextArea1.setEditable(false);
jTextArea1.setFont(new java.awt.Font("Arial", 0, 13)); // NOI18N
jTextArea1.setFont(new java.awt.Font("Arial", 0, 13));
jTextArea1.setLineWrap(true);
jTextArea1.setRows(5);
jTextArea1.setText("Welcome to RoFage !\n\nRoFage stands for ROm manager For Any Good Environment. And you're just a few steps away from using it !\n\nRoFage will help you manage your rom collections with the help of dat files available on the internet. Dat files (OL compatible) exist for a lot of system, so you should be able to manage all your collections with RoFage.");
jTextArea1.setWrapStyleWord(true);
jTextArea1.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
jScrollPane1.setViewportView(jTextArea1);

jLabel1.setFont(new java.awt.Font("Arial Black", 1, 14)); // NOI18N
jLabel1.setFont(new java.awt.Font("Arial Black", 1, 14));
jLabel1.setText("Welcome !");

javax.swing.GroupLayout pnlWelcomeLayout = new javax.swing.GroupLayout(pnlWelcome);
Expand Down Expand Up @@ -279,11 +281,6 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
buttonGroup1.add(rBtnLoadDat);
rBtnLoadDat.setSelected(true);
rBtnLoadDat.setText("Load a dat file (.dat) from the file system");
rBtnLoadDat.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
rBtnLoadDatActionPerformed(evt);
}
});

buttonGroup1.add(rBtnDlDat);
rBtnDlDat.setText("Automatically download this dat");
Expand Down Expand Up @@ -349,10 +346,25 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
jLabel7.setText("Nfo main folder");

jButton2.setText("Browse...");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});

jButton3.setText("Browse...");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
}
});

jButton4.setText("Browse...");
jButton4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
}
});

javax.swing.GroupLayout pnlFoldersConfLayout = new javax.swing.GroupLayout(pnlFoldersConf);
pnlFoldersConf.setLayout(pnlFoldersConfLayout);
Expand Down Expand Up @@ -418,7 +430,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
txPaneSummary.setBackground(javax.swing.UIManager.getDefaults().getColor("Panel.background"));
txPaneSummary.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
txPaneSummary.setEditable(false);
txPaneSummary.setFont(new java.awt.Font("Monospaced", 0, 11)); // NOI18N
txPaneSummary.setFont(new java.awt.Font("Monospaced", 0, 11));
jScrollPane2.setViewportView(txPaneSummary);

javax.swing.GroupLayout pnlSummaryLayout = new javax.swing.GroupLayout(pnlSummary);
Expand Down Expand Up @@ -565,14 +577,37 @@ private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event
System.exit(-1);
}//GEN-LAST:event_formWindowClosed

private void rBtnLoadDatActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rBtnLoadDatActionPerformed
// TODO add your handling code here:
}//GEN-LAST:event_rBtnLoadDatActionPerformed

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
// TODO add your handling code here:
fc.setDialogTitle("Select your dat file");
if (fc.showOpenDialog(this)==JFileChooser.APPROVE_OPTION) {
fldImageFolder.setText(fc.getSelectedFile().getAbsolutePath());
}
}//GEN-LAST:event_jButton1ActionPerformed

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
fc.setDialogTitle("Select your image folder");
if (fc.showOpenDialog(this)==JFileChooser.APPROVE_OPTION) {
fldImageFolder.setText(fc.getSelectedFile().getAbsolutePath());
}
}//GEN-LAST:event_jButton2ActionPerformed

private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
fc.setDialogTitle("Select your icons folder");
if (fc.showOpenDialog(this)==JFileChooser.APPROVE_OPTION) {
fldIconsFolder.setText(fc.getSelectedFile().getAbsolutePath());
}
}//GEN-LAST:event_jButton3ActionPerformed

private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton4ActionPerformed
fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
fc.setDialogTitle("Select your nfo folder");
if (fc.showOpenDialog(this)==JFileChooser.APPROVE_OPTION) {
fldNfoFolder.setText(fc.getSelectedFile().getAbsolutePath());
}
}//GEN-LAST:event_jButton4ActionPerformed

/**
* @param args the command line arguments
*/
Expand Down

0 comments on commit a83977b

Please sign in to comment.