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

Method initEditorCode

java/src/processing/mode/java/JavaEditor.java:1939–1964  ·  view source on GitHub ↗
(List<List<Handle>> handles)

Source from the content-addressed store, hash-verified

1937
1938
1939 protected void initEditorCode(List<List<Handle>> handles) {
1940 SketchCode[] sketchCode = sketch.getCode();
1941 for (int tab=0; tab<baseCode.length; tab++) {
1942 // beautify the numbers
1943 int charInc = 0;
1944 String code = baseCode[tab];
1945
1946 for (Handle n : handles.get(tab)) {
1947 int s = n.startChar + charInc;
1948 int e = n.endChar + charInc;
1949 String newStr = n.strNewValue;
1950 code = replaceString(code, s, e, newStr);
1951 n.newStartChar = n.startChar + charInc;
1952 charInc += n.strNewValue.length() - n.strValue.length();
1953 n.newEndChar = n.endChar + charInc;
1954 }
1955
1956 sketchCode[tab].setProgram(code);
1957 /* Wild Hack: set document to null so the text editor will refresh
1958 the program contents when the document tab is being clicked */
1959 sketchCode[tab].setDocument(null);
1960 }
1961
1962 // this will update the current code
1963 setCode(sketch.getCurrentCode());
1964 }
1965
1966
1967 private void loadSavedCode() {

Callers 1

handleTweakMethod · 0.80

Calls 7

replaceStringMethod · 0.95
setCodeMethod · 0.95
getCodeMethod · 0.80
setProgramMethod · 0.80
getCurrentCodeMethod · 0.80
getMethod · 0.65
setDocumentMethod · 0.45

Tested by

no test coverage detected