mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-22 11:55:15 -04:00
adds missing language keys, see #631
This commit is contained in:
parent
1a25ac7279
commit
d3f7403077
@ -443,13 +443,13 @@ public class TableDialog extends JDialog {
|
||||
|
||||
JMenu export = new JMenu(Lang.get("menu_export"));
|
||||
fileMenu.add(export);
|
||||
export.add(new FileExportAction(Lang.get("menu_table_exportHex"), "hex") {
|
||||
export.add(new FileExportActionConfirm(Lang.get("menu_table_exportHex"), "hex") {
|
||||
@Override
|
||||
protected String getString() throws FormatterException, ExpressionException {
|
||||
return new TruthTableFormatterHex().format(undoManager.getActual());
|
||||
}
|
||||
}.setToolTip(Lang.get("menu_table_exportHex_tt")).createJMenuItem());
|
||||
export.add(new FileExportAction(Lang.get("menu_table_exportTableCSVCondensed"), "csv") {
|
||||
export.add(new FileExportAction(Lang.get("menu_table_exportCSVCondensed"), "csv") {
|
||||
@Override
|
||||
protected String getString() throws FormatterException, ExpressionException {
|
||||
ExpressionListenerCSVCondensed expressionListener = new ExpressionListenerCSVCondensed();
|
||||
@ -457,13 +457,13 @@ public class TableDialog extends JDialog {
|
||||
expressionListener.close();
|
||||
return expressionListener.toString();
|
||||
}
|
||||
}.setToolTip(Lang.get("menu_table_exportTableCSVCondensed")).createJMenuItem());
|
||||
export.add(new FileExportAction(Lang.get("menu_table_exportTableCSV"), "csv") {
|
||||
}.setToolTip(Lang.get("menu_table_exportCSVCondensed_tt")).createJMenuItem());
|
||||
export.add(new FileExportActionConfirm(Lang.get("menu_table_exportCSV"), "csv") {
|
||||
@Override
|
||||
protected String getString() throws FormatterException, ExpressionException {
|
||||
protected String getString() throws ExpressionException {
|
||||
return new TruthTableFormatterCSV().format(undoManager.getActual());
|
||||
}
|
||||
}.setToolTip(Lang.get("menu_table_exportTableCSV")).createJMenuItem());
|
||||
}.setToolTip(Lang.get("menu_table_exportCSV_tt")).createJMenuItem());
|
||||
|
||||
createJK = new JCheckBoxMenuItem(Lang.get("menu_table_JK"));
|
||||
createJK.addActionListener(e -> calculateExpressions());
|
||||
@ -1020,22 +1020,44 @@ public class TableDialog extends JDialog {
|
||||
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
JFileChooser fc = new MyFileChooser();
|
||||
if (TableDialog.this.filename != null)
|
||||
fc.setSelectedFile(SaveAsHelper.checkSuffix(TableDialog.this.filename, suffix));
|
||||
new SaveAsHelper(TableDialog.this, fc, suffix)
|
||||
.checkOverwrite(file -> {
|
||||
try {
|
||||
try (Writer w = new FileWriter(file)) {
|
||||
w.write(getString());
|
||||
if (confirmExport()) {
|
||||
JFileChooser fc = new MyFileChooser();
|
||||
if (TableDialog.this.filename != null)
|
||||
fc.setSelectedFile(SaveAsHelper.checkSuffix(TableDialog.this.filename, suffix));
|
||||
new SaveAsHelper(TableDialog.this, fc, suffix)
|
||||
.checkOverwrite(file -> {
|
||||
try {
|
||||
try (Writer w = new FileWriter(file)) {
|
||||
w.write(getString());
|
||||
}
|
||||
} catch (FormatterException | ExpressionException ex) {
|
||||
throw new IOException(ex);
|
||||
}
|
||||
} catch (FormatterException | ExpressionException ex) {
|
||||
throw new IOException(ex);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
protected boolean confirmExport() {
|
||||
return true;
|
||||
}
|
||||
|
||||
protected abstract String getString() throws FormatterException, ExpressionException;
|
||||
}
|
||||
|
||||
private abstract class FileExportActionConfirm extends FileExportAction {
|
||||
|
||||
private FileExportActionConfirm(String name, String suffix) {
|
||||
super(name, suffix);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean confirmExport() {
|
||||
int res = JOptionPane.OK_OPTION;
|
||||
if (undoManager.getActual().getVars().size() > 20)
|
||||
res = JOptionPane.showConfirmDialog(TableDialog.this, Lang.get("msg_tableHasManyRowsConfirm"));
|
||||
return res == JOptionPane.OK_OPTION;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1835,8 +1835,12 @@ Sind evtl. die Namen der Variablen nicht eindeutig?</string>
|
||||
rein kombinatorisch ist!
|
||||
</string>
|
||||
|
||||
<string name="menu_table_exportHex">Erzeuge HEX</string>
|
||||
<string name="menu_table_exportHex">HEX</string>
|
||||
<string name="menu_table_exportHex_tt">Die HEX-Datei kann in ein ROM oder eine LUT geladen werden.</string>
|
||||
<string name="menu_table_exportCSV">CSV</string>
|
||||
<string name="menu_table_exportCSV_tt">Eine CSV Datei, welche die komplette Warheitstabelle enthält.</string>
|
||||
<string name="menu_table_exportCSVCondensed">CSV, Primimplikanten</string>
|
||||
<string name="menu_table_exportCSVCondensed_tt">Eine CSV Datei, welche nur die Primimplikanten enthält.</string>
|
||||
<string name="menu_table_new">Neu</string>
|
||||
<string name="menu_table_new_combinatorial">Kombinatorisch</string>
|
||||
<string name="menu_table_new_sequential">Automat</string>
|
||||
|
@ -1821,8 +1821,12 @@
|
||||
purely combinatorial!
|
||||
</string>
|
||||
|
||||
<string name="menu_table_exportHex">Export HEX</string>
|
||||
<string name="menu_table_exportHex">HEX</string>
|
||||
<string name="menu_table_exportHex_tt">You can load the HEX file to a ROM or a LUT.</string>
|
||||
<string name="menu_table_exportCSV">CSV</string>
|
||||
<string name="menu_table_exportCSV_tt">A CSV file containing the complete truth table.</string>
|
||||
<string name="menu_table_exportCSVCondensed">CSV, prime implicants</string>
|
||||
<string name="menu_table_exportCSVCondensed_tt">A CSV file containing only the prime implicants.</string>
|
||||
<string name="menu_table_new">New</string>
|
||||
<string name="menu_table_new_combinatorial">Combinatorial</string>
|
||||
<string name="menu_table_new_sequential">Sequential</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user