Code cleanup for Jskad's Tibetan font converter GUI.
This commit is contained in:
parent
896344f2d1
commit
dd22e161a5
3 changed files with 25 additions and 30 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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_";
|
||||
|
|
Loading…
Reference in a new issue