Examples of ATextScreenOutputJFrame


Examples of com.atolsystems.atolutilities.ATextScreenOutputJFrame

    void init() throws IOException {
        pos = new PipedOutputStream();
        outStream = new PrintStream(pos);
        //dialog = new ATextScreenOutput(null, false, true);
        dialog = new ATextScreenOutputJFrame(true);
        dialog.setTitle(this.getClass().getSimpleName()+" "+ATimeUtilities.getTimeForUi());
        dialog.monitorStream(pos);
        logHandler = new ScardPrintStreamLogHandler(outStream);
        //dialog.setVisible(true);
    }
View Full Code Here

Examples of com.atolsystems.atolutilities.ATextScreenOutputJFrame

    List<File> logFiles = null;
    StdParams params;

    public void nimpSmartCardShell(String[] args) throws FileNotFoundException, IOException, InterruptedException, ScardException, ClassNotFoundException, InstantiationException, IllegalAccessException, UnsupportedLookAndFeelException {
        long start = System.nanoTime();
        ATextScreenOutputJFrame mainWindow;

        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        final SplashScreen splash = SplashScreen.getSplashScreen();

        PipedOutputStream pos = new PipedOutputStream();
        PrintStream outputStream = new PrintStream(pos);
        mainWindow = new ATextScreenOutputJFrame(true);
        mainWindow.monitorStream(pos);
        mainWindow.setTitle(ATimeUtilities.getTimeForUi() + " - Nimp smart card script player");

        System.setOut(outputStream);
        System.setErr(outputStream);

        if (splash != null) {
            splash.close();
        }

        mainWindow.setExtendedState(JFrame.MAXIMIZED_BOTH);
        mainWindow.setBackground(mainWindow.getBackground());//this get the system color for window background and apply it to the log area
        mainWindow.setVisible(true);

        ACommandLineUtilities.dispArgs(args);

        ACommandLineUtilities clUtil = null;
        try {
            List<GenericTerminal> availableTerminals = new LinkedList<GenericTerminal>();
            ArgSpec argSpecs[] = {
                new ArgSpec(ARG_PARALLEL_MODE, ARG_PARALLEL_MODE_ID),
                new ArgSpec(ARG_CHECK_CARD_CONNECTION, ARG_CHECK_CARD_CONNECTION_ID)
            };

            //params = processStdArgs(args, argSpecs, Main.class, "NimpSmartCardScriptPlayer");
            ArgSpec internalArgSpecs[] = addStdArgSpecs(argSpecs);
            //internalArgSpecs = ACommandLineUtilities.addArgFileArgSpecs(internalArgSpecs);
            Set specs = ACommandLineUtilities.addArgFileArgSpecs(internalArgSpecs);
            internalArgSpecs = new ArgSpec[specs.size()];
            specs.toArray(internalArgSpecs);

            ConfigArgProcessor configArgProcessor = new ConfigArgProcessor(Main.class, "NimpSmartCardScriptPlayer");
            clUtil = new ACommandLineUtilities(new File(AFileUtilities.getCurrentDirectory()), args, internalArgSpecs, configArgProcessor, true);
            clUtil.processArgs();
            clUtil.setAllowUnprocessedArgs(false);
            clUtil.throwIfError();

            params = configArgProcessor.getStdParams();
            //params.args = clUtil.getArgsAsArray();
            params.args=null;

            getAvailableTerminals(params.terminalManagers, availableTerminals);

            if (0 == availableTerminals.size()) {
                printNoTerminalMessage(params.terminalManagers);
                //throw new RuntimeException();
                error = new RuntimeException();
                return;
            }

            try {
                long startOfTerminalChooser = System.nanoTime();
                selectedTerminals = new LinkedList<GenericTerminal>();
                players = new LinkedList<ScriptPlayer>();
                errors = new LinkedList<Boolean>();
                logFiles = new LinkedList<File>();
                if (clUtil.hasArg(ARG_PARALLEL_MODE)) {
                    StringBuilder sb = new StringBuilder("Cards detected in following readers:\n");
                    StringBuilder terminalNames = new StringBuilder();
                    for (GenericTerminal terminal : availableTerminals) {
                        if (terminal.isCardPresent()) {
                            selectedTerminals.add(terminal);
                            players.add(new ScriptPlayer());
                            errors.add(Boolean.FALSE);
                            logFiles.add(null);
                            terminalNames.append("\t- ");
                            terminalNames.append(terminal.getName());
                            terminalNames.append("\n");
                        }
                    }
                    if (0 == selectedTerminals.size()) {
                        System.out.println("Could not find any card.");
                        mainWindow.setBackground(Color.red);
                        return;
                    }
                    if (clUtil.hasArg(ARG_FIXED_PARALLEL_MODE)) {

                        String nTerminalsStr = clUtil.getArgValue(ARG_FIXED_PARALLEL_MODE, null);
View Full Code Here

Examples of com.atolsystems.atolutilities.ATextScreenOutputJFrame

        //check if an instance exist

        //otherwise:
        UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

        ATextScreenOutputJFrame mainWindow;
        final SplashScreen splash = SplashScreen.getSplashScreen();

        PipedOutputStream pos = new PipedOutputStream();
        PrintStream outputStream = new PrintStream(pos);
        mainWindow = new ATextScreenOutputJFrame(true);
        //Font outputFont=new Font("Monospaced", 0, 10);
        //mainWindow.setFont(outputFont);
        mainWindow.monitorStream(pos);
        mainWindow.setTitle(ATimeUtilities.getTimeForUi() + " - Nimp smart card script player (build "+getBuildNumber()+")");

       
        System.setOut(outputStream);
        System.setErr(outputStream);

        if (splash != null) {
            splash.close();
        }

        mainWindow.setExtendedState(JFrame.MAXIMIZED_BOTH);
        mainWindow.setBackground(mainWindow.getBackground());//this get the system color for window background and apply it to the log area
        mainWindow.setVisible(true);


        TerminalManager terminalManager = new TerminalManager("NimpSmartCardScriptPlayer");
        boolean errorOccured=terminalManager.processArgs(args);
        int autoCloseTimeout;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.