From: Benjamin R. <ran...@us...> - 2007-08-27 19:54:00
|
Update of /cvsroot/jrobin/src/org/jrobin/graph In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv14837/src/org/jrobin/graph Modified Files: CommentText.java Log Message: clean up the whitespace Index: CommentText.java =================================================================== RCS file: /cvsroot/jrobin/src/org/jrobin/graph/CommentText.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CommentText.java 21 Dec 2006 18:02:43 -0000 1.2 --- CommentText.java 27 Aug 2007 19:53:54 -0000 1.3 *************** *** 29,72 **** class CommentText implements RrdGraphConstants { ! private final String text; // original text ! ! String resolvedText; // resolved text ! String marker; // end-of-text marker ! boolean enabled; // hrule and vrule comments can be disabled at runtime ! int x, y; // coordinates, evaluated later ! CommentText(String text) { ! this.text = text; ! } ! void resolveText(DataProcessor dproc, ValueScaler valueScaler) throws RrdException { ! resolvedText = text; ! marker = ""; ! if (resolvedText != null) { ! for (String mark : MARKERS) { ! if (resolvedText.endsWith(mark)) { ! marker = mark; ! resolvedText = resolvedText.substring(0, resolvedText.length() - marker.length()); ! trimIfGlue(); ! break; ! } ! } ! } ! enabled = resolvedText != null; ! } ! void trimIfGlue() { ! if (marker.equals(GLUE_MARKER)) { ! resolvedText = resolvedText.trim(); ! } ! } ! boolean isPrint() { ! return false; ! } ! boolean isValidGraphElement() { ! return !isPrint() && enabled; ! } } --- 29,71 ---- class CommentText implements RrdGraphConstants { ! private final String text; // original text ! String resolvedText; // resolved text ! String marker; // end-of-text marker ! boolean enabled; // hrule and vrule comments can be disabled at runtime ! int x, y; // coordinates, evaluated later ! CommentText(String text) { ! this.text = text; ! } + void resolveText(DataProcessor dproc, ValueScaler valueScaler) throws RrdException { + resolvedText = text; + marker = ""; + if (resolvedText != null) { + for (String mark : MARKERS) { + if (resolvedText.endsWith(mark)) { + marker = mark; + resolvedText = resolvedText.substring(0, resolvedText.length() - marker.length()); + trimIfGlue(); + break; + } + } + } + enabled = resolvedText != null; + } ! void trimIfGlue() { ! if (marker.equals(GLUE_MARKER)) { ! resolvedText = resolvedText.trim(); ! } ! } ! boolean isPrint() { ! return false; ! } ! boolean isValidGraphElement() { ! return !isPrint() && enabled; ! } } |