1 |
/* |
/* |
2 |
* JSampler - a java front-end for LinuxSampler |
* JSampler - a java front-end for LinuxSampler |
3 |
* |
* |
4 |
* Copyright (C) 2005-2008 Grigor Iliev <grigor@grigoriliev.com> |
* Copyright (C) 2005-2009 Grigor Iliev <grigor@grigoriliev.com> |
5 |
* |
* |
6 |
* This file is part of JSampler. |
* This file is part of JSampler. |
7 |
* |
* |
43 |
import javax.swing.JToolBar; |
import javax.swing.JToolBar; |
44 |
|
|
45 |
import org.jsampler.CC; |
import org.jsampler.CC; |
46 |
|
import org.jsampler.view.fantasia.basic.*; |
47 |
|
|
48 |
import static org.jsampler.view.fantasia.A4n.a4n; |
import static org.jsampler.view.fantasia.A4n.a4n; |
49 |
|
|
68 |
private final ToolbarButton btnPreferences = new ToolbarButton(a4n.editPreferences); |
private final ToolbarButton btnPreferences = new ToolbarButton(a4n.editPreferences); |
69 |
|
|
70 |
private final JLabel lLogo = new JLabel(Res.gfxFantasiaLogo); |
private final JLabel lLogo = new JLabel(Res.gfxFantasiaLogo); |
71 |
|
|
72 |
|
private final Boolean screenMenuEnabled; |
73 |
|
|
74 |
/** Creates a new instance of <code>StandardBar</code> */ |
/** Creates a new instance of <code>StandardBar</code> */ |
75 |
public |
public |
76 |
StandardBar() { |
StandardBar() { |
77 |
|
screenMenuEnabled = CC.getViewConfig().isUsingScreenMenuBar(); |
78 |
//super(Res.gfxToolBarBg); |
//super(Res.gfxToolBarBg); |
79 |
//setPixmapInsets(new Insets(0, 6, 6, 6)); |
//setPixmapInsets(new Insets(0, 6, 6, 6)); |
80 |
|
|
81 |
setLayout(new BorderLayout()); |
setLayout(new BorderLayout()); |
82 |
setOpaque(false); |
setOpaque(false); |
83 |
|
|
84 |
Dimension d = new Dimension(60, 51); |
int h = screenMenuEnabled ? 56 : 51; |
85 |
|
Dimension d = new Dimension(60, h); |
86 |
setMinimumSize(d); |
setMinimumSize(d); |
87 |
setPreferredSize(d); |
setPreferredSize(d); |
88 |
d = new Dimension(Short.MAX_VALUE, 51); |
d = new Dimension(Short.MAX_VALUE, 51); |
89 |
setMaximumSize(d); |
setMaximumSize(d); |
90 |
setBorder(BorderFactory.createEmptyBorder(0, 5, 2, 5)); |
int top = screenMenuEnabled ? 5 : 0; |
91 |
|
setBorder(BorderFactory.createEmptyBorder(top, 5, 2, 5)); |
92 |
|
|
93 |
|
|
94 |
//mainPane = new PixmapPane(Res.gfxToolBar); |
//mainPane = new PixmapPane(Res.gfxToolBar); |
150 |
double w = getSize().getWidth(); |
double w = getSize().getWidth(); |
151 |
|
|
152 |
FantasiaPainter.paintGradient(g2, 0.0, 0.0, w - 1, h - 1, FantasiaPainter.color5, midColor); |
FantasiaPainter.paintGradient(g2, 0.0, 0.0, w - 1, h - 1, FantasiaPainter.color5, midColor); |
153 |
|
|
154 |
FantasiaPainter.Border b = new FantasiaPainter.Border(false, true, false, true); |
boolean paintTop = screenMenuEnabled; |
155 |
|
FantasiaPainter.Border b = new FantasiaPainter.Border(paintTop, true, false, true); |
156 |
FantasiaPainter.paintBoldOuterBorder(g2, 0, 0, w - 1, h + 2, b); |
FantasiaPainter.paintBoldOuterBorder(g2, 0, 0, w - 1, h + 2, b); |
157 |
|
|
158 |
g2.setPaint(oldPaint); |
g2.setPaint(oldPaint); |