MCPcopy Index your code
hub / github.com/processing/processing / modeInfoFor

Method modeInfoFor

app/src/processing/app/Base.java:1045–1064  ·  view source on GitHub ↗
(final File sketch)

Source from the content-addressed store, hash-verified

1043
1044
1045 private static ModeInfo modeInfoFor(final File sketch) {
1046 final File sketchFolder = sketch.getParentFile();
1047 final File sketchProps = new File(sketchFolder, "sketch.properties");
1048 if (!sketchProps.exists()) {
1049 return null;
1050 }
1051 try {
1052 final Settings settings = new Settings(sketchProps);
1053 final String title = settings.get("mode");
1054 final String id = settings.get("mode.id");
1055 if (title == null || id == null) {
1056 return null;
1057 }
1058 return new ModeInfo(id, title);
1059 } catch (IOException e) {
1060 System.err.println("While trying to read " + sketchProps + ": "
1061 + e.getMessage());
1062 }
1063 return null;
1064 }
1065
1066
1067 private Mode promptForMode(final File sketch, final ModeInfo preferredMode) {

Callers 1

selectModeMethod · 0.95

Calls 3

getMethod · 0.95
getMessageMethod · 0.65
printlnMethod · 0.45

Tested by

no test coverage detected