Use Font.{DIALOG,SANS_SERIF}.

This commit is contained in:
Masaki Muranaka 2012-12-01 15:04:48 +09:00 committed by Dale Schultz
parent 632c736db5
commit 5df9906be7
3 changed files with 26 additions and 26 deletions

View File

@ -155,7 +155,7 @@ public class DialGaugeStyle implements GaugeStyle {
db.setGradientPaintTransformer(new StandardGradientPaintTransformer(VERTICAL)); db.setGradientPaintTransformer(new StandardGradientPaintTransformer(VERTICAL));
plot.setBackground(db); plot.setBackground(db);
unitsLabel.setFont(new Font("Dialog", BOLD, 15)); unitsLabel.setFont(new Font(Font.DIALOG, BOLD, 15));
unitsLabel.setRadius(0.7); unitsLabel.setRadius(0.7);
unitsLabel.setLabel(loggerData.getSelectedConvertor().getUnits()); unitsLabel.setLabel(loggerData.getSelectedConvertor().getUnits());
plot.addLayer(unitsLabel); plot.addLayer(unitsLabel);
@ -171,7 +171,7 @@ public class DialGaugeStyle implements GaugeStyle {
StandardDialScale scale = new StandardDialScale(minMax.min, minMax.max, 225.0, -270.0, minMax.step, 5); StandardDialScale scale = new StandardDialScale(minMax.min, minMax.max, 225.0, -270.0, minMax.step, 5);
scale.setTickRadius(0.88); scale.setTickRadius(0.88);
scale.setTickLabelOffset(0.15); scale.setTickLabelOffset(0.15);
scale.setTickLabelFont(new Font("Dialog", PLAIN, 12)); scale.setTickLabelFont(new Font(Font.DIALOG, PLAIN, 12));
scale.setTickLabelFormatter(format); scale.setTickLabelFormatter(format);
plot.addScale(0, scale); plot.addScale(0, scale);
plot.addScale(1, scale); plot.addScale(1, scale);

View File

@ -72,7 +72,7 @@ public final class SmallDialGaugeStyle extends DialGaugeStyle {
db.setGradientPaintTransformer(new StandardGradientPaintTransformer(VERTICAL)); db.setGradientPaintTransformer(new StandardGradientPaintTransformer(VERTICAL));
plot.setBackground(db); plot.setBackground(db);
unitsLabel.setFont(new Font("Dialog", BOLD, 14)); unitsLabel.setFont(new Font(Font.DIALOG, BOLD, 14));
unitsLabel.setRadius(0.7); unitsLabel.setRadius(0.7);
unitsLabel.setLabel(loggerData.getSelectedConvertor().getUnits()); unitsLabel.setLabel(loggerData.getSelectedConvertor().getUnits());
plot.addLayer(unitsLabel); plot.addLayer(unitsLabel);
@ -88,7 +88,7 @@ public final class SmallDialGaugeStyle extends DialGaugeStyle {
StandardDialScale scale = new StandardDialScale(minMax.min, minMax.max, 225.0, -270.0, minMax.step, 5); StandardDialScale scale = new StandardDialScale(minMax.min, minMax.max, 225.0, -270.0, minMax.step, 5);
scale.setTickRadius(0.88); scale.setTickRadius(0.88);
scale.setTickLabelOffset(0.15); scale.setTickLabelOffset(0.15);
scale.setTickLabelFont(new Font("Dialog", PLAIN, 12)); scale.setTickLabelFont(new Font(Font.DIALOG, PLAIN, 12));
scale.setTickLabelFormatter(format); scale.setTickLabelFormatter(format);
plot.addScale(0, scale); plot.addScale(0, scale);
plot.addScale(1, scale); plot.addScale(1, scale);

View File

@ -193,7 +193,7 @@ public final class DynoChartPanel extends JPanel {
hpPointer.setArrowPaint(BLUE); hpPointer.setArrowPaint(BLUE);
hpPointer.setTipRadius(7.0); hpPointer.setTipRadius(7.0);
hpPointer.setBaseRadius(30.0); hpPointer.setBaseRadius(30.0);
hpPointer.setFont(new Font("SansSerif", Font.BOLD, 10)); hpPointer.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 10));
hpPointer.setPaint(BLUE); hpPointer.setPaint(BLUE);
bestTq = new XYDrawableAnnotation(results[3], results[2], 10, 10, cd); bestTq = new XYDrawableAnnotation(results[3], results[2], 10, 10, cd);
tqPointer.setX(results[3]); tqPointer.setX(results[3]);
@ -201,32 +201,32 @@ public final class DynoChartPanel extends JPanel {
tqPointer.setArrowPaint(YELLOW); tqPointer.setArrowPaint(YELLOW);
tqPointer.setTipRadius(7.0); tqPointer.setTipRadius(7.0);
tqPointer.setBaseRadius(30.0); tqPointer.setBaseRadius(30.0);
tqPointer.setFont(new Font("SansSerif", Font.BOLD, 10)); tqPointer.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 10));
tqPointer.setPaint(YELLOW); tqPointer.setPaint(YELLOW);
final XYTextAnnotation dynoResults = new XYTextAnnotation(resultStrings[1], xMin, yMin + (ySpace * 5)); final XYTextAnnotation dynoResults = new XYTextAnnotation(resultStrings[1], xMin, yMin + (ySpace * 5));
dynoResults.setPaint(RED); dynoResults.setPaint(RED);
dynoResults.setTextAnchor(TextAnchor.BOTTOM_LEFT); dynoResults.setTextAnchor(TextAnchor.BOTTOM_LEFT);
dynoResults.setFont(new Font("SansSerif", Font.BOLD, 14)); dynoResults.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 14));
final XYTextAnnotation carText = new XYTextAnnotation(resultStrings[0], xMin, yMin + (ySpace * 4)); final XYTextAnnotation carText = new XYTextAnnotation(resultStrings[0], xMin, yMin + (ySpace * 4));
carText.setPaint(RED); carText.setPaint(RED);
carText.setTextAnchor(TextAnchor.BOTTOM_LEFT); carText.setTextAnchor(TextAnchor.BOTTOM_LEFT);
carText.setFont(new Font("SansSerif", Font.BOLD, 12)); carText.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 12));
final XYTextAnnotation stat1 = new XYTextAnnotation(resultStrings[2], xMin, yMin + (ySpace * 3)); final XYTextAnnotation stat1 = new XYTextAnnotation(resultStrings[2], xMin, yMin + (ySpace * 3));
stat1.setPaint(RED); stat1.setPaint(RED);
stat1.setTextAnchor(TextAnchor.BOTTOM_LEFT); stat1.setTextAnchor(TextAnchor.BOTTOM_LEFT);
stat1.setFont(new Font("SansSerif", Font.BOLD, 12)); stat1.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 12));
final XYTextAnnotation stat2 = new XYTextAnnotation(resultStrings[3], xMin, yMin + ySpace * 2); final XYTextAnnotation stat2 = new XYTextAnnotation(resultStrings[3], xMin, yMin + ySpace * 2);
stat2.setPaint(RED); stat2.setPaint(RED);
stat2.setTextAnchor(TextAnchor.BOTTOM_LEFT); stat2.setTextAnchor(TextAnchor.BOTTOM_LEFT);
stat2.setFont(new Font("SansSerif", Font.BOLD, 12)); stat2.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 12));
final XYTextAnnotation stat3 = new XYTextAnnotation(resultStrings[4], xMin, yMin + ySpace); final XYTextAnnotation stat3 = new XYTextAnnotation(resultStrings[4], xMin, yMin + ySpace);
stat3.setPaint(RED); stat3.setPaint(RED);
stat3.setTextAnchor(TextAnchor.BOTTOM_LEFT); stat3.setTextAnchor(TextAnchor.BOTTOM_LEFT);
stat3.setFont(new Font("SansSerif", Font.BOLD, 12)); stat3.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 12));
final XYTextAnnotation stat4 = new XYTextAnnotation(resultStrings[5], xMin, yMin); final XYTextAnnotation stat4 = new XYTextAnnotation(resultStrings[5], xMin, yMin);
stat4.setPaint(RED); stat4.setPaint(RED);
stat4.setTextAnchor(TextAnchor.BOTTOM_LEFT); stat4.setTextAnchor(TextAnchor.BOTTOM_LEFT);
stat4.setFont(new Font("SansSerif", Font.BOLD, 12)); stat4.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 12));
if (!refStat.equals(" ")) { if (!refStat.equals(" ")) {
refStat.setX(plot.getDomainAxis().getLowerBound() + 10); refStat.setX(plot.getDomainAxis().getLowerBound() + 10);
refStat.setY(hpAxis.getUpperBound()); refStat.setY(hpAxis.getUpperBound());
@ -268,60 +268,60 @@ public final class DynoChartPanel extends JPanel {
final XYTextAnnotation s60Label = new XYTextAnnotation(s60Text, etResults[0], (etResults[1] + ySpace)); final XYTextAnnotation s60Label = new XYTextAnnotation(s60Text, etResults[0], (etResults[1] + ySpace));
s60Label.setPaint(RED); s60Label.setPaint(RED);
s60Label.setTextAnchor(TextAnchor.TOP_RIGHT); s60Label.setTextAnchor(TextAnchor.TOP_RIGHT);
s60Label.setFont(new Font("SansSerif", Font.BOLD, 10)); s60Label.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 10));
final XYTextAnnotation s60Time = new XYTextAnnotation(String.format("%1.3f", etResults[0]) + "\" / " + String.format("%1.2f", etResults[1]), etResults[0], (etResults[1] - ySpace)); final XYTextAnnotation s60Time = new XYTextAnnotation(String.format("%1.3f", etResults[0]) + "\" / " + String.format("%1.2f", etResults[1]), etResults[0], (etResults[1] - ySpace));
s60Time.setPaint(RED); s60Time.setPaint(RED);
s60Time.setTextAnchor(TextAnchor.BOTTOM_LEFT); s60Time.setTextAnchor(TextAnchor.BOTTOM_LEFT);
s60Time.setFont(new Font("SansSerif", Font.BOLD, 10)); s60Time.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 10));
final XYAnnotation s330Marker = new XYDrawableAnnotation(etResults[2], etResults[3], 10, 10, cd); final XYAnnotation s330Marker = new XYDrawableAnnotation(etResults[2], etResults[3], 10, 10, cd);
final XYTextAnnotation s330Label = new XYTextAnnotation(s330Text, etResults[2], (etResults[3] + ySpace)); final XYTextAnnotation s330Label = new XYTextAnnotation(s330Text, etResults[2], (etResults[3] + ySpace));
s330Label.setPaint(RED); s330Label.setPaint(RED);
s330Label.setTextAnchor(TextAnchor.TOP_RIGHT); s330Label.setTextAnchor(TextAnchor.TOP_RIGHT);
s330Label.setFont(new Font("SansSerif", Font.BOLD, 10)); s330Label.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 10));
final XYTextAnnotation s330Time = new XYTextAnnotation(String.format("%1.3f", etResults[2]) + "\" / " + String.format("%1.2f", etResults[3]), etResults[2], (etResults[3] - ySpace)); final XYTextAnnotation s330Time = new XYTextAnnotation(String.format("%1.3f", etResults[2]) + "\" / " + String.format("%1.2f", etResults[3]), etResults[2], (etResults[3] - ySpace));
s330Time.setPaint(RED); s330Time.setPaint(RED);
s330Time.setTextAnchor(TextAnchor.BOTTOM_LEFT); s330Time.setTextAnchor(TextAnchor.BOTTOM_LEFT);
s330Time.setFont(new Font("SansSerif", Font.BOLD, 10)); s330Time.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 10));
final XYAnnotation s660Marker = new XYDrawableAnnotation(etResults[4], etResults[5], 10, 10, cd); final XYAnnotation s660Marker = new XYDrawableAnnotation(etResults[4], etResults[5], 10, 10, cd);
final XYTextAnnotation s660Label = new XYTextAnnotation(s660Text, etResults[4], (etResults[5] + ySpace)); final XYTextAnnotation s660Label = new XYTextAnnotation(s660Text, etResults[4], (etResults[5] + ySpace));
s660Label.setPaint(RED); s660Label.setPaint(RED);
s660Label.setTextAnchor(TextAnchor.TOP_RIGHT); s660Label.setTextAnchor(TextAnchor.TOP_RIGHT);
s660Label.setFont(new Font("SansSerif", Font.BOLD, 10)); s660Label.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 10));
final XYTextAnnotation s660Time = new XYTextAnnotation(String.format("%1.3f", etResults[4]) + "\" / " + String.format("%1.2f", etResults[5]), etResults[4], (etResults[5] - ySpace)); final XYTextAnnotation s660Time = new XYTextAnnotation(String.format("%1.3f", etResults[4]) + "\" / " + String.format("%1.2f", etResults[5]), etResults[4], (etResults[5] - ySpace));
s660Time.setPaint(RED); s660Time.setPaint(RED);
s660Time.setTextAnchor(TextAnchor.BOTTOM_LEFT); s660Time.setTextAnchor(TextAnchor.BOTTOM_LEFT);
s660Time.setFont(new Font("SansSerif", Font.BOLD, 10)); s660Time.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 10));
final XYAnnotation s1000Marker = new XYDrawableAnnotation(etResults[6], etResults[7], 10, 10, cd); final XYAnnotation s1000Marker = new XYDrawableAnnotation(etResults[6], etResults[7], 10, 10, cd);
final XYTextAnnotation s1000Label = new XYTextAnnotation(s1000Text, etResults[6], (etResults[7] + ySpace)); final XYTextAnnotation s1000Label = new XYTextAnnotation(s1000Text, etResults[6], (etResults[7] + ySpace));
s1000Label.setPaint(RED); s1000Label.setPaint(RED);
s1000Label.setTextAnchor(TextAnchor.TOP_RIGHT); s1000Label.setTextAnchor(TextAnchor.TOP_RIGHT);
s1000Label.setFont(new Font("SansSerif", Font.BOLD, 10)); s1000Label.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 10));
final XYTextAnnotation s1000Time = new XYTextAnnotation(String.format("%1.3f", etResults[6]) + "\" / " + String.format("%1.2f", etResults[7]), etResults[6], (etResults[7] - ySpace)); final XYTextAnnotation s1000Time = new XYTextAnnotation(String.format("%1.3f", etResults[6]) + "\" / " + String.format("%1.2f", etResults[7]), etResults[6], (etResults[7] - ySpace));
s1000Time.setPaint(RED); s1000Time.setPaint(RED);
s1000Time.setTextAnchor(TextAnchor.BOTTOM_LEFT); s1000Time.setTextAnchor(TextAnchor.BOTTOM_LEFT);
s1000Time.setFont(new Font("SansSerif", Font.BOLD, 10)); s1000Time.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 10));
final XYAnnotation s1320Marker = new XYDrawableAnnotation(etResults[8], etResults[9], 10, 10, cd); final XYAnnotation s1320Marker = new XYDrawableAnnotation(etResults[8], etResults[9], 10, 10, cd);
final XYTextAnnotation s1320Label = new XYTextAnnotation(s1320Text, etResults[8], (etResults[9] - ySpace)); final XYTextAnnotation s1320Label = new XYTextAnnotation(s1320Text, etResults[8], (etResults[9] - ySpace));
s1320Label.setPaint(RED); s1320Label.setPaint(RED);
s1320Label.setTextAnchor(TextAnchor.BOTTOM_CENTER); s1320Label.setTextAnchor(TextAnchor.BOTTOM_CENTER);
s1320Label.setFont(new Font("SansSerif", Font.BOLD, 10)); s1320Label.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 10));
final XYTextAnnotation s1320Time = new XYTextAnnotation(String.format("%1.3f", etResults[8]) + "\" / " + String.format("%1.2f", etResults[9]), (etResults[8] - 0.2), etResults[9]); final XYTextAnnotation s1320Time = new XYTextAnnotation(String.format("%1.3f", etResults[8]) + "\" / " + String.format("%1.2f", etResults[9]), (etResults[8] - 0.2), etResults[9]);
s1320Time.setPaint(RED); s1320Time.setPaint(RED);
s1320Time.setTextAnchor(TextAnchor.CENTER_RIGHT); s1320Time.setTextAnchor(TextAnchor.CENTER_RIGHT);
s1320Time.setFont(new Font("SansSerif", Font.BOLD, 10)); s1320Time.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 10));
final XYTextAnnotation carText = new XYTextAnnotation(car[0], (plot.getDomainAxis().getUpperBound() - 0.2), (hpAxis.getLowerBound() + ySpace)); final XYTextAnnotation carText = new XYTextAnnotation(car[0], (plot.getDomainAxis().getUpperBound() - 0.2), (hpAxis.getLowerBound() + ySpace));
carText.setPaint(RED); carText.setPaint(RED);
carText.setTextAnchor(TextAnchor.BOTTOM_RIGHT); carText.setTextAnchor(TextAnchor.BOTTOM_RIGHT);
carText.setFont(new Font("SansSerif", Font.BOLD, 12)); carText.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 12));
final XYAnnotation zTo60Marker = new XYDrawableAnnotation(etResults[10], etResults[11], 10, 10, cdGreen); final XYAnnotation zTo60Marker = new XYDrawableAnnotation(etResults[10], etResults[11], 10, 10, cdGreen);
final XYTextAnnotation zTo60Label = new XYTextAnnotation(zTo60Text, etResults[10], (etResults[11] + ySpace)); final XYTextAnnotation zTo60Label = new XYTextAnnotation(zTo60Text, etResults[10], (etResults[11] + ySpace));
zTo60Label.setPaint(GREEN); zTo60Label.setPaint(GREEN);
zTo60Label.setTextAnchor(TextAnchor.TOP_RIGHT); zTo60Label.setTextAnchor(TextAnchor.TOP_RIGHT);
zTo60Label.setFont(new Font("SansSerif", Font.BOLD, 10)); zTo60Label.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 10));
final XYTextAnnotation zTo60Time = new XYTextAnnotation((String.format("%1.3f", etResults[10]) + "\""), etResults[10], (etResults[11] - ySpace)); final XYTextAnnotation zTo60Time = new XYTextAnnotation((String.format("%1.3f", etResults[10]) + "\""), etResults[10], (etResults[11] - ySpace));
zTo60Time.setPaint(GREEN); zTo60Time.setPaint(GREEN);
zTo60Time.setTextAnchor(TextAnchor.BOTTOM_LEFT); zTo60Time.setTextAnchor(TextAnchor.BOTTOM_LEFT);
zTo60Time.setFont(new Font("SansSerif", Font.BOLD, 10)); zTo60Time.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 10));
plot.addAnnotation(s60Marker); plot.addAnnotation(s60Marker);
plot.addAnnotation(s60Label); plot.addAnnotation(s60Label);
plot.addAnnotation(s60Time); plot.addAnnotation(s60Time);
@ -399,7 +399,7 @@ public final class DynoChartPanel extends JPanel {
plot.setRangeGridlinePaint(DARK_GREY); plot.setRangeGridlinePaint(DARK_GREY);
refStat.setPaint(WHITE); refStat.setPaint(WHITE);
refStat.setTextAnchor(TextAnchor.TOP_LEFT); refStat.setTextAnchor(TextAnchor.TOP_LEFT);
refStat.setFont(new Font("SansSerif", Font.BOLD, 12)); refStat.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 12));
} }