Search in sources :

Example 1 with CodeDisplayCoordinate

use of com.google.security.zynamics.zylib.gui.CodeDisplay.CodeDisplayCoordinate in project binnavi by google.

the class InstructionCommentsDataModel method getCommentCharacterBuffer.

private FormattedCharacterBuffer getCommentCharacterBuffer(int rowIndex, int columnIndex, int lineIndex) {
    // Return the actual comment.
    CodeDisplayCoordinate coordinate = new CodeDisplayCoordinate(rowIndex, lineIndex, columnIndex, 0);
    Pair<IComment, Pair<Integer, Integer>> commentAndIndex = getCommentAndIndexAtCoordinate(coordinate);
    String finalComment = "";
    if (commentAndIndex.first().getNumberOfCommentLines() > 0) {
        String commentString = commentAndIndex.first().getComment();
        Pair<Integer, Integer> indices = commentAndIndex.second();
        finalComment = commentString.substring(indices.first(), indices.second());
    }
    finalComment = CodeDisplay.padRight(finalComment, getColumnWidthInCharacters(columnIndex));
    return new FormattedCharacterBuffer(finalComment, STANDARD_FONT, columns[COMMENT_INDEX].getDefaultFontColor(), columns[COMMENT_INDEX].getDefaultBackgroundColor());
}
Also used : IComment(com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.Interfaces.IComment) CodeDisplayCoordinate(com.google.security.zynamics.zylib.gui.CodeDisplay.CodeDisplayCoordinate) Pair(com.google.security.zynamics.zylib.general.Pair) FormattedCharacterBuffer(com.google.security.zynamics.zylib.gui.CodeDisplay.FormattedCharacterBuffer)

Aggregations

IComment (com.google.security.zynamics.binnavi.Gui.GraphWindows.CommentDialogs.Interfaces.IComment)1 Pair (com.google.security.zynamics.zylib.general.Pair)1 CodeDisplayCoordinate (com.google.security.zynamics.zylib.gui.CodeDisplay.CodeDisplayCoordinate)1 FormattedCharacterBuffer (com.google.security.zynamics.zylib.gui.CodeDisplay.FormattedCharacterBuffer)1