1
/*FreeMind - A Program for creating and viewing Mindmaps
2
*Copyright (C) 2000-2006 Joerg Mueller, Daniel Polansky, Christian Foltin, Dimitri Polivaev and others.
4
*See COPYING for Details
6
*This program is free software; you can redistribute it and/or
7
*modify it under the terms of the GNU General Public License
8
*as published by the Free Software Foundation; either version 2
9
*of the License, or (at your option) any later version.
11
*This program is distributed in the hope that it will be useful,
12
*but WITHOUT ANY WARRANTY; without even the implied warranty of
13
*MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
*GNU General Public License for more details.
16
*You should have received a copy of the GNU General Public License
17
*along with this program; if not, write to the Free Software
18
*Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21
* Created on 28.03.2004
24
package freemind.controller;
26
import java.awt.Insets;
28
import javax.swing.Action;
29
import javax.swing.JButton;
30
import javax.swing.JToolBar;
32
import freemind.main.Tools;
35
* @author Stefan Zechmeister
37
public class FreeMindToolBar extends JToolBar {
38
private static Insets nullInsets = new Insets(0,0,0,0);
43
public FreeMindToolBar() {
44
this("", JToolBar.HORIZONTAL);
49
public FreeMindToolBar(int arg0) {
55
public FreeMindToolBar(String arg0) {
56
this(arg0, JToolBar.HORIZONTAL);
61
public FreeMindToolBar(String arg0, int arg1) {
63
this.setMargin(nullInsets);
68
* @see javax.swing.JToolBar#add(javax.swing.Action)
70
public JButton add(Action arg0) {
71
final Object actionName = arg0.getValue(Action.NAME);
72
arg0.putValue(Action.SHORT_DESCRIPTION, Tools.removeMnemonic(actionName.toString()));
73
JButton returnValue = super.add(arg0);
74
returnValue.setName(actionName.toString());
75
returnValue.setText("");
76
returnValue.setMargin(nullInsets);
77
returnValue.setFocusable(false);
79
// fc, 20.6.2004: try to make the toolbar looking good under Mac OS X.
80
if (System.getProperty("os.name").startsWith("Mac OS")) {
81
returnValue.setBorderPainted (false);
83
returnValue.setContentAreaFilled (false);