Skip to content

Commit

Permalink
Filechooser is now common to all components
Browse files Browse the repository at this point in the history
  • Loading branch information
dinasv committed Sep 5, 2018
1 parent ae03f25 commit 3d4292c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/Main/java/MVC/View/InputParametersDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ public class InputParametersDialog extends JDialog {

JFileChooser fc;

public InputParametersDialog() {
public InputParametersDialog(JFileChooser fc) {

fc = new JFileChooser(System.getProperty("user.dir"));
this.fc = fc;
setTitle("Parameters");

initLabels();
Expand Down
7 changes: 5 additions & 2 deletions src/Main/java/MVC/View/MainFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ public class MainFrame extends JFrame {

private ProgressBar progressBar;

private JFileChooser fc;

public MainFrame(CSBFinderController controller) {
super("CSBFinder");

setUIFont (new javax.swing.plaf.FontUIResource("Serif",Font.PLAIN,16));

fc = new JFileChooser(System.getProperty("user.dir"));

this.controller = controller;

Expand Down Expand Up @@ -72,9 +75,9 @@ public void clearPanels(){

public void initComponents() {

inputParamsDialog = new InputParametersDialog();
inputParamsDialog = new InputParametersDialog(fc);

toolbar = new Toolbar();
toolbar = new Toolbar(fc);
genomes = new GenomePanel();
summaryPanel = new SummaryPanel();

Expand Down
5 changes: 2 additions & 3 deletions src/Main/java/MVC/View/Toolbar.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ public class Toolbar extends JPanel {

private JFileChooser fc;

public Toolbar() {

fc = new JFileChooser(System.getProperty("user.dir"));
public Toolbar(JFileChooser fc) {
this.fc = fc;

setBorder(BorderFactory.createEtchedBorder());
loadFile = new JButton("Load Input Genomes");
Expand Down

0 comments on commit 3d4292c

Please sign in to comment.