本文整理汇总了Java中edu.stanford.ejalbert.exception.UnsupportedOperatingSystemException类的典型用法代码示例。如果您正苦于以下问题:Java UnsupportedOperatingSystemException类的具体用法?Java UnsupportedOperatingSystemException怎么用?Java UnsupportedOperatingSystemException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UnsupportedOperatingSystemException类属于edu.stanford.ejalbert.exception包,在下文中一共展示了UnsupportedOperatingSystemException类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: OSMCreditPanel
import edu.stanford.ejalbert.exception.UnsupportedOperatingSystemException; //导入依赖的package包/类
/**
* Konstruktor
*/
public OSMCreditPanel() {
super(new FlowLayout(FlowLayout.CENTER));
JLabel lab = new JLabel("Map data \u00a9 ");
lab.setFont(font);
lab.setForeground(new Color(0x505050));
add(lab);
lab = new JLabel("OpenStreetMap");
lab.setCursor(new Cursor(Cursor.HAND_CURSOR));
Map<TextAttribute, Integer> fontAttr = new HashMap<>();
fontAttr.put(TextAttribute.UNDERLINE, TextAttribute.UNDERLINE_ON);
lab.setFont(font.deriveFont(fontAttr));
lab.setForeground(new Color(0x330066));
add(lab);
lab.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
try {
new BrowserLauncher().openURLinBrowser("http://www.openstreetmap.org/copyright");
} catch (BrowserLaunchingInitializingException | UnsupportedOperatingSystemException ex) {
System.err.println(ex);
}
}
});
lab = new JLabel(" contributors");
lab.setFont(font);
lab.setForeground(new Color(0x505050));
add(lab);
setBackground(new Color(210, 210, 210, 170));
setOpaque(true);
setPreferredSize(new Dimension(270, 24));
}
示例2: getLauncher
import edu.stanford.ejalbert.exception.UnsupportedOperatingSystemException; //导入依赖的package包/类
/**
* Return the BrowserLauncher instance
* @return BrowserLauncher instance
*/
static edu.stanford.ejalbert.BrowserLauncher getLauncher() {
if (_launcher == null) {
boolean hackMRJ = false;
if (SystemUtils.IS_OS_MAC_OSX) {
// Circumvent BrowserLauncher NPE when running under Oracle 1.7u4 (and later ???) release for Mac OS X
if (System.getProperty(PROP_MRJ_VERSION) == null) {
hackMRJ = true;
System.setProperty(PROP_MRJ_VERSION, "9999.999");
_logger.debug("Probably running Oracle JVM under Mac OS X, faking missing 'mrj.version' system property.");
}
}
try {
final LoggerAdapter loggerAdapter = new LoggerAdapter();
_launcher = new edu.stanford.ejalbert.BrowserLauncher(loggerAdapter, loggerAdapter);
// Refresh the system property at startup:
refreshBrowserPref();
} catch (UnsupportedOperatingSystemException uose) {
_logger.warn("Cannot initialize browser launcher : ", uose);
} catch (BrowserLaunchingInitializingException bie) {
_logger.warn("Cannot initialize browser launcher : ", bie);
} finally {
if (hackMRJ) {
// Circumvent BrowserLauncher NPE when running under Oracle 1.7u4 (and later ???) release for Mac OS X
System.clearProperty(PROP_MRJ_VERSION);
}
}
}
return _launcher;
}