|
|
|
@ -1,11 +1,12 @@
|
|
|
|
|
package com.fr.design.menu; |
|
|
|
|
|
|
|
|
|
import java.awt.FlowLayout; |
|
|
|
|
import java.awt.*; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
import javax.swing.BorderFactory; |
|
|
|
|
import javax.swing.*; |
|
|
|
|
|
|
|
|
|
import com.fr.design.gui.itoolbar.UIToolBarUI; |
|
|
|
|
import com.fr.design.gui.itoolbar.UIToolbar; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -15,7 +16,24 @@ public class ToolBarDef {
|
|
|
|
|
|
|
|
|
|
// item List.
|
|
|
|
|
private List<ShortCut> shortcutList = new ArrayList<ShortCut>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
* 一个static的方法生成一个JToolBar |
|
|
|
|
*/ |
|
|
|
|
public static UIToolbar createJToolBar(Color background) { |
|
|
|
|
UIToolbar toolbar = new UIToolbar(FlowLayout.LEFT, new UIToolBarUI(){ |
|
|
|
|
@Override |
|
|
|
|
public void paint(Graphics g, JComponent c) { |
|
|
|
|
Graphics2D g2 = (Graphics2D) g; |
|
|
|
|
g2.setColor(background); |
|
|
|
|
g2.fillRect(0, 0, c.getWidth(), c.getHeight()); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
toolbar.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0)); |
|
|
|
|
return toolbar; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
* 一个static的方法生成一个JToolBar |
|
|
|
|
*/ |
|
|
|
|