public UIBlendMode(float x, float y, float w, float h) {
super(lx.ui, "BLEND MODE", x, y, w, h);
List<UIScrollList.Item> items = new ArrayList<UIScrollList.Item>();
- for (LXTransition t : glucose.getTransitions()) {
- items.add(new TransitionScrollItem(t));
+ int i = 0;
+ for (LXTransition t : transitions) {
+ items.add(new TransitionScrollItem(t, i++));
}
final UIScrollList tList;
(tList = new UIScrollList(1, UIWindow.TITLE_LABEL_HEIGHT, w-2, 60)).setItems(items).addToContainer(this);
class TransitionScrollItem extends UIScrollList.AbstractItem {
private final LXTransition transition;
- private String label;
+ private final int index;
+ private final String label;
- TransitionScrollItem(LXTransition transition) {
+ TransitionScrollItem(LXTransition transition, int index) {
this.transition = transition;
- label = className(transition, "Transition");
+ this.index = index;
+ this.label = className(transition, "Transition");
}
public String getLabel() {
}
public boolean isSelected() {
- return transition == glucose.getSelectedTransition();
+ return index == activeTransition.getValuei();
}
public boolean isPending() {
}
public void onMousePressed() {
- glucose.setSelectedTransition(transition);
+ activeTransition.setValue(this.index);
}
}