public LAFPreferences() { super(); _lafClassName = UIManager.getCrossPlatformLookAndFeelClassName(); } public LAFPreferences(IIdentifier id)
/** * Try to set a safe look and feel. */ public static void setSafeLookAndFeel() { try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } catch (Throwable e) { } }
/** * Checks if the system look and feel differs * from the cross platform look and feel. * * @return True if the system look and feel is different * from the cross platform look and feel. */ public boolean isSystemLookAndFeelSupported() { return !UIManager.getSystemLookAndFeelClassName().equals(UIManager.getCrossPlatformLookAndFeelClassName()); }
private static void changeUI(boolean system) { try { // Set System L&F // UIManager.setLookAndFeel("com.sun.java.swing.plaf.motif.MotifLookAndFeel"); UIManager.setLookAndFeel(system ? UIManager.getSystemLookAndFeelClassName() : UIManager.getCrossPlatformLookAndFeelClassName()); } catch (Exception e) { e.printStackTrace(); } }
private static String checkLafName(String laf){ if (JMeterMenuBar.SYSTEM_LAF.equalsIgnoreCase(laf)){ return UIManager.getSystemLookAndFeelClassName(); } if (JMeterMenuBar.CROSS_PLATFORM_LAF.equalsIgnoreCase(laf)){ return UIManager.getCrossPlatformLookAndFeelClassName(); } return laf; }
@Override public void actionPerformed(ActionEvent e) { setLaf(UIManager.getCrossPlatformLookAndFeelClassName()); } };
public static void main(String[] args) { try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } catch(Exception e) { e.printStackTrace(); } new Browser(); } }
/** * {@inheritDoc} */ @Override protected boolean matches() { LookAndFeel laf = getLookAndFeel(); if (getCrossPlatformLookAndFeelClassName().equals(laf.getClass().getName())) { //just in case someone sets Nimbus as the cross platform Look and Feel return !laf.getID().equals("Nimbus"); } return getLookAndFeel() instanceof MetalLookAndFeel; }
/** * Load the "cross-platform look-and-feel" (a.k.a. "Metal"). */ public void setCrossPlatform(boolean value) { if (value) this.setClassName(UIManager.getCrossPlatformLookAndFeelClassName()); }
/** * {@inheritDoc} */ @Override protected boolean matches() { LookAndFeel laf = getLookAndFeel(); if (getCrossPlatformLookAndFeelClassName().equals(laf.getClass().getName())) { //just in case someone sets Nimbus as the cross platform Look and Feel return !laf.getID().equals("Nimbus"); } return getLookAndFeel() instanceof MetalLookAndFeel; }
/** * {@inheritDoc} */ @Override protected boolean matches() { LookAndFeel laf = getLookAndFeel(); if (getCrossPlatformLookAndFeelClassName().equals(laf.getClass().getName())) { //just in case someone sets Nimbus as the cross platform Look and Feel return !laf.getID().equals("Nimbus"); } return getLookAndFeel() instanceof MetalLookAndFeel; }
static public void main(String[] args) { printStartupHeader(); try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } catch (Exception x) { // TODO: log this instead of simply dumping it System.err.println("Error loading L&F:" +x); } // TODO: do command line processing new WebStart(); }
static public void main(String[] args) { printStartupHeader(); try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); } catch (Exception x) { // TODO: log this instead of simply dumping it System.err.println("Error loading L&F:" +x); } // TODO: do command line processing new Application(); }
/** * Get a list of all installed LAFs plus CrossPlatform and System. * * @return The list of available {@link LookAndFeelInfo}s */ // This is also used by LookAndFeelCommand public static LookAndFeelInfo[] getAllLAFs() { UIManager.LookAndFeelInfo[] lafs = UIManager.getInstalledLookAndFeels(); int i = lafs.length; UIManager.LookAndFeelInfo[] lafsAll = new UIManager.LookAndFeelInfo[i+2]; System.arraycopy(lafs, 0, lafsAll, 0, i); lafsAll[i++]=new UIManager.LookAndFeelInfo(CROSS_PLATFORM_LAF,UIManager.getCrossPlatformLookAndFeelClassName()); lafsAll[i]=new UIManager.LookAndFeelInfo(SYSTEM_LAF,UIManager.getSystemLookAndFeelClassName()); return lafsAll; }
public static String getLookAndFeelClassName(String name) { if(name == null) { if(XJSystem.isLinux()) { return UIManager.getCrossPlatformLookAndFeelClassName(); } else { return UIManager.getSystemLookAndFeelClassName(); } } UIManager.LookAndFeelInfo[] info = UIManager.getInstalledLookAndFeels(); for (UIManager.LookAndFeelInfo anInfo : info) { if (anInfo.getName().equalsIgnoreCase(name)) return anInfo.getClassName(); } return null; }
/** * Restore the look-and-feel stored in the settings. */ private void restoreLookAndFeel() { // get initial look and feel from properties String defaultLookAndFeel = UIManager.getCrossPlatformLookAndFeelClassName(); String startLookAndFeel = setts.getStringProperty(LookAndFeelHelper.LOOK_AND_FEEL_KEY, defaultLookAndFeel); try { setLookAndFeel(startLookAndFeel); } catch (Exception e) { ExceptionDialog.showExceptionDialog(null, "Look & Feel error", "Cannot set look & feel:\n" + startLookAndFeel + "\n -> Will use default one.", e); } }
public static void main(String[] args) { Examples.initializeLogging(); // set to Metal LaF try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); EventQueue.invokeAndWait(new Runnable() { public void run() { new OnChangeExample(); } }); } catch (Exception e) { e.printStackTrace(); } }
public static void main(String[] args) throws InterruptedException, InvocationTargetException { Examples.initializeLogging(); // set to Metal LaF try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); EventQueue.invokeAndWait(new Runnable() { public void run() { new BoundExtentsExample(); } }); } catch (Exception e) { e.printStackTrace(); } }
public static void main(String[] args) throws InterruptedException, InvocationTargetException { Examples.initializeLogging(); // set to Metal LaF try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); EventQueue.invokeAndWait(new Runnable() { public void run() { new FocusChangedExample(); } }); } catch (Exception e) { e.printStackTrace(); } } }
public static void main(String[] args) throws InterruptedException, InvocationTargetException { Examples.initializeLogging(); // set to Metal LaF try { UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName()); EventQueue.invokeAndWait(new Runnable() { public void run() { new BoundLocationExample(); } }); } catch (Exception e) { e.printStackTrace(); } } }