use of blue.components.lines.Line in project blue by kunstmusik.
the class CSDRender method getTempoScore.
protected String getTempoScore(Tempo tempo, double renderStart, double renderEnd) {
Line line = tempo.getLine();
if (line.size() == 1) {
return "t 0 " + line.getLinePoint(0).getY();
}
if (renderStart > line.getLinePoint(line.size() - 1).getX()) {
return "t 0 " + line.getLinePoint(line.size() - 1).getY();
}
StrBuilder buffer = new StrBuilder();
buffer.append("t 0 ").append(line.getValue(renderStart));
for (int i = 0; i < line.size(); i++) {
LinePoint lp = line.getLinePoint(i);
double pointBeat = lp.getX();
if (pointBeat > renderStart) {
if (renderEnd < 0 || pointBeat < renderEnd) {
buffer.append(" ").append(pointBeat - renderStart);
buffer.append(" ").append(lp.getY());
} else {
break;
}
}
}
if (renderEnd > 0) {
buffer.append(" ").append(renderEnd - renderStart);
buffer.append(" ").append(line.getValue(renderEnd));
}
buffer.append("\n");
return buffer.toString();
}
use of blue.components.lines.Line in project blue by kunstmusik.
the class ParameterLineView method repaint.
public void repaint() {
GraphicsContext gc = getGraphicsContext2D();
double w = getWidth();
double h = getHeight();
gc.setFill(Color.BLACK);
gc.fillRect(0, 0, w, h);
gc.setLineWidth(2.0);
gc.setStroke(Color.WHITE);
gc.strokeRect(0, 0, w, h);
for (Line line : lineList) {
boolean current = (line == getSelectedLine());
Color c = current ? line.getColorFX() : line.getColorFX().darker();
gc.setStroke(c);
gc.setFill(c);
drawLine(line, gc, w, h);
if (current) {
drawPoints(line, gc, w, h);
}
}
drawSelectedPoint(gc);
}
use of blue.components.lines.Line in project blue by kunstmusik.
the class LineSelector method nextLine.
private void nextLine() {
Line line = getSelectedLine();
if (line == null || lineList.size() < 2) {
return;
}
int index = lineList.indexOf(line) + 1;
if (index >= lineList.size()) {
index = 0;
}
setSelectedLine(lineList.get(index));
}
use of blue.components.lines.Line in project blue by kunstmusik.
the class LineSelector method previousLine.
private void previousLine() {
Line line = getSelectedLine();
if (line == null || lineList.size() < 2) {
return;
}
int index = lineList.indexOf(line) - 1;
if (index < 0) {
index = lineList.size() - 1;
}
setSelectedLine(lineList.get(index));
}
use of blue.components.lines.Line in project blue by kunstmusik.
the class LineView method repaint.
public void repaint() {
GraphicsContext gc = getGraphicsContext2D();
double w = getWidth();
double h = getHeight();
gc.setFill(Color.BLACK);
gc.fillRect(0, 0, w, h);
gc.setLineWidth(1.0);
for (Line line : lineList) {
boolean current = (line == getSelectedLine());
Color c = current ? line.getColorFX() : line.getColorFX().darker();
gc.setStroke(c);
gc.setFill(c);
drawLine(line, gc, w, h);
if (current) {
drawPoints(line, gc, w, h);
}
}
drawSelectedPoint(gc);
}
Aggregations