Package org.foray.core

Examples of org.foray.core.FOrayException


        case AWT: {
            renderer = new AWTRenderer(logger, outputOptions);
            break;
        }
        case PRINT: {
            throw new FOrayException("Print renderer cannot be instantiated "
                    + "from the standard method.");
        }
        case PCL: {
            renderer = new PCLRenderer(logger, outputOptions);
            break;
View Full Code Here


        this.userMessage = new UserMessage();
        try {
            UIManager.setLookAndFeel(
                    new javax.swing.plaf.metal.MetalLookAndFeel());
        } catch (final UnsupportedLookAndFeelException e) {
            throw new FOrayException(e);
        }

        String language = getCommandLineOptions().getLanguage();
        if (language == null) {
            try {
                language = System.getProperty("user.language");
            } catch (final SecurityException se) {
                // if this is running in a secure place
            }
        }
        try {
            this.resource = getResourceBundle(AWTStarter.TRANSLATION_PATH + "resources." + language);
            this.userMessage.setTranslator(getResourceBundle(AWTStarter.TRANSLATION_PATH + "messages." + language));
        } catch (final IOException e) {
            throw new FOrayException(e);
        }

        final SessionConfig configuration = getOptions().getSessionConfig();
        final FOraySession session = FOraySpecific.makeFOraySession(
                configuration);

        this.document = new FOrayDocument(session, getInputSource(), null);

        final OutputConfig renderOptions =
                getCommandLineOptions().getRendererOptions();
        this.renderer = new AWTRenderer(this.getLogger(), renderOptions);
        try {
            this.frame = createPreviewDialog(this.renderer, this.resource);
        } catch (final OutputException e) {
            throw new FOrayException(e);
        }
        this.renderer.setComponent(this.frame);
        this.frame.progress(this.resource.getString("Init parser") + " ...");
    }
View Full Code Here

            throws FOrayException {
        InputSource inputSource;
        try {
            inputSource = new InputSource(foFile.toURI().toURL().openStream());
        } catch (final MalformedURLException e) {
            throw new FOrayException(e);
        } catch (final IOException e) {
            throw new FOrayException(e);
        }

        OutputStream out = null;
        try {
            final File dir = outFile.getParentFile();
View Full Code Here

                configuration);

        final PrinterJob pj = PrinterJob.getPrinterJob();
        if (System.getProperty("dialog") != null) {
            if (! pj.printDialog()) {
                throw new FOrayException("Printing cancelled by operator");
            }
        }
        final int copies = getIntProperty("copies", 1);
        pj.setCopies(copies);
        pj.setJobName("FOray Document");
View Full Code Here

        forayFontServer.setEntityResolver(entityResolver);
        try {
            forayFontServer.setup(configuration.optionFontConfiguration(),
                    null);
        } catch (final FontException e) {
            throw new FOrayException(e);
        }
        return forayFontServer;
    }
View Full Code Here

    private FileOutputStream getFileOutputStream() throws FOrayException {
        final File outputFile = this.commandLineOptions.getOutputFile();
        try {
            return new FileOutputStream(outputFile);
        } catch (final FileNotFoundException e) {
            throw new FOrayException(e);
        }
    }
View Full Code Here

    public InputSource getInputSource() throws FOrayException {
        if (this.commandLineOptions.getInputMode() == CommandLineOptions.INPUT_FO) {
            try {
                return new InputSource(this.commandLineOptions.getFOFile().openStream());
            } catch (final IOException e) {
                throw new FOrayException("Error creating InputSource: " + e.getClass().getName() + ": "
                        + e.getMessage() + " (" + this.commandLineOptions.getFOFile() + ")", e);
            }
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.foray.core.FOrayException

Copyright © 2018 www.massapicom. 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.