Example usage for java.lang Package getImplementationVersion

List of usage examples for java.lang Package getImplementationVersion

Introduction

In this page you can find the example usage for java.lang Package getImplementationVersion.

Prototype

public String getImplementationVersion() 

Source Link

Document

Return the version of this implementation.

Usage

From source file:mod.org.dcm4che2.tool.DcmQR.java

private static CommandLine parse(String[] args) {
    Options opts = new Options();

    OptionBuilder.withArgName("name");
    OptionBuilder.hasArg();/*from  w  ww . j  a v a  2 s  . c  om*/
    OptionBuilder.withDescription("set device name, use DCMQR by default");
    opts.addOption(OptionBuilder.create("device"));

    OptionBuilder.withArgName("aet[@host][:port]");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("set AET, local address and listening port of local"
            + "Application Entity, use device name and pick up any valid "
            + "local address to bind the socket by default");
    opts.addOption(OptionBuilder.create("L"));

    OptionBuilder.withArgName("username");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription(
            "enable User Identity Negotiation with specified username and " + " optional passcode");
    opts.addOption(OptionBuilder.create("username"));

    OptionBuilder.withArgName("passcode");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription(
            "optional passcode for User Identity Negotiation, " + "only effective with option -username");
    opts.addOption(OptionBuilder.create("passcode"));

    opts.addOption("uidnegrsp", false,
            "request positive User Identity Negotation response, " + "only effective with option -username");

    OptionBuilder.withArgName("NULL|3DES|AES");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("enable TLS connection without, 3DES or AES encryption");
    opts.addOption(OptionBuilder.create("tls"));

    OptionGroup tlsProtocol = new OptionGroup();
    tlsProtocol.addOption(new Option("tls1", "disable the use of SSLv3 and SSLv2 for TLS connections"));
    tlsProtocol.addOption(new Option("ssl3", "disable the use of TLSv1 and SSLv2 for TLS connections"));
    tlsProtocol.addOption(new Option("no_tls1", "disable the use of TLSv1 for TLS connections"));
    tlsProtocol.addOption(new Option("no_ssl3", "disable the use of SSLv3 for TLS connections"));
    tlsProtocol.addOption(new Option("no_ssl2", "disable the use of SSLv2 for TLS connections"));
    opts.addOptionGroup(tlsProtocol);

    opts.addOption("noclientauth", false, "disable client authentification for TLS");

    OptionBuilder.withArgName("file|url");
    OptionBuilder.hasArg();
    OptionBuilder
            .withDescription("file path or URL of P12 or JKS keystore, resource:tls/test_sys_1.p12 by default");
    opts.addOption(OptionBuilder.create("keystore"));

    OptionBuilder.withArgName("password");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("password for keystore file, 'secret' by default");
    opts.addOption(OptionBuilder.create("keystorepw"));

    OptionBuilder.withArgName("password");
    OptionBuilder.hasArg();
    OptionBuilder
            .withDescription("password for accessing the key in the keystore, keystore password by default");
    opts.addOption(OptionBuilder.create("keypw"));

    OptionBuilder.withArgName("file|url");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("file path or URL of JKS truststore, resource:tls/mesa_certs.jks by default");
    opts.addOption(OptionBuilder.create("truststore"));

    OptionBuilder.withArgName("password");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("password for truststore file, 'secret' by default");
    opts.addOption(OptionBuilder.create("truststorepw"));

    OptionBuilder.withArgName("aet");
    OptionBuilder.hasArg();
    OptionBuilder
            .withDescription("retrieve instances of matching entities by C-MOVE to specified destination.");
    opts.addOption(OptionBuilder.create("cmove"));

    opts.addOption("nocfind", false,
            "retrieve instances without previous query - unique keys must be specified by -q options");

    opts.addOption("cget", false, "retrieve instances of matching entities by C-GET.");

    OptionBuilder.withArgName("cuid[:ts]");
    OptionBuilder.hasArgs();
    OptionBuilder.withDescription("negotiate support of specified Storage SOP Class and Transfer "
            + "Syntaxes. The Storage SOP Class may be specified by its UID "
            + "or by one of following key words:\n" + "CR  - Computed Radiography Image Storage\n"
            + "CT  - CT Image Storage\n" + "MR  - MRImageStorage\n" + "US  - Ultrasound Image Storage\n"
            + "NM  - Nuclear Medicine Image Storage\n" + "PET - PET Image Storage\n"
            + "SC  - Secondary Capture Image Storage\n" + "XA  - XRay Angiographic Image Storage\n"
            + "XRF - XRay Radiofluoroscopic Image Storage\n"
            + "DX  - Digital X-Ray Image Storage for Presentation\n"
            + "MG  - Digital Mammography X-Ray Image Storage for Presentation\n"
            + "PR  - Grayscale Softcopy Presentation State Storage\n"
            + "KO  - Key Object Selection Document Storage\n"
            + "SR  - Basic Text Structured Report Document Storage\n"
            + "The Transfer Syntaxes may be specified by a comma "
            + "separated list of UIDs or by one of following key " + "words:\n"
            + "IVRLE - offer only Implicit VR Little Endian " + "Transfer Syntax\n"
            + "LE - offer Explicit and Implicit VR Little Endian " + "Transfer Syntax\n"
            + "BE - offer Explicit VR Big Endian Transfer Syntax\n"
            + "DEFL - offer Deflated Explicit VR Little " + "Endian Transfer Syntax\n"
            + "JPLL - offer JEPG Loss Less Transfer Syntaxes\n" + "JPLY - offer JEPG Lossy Transfer Syntaxes\n"
            + "MPEG2 - offer MPEG2 Transfer Syntax\n" + "NOPX - offer No Pixel Data Transfer Syntax\n"
            + "NOPXD - offer No Pixel Data Deflate Transfer Syntax\n"
            + "If only the Storage SOP Class is specified, all "
            + "Transfer Syntaxes listed above except No Pixel Data "
            + "and No Pixel Data Delflate Transfer Syntax are " + "offered.");
    opts.addOption(OptionBuilder.create("cstore"));

    OptionBuilder.withArgName("dir");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("store received objects into files in specified directory <dir>."
            + " Do not store received objects by default.");
    opts.addOption(OptionBuilder.create("cstoredest"));

    opts.addOption("ivrle", false, "offer only Implicit VR Little Endian Transfer Syntax.");

    OptionBuilder.withArgName("maxops");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription(
            "maximum number of outstanding C-MOVE-RQ " + "it may invoke asynchronously, 1 by default.");
    opts.addOption(OptionBuilder.create("async"));

    OptionBuilder.withArgName("maxops");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("maximum number of outstanding storage operations performed "
            + "asynchronously, unlimited by default.");
    opts.addOption(OptionBuilder.create("storeasync"));

    opts.addOption("noextneg", false, "disable extended negotiation.");
    opts.addOption("rel", false, "negotiate support of relational queries and retrieval.");
    opts.addOption("datetime", false, "negotiate support of combined date and time attribute range matching.");
    opts.addOption("fuzzy", false, "negotiate support of fuzzy semantic person name attribute matching.");

    opts.addOption("retall", false,
            "negotiate private FIND SOP Classes " + "to fetch all available attributes of matching entities.");
    opts.addOption("blocked", false, "negotiate private FIND SOP Classes "
            + "to return attributes of several matching entities per FIND " + "response.");
    opts.addOption("vmf", false, "negotiate private FIND SOP Classes to "
            + "return attributes of legacy CT/MR images of one series as " + "virtual multiframe object.");
    opts.addOption("pdv1", false, "send only one PDV in one P-Data-TF PDU, pack command and data "
            + "PDV in one P-DATA-TF PDU by default.");
    opts.addOption("tcpdelay", false, "set TCP_NODELAY socket option to false, true by default");

    OptionBuilder.withArgName("ms");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("timeout in ms for TCP connect, no timeout by default");
    opts.addOption(OptionBuilder.create("connectTO"));

    OptionBuilder.withArgName("ms");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("delay in ms for Socket close after sending A-ABORT, 50ms by default");
    opts.addOption(OptionBuilder.create("soclosedelay"));

    OptionBuilder.withArgName("ms");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("period in ms to check for outstanding DIMSE-RSP, 10s by default");
    opts.addOption(OptionBuilder.create("reaper"));

    OptionBuilder.withArgName("ms");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("timeout in ms for receiving C-FIND-RSP, 60s by default");
    opts.addOption(OptionBuilder.create("cfindrspTO"));

    OptionBuilder.withArgName("ms");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("timeout in ms for receiving C-MOVE-RSP and C-GET RSP, 600s by default");
    opts.addOption(OptionBuilder.create("cmoverspTO"));

    OptionBuilder.withArgName("ms");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("timeout in ms for receiving C-GET-RSP and C-MOVE RSP, 600s by default");
    opts.addOption(OptionBuilder.create("cgetrspTO"));

    OptionBuilder.withArgName("ms");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("timeout in ms for receiving A-ASSOCIATE-AC, 5s by default");
    opts.addOption(OptionBuilder.create("acceptTO"));

    OptionBuilder.withArgName("ms");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("timeout in ms for receiving A-RELEASE-RP, 5s by default");
    opts.addOption(OptionBuilder.create("releaseTO"));

    OptionBuilder.withArgName("KB");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("maximal length in KB of received P-DATA-TF PDUs, 16KB by default");
    opts.addOption(OptionBuilder.create("rcvpdulen"));

    OptionBuilder.withArgName("KB");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("maximal length in KB of sent P-DATA-TF PDUs, 16KB by default");
    opts.addOption(OptionBuilder.create("sndpdulen"));

    OptionBuilder.withArgName("KB");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("set SO_RCVBUF socket option to specified value in KB");
    opts.addOption(OptionBuilder.create("sorcvbuf"));

    OptionBuilder.withArgName("KB");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("set SO_SNDBUF socket option to specified value in KB");
    opts.addOption(OptionBuilder.create("sosndbuf"));

    OptionBuilder.withArgName("KB");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("minimal buffer size to write received object to file, 1KB by default");
    opts.addOption(OptionBuilder.create("filebuf"));

    OptionGroup qrlevel = new OptionGroup();

    OptionBuilder.withDescription("perform patient level query, multiple "
            + "exclusive with -S and -I, perform study level query " + "by default.");
    OptionBuilder.withLongOpt("patient");
    qrlevel.addOption(OptionBuilder.create("P"));

    OptionBuilder.withDescription("perform series level query, multiple "
            + "exclusive with -P and -I, perform study level query " + "by default.");
    OptionBuilder.withLongOpt("series");
    qrlevel.addOption(OptionBuilder.create("S"));

    OptionBuilder.withDescription("perform instance level query, multiple "
            + "exclusive with -P and -S, perform study level query " + "by default.");
    OptionBuilder.withLongOpt("image");
    qrlevel.addOption(OptionBuilder.create("I"));

    OptionBuilder.withArgName("cuid");
    OptionBuilder.hasArgs();
    OptionBuilder.withDescription("negotiate addition private C-FIND SOP " + "class with specified UID");
    opts.addOption(OptionBuilder.create("cfind"));

    opts.addOptionGroup(qrlevel);

    OptionBuilder.withArgName("[seq/]attr=value");
    OptionBuilder.hasArgs();
    OptionBuilder.withValueSeparator('=');
    OptionBuilder.withDescription(
            "specify matching key. attr can be " + "specified by name or tag value (in hex), e.g. PatientName "
                    + "or 00100010. Attributes in nested Datasets can "
                    + "be specified by including the name/tag value of "
                    + "the sequence attribute, e.g. 00400275/00400009 "
                    + "for Scheduled Procedure Step ID in the Request " + "Attributes Sequence");
    opts.addOption(OptionBuilder.create("q"));

    OptionBuilder.withArgName("attr");
    OptionBuilder.hasArgs();
    OptionBuilder.withDescription(
            "specify additional return key. attr can " + "be specified by name or tag value (in hex).");
    opts.addOption(OptionBuilder.create("r"));

    opts.addOption("nodefret", false, "only inlcude return keys specified by -r into the request.");

    OptionBuilder.withArgName("num");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription(
            "cancel query after receive of specified " + "number of responses, no cancel by default");
    opts.addOption(OptionBuilder.create("C"));

    OptionBuilder.withArgName("aet");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("retrieve matching objects to specified " + "move destination.");
    opts.addOption(OptionBuilder.create("cmove"));

    opts.addOption("evalRetrieveAET", false, "Only Move studies not allready stored on destination AET");
    opts.addOption("lowprior", false, "LOW priority of the C-FIND/C-MOVE operation, MEDIUM by default");
    opts.addOption("highprior", false, "HIGH priority of the C-FIND/C-MOVE operation, MEDIUM by default");

    OptionBuilder.withArgName("num");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("repeat query (and retrieve) several times");
    opts.addOption(OptionBuilder.create("repeat"));

    OptionBuilder.withArgName("ms");
    OptionBuilder.hasArg();
    OptionBuilder.withDescription("delay in ms between repeated query (and retrieve), no delay by default");
    opts.addOption(OptionBuilder.create("repeatdelay"));

    opts.addOption("reuseassoc", false, "Reuse association for repeated query (and retrieve)");
    opts.addOption("closeassoc", false, "Close association between repeated query (and retrieve)");

    opts.addOption("h", "help", false, "print this message");
    opts.addOption("V", "version", false, "print the version information and exit");
    CommandLine cl = null;
    try {
        cl = new GnuParser().parse(opts, args);
    } catch (ParseException e) {
        exit("dcmqr: " + e.getMessage());
        throw new RuntimeException("unreachable");
    }
    if (cl.hasOption('V')) {
        Package p = DcmQR.class.getPackage();
        System.out.println("dcmqr v" + p.getImplementationVersion());
        System.exit(0);
    }
    if (cl.hasOption('h') || cl.getArgList().size() != 1) {
        HelpFormatter formatter = new HelpFormatter();
        formatter.printHelp(USAGE, DESCRIPTION, opts, EXAMPLE);
        System.exit(0);
    }

    return cl;
}

From source file:org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.java

/** {@inheritDoc} */
public SiteRenderingContext createContextForSkin(Artifact skin, Map<String, ?> attributes,
        DecorationModel decoration, String defaultWindowTitle, Locale locale)
        throws IOException, RendererException {
    SiteRenderingContext context = createSiteRenderingContext(attributes, decoration, defaultWindowTitle,
            locale);/*  w  w w .j av a2  s  . co  m*/

    context.setSkin(skin);

    ZipFile zipFile = getZipFile(skin.getFile());
    InputStream in = null;

    try {
        if (zipFile.getEntry(SKIN_TEMPLATE_LOCATION) != null) {
            context.setTemplateName(SKIN_TEMPLATE_LOCATION);
            context.setTemplateClassLoader(new URLClassLoader(new URL[] { skin.getFile().toURI().toURL() }));
        } else {
            context.setTemplateName(DEFAULT_TEMPLATE);
            context.setTemplateClassLoader(getClass().getClassLoader());
            context.setUsingDefaultTemplate(true);
        }

        ZipEntry skinDescriptorEntry = zipFile.getEntry(SkinModel.SKIN_DESCRIPTOR_LOCATION);
        if (skinDescriptorEntry != null) {
            in = zipFile.getInputStream(skinDescriptorEntry);

            SkinModel skinModel = new SkinXpp3Reader().read(in);
            context.setSkinModel(skinModel);

            String toolsPrerequisite = skinModel.getPrerequisites() == null ? null
                    : skinModel.getPrerequisites().getDoxiaSitetools();

            Package p = DefaultSiteRenderer.class.getPackage();
            String current = (p == null) ? null : p.getImplementationVersion();

            if (StringUtils.isNotBlank(toolsPrerequisite) && (current != null)
                    && !matchVersion(current, toolsPrerequisite)) {
                throw new RendererException("Cannot use skin: has " + toolsPrerequisite
                        + " Doxia Sitetools prerequisite, but current is " + current);
            }
        }
    } catch (XmlPullParserException e) {
        throw new RendererException("Failed to parse " + SkinModel.SKIN_DESCRIPTOR_LOCATION
                + " skin descriptor from " + skin.getId() + " skin", e);
    } finally {
        IOUtil.close(in);
        closeZipFile(zipFile);
    }

    return context;
}

From source file:wicket.settings.Settings.java

/**
 * @see wicket.settings.IFrameworkSettings#getVersion()
 *///from ww w. ja  va2 s  . co m
public String getVersion() {
    String implVersion = null;
    Package pkg = this.getClass().getPackage();
    if (pkg != null) {
        implVersion = pkg.getImplementationVersion();
    }
    return Strings.isEmpty(implVersion) ? "n/a" : implVersion;
}

From source file:com.cablelabs.sim.PCSim2.java

private static void logPackage() {
    Package p = Package.getPackage("com.cablelabs.sim");
    if (p == null) {
        logger.info(PC2LogCategory.Parser, subCat, "com.cablelabs.sim not loaded");
        return;/*from www  .j  a va  2  s  .co  m*/
    }

    logger.info(PC2LogCategory.Parser, subCat, "com.cablelabs.sim version " + p.getSpecificationVersion()
            + " build-" + p.getImplementationVersion());
    //      if (logFile.exists())    
    //         logDebugInfo(logFile);
    logger.logConfigSettings();

}

From source file:org.aitools.programd.Core.java

/**
 * Initializes and starts up the Core.//from  www  .j  av a  2  s . c  o  m
 */
@SuppressWarnings("boxing")
protected void start() {
    Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler());

    // Set up the XML parsing feature settings.
    this._xmlParserFeatureSettings = new HashMap<String, Boolean>(6);
    this._xmlParserFeatureSettings.put("http://xml.org/sax/features/use-entity-resolver2",
            this._settings.xmlParserUseEntityResolver2());
    this._xmlParserFeatureSettings.put("http://xml.org/sax/features/validation",
            this._settings.xmlParserUseValidation());
    this._xmlParserFeatureSettings.put("http://apache.org/xml/features/validation/schema",
            this._settings.xmlParserUseSchemaValidation());
    this._xmlParserFeatureSettings.put("http://apache.org/xml/features/honour-all-schemaLocations",
            this._settings.xmlParserHonourAllSchemaLocations());
    this._xmlParserFeatureSettings.put("http://apache.org/xml/features/xinclude",
            this._settings.xmlParserUseXInclude());
    this._xmlParserFeatureSettings.put("http://apache.org/xml/features/validate-annotations",
            this._settings.xmlParserValidateAnnotations());

    // Use the stdout and stderr appenders in a special way, if they are defined.
    ConsoleStreamAppender stdOutAppender = ((ConsoleStreamAppender) Logger.getLogger("programd")
            .getAppender("stdout"));
    if (stdOutAppender != null) {
        if (!stdOutAppender.isWriterSet()) {
            stdOutAppender.setWriter(new OutputStreamWriter(System.out));
        }
    }

    ConsoleStreamAppender stdErrAppender = ((ConsoleStreamAppender) Logger.getLogger("programd")
            .getAppender("stderr"));
    if (stdErrAppender != null) {
        if (!stdErrAppender.isWriterSet()) {
            stdErrAppender.setWriter(new OutputStreamWriter(System.err));
        }
    }

    // Set up an interception of calls to the JDK logging system and re-route to log4j.
    JDKLogHandler.setupInterception();

    this._logger.info(String.format("Base URL for Program D Core: \"%s\".", this._baseURL));

    this._aimlProcessorRegistry = new AIMLProcessorRegistry();

    this._graphmapper = Classes.getSubclassInstance(Graphmapper.class,
            this._settings.getGraphmapperImplementation(), "Graphmapper implementation", this);
    this._bots = new Bots();
    this._processes = new ManagedProcesses(this);

    // Get an instance of the settings-specified PredicateManager.
    this._predicateManager = Classes.getSubclassInstance(PredicateManager.class,
            this._settings.getPredicateManagerImplementation(), "PredicateManager", this);

    // Get the hostname (used occasionally).
    try {
        this._hostname = InetAddress.getLocalHost().getHostName();
    } catch (UnknownHostException e) {
        this._hostname = "unknown hostname";
    }

    // Load the plugin config.
    URL pluginConfigURL = this._settings.getPluginConfigURL();
    if (pluginConfigURL != null) {
        pluginConfigURL = URLTools.contextualize(this._baseURL, pluginConfigURL);
        try {
            if (pluginConfigURL.openStream() != null) {
                this._pluginConfig = JDOM.getDocument(pluginConfigURL, this._logger);
            }
        } catch (IOException e) {
            // Don't load plugin config.
        }
    }

    // TODO: Make this work even if the classes aren't in a jar.
    Package pkg = Package.getPackage("org.aitools.programd");
    this._logger.info(String.format("Starting %s version %s [%s].", pkg.getSpecificationTitle(),
            pkg.getSpecificationVersion(), pkg.getImplementationVersion()));
    this._logger.info(UserSystem.jvmDescription());
    this._logger.info(UserSystem.osDescription());
    this._logger.info(UserSystem.memoryReport());
    this._logger.info("Predicates with no values defined will return: \""
            + this._settings.getPredicateEmptyDefault() + "\".");

    try {
        // Create the AIMLWatcher if configured to do so.
        if (this._settings.useAIMLWatcher()) {
            this._aimlWatcher = new AIMLWatcher(this);
        }

        // Setup a JavaScript interpreter if supposed to.
        setupInterpreter();

        // Start the AIMLWatcher if configured to do so.
        startWatcher();

        this._logger.info("Starting up the Graphmaster.");

        // Start loading bots.
        URL botConfigURL = this._settings.getBotConfigURL();
        if (botConfigURL != null) {
            loadBotConfig(botConfigURL);
        } else {
            this._logger.warn("No bot config URL specified; no bots will be loaded.");
        }

        // Request garbage collection.
        System.gc();

        this._logger.info(UserSystem.memoryReport());

        // Start the heart, if enabled.
        startHeart();
    } catch (DeveloperError e) {
        alert("developer error", e);
    } catch (UserError e) {
        alert("user error", e);
    } catch (RuntimeException e) {
        alert("unforeseen runtime exception", e);
    } catch (Throwable e) {
        alert("unforeseen problem", e);
    }

    // Set the status indicator.
    this._status = Status.READY;

    // Exit immediately if configured to do so (for timing purposes).
    if (this._settings.exitImmediatelyOnStartup()) {
        shutdown();
    }
}

From source file:net.chaosserver.timelord.swingui.Timelord.java

/**
 * Shows the about dialog that tells about the application.
 *///from w w w.  j  ava2s .  co  m
public void showAboutDialog() {
    Package packageInfo = Package.getPackage("net.chaosserver.timelord.swingui");

    if (log.isTraceEnabled()) {
        if (packageInfo != null) {
            StringBuffer sb = new StringBuffer();
            sb.append(packageInfo.getClass().getName());
            sb.append(" [name=");
            sb.append(packageInfo.getName());
            sb.append(", specificationTitle=");
            sb.append(packageInfo.getSpecificationTitle());
            sb.append(", specificationVersion=");
            sb.append(packageInfo.getSpecificationVersion());
            sb.append(", specificationVendor=");
            sb.append(packageInfo.getSpecificationVendor());
            sb.append(", implementationTitle=");
            sb.append(packageInfo.getImplementationTitle());
            sb.append(", implementationVersion=");
            sb.append(packageInfo.getImplementationVersion());
            sb.append(", implementationVendor=");
            sb.append(packageInfo.getImplementationVendor());
            sb.append("]");
            log.trace(sb.toString());
        }
    }

    StringBuffer sb = new StringBuffer();
    sb.append("Timelord");

    if ((packageInfo != null) && (packageInfo.getImplementationVersion() != null)) {
        sb.append(" [");
        sb.append(packageInfo.getImplementationVersion());
        sb.append("]");
    } else {
        Properties appProperties = getAppProperties();
        if (appProperties != null) {
            sb.append(" ");
            sb.append(appProperties.getProperty("implementation.version", "[Unknown Version]"));
        } else {
            sb.append(" [Unknown Version]");
        }
    }

    sb.append("\n");
    sb.append(resourceBundle.getString(RROOT + ".about"));

    JOptionPane.showMessageDialog(applicationFrame, sb.toString(), "About Timelord",
            JOptionPane.INFORMATION_MESSAGE, applicationIcon);
}

From source file:org.apache.hive.beeline.BeeLine.java

String getApplicationTitle() {
    Package pack = BeeLine.class.getPackage();

    return loc("app-introduction", new Object[] { "Beeline",
            pack.getImplementationVersion() == null ? "???" : pack.getImplementationVersion(), "Apache Hive",
            // getManifestAttribute ("Specification-Title"),
            // getManifestAttribute ("Implementation-Version"),
            // getManifestAttribute ("Implementation-ReleaseDate"),
            // getManifestAttribute ("Implementation-Vendor"),
            // getManifestAttribute ("Implementation-License"),
    });//from  w w  w.j  a  v a  2  s. c  o m
}

From source file:editeurpanovisu.EditeurPanovisu.java

/**
 *
 * @param stPrimaryStage/*from  www  .  jav  a 2  s  .co m*/
 * @throws Exception Exceptions
 */
@Override

public void start(Stage stPrimaryStage) throws Exception {
    if (isLinux()) {
        stPrimaryStage.setFullScreen(true);
    }
    File fileRep = new File("");
    setbInternet(netIsAvailable());
    setStrCurrentDir(fileRep.getAbsolutePath());
    setStrRepertAppli(fileRep.getAbsolutePath());
    fileRepertConfig = new File(getStrRepertAppli() + File.separator + "configPV");
    rbLocalisation = ResourceBundle.getBundle("editeurpanovisu.i18n.PanoVisu", getLocale());
    Package pack = Package.getPackage("editeurpanovisu");
    strNumVersion = pack.getImplementationVersion() + "-b"
            + rbLocalisation.getString("build.numero").replace(" ", "").replace("", "");
    lisPreferences();
    setStPrincipal(stPrimaryStage);
    stPrimaryStage.setResizable(false);
    getStPrincipal().setResizable(true);
    getStPrincipal().setAlwaysOnTop(false);
    getStPrincipal().setTitle("PanoVisu v" + strNumVersion.split("-")[0]);
    stPrimaryStage.setMaximized(true);
    stPrimaryStage.setAlwaysOnTop(false);
    Rectangle2D tailleEcran = Screen.getPrimary().getBounds();
    int iHauteur;
    if (isMac()) {
        iHauteur = (int) tailleEcran.getHeight() - 60;
    } else {
        iHauteur = (int) tailleEcran.getHeight() - 20;
    }
    int iLargeur = (int) tailleEcran.getWidth() - 2;
    largeurMax = tailleEcran.getWidth() - 450.0d;
    creeEnvironnement(stPrimaryStage, iLargeur, iHauteur);

    File fileRepertTempFile = new File(getStrRepertAppli() + File.separator + "temp");
    setStrRepertTemp(fileRepertTempFile.getAbsolutePath());

    if (!fileRepertTempFile.exists()) {
        fileRepertTempFile.mkdirs();
    } else {
        deleteDirectory(getStrRepertTemp());
    }
    String strExtTemp = strGenereChaineAleatoire(20);
    setStrRepertTemp(getStrRepertTemp() + File.separator + "temp" + strExtTemp);
    fileRepertTempFile = new File(getStrRepertTemp());
    fileRepertTempFile.mkdirs();
    installeEvenements();
    projetsNouveau();
    stPrimaryStage.setOnCloseRequest((WindowEvent event) -> {
        try {
            sauvePreferences();
        } catch (IOException ex) {
            Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
        }
        ButtonType reponse = null;
        ButtonType buttonTypeOui = new ButtonType(rbLocalisation.getString("main.oui"));
        ButtonType buttonTypeNon = new ButtonType(rbLocalisation.getString("main.non"));
        ButtonType buttonTypeAnnule = new ButtonType(rbLocalisation.getString("main.annuler"));
        if (!isbDejaSauve()) {
            Alert alert = new Alert(AlertType.CONFIRMATION);
            alert.setTitle(rbLocalisation.getString("main.dialog.quitterApplication"));
            alert.setHeaderText(null);
            alert.setContentText(rbLocalisation.getString("main.dialog.chargeProjetMessage"));
            alert.getButtonTypes().clear();
            alert.getButtonTypes().setAll(buttonTypeOui, buttonTypeNon, buttonTypeAnnule);
            Optional<ButtonType> actReponse = alert.showAndWait();
            reponse = actReponse.get();
        }
        if (reponse == buttonTypeOui) {
            try {
                projetSauve();

            } catch (IOException ex) {
                Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        if ((reponse == buttonTypeOui) || (reponse == buttonTypeNon) || (reponse == null)) {
            try {
                sauveHistoFichiers();

            } catch (IOException ex) {
                Logger.getLogger(EditeurPanovisu.class.getName()).log(Level.SEVERE, null, ex);
            }

            deleteDirectory(getStrRepertTemp());
            File fileTemp = new File(getStrRepertTemp());
            fileTemp.delete();
        } else {
            event.consume();
        }
    });
}