use of de.neemann.gui.language.Language in project Digital by hneemann.
the class DocuTest method testDocu.
public void testDocu() throws IOException, NodeException, PinException, TransformerException, SAXException {
FopFactory fopFactory = FopFactory.newInstance(new File(Resources.getRoot(), "docu/fop.xconf"));
File maven = Resources.getRoot().getParentFile().getParentFile().getParentFile();
File target = new File(maven, "target/docu");
File target2 = new File(maven, "target/docuDist");
File images = new File(target, "img");
images.mkdirs();
target2.mkdirs();
final File library = new File(target, "library.xml");
write74xx(library);
for (Language l : Lang.getBundle().getSupportedLanguages()) {
// set language
Lang.setActualRuntimeLanguage(l);
final String basename = "Documentation_" + l.getName();
// write xml
File xml = new File(target, basename + ".xml");
try (Writer w = new OutputStreamWriter(new FileOutputStream(xml), "UTF-8")) {
writeXML(w, images, l.getName(), library);
}
// start xslt transformation
File xslFO = new File(target, basename + ".fo");
File xslt = new File(Resources.getRoot(), "docu/elem2fo.xslt");
startXalan(xml, xslt, xslFO);
// write pdf
File pdf = new File(target, basename + ".pdf");
startFOP(fopFactory, xslFO, pdf);
copy(pdf, new File(target2, "Doc_" + l + ".pdf"));
}
}
use of de.neemann.gui.language.Language in project Digital by hneemann.
the class ScreenShots method mainScreenShot.
private static void mainScreenShot() {
Lang.setActualRuntimeLanguage(new Language("en"));
Settings.getInstance().getAttributes().set(Keys.SETTINGS_IEEE_SHAPES, true);
new GuiTester("../../main/dig/processor/Processor.dig", "examples/processor/Processor.dig").press(' ').delay(500).add(new GuiTester.WindowCheck<>(GraphicDialog.class, (gt, gd) -> {
graphic = gd;
final Main main = (Main) gd.getParent();
main.getCircuitComponent().requestFocus();
})).delay(500).press(' ').add((gt) -> graphic.dispose()).delay(500).press("F1").add(new MainScreenShot("screenshot.png")).execute();
new GuiTester().press("F10").press("RIGHT", 4).press("DOWN", 3).press("ENTER").delay(500).press("control typed a").type("A B + B !C + A !C").add(new GuiTester.SetFocusTo<>(ExpressionDialog.class, comp -> comp instanceof JButton && ((JButton) comp).getText().equals(Lang.get("btn_create")))).press("SPACE").delay(500).press("control typed -", 1).add(new GuiTester.WindowCheck<>(Main.class, (gt, main) -> main.getCircuitComponent().translateCircuit(-120, 0))).delay(500).press("F9").delay(500).add(new GuiTester.WindowCheck<>(TableDialog.class, (gt, td) -> {
td.getContentPane().setPreferredSize(new Dimension(370, 280));
td.pack();
final Point location = td.getParent().getLocation();
location.x += 640;
location.y += 410;
td.setLocation(location);
})).delay(500).press("F1").delay(500).add(new GuiTester.WindowCheck<>(KarnaughMapDialog.class, (gt, td) -> {
final Point location = td.getParent().getLocation();
location.x -= 150;
location.y -= 340;
td.setLocation(location);
td.getContentPane().setPreferredSize(new Dimension(390, 300));
td.pack();
})).delay(500).add(new MainScreenShot("screenshot2.png")).add(new GuiTester.CloseTopMost()).add(new GuiTester.CloseTopMost()).add(new GuiTester.CloseTopMost()).execute();
}
use of de.neemann.gui.language.Language in project Digital by hneemann.
the class ScreenShots method all.
private static void all() {
// english
Lang.setActualRuntimeLanguage(new Language("en"));
Settings.getInstance().getAttributes().set(Keys.SETTINGS_GRID, true).set(Keys.SETTINGS_IEEE_SHAPES, true);
mainScreenShot();
firstSteps();
hierarchicalDesign();
// german
Lang.setActualRuntimeLanguage(new Language("de"));
Settings.getInstance().getAttributes().set(Keys.SETTINGS_IEEE_SHAPES, false);
firstSteps();
hierarchicalDesign();
}
Aggregations