Multilanguage support

Czech language added
This commit is contained in:
Jindra Petk
2013-07-01 19:42:56 +02:00
parent 03932b6e69
commit f7bbb8577f
79 changed files with 1677 additions and 461 deletions

View File

@@ -0,0 +1,117 @@
/*
* Copyright (C) 2010-2013 JPEXS
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package com.jpexs.decompiler.flash.gui.abc;
import com.jpexs.decompiler.flash.gui.AppDialog;
import com.jpexs.decompiler.flash.gui.View;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.Hashtable;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JDialog;
import javax.swing.JLabel;
import javax.swing.JSlider;
/**
*
* @author JPEXS
*/
public class DeobfuscationDialog extends AppDialog implements ActionListener {
public JCheckBox processAllCheckbox = new JCheckBox(translate("processallclasses"));
public JSlider codeProcessingLevel;
public boolean ok = false;
public static final int LEVEL_REMOVE_DEAD_CODE = 1;
public static final int LEVEL_REMOVE_TRAPS = 2;
public static final int LEVEL_RESTORE_CONTROL_FLOW = 3;
@SuppressWarnings("unchecked")
public DeobfuscationDialog() {
setDefaultCloseOperation(HIDE_ON_CLOSE);
setSize(new Dimension(300, 270));
setTitle(translate("dialog.title"));
Container cp = getContentPane();
cp.setLayout(null);
codeProcessingLevel = new JSlider(JSlider.VERTICAL, 1, 3, 3);
codeProcessingLevel.setMajorTickSpacing(1);
codeProcessingLevel.setPaintTicks(true);
codeProcessingLevel.setMinorTickSpacing(1);
codeProcessingLevel.setSnapToTicks(true);
JLabel lab1 = new JLabel(translate("deobfuscation.level"));
lab1.setBounds(30, 0, getWidth() - 60, 25);
cp.add(lab1);
Hashtable labelTable = new Hashtable();
//labelTable.put(new Integer(LEVEL_NONE), new JLabel("None"));
labelTable.put(new Integer(LEVEL_REMOVE_DEAD_CODE), new JLabel(translate("deobfuscation.removedeadcode")));
labelTable.put(new Integer(LEVEL_REMOVE_TRAPS), new JLabel(translate("deobfuscation.removetraps")));
labelTable.put(new Integer(LEVEL_RESTORE_CONTROL_FLOW), new JLabel(translate("deobfuscation.restorecontrolflow")));
codeProcessingLevel.setLabelTable(labelTable);
codeProcessingLevel.setPaintLabels(true);
codeProcessingLevel.setAlignmentX(Component.CENTER_ALIGNMENT);
codeProcessingLevel.setSize(300, 200);
codeProcessingLevel.setBounds(30, 25, getWidth() - 60, 125);
add(codeProcessingLevel);
processAllCheckbox.setBounds(50, 150, getWidth() - 100, 25);
add(processAllCheckbox);
processAllCheckbox.setSelected(true);
JButton cancelButton = new JButton(translate("button.cancel"));
cancelButton.addActionListener(this);
cancelButton.setActionCommand("CANCEL");
JButton okButton = new JButton(translate("button.ok"));
okButton.addActionListener(this);
okButton.setActionCommand("OK");
okButton.setBounds(50, 200, 75, 25);
cancelButton.setBounds(145, 200, 75, 25);
cp.add(okButton);
cp.add(cancelButton);
setModal(true);
View.centerScreen(this);
View.setWindowIcon(this);
}
@Override
public void actionPerformed(ActionEvent e) {
if (e.getActionCommand().equals("OK")) {
ok = true;
setVisible(false);
}
if (e.getActionCommand().equals("CANCEL")) {
ok = false;
setVisible(false);
}
}
@Override
public void setVisible(boolean b) {
if (b) {
ok = false;
}
super.setVisible(b);
}
}