fixed wrong output ordering in screenshot

This commit is contained in:
hneemann 2018-12-01 21:24:55 +01:00
parent 07f60f0ca9
commit 34ee212bf4
3 changed files with 38 additions and 9 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 89 KiB

View File

@ -515,7 +515,19 @@ public class TableDialog extends JDialog {
}
}
void setModel(TruthTableTableModel model) {
/**
* @return the used table model
*/
public TruthTableTableModel getModel() {
return model;
}
/**
* Sets the table model
*
* @param model the model to use
*/
public void setModel(TruthTableTableModel model) {
this.model = model;
model.addTableModelListener(new CalculationTableModelListener());
table.setModel(model);

View File

@ -5,6 +5,8 @@
*/
package de.neemann.digital.docu;
import de.neemann.digital.analyse.TruthTable;
import de.neemann.digital.analyse.TruthTableTableModel;
import de.neemann.digital.core.element.Keys;
import de.neemann.digital.fsm.gui.FSMFrame;
import de.neemann.digital.gui.Main;
@ -14,6 +16,7 @@ import de.neemann.digital.gui.components.expression.ExpressionDialog;
import de.neemann.digital.gui.components.graphics.GraphicDialog;
import de.neemann.digital.gui.components.karnaugh.KarnaughMapDialog;
import de.neemann.digital.gui.components.table.AllSolutionsDialog;
import de.neemann.digital.gui.components.table.ReorderOutputs;
import de.neemann.digital.gui.components.table.TableDialog;
import de.neemann.digital.gui.components.testing.TestCaseDescriptionDialog;
import de.neemann.digital.gui.components.testing.ValueTableDialog;
@ -147,14 +150,18 @@ public class ScreenShots {
.press("DOWN", 1)
.press("ENTER")
.delay(500)
.add(new GuiTester.WindowCheck<>(Window.class, (guiTester, window) -> {
if (window instanceof AllSolutionsDialog)
window.dispose();
else
if (window instanceof TableDialog)
((TableDialog)window).getAllSolutionsDialog().dispose();
.add(closeAllSolutionsDialog())
.delay(500)
.add(new GuiTester.WindowCheck<>(TableDialog.class, (guiTester, tableDialog) -> {
TruthTable tt = tableDialog.getModel().getTable();
ReorderOutputs ro = new ReorderOutputs(tt);
ro.getItems().swap(3,4);
ro.getItems().swap(4,5);
tableDialog.setModel(new TruthTableTableModel(ro.reorder()));
}))
.add(new GuiTester.WindowCheck<>(TableDialog.class))
.delay(500)
.add(closeAllSolutionsDialog())
.delay(500)
.press("F10")
.press("RIGHT", 4)
.press("DOWN", 2)
@ -162,7 +169,7 @@ public class ScreenShots {
.delay(500)
.add(new GuiTester.WindowCheck<>(Main.class,
(gt, main) -> {
main.getCircuitComponent().translateCircuit(-300, 0);
main.getCircuitComponent().translateCircuit(-40, 0);
mainStatic = main;
}))
.delay(500)
@ -189,6 +196,16 @@ public class ScreenShots {
.execute();
}
private static GuiTester.WindowCheck<Window> closeAllSolutionsDialog() {
return new GuiTester.WindowCheck<>(Window.class, (guiTester, window) -> {
if (window instanceof AllSolutionsDialog)
window.dispose();
else
if (window instanceof TableDialog)
((TableDialog)window).getAllSolutionsDialog().dispose();
});
}
// Set all settings as needed before start this method
private static void firstSteps() {
ScreenShot.n = 0;