if (setupCells) {
final int[] hoshis = Board.getHoshis(boardSize);
if (hoshis != null)
for (int k = 0; k < hoshis.length; k++) {
SGFPoint sgfp = Board.xy(hoshis[k], boardSize);
if (isInView(sgfp))
getWit(sgfp).addMark(WIT.HOSHI);
}
setupCells = false;
}
SGFNode lastMoveNode = game.kifuLastMove();
// draw marks from properties
for (Enumeration e = lastMoveNode.getProperties(); e.hasMoreElements(); ) {
SGFProperty prop = (SGFProperty) e.nextElement();
try {
SGFPoint sgfp = prop.getPoint();
if (isInView(sgfp)) {
WIT wit = getWit(sgfp);
if (prop.name() == SGFPropertyName.TR)
wit.addMark(WIT.TRIANGLE);
else if (prop.name() == SGFPropertyName.SQ)
wit.addMark(WIT.SQUARE);
else if (prop.name() == SGFPropertyName.CR)
wit.addMark(WIT.CIRCLE);
else if (prop.name() == SGFPropertyName.MA)
wit.addMark(WIT.CROSS);
else if (prop.name() == SGFPropertyName.SL)
wit.addMark(WIT.SELECTED);
else if (prop.name() == SGFPropertyName.DD)
wit.addMark(WIT.DIMMED);
else if (prop.name() == SGFPropertyName.TW)
wit.addMark(WIT.WHITE_TER);
else if (prop.name() == SGFPropertyName.TB)
wit.addMark(WIT.BLACK_TER);
else if (prop.name() == SGFPropertyName.LB)
wit.setLabel(prop.getText());
else if (prop.name() == SGFPropertyName.VW)
wit.addMark(WIT.VIEW);
}
} catch (SGFInvalidDataRequestException e1) {
}
}
// mark last move (if not marked in props)
if (game.lastMove >= 0) {
SGFPoint sgfp = game.board.xy(game.lastMove);
if (isInView(sgfp) && (getWit(sgfp).bits & WIT.PURE_MARK) == 0)
getWit(sgfp).addMark(WIT.CIRCLE);
}
// mark next move (if not marked in props)
if (showNextMove) {
SGFNodeIterator i = lastMoveNode.iterator();
if (i.next(true) != null) {
try {
SGFMove m = i.current().getMoveProperty();
if (isInView(m) && (getWit(m).bits & WIT.PURE_MARK) == 0)
getWit(m).addMark(WIT.CIRCLE);
} catch (SGFPropertyNotFoundException e) {
// DO NOTHING
}
}
}
// mark ko move (if not marked in props)
if (game.koMove >= 0) {
SGFPoint sgfp = game.board.xy(game.koMove);
if (isInView(sgfp) && (getWit(sgfp).bits & WIT.PURE_MARK) == 0)
getWit(sgfp).addMark(WIT.SQUARE);
}
// mark variations