本文整理匯總了Java中net.sf.freecol.common.util.OSUtils類的典型用法代碼示例。如果您正苦於以下問題:Java OSUtils類的具體用法?Java OSUtils怎麽用?Java OSUtils使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
OSUtils類屬於net.sf.freecol.common.util包,在下文中一共展示了OSUtils類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: actionPerformed
import net.sf.freecol.common.util.OSUtils; //導入依賴的package包/類
/**
* {@inheritDoc}
*
* Launch a browser with the link clicked from the panel.
*
* @see OSUtils#launchBrowser(String)
*/
@Override
public void actionPerformed(ActionEvent ae) {
final String url = ae.getActionCommand();
if (SITE_URL.equals(url) || PROJECT_URL.equals(url)
|| MANUAL_URL.equals(url)) {
OSUtils.launchBrowser(url);
}
else {
super.actionPerformed(ae);
}
}
示例2: DefaultHandler
import net.sf.freecol.common.util.OSUtils; //導入依賴的package包/類
/**
* The constructor to use.
*
* @param consoleLogging The flag to log to the console as well.
* @param writer The {@code Writer} to use for logging.
*/
public DefaultHandler(boolean consoleLogging, Writer writer) {
this.consoleLogging = consoleLogging;
this.writer = writer;
// We should use XMLFormatter here in the future
// or maybe a self-made HTMLFormatter.
setFormatter(new TextFormatter());
try {
StringBuilder sb = new StringBuilder(512);
sb.append("FreeCol game version: ")
.append(FreeCol.getRevision())
.append("\nFreeCol protocol version: ")
.append(FreeCol.getFreeColProtocolVersion())
.append("\n\nJava vendor: ")
.append(System.getProperty("java.vendor"))
.append("\nJava version: ")
.append(System.getProperty("java.version"))
.append("\nJava WM name: ")
.append(System.getProperty("java.vm.name"))
.append("\nJava WM vendor: ")
.append(System.getProperty("java.vm.vendor"))
.append("\nJava WM version: ")
.append(System.getProperty("java.vm.version"))
.append("\n\nOS name: ")
.append(OSUtils.getOperatingSystem())
.append("\nOS architecture: ")
.append(System.getProperty("os.arch"))
.append("\nOS version: ")
.append(System.getProperty("os.version"))
.append("\n\n");
synchronized (this.writerLock) {
this.writer.write(sb.toString());
}
} catch (IOException ioe) {
ioe.printStackTrace(System.err);
}
}