/** * Draw a string with given rotation angle. Reference point is the center * of string. The angle of rotation is in radians. The logical coordinates * are proportional to the base coordinates. */ public void drawTextBaseRatio(String label, double rotation, double[] coord) { drawTextBaseRatio(label, 0.5, 0.5, 0.0, coord); }
/** * Draw a string with given rotation angle. Reference point is the center * of string. The logical coordinates are proportional to the base coordinates. */ public void drawTextBaseRatio(String label, double[] coord) { drawTextBaseRatio(label, 0.5, 0.5, 0.0, coord); }
/** * Draw a string with given reference point. (0.5, 0.5) is center, (0, 0) is * lower left, (0, 1) is upper left, etc. The logical coordinates are * proportional to the base coordinates. */ public void drawTextBaseRatio(String label, double horizontalReference, double verticalReference, double[] coord) { drawTextBaseRatio(label, horizontalReference, verticalReference, 0.0, coord); }
@Override public void paint(Graphics g) { Font f = g.getFont(); if (font != null) { g.setFont(font); } Color c = g.getColor(); g.setColor(getColor()); g.drawTextBaseRatio(text, horizontalReference, verticalReference, rotation, coord); g.setColor(c); if (font != null) { g.setFont(f); } } }
decimal = (int) -log + 1; g.drawTextBaseRatio(String.valueOf(Math.round(levels[levels.length-1], decimal)), 0.0, 1.0, start); decimal = (int) -log + 1; g.drawTextBaseRatio(String.valueOf(Math.round(levels[0], decimal)), 0.0, 0.0, start);
int decimal = 1; if (log < 0) decimal = (int) -log + 1; g.drawTextBaseRatio(String.valueOf(Math.round(max, decimal)), 0.0, 1.0, start); decimal = 1; if (log < 0) decimal = (int) -log + 1; g.drawTextBaseRatio(String.valueOf(Math.round(min, decimal)), 0.0, 0.0, start);
decimal = (int) -log + 1; g.drawTextBaseRatio(String.valueOf(Math.round(max, decimal)), 0.0, 1.0, start); decimal = (int) -log + 1; g.drawTextBaseRatio(String.valueOf(Math.round(min, decimal)), 0.0, 0.0, start);
decimal = (int) -log + 1; g.drawTextBaseRatio(String.valueOf(Math.round(max, decimal)), 0.0, 1.0, start); decimal = (int) -log + 1; g.drawTextBaseRatio(String.valueOf(Math.round(min, decimal)), 0.0, 0.0, start);