MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / getWidth

Method getWidth

src/org/opensourcephysics/display/TextLine.java:1030–1035  ·  view source on GitHub ↗
(Graphics g)

Source from the content-addressed store, hash-verified

1028 }
1029
1030 public int getWidth(Graphics g) {
1031 if((g==null)||(f==null)||(s.length()==0)) {
1032 return 0;
1033 }
1034 return g.getFontMetrics(f).stringWidth(s.toString());
1035 }
1036
1037 public int getHeight(Graphics g) {
1038 if((g==null)||(f==null)) {

Callers 1

parseTextMethod · 0.95

Calls 3

lengthMethod · 0.80
getFontMetricsMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected