diff --git a/source/org/thdl/tib/input/ConvertDialog.java b/source/org/thdl/tib/input/ConvertDialog.java index 3d601a1..1eb3238 100644 --- a/source/org/thdl/tib/input/ConvertDialog.java +++ b/source/org/thdl/tib/input/ConvertDialog.java @@ -38,25 +38,23 @@ class ConvertDialog extends JDialog private static final boolean debug = false; // Attributes - FontConversion controller; + private FontConversion controller; - Box fileBox, buttonBox; + private Box fileBox, buttonBox; - JPanel content, choicePanel; + private JPanel content; - JComboBox choices; + JPanel getContentPanel() { return content; } + + private JComboBox choices; private JComboBox warningLevels; - JTextField oldTextField, newTextField; + private JTextField oldTextField, newTextField; - JButton browseOld, browseNew, convert, cancel, openDocOld, openDocNew, about; + private JButton browseOld, browseNew, convert, cancel, openDocOld, openDocNew, about; - JLabel oldLabel, newLabel; - - String[] choiceNames; - - JFileChooser jfc; + private JFileChooser jfc; private static final String BROWSENEW = "Browse..."; private static final String BROWSEOLD = BROWSENEW; @@ -98,8 +96,7 @@ class ConvertDialog extends JDialog content.add(temp); temp = new JPanel(new FlowLayout(FlowLayout.CENTER,5,5)); - oldLabel = new JLabel("Original File: "); - temp.add(oldLabel); + temp.add(new JLabel("Original File: ")); oldTextField = new JTextField(25); JPanel tfTemp = new JPanel(); @@ -115,8 +112,7 @@ class ConvertDialog extends JDialog content.add(temp); temp = new JPanel(new FlowLayout(FlowLayout.CENTER,5,5)); - newLabel = new JLabel("Converted File: "); - temp.add(newLabel); + temp.add(new JLabel("Converted File: ")); newTextField = new JTextField(25); tfTemp = new JPanel(); @@ -158,8 +154,7 @@ class ConvertDialog extends JDialog private void setChoices(String[] choices) { - choiceNames = choices; - this.choices = new JComboBox(choiceNames); + this.choices = new JComboBox(choices); this.choices.addActionListener(tal); } diff --git a/source/org/thdl/tib/input/ConverterGUI.java b/source/org/thdl/tib/input/ConverterGUI.java index 52300e5..bd5e701 100644 --- a/source/org/thdl/tib/input/ConverterGUI.java +++ b/source/org/thdl/tib/input/ConverterGUI.java @@ -174,27 +174,16 @@ public class ConverterGUI implements FontConversion, FontConverterConstants { returnCode = 0; try { final ConvertDialog convDialog; - String[] choices = new String[]{ - ACIP_TO_UNI, - TM_TO_TMW, - TMW_TO_UNI, - TMW_TO_WYLIE, - TMW_TO_TM, - FIND_SOME_NON_TMW, - FIND_SOME_NON_TM, - FIND_ALL_NON_TMW, - FIND_ALL_NON_TM - }; if (null == owner) { convDialog = new ConvertDialog(new ConverterGUI(), - choices, + CHOICES, true); } else { convDialog = new ConvertDialog(owner, new ConverterGUI(), - choices, + CHOICES, true); } diff --git a/source/org/thdl/tib/input/FontConverterConstants.java b/source/org/thdl/tib/input/FontConverterConstants.java index 9d4af8b..95fecbd 100644 --- a/source/org/thdl/tib/input/FontConverterConstants.java +++ b/source/org/thdl/tib/input/FontConverterConstants.java @@ -36,6 +36,17 @@ interface FontConverterConstants final String FIND_ALL_NON_TMW = "Find all non-TMW"; final String FIND_ALL_NON_TM = "Find all non-TM"; + final String[] CHOICES = new String[]{ + TM_TO_TMW, + TMW_TO_UNI, + TMW_TO_WYLIE, + TMW_TO_TM, + FIND_SOME_NON_TMW, + FIND_SOME_NON_TM, + FIND_ALL_NON_TMW, + FIND_ALL_NON_TM + }; + final String suggested_WYLIE_prefix = "THDL_Wylie_"; final String suggested_TO_TMW_prefix = "TMW_"; final String suggested_TO_UNI_prefix = "Uni_";