MCPcopy Index your code
hub / github.com/benfry/processing4 / getPrettyName

Method getPrettyName

app/src/processing/app/SketchCode.java:143–151  ·  view source on GitHub ↗

Get the name of this file with its extension removed. Because of other uses of this method, this is not a good place to do things like swap underscores for spaces.

()

Source from the content-addressed store, hash-verified

141 * to do things like swap underscores for spaces.
142 */
143 public String getPrettyName() {
144 String name = file.getName();
145
146 // remove the extension from the name
147 int dot = name.lastIndexOf('.');
148 // should have a dot in all current scenarios, but better not to make
149 // that assumption in case we later decide to allow things like README
150 return (dot != -1) ? name.substring(0, dot) : name;
151 }
152
153
154 public String getExtension() {

Callers 1

paintComponentMethod · 0.95

Calls 1

getNameMethod · 0.45

Tested by

no test coverage detected