public List<NoteButton> getComponents() {
List<NoteButton> results=new ArrayList<NoteButton>();
if (layer==null) {
for(Note[] rows:notes) {
for (Note col:rows) {
results.add(new NoteButton(col));
}
}
} else {
int rowIdx=0;
int colCount=notes[0].length;
for(Note[] rows:notes) {
int colIdx=0;
for (Note col:rows) {
NoteButton black=new NoteButton(col);
if (rowIdx%2==0) {
results.add(black);
NoteButton red=new NoteButton(layer.notes[rowIdx][colIdx]);
red.setForeground(Color.RED);
results.add(red);
} else {
NoteButton red=new NoteButton(layer.notes[rowIdx][(colIdx+colCount-1)%colCount]);
red.setForeground(Color.RED);
results.add(red);
results.add(black);
}
colIdx++;
}