Class TranslateWindow

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, ListSelectionListener, TreeSelectionListener, RootPaneContainer, WindowConstants
Direct Known Subclasses:
TranslateVassalWindow

public class TranslateWindow extends JDialog implements ListSelectionListener, TreeSelectionListener
Window for editing translations of a Configurable object
See Also:
  • Field Details

    • TRANSLATION_NEEDED_COLOR

      protected static final Color TRANSLATION_NEEDED_COLOR
    • TRANSLATION_DONE_COLOR

      protected static final Color TRANSLATION_DONE_COLOR
    • NO_TRANSLATION_NEEDED_COLOR

      protected static final Color NO_TRANSLATION_NEEDED_COLOR
    • target

      protected Translatable target
    • keys

      protected String[] keys
    • keyTable

      protected JTable keyTable
    • keyTarget

      protected Translatable keyTarget
    • tree

      protected JTree tree
    • currentTranslation

      protected Translation currentTranslation
    • langBox

      protected JComboBox<String> langBox
    • boxListener

      protected ActionListener boxListener
    • lastSelectedLangIndex

      protected int lastSelectedLangIndex
    • currentKey

      protected String currentKey
    • myConfigureTree

      protected ConfigureTree myConfigureTree
    • copyButtons

      protected VASSAL.i18n.TranslateWindow.CopyButton[] copyButtons
    • okButton

      protected JButton okButton
    • cancelButton

      protected JButton cancelButton
  • Constructor Details

  • Method Details

    • initComponents

      protected void initComponents()
    • getHeaderPanel

      protected Component getHeaderPanel()
    • getNewTranslation

      protected void getNewTranslation()
      User has clicked on the Add Translation button. Create a new PropertiesWindow for a translation and display it.
    • refreshTranslationList

      protected void refreshTranslationList(Configurable target)
      Called from MyPropertiesWindow when the user saves the new translation
      Parameters:
      target - new Translation
    • buildMainPanel

      protected Component buildMainPanel()
    • buildKeyTablePanel

      protected JPanel buildKeyTablePanel()
    • getButtonPanel

      protected Component getButtonPanel()
    • commitTableEdit

      protected void commitTableEdit()
    • changeLanguage

      protected void changeLanguage(String selectedTranslation)
      New Language selected from the drop-down box
    • valueChanged

      public void valueChanged(TreeSelectionEvent e)
      When a new node is selected, display keys for the new component in the keys table
      Specified by:
      valueChanged in interface TreeSelectionListener
    • valueChanged

      public void valueChanged(ListSelectionEvent e)
      When a key is selected in the table, display the source and translated texts in the right hand panels
      Specified by:
      valueChanged in interface ListSelectionListener
    • createNodes

      protected void createNodes(TranslateWindow.MyTreeNode top)
      Create the nodes for the JTree display
    • getDisplayName

      public static String getDisplayName(Translatable t)
    • cancel

      protected void cancel()
      Cancel button clicked. Check for outstanding changes.
    • querySave

      protected boolean querySave() throws IOException
      Throws:
      IOException
    • save

      protected void save() throws IOException
      Save button clicked
      Throws:
      IOException - oops
    • saveTranslation

      protected boolean saveTranslation() throws IOException
      Save the current Translation
      Throws:
      IOException - oops
    • reloadTranslation

      protected void reloadTranslation() throws IOException
      Reload the current translation from the archive
      Throws:
      IOException - oops