|
|
@ -1,11 +1,12 @@ |
|
|
|
package com.fr.design.menu; |
|
|
|
package com.fr.design.menu; |
|
|
|
|
|
|
|
|
|
|
|
import java.awt.FlowLayout; |
|
|
|
import java.awt.*; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.List; |
|
|
|
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; |
|
|
|
import com.fr.design.gui.itoolbar.UIToolbar; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -16,6 +17,23 @@ public class ToolBarDef { |
|
|
|
// item List.
|
|
|
|
// item List.
|
|
|
|
private List<ShortCut> shortcutList = new ArrayList<ShortCut>(); |
|
|
|
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 |
|
|
|
* 一个static的方法生成一个JToolBar |
|
|
|
*/ |
|
|
|
*/ |
|
|
|