public static boolean testLayout(LayoutEnv env, SimpleNode node) {
if (node.id != ParserTreeConstants.JJTSCORE) {
return false;
}
ASTScore score = (ASTScore) node;
ScoreLayout layout = new ScoreLayout();
score.setLayoutObject(layout);
Iterator<ASTTime> times = score.getAllTime().iterator();
while (times.hasNext()) {
ASTTime t = times.next();
if (t.generated) {
score.layoutCalculator.calcLayout(env, t);
}
}
//clef is printed in each line
for (int s = 0; s < score.getAllClef().size(); s++) {
Iterator<ASTClef> clefs = score.getAllClef().get(s).iterator();
while (clefs.hasNext()) {
ASTClef t = clefs.next();
if (t.generated) {
score.layoutCalculator.calcLayout(env, t);
}
}
}
//key is printed in each line
for (int s = 0; s < score.getAllKeys().size(); s++) {
Iterator<ASTKey> keys = score.getAllKeys().get(s).iterator();
while (keys.hasNext()) {
ASTKey t = keys.next();
if (t.generated) {
score.layoutCalculator.calcLayout(env, t);
}