-
Notifications
You must be signed in to change notification settings - Fork 3
/
gui.pde
38 lines (31 loc) · 1.36 KB
/
gui.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// =============================================================================
// Extended G4P classes
// =============================================================================
// Channel Toggles =============================================================
/**
* Extended GOption class that stores the corresponding color channel and
* whether this is a source or target channel toggle. Toggle text and color are
* set based on the color channel
*/
public class ChannelOption extends GOption {
// Color channel associated w/ this option
int channel;
// Whether this is source or target
boolean source;
// TODO: figure out error about constant declarations
// Text associated w/ channel indices
String[] CHANNELS = {"R","G","B"};
// GCSchemes associated w/ channel indices
int[] SCHEMES = {GCScheme.RED_SCHEME, GCScheme.GREEN_SCHEME, GCScheme.BLUE_SCHEME};
public ChannelOption(PApplet theApplet, float p0, float p1, float p2, float p3, int channel, boolean source) {
super(theApplet, p0, p1, p2, p3, "");
this.channel = channel;
this.source = source;
this.setText(this.CHANNELS[this.channel]);
this.setLocalColorScheme(this.SCHEMES[this.channel]);
this.setIconAlign(GAlign.LEFT, GAlign.MIDDLE);
this.setOpaque(true);
}
public int getChannel() { return this.channel; }
public boolean isSource() { return this.source; }
}