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

Method measure

ij/src/main/java/ij/gui/MultiLineLabel.java:38–50  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

36 // Figures out how wide each line of the label
37 // is, and how wide the widest line is.
38 protected void measure() {
39 Font font = getFont();
40 FontMetrics fm = font!=null?getFontMetrics(font):null;
41 // If we don't have font metrics yet, just return.
42 if (fm == null) return;
43 line_height = fm.getHeight();
44 line_ascent = fm.getAscent();
45 max_width = 0;
46 for(int i = 0; i < num_lines; i++) {
47 line_widths[i] = fm.stringWidth(lines[i]);
48 if (line_widths[i] > max_width) max_width = line_widths[i];
49 }
50 }
51
52
53 public void setText(String text) {

Callers 3

setTextMethod · 0.95
setFontMethod · 0.95
addNotifyMethod · 0.95

Calls 4

stringWidthMethod · 0.80
getFontMethod · 0.65
getFontMetricsMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected