Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/tunecomposer/BackgroundController.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ public class BackgroundController implements Initializable{
//makes available the graphicsContext
GraphicsContext gc;

String[] noteNames = {"C", "C#", "D", "D#", "E", "F", "F#", "G", "G#", "A", "A#", "B"};

/**
* Initializes the controller class.
* @param url placeholder/default/generic url
Expand All @@ -37,7 +39,6 @@ public class BackgroundController implements Initializable{
public void initialize(URL url, ResourceBundle rb) {
//set up for drawing grey lines
gc = linesCanvas.getGraphicsContext2D();
changeBackgroundColor(Color.GREY);
drawLine(Color.BLACK);
}

Expand All @@ -46,6 +47,7 @@ public void initialize(URL url, ResourceBundle rb) {
* "lines"
*/
private void drawLine(Color value) {
int noteIndex = 0;
gc.setLineWidth(1.0);
for (int y = 0; y < 1280; y+=10) {
double y1 ;
Expand All @@ -54,6 +56,10 @@ private void drawLine(Color value) {
gc.setStroke(value);
gc.lineTo(8000, y1);
gc.stroke();
for( int j = 5; j < 8000; j += 1000){
gc.strokeText(noteNames[noteIndex], j, y1);
}
noteIndex = (noteIndex + 1) % 12;
}
}

Expand Down