public void setUI(SeparatorUI ui) { synchronized(this) { if (!separatorUIInitialized) { macOsXSeparatorUI = createCustomUI(this); separatorUIInitialized = true; } } if (macOsXSeparatorUI == null) { super.setUI(ui); } else { super.setUI(macOsXSeparatorUI); setForeground(UIManager.getColor(MAC_OS_X_SEPARATOR_COLOR_KEY)); } }
private static SeparatorUI createCustomUI(JComponent separator) { if (MAC_OS_X_SEPARATOR_UI_CLASS != null) { try { Method m = MAC_OS_X_SEPARATOR_UI_CLASS.getDeclaredMethod( "createUI", JComponent.class); // NOI18N return (SeparatorUI)m.invoke(null, separator); } catch (Throwable e) { return null; } } else { return null; } }
public void testSetUISeparatorUI() { SeparatorUI ui1 = new BasicSeparatorUI(); SeparatorUI ui2 = new BasicSeparatorUI(); separator.setUI(ui1); assertEquals(ui1, separator.ui); assertEquals(ui1, separator.getUI()); separator.setUI(ui2); assertEquals(ui2, separator.ui); assertEquals(ui2, separator.getUI()); }
public SeparatorUI getUI() { AndroidClassUtil.callEmptyMethod(); return (SeparatorUI) null; }
public void setUI(SeparatorUI ui) { AndroidClassUtil.callEmptyMethod(); }
/** * Sets this separator's UI delegate to the default (obtained from the * {@link UIManager}) for the current look and feel. */ public void updateUI() { setUI((SeparatorUI) UIManager.getUI(this)); }
public SeparatorUI getUI() { return (SeparatorUI)ui; }
public void setUI(final SeparatorUI ui) { super.setUI(ui); }
/** * Returns the UI delegate being used with the <code>JSeparator</code>. * * @return The JSeparator's UI delegate. */ public SeparatorUI getUI() { return (SeparatorUI) ui; }
/** * Sets the separator's UI delegate. * * @param ui the UI delegate. */ public void setUI(SeparatorUI ui) { super.setUI(ui); }