22 |
|
|
23 |
package org.jsampler.view.fantasia; |
package org.jsampler.view.fantasia; |
24 |
|
|
25 |
|
import java.awt.Color; |
26 |
import java.awt.Dimension; |
import java.awt.Dimension; |
27 |
|
import java.awt.Graphics; |
28 |
|
import java.awt.Graphics2D; |
29 |
import java.awt.Insets; |
import java.awt.Insets; |
30 |
|
|
31 |
import java.awt.event.ActionEvent; |
import java.awt.event.ActionEvent; |
57 |
import net.sf.juife.Dial; |
import net.sf.juife.Dial; |
58 |
|
|
59 |
import org.jsampler.CC; |
import org.jsampler.CC; |
60 |
import org.jsampler.view.fantasia.basic.PixmapPane; |
import org.jsampler.view.fantasia.basic.*; |
|
import org.jsampler.view.fantasia.basic.PixmapButton; |
|
61 |
|
|
62 |
import org.jvnet.substance.utils.SubstanceImageCreator; |
import org.jvnet.substance.utils.SubstanceImageCreator; |
63 |
|
|
72 |
* |
* |
73 |
* @author Grigor Iliev |
* @author Grigor Iliev |
74 |
*/ |
*/ |
75 |
public class NormalChannelView extends PixmapPane implements ChannelView { |
public class NormalChannelView extends JPanel implements ChannelView { |
76 |
private final Channel channel; |
private final Channel channel; |
77 |
private ChannelOptionsView channelOptionsView = null; |
private ChannelOptionsView channelOptionsView = null; |
78 |
|
|
90 |
/** Creates a new instance of <code>NormalChannelView</code> */ |
/** Creates a new instance of <code>NormalChannelView</code> */ |
91 |
public |
public |
92 |
NormalChannelView(Channel channel) { |
NormalChannelView(Channel channel) { |
|
super(Res.gfxChannel); |
|
|
setPixmapInsets(new Insets(3, 3, 3, 3)); |
|
|
|
|
93 |
components.add(this); |
components.add(this); |
94 |
|
|
95 |
this.channel = channel; |
this.channel = channel; |
334 |
|
|
335 |
////////////////////////////////////////////// |
////////////////////////////////////////////// |
336 |
|
|
337 |
|
@Override |
338 |
|
protected void |
339 |
|
paintComponent(Graphics g) { |
340 |
|
if(isOpaque()) super.paintComponent(g); |
341 |
|
|
342 |
|
double h = getSize().getHeight(); |
343 |
|
double w = getSize().getWidth(); |
344 |
|
|
345 |
|
Color c1 = channel.isSelected() ? new Color(0x555555) : FantasiaPainter.color6; |
346 |
|
Color c2 = channel.isSelected() ? new Color(0x606060) : FantasiaPainter.color4; |
347 |
|
|
348 |
|
Graphics2D g2 = (Graphics2D)g; |
349 |
|
FantasiaPainter.paintGradient(g2, 0, 0, w - 1, h - 1, c1, c2); |
350 |
|
FantasiaPainter.paintOuterBorder(g2, 0, 0, w - 1, h - 1, false, 0.27f, 0.11f, 0.64f, 0.20f); |
351 |
|
} |
352 |
|
|
353 |
|
|
354 |
/** |
/** |
355 |
* Updates the mute button with the proper icon regarding to information obtained |
* Updates the mute button with the proper icon regarding to information obtained |
516 |
private class EventHandler extends MouseAdapter { |
private class EventHandler extends MouseAdapter { |
517 |
@Override |
@Override |
518 |
public void |
public void |
519 |
mouseClicked(MouseEvent e) { |
mousePressed(MouseEvent e) { |
|
if(e.getButton() != e.BUTTON1) return; |
|
520 |
// TAG: channel selection system |
// TAG: channel selection system |
521 |
CC.getMainFrame().getSelectedChannelsPane().setSelectedChannel(channel); |
if(e.getButton() == MouseEvent.BUTTON3 && channel.isSelected()) return; |
522 |
|
|
523 |
|
CC.getMainFrame().getSelectedChannelsPane().processChannelSelection ( |
524 |
|
channel, e.isControlDown(), e.isShiftDown() |
525 |
|
); |
526 |
/////// |
/////// |
527 |
} |
} |
528 |
} |
} |