MCPcopy Create free account
hub / github.com/AstroImageJ/astroimagej / setAxisLabelFont

Method setAxisLabelFont

ij/src/main/java/ij/gui/Plot.java:1284–1291  ·  view source on GitHub ↗

Sets the x and y label font size and style. Styles are defined in the Font class, e.g. Font.PLAIN, Font.BOLD. Set style to -1 to leave the style unchanged. Call update() thereafter to make the change visible (if the image is shown already).

(int style, float size)

Source from the content-addressed store, hash-verified

1282 * Set <code>style</code> to -1 to leave the style unchanged.
1283 * Call update() thereafter to make the change visible (if the image is shown already). */
1284 public void setAxisLabelFont(int style, float size) {
1285 if (size < 9) size = 9f;
1286 if (size > 33) size = 33f;
1287 pp.xLabel.setFont(nonNullFont(pp.xLabel.getFont(), currentFont));
1288 pp.yLabel.setFont(nonNullFont(pp.yLabel.getFont(), currentFont));
1289 setXLabelFont(pp.xLabel.getFont().deriveFont(style < 0 ? pp.xLabel.getFont().getStyle() : style, size));
1290 setYLabelFont(pp.xLabel.getFont().deriveFont(style < 0 ? pp.yLabel.getFont().getStyle() : style, size));
1291 }
1292
1293 /** Sets the xLabelFont; must not be null. If this method is not used, the last setFont
1294 * of setFontSize call before displaying the plot determines the font, or if neither

Callers 3

setPlotFontSizeMethod · 0.80
actionPerformedMethod · 0.80
dialogItemChangedMethod · 0.80

Calls 6

nonNullFontMethod · 0.95
setXLabelFontMethod · 0.95
setYLabelFontMethod · 0.95
setFontMethod · 0.65
getFontMethod · 0.65
getStyleMethod · 0.45

Tested by

no test coverage detected