本文整理汇总了Java中javax.swing.plaf.ToolBarUI类的典型用法代码示例。如果您正苦于以下问题:Java ToolBarUI类的具体用法?Java ToolBarUI怎么用?Java ToolBarUI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ToolBarUI类属于javax.swing.plaf包,在下文中一共展示了ToolBarUI类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testInitOutsideOfEDT
import javax.swing.plaf.ToolBarUI; //导入依赖的package包/类
public void testInitOutsideOfEDT() throws Exception {
class MyToolbar extends Toolbar implements Runnable {
@Override
protected void setUI(ComponentUI newUI) {
assertTrue("Can only be called in EDT", EventQueue.isDispatchThread());
super.setUI(newUI);
}
@Override
public void setUI(ToolBarUI ui) {
assertTrue("Can only be called in EDT", EventQueue.isDispatchThread());
super.setUI(ui);
}
private void assertUI() throws Exception {
EventQueue.invokeAndWait(this);
}
@Override
public void run() {
assertNotNull("UI delegate is specified", getUI());
}
}
assertFalse("We are not in EDT", EventQueue.isDispatchThread());
MyToolbar mt = new MyToolbar();
assertNotNull("Instance created", mt);
mt.assertUI();
}
示例2: testInitOutsideOfEDT
import javax.swing.plaf.ToolBarUI; //导入依赖的package包/类
public void testInitOutsideOfEDT() throws Exception {
class MyToolbar extends ToolbarWithOverflow implements Runnable {
@Override
protected void setUI(ComponentUI newUI) {
assertTrue("Can only be called in EDT", EventQueue.isDispatchThread());
super.setUI(newUI);
}
@Override
public void setUI(ToolBarUI ui) {
assertTrue("Can only be called in EDT", EventQueue.isDispatchThread());
super.setUI(ui);
}
private void assertUI() throws Exception {
EventQueue.invokeAndWait(this);
}
@Override
public void run() {
assertNotNull("UI delegate is specified", getUI());
}
}
assertFalse("We are not in EDT", EventQueue.isDispatchThread());
MyToolbar mt = new MyToolbar();
assertNotNull("Instance created", mt);
mt.assertUI();
}
示例3: updateUI
import javax.swing.plaf.ToolBarUI; //导入依赖的package包/类
/**
* Notification from the <code>UIFactory</code> that the L&F has changed.
* Called to replace the UI with the latest version from the
* <code>UIFactory</code>.
*
* @see JComponent#updateUI
*/
public void updateUI() {
setUI((ToolBarUI) UIManager.getUI(this));
// GTKLookAndFeel installs a different LayoutManager, and sets it
// to null after changing the look and feel, so, install the default
// if the LayoutManager is null.
if (getLayout() == null) {
setLayout(new DefaultToolBarLayout(getOrientation()));
}
invalidate();
}
示例4: setUI
import javax.swing.plaf.ToolBarUI; //导入依赖的package包/类
public @Override void setUI(ToolBarUI ui){
addListener = false;
super.setUI(ui);
addListener = true;
}
示例5: updateUI
import javax.swing.plaf.ToolBarUI; //导入依赖的package包/类
/**
* This method resets the UI used to the Look and Feel defaults.
*/
public void updateUI()
{
setUI((ToolBarUI) UIManager.getUI(this));
}
示例6: unfloatToolBar
import javax.swing.plaf.ToolBarUI; //导入依赖的package包/类
public static void unfloatToolBar(JToolBar tb) {
ToolBarUI tbUI = tb.getUI();
if (tbUI instanceof BasicToolBarUI)
((BasicToolBarUI) tbUI).setFloating(false, null);
}
示例7: floatToolBar
import javax.swing.plaf.ToolBarUI; //导入依赖的package包/类
public static void floatToolBar(JToolBar tb, Point p) {
ToolBarUI tbUI = tb.getUI();
if (tbUI instanceof BasicToolBarUI)
((BasicToolBarUI) tbUI).setFloating(false, p);
}
示例8: setUI
import javax.swing.plaf.ToolBarUI; //导入依赖的package包/类
public void setUI(final ToolBarUI ui) {
super.setUI(ui);
}
示例9: getUI
import javax.swing.plaf.ToolBarUI; //导入依赖的package包/类
public ToolBarUI getUI() {
return (ToolBarUI)ui;
}
示例10: updateUI
import javax.swing.plaf.ToolBarUI; //导入依赖的package包/类
public void updateUI() {
setUI((ToolBarUI)UIManager.getUI(this));
}
示例11: getUI
import javax.swing.plaf.ToolBarUI; //导入依赖的package包/类
/**
* Returns the tool bar's current UI.
*
* @see #setUI
*/
public ToolBarUI getUI() {
return (ToolBarUI) null;
}
示例12: setUI
import javax.swing.plaf.ToolBarUI; //导入依赖的package包/类
/**
* Sets the L&F object that renders this component.
*
* @param ui
* the <code>ToolBarUI</code> L&F object
* @see UIDefaults#getUI
* @beaninfo bound: true hidden: true attribute: visualUpdate true
* description: The UI object that implements the Component's
* LookAndFeel.
*/
public void setUI(ToolBarUI ui) {
super.setUI(ui);
}
示例13: getUI
import javax.swing.plaf.ToolBarUI; //导入依赖的package包/类
/**
* This method returns the UI class used to paint this JToolBar.
*
* @return The UI class for this JToolBar.
*/
public ToolBarUI getUI()
{
return (ToolBarUI) ui;
}
示例14: setUI
import javax.swing.plaf.ToolBarUI; //导入依赖的package包/类
/**
* This method sets the UI used with the JToolBar.
*
* @param ui The UI used with the JToolBar.
*/
public void setUI(ToolBarUI ui)
{
super.setUI(ui);
}