improving old code in Problem

This commit is contained in:
Manindra Moharana
2013-08-19 16:02:45 +05:30
parent 4d62508f9b
commit a8cd6d598b
4 changed files with 28 additions and 20 deletions

View File

@@ -175,9 +175,9 @@ public class ErrorBar extends JPanel {
// because of
// class declaration in the beginning as well as default imports
for (Problem problem : problems) {
if (problem.tabIndex == currentTab) {
if (problem.getTabIndex() == currentTab) {
// Ratio of error line to total lines
float y = (problem.lineNumber - errorCheckerService.defaultImportsOffset)
float y = (problem.getLineNumber() - errorCheckerService.defaultImportsOffset)
/ ((float) totalLines);
// Ratio multiplied by height of the error bar
y *= fheight - 15; // -15 is just a vertical offset
@@ -294,7 +294,7 @@ public class ErrorBar extends JPanel {
&& evt.getY() <= eMarker.getY() + 2 + errorMarkerHeight) {
Problem p = eMarker.getProblem();
String msg = (p.isError() ? "Error: " : "Warning: ")
+ p.message;
+ p.getMessage();
setToolTipText(msg);
setCursor(Cursor
.getPredefinedCursor(Cursor.HAND_CURSOR));