22 |
|
|
23 |
package org.jsampler.view.fantasia; |
package org.jsampler.view.fantasia; |
24 |
|
|
|
import java.awt.Container; |
|
25 |
import java.awt.Cursor; |
import java.awt.Cursor; |
26 |
import java.awt.Dialog; |
import java.awt.Dialog; |
27 |
|
import java.awt.Dimension; |
28 |
import java.awt.Frame; |
import java.awt.Frame; |
29 |
import java.awt.Graphics; |
import java.awt.Graphics; |
30 |
import java.awt.Graphics2D; |
import java.awt.Graphics2D; |
34 |
import javax.swing.BorderFactory; |
import javax.swing.BorderFactory; |
35 |
import javax.swing.JButton; |
import javax.swing.JButton; |
36 |
import javax.swing.JComboBox; |
import javax.swing.JComboBox; |
|
import javax.swing.JComponent; |
|
37 |
import javax.swing.JLabel; |
import javax.swing.JLabel; |
38 |
import javax.swing.JScrollBar; |
import javax.swing.JPanel; |
39 |
import javax.swing.JScrollPane; |
import javax.swing.JToolBar; |
40 |
|
|
41 |
import javax.swing.plaf.basic.BasicButtonUI; |
import javax.swing.plaf.basic.BasicButtonUI; |
42 |
import javax.swing.plaf.basic.BasicLabelUI; |
import javax.swing.plaf.basic.BasicLabelUI; |
|
import javax.swing.plaf.basic.ComboPopup; |
|
43 |
|
|
44 |
import org.jsampler.view.InstrumentsDbTreeModel; |
import org.jsampler.view.InstrumentsDbTreeModel; |
45 |
|
|
47 |
import org.jsampler.view.std.JSInstrumentChooser; |
import org.jsampler.view.std.JSInstrumentChooser; |
48 |
import org.jsampler.view.std.JSInstrumentsDbTree; |
import org.jsampler.view.std.JSInstrumentsDbTree; |
49 |
|
|
|
import org.jvnet.lafwidget.animation.FadeConfigurationManager; |
|
|
import org.jvnet.lafwidget.animation.FadeKind; |
|
|
|
|
|
import org.jvnet.substance.SubstanceComboBoxUI; |
|
|
import org.jvnet.substance.SubstanceLookAndFeel; |
|
50 |
|
|
51 |
/** |
/** |
52 |
* |
* |
74 |
public static JButton |
public static JButton |
75 |
createScreenButton(String s) { return new ScreenButton(s); } |
createScreenButton(String s) { return new ScreenButton(s); } |
76 |
|
|
77 |
|
public static JToolBar |
78 |
|
createSubToolBar() { return new ToolBar(); } |
79 |
|
|
80 |
|
public static JPanel |
81 |
|
createBottomSubPane() { return new BottomSubPane(); } |
82 |
|
|
83 |
|
|
84 |
private static class InstrumentChooser extends JSInstrumentChooser { |
private static class InstrumentChooser extends JSInstrumentChooser { |
85 |
InstrumentChooser(Frame owner) { |
InstrumentChooser(Frame owner) { |
89 |
protected JComboBox |
protected JComboBox |
90 |
createComboBox() { return createEnhancedComboBox(); } |
createComboBox() { return createEnhancedComboBox(); } |
91 |
|
|
92 |
|
@Override |
93 |
protected JSDbInstrumentChooser |
protected JSDbInstrumentChooser |
94 |
createDbInstrumentChooser(Dialog owner) { |
createDbInstrumentChooser(Dialog owner) { |
95 |
return new DbInstrumentChooser(owner); |
return new DbInstrumentChooser(owner); |
101 |
super(owner); |
super(owner); |
102 |
} |
} |
103 |
|
|
104 |
|
@Override |
105 |
protected JButton |
protected JButton |
106 |
createToolbarButton(Action a) { return new ToolbarButton(a); } |
createToolbarButton(Action a) { return new ToolbarButton(a); } |
107 |
|
|
108 |
|
@Override |
109 |
protected JSInstrumentsDbTree |
protected JSInstrumentsDbTree |
110 |
createInstrumentsDbTree(InstrumentsDbTreeModel m) { |
createInstrumentsDbTree(InstrumentsDbTreeModel m) { |
111 |
return new FantasiaInstrumentsDbTree(m); |
return new FantasiaInstrumentsDbTree(m); |
121 |
setForeground(new java.awt.Color(0xFFA300)); |
setForeground(new java.awt.Color(0xFFA300)); |
122 |
} |
} |
123 |
|
|
124 |
|
@Override |
125 |
protected void |
protected void |
126 |
paintComponent(Graphics g) { |
paintComponent(Graphics g) { |
127 |
Graphics2D g2d = (Graphics2D)g; |
Graphics2D g2d = (Graphics2D)g; |
134 |
super.paintComponent(g2d); |
super.paintComponent(g2d); |
135 |
} |
} |
136 |
|
|
137 |
|
@Override |
138 |
public void |
public void |
139 |
updateUI() { setUI(new BasicLabelUI()); } |
updateUI() { setUI(new BasicLabelUI()); } |
140 |
} |
} |
153 |
setForeground(new java.awt.Color(0xFFA300)); |
setForeground(new java.awt.Color(0xFFA300)); |
154 |
} |
} |
155 |
|
|
156 |
|
@Override |
157 |
protected void |
protected void |
158 |
paintComponent(Graphics g) { |
paintComponent(Graphics g) { |
159 |
Graphics2D g2d = (Graphics2D)g; |
Graphics2D g2d = (Graphics2D)g; |
166 |
super.paintComponent(g2d); |
super.paintComponent(g2d); |
167 |
} |
} |
168 |
|
|
169 |
|
@Override |
170 |
public void |
public void |
171 |
updateUI() { setUI(new BasicButtonUI()); } |
updateUI() { setUI(new BasicButtonUI()); } |
172 |
} |
} |
173 |
|
|
174 |
|
|
175 |
|
|
176 |
|
private static class ToolBar extends JToolBar { |
177 |
|
ToolBar() { |
178 |
|
setFloatable(false); |
179 |
|
setOpaque(false); |
180 |
|
setPreferredSize(new Dimension(77, 29)); |
181 |
|
setMinimumSize(getPreferredSize()); |
182 |
|
//setBackground(Color.BLACK); |
183 |
|
} |
184 |
|
|
185 |
|
@Override |
186 |
|
protected void |
187 |
|
paintComponent(Graphics g) { |
188 |
|
super.paintComponent(g); |
189 |
|
|
190 |
|
double h = getSize().getHeight(); |
191 |
|
double w = getSize().getWidth(); |
192 |
|
|
193 |
|
FantasiaPainter.paintGradient((Graphics2D)g, 0, 0, w - 1, h - 1); |
194 |
|
|
195 |
|
FantasiaPainter.RoundCorners rc = |
196 |
|
new FantasiaPainter.RoundCorners(true, false, false, true); |
197 |
|
|
198 |
|
FantasiaPainter.paintOuterBorder((Graphics2D)g, 0, 0, w - 1, h - 1, rc); |
199 |
|
} |
200 |
|
} |
201 |
|
|
202 |
|
private static class BottomSubPane extends JPanel { |
203 |
|
BottomSubPane() { |
204 |
|
setLayout(new java.awt.BorderLayout()); |
205 |
|
setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); |
206 |
|
} |
207 |
|
|
208 |
|
@Override |
209 |
|
protected void |
210 |
|
paintComponent(Graphics g) { |
211 |
|
super.paintComponent(g); |
212 |
|
|
213 |
|
Graphics2D g2 = (Graphics2D)g; |
214 |
|
double h = getSize().getHeight(); |
215 |
|
double w = getSize().getWidth(); |
216 |
|
|
217 |
|
FantasiaPainter.paintGradient(g2, 0, 0, w - 1, h - 1); |
218 |
|
|
219 |
|
FantasiaPainter.RoundCorners rc = |
220 |
|
new FantasiaPainter.RoundCorners(false, true, true, false); |
221 |
|
|
222 |
|
FantasiaPainter.paintOuterBorder(g2, 0, 0, w - 1, h - 1, rc); |
223 |
|
|
224 |
|
FantasiaPainter.paintInnerBorder(g2, 4, 4, w - 5, h - 5, true); |
225 |
|
} |
226 |
|
} |
227 |
} |
} |