/** * Sets all the font properties at once * * @param newFontName the name of the new font * @param newFontColor the new font color * @param newFontSize the new font size */ public void setFontProperties(String newFontName, int newFontColor, int newFontSize) { if (newFontSize > 0) { fontName = newFontName; fontColor = newFontColor; fontSize = newFontSize; font = parent.createFont(fontName, fontSize); } }
void display(String l) { // 选择显示坐标轴的方案序号 if (l == "x") { r.scaley(); x0 = r.x0; y0 = r.y0; x1 = r.x1; y1 = r.y1; float textSize = p.abs(y1 - y0); p.textFont(p.createFont("AngsanaNew-BoldItalic", textSize)); p.text(text, x0, y1); } if (l == "y") { r.scalex(); x0 = r.x0; y0 = r.y0; x1 = r.x1; y1 = r.y1; double textSize = p.abs(x1 - x0) / (float) n; p.textFont(p.createFont("AngsanaNew-BoldItalic", textSize)); p.text(text, x0, y1); } }
/** * Sets the font size * * @param newFontSize the new font size */ public void setFontSize(int newFontSize) { if (newFontSize > 0) { fontSize = newFontSize; font = parent.createFont(fontName, fontSize); } }
/** * Sets the font name * * @param newFontName the name of the new font */ public void setFontName(String newFontName) { fontName = newFontName; font = parent.createFont(fontName, fontSize); }