moving more things into Editor

This commit is contained in:
Ben Fry
2016-08-06 14:52:42 -04:00
parent 14f332c050
commit d41e083700
5 changed files with 16 additions and 25 deletions

View File

@@ -80,21 +80,6 @@ public class JavaEditor extends Editor {
debugger = new Debugger(this);
inspector = new VariableInspector(this);
// set action on frame close
// addWindowListener(new WindowAdapter() {
// @Override
// public void windowClosing(WindowEvent e) {
// onWindowClosing(e);
// }
// });
// // load settings from theme.txt
// breakpointColor = mode.getColor("breakpoint.bgcolor");
// breakpointMarkerColor = mode.getColor("breakpoint.marker.color");
// currentLineColor = mode.getColor("currentline.bgcolor");
// currentLineMarkerColor = mode.getColor("currentline.marker.color");
// set breakpoints from marker comments
for (LineID lineID : stripBreakpointComments()) {
//System.out.println("setting: " + lineID);
@@ -119,7 +104,7 @@ public class JavaEditor extends Editor {
// add our hacked version back to the editor
box.add(textAndError);
getJavaTextArea().setMode(jmode);
getPdeTextArea().setMode(jmode);
preprocessingService = new PreprocessingService(this);
pdex = new PDEX(this, preprocessingService);
@@ -134,12 +119,6 @@ public class JavaEditor extends Editor {
public void windowGainedFocus(WindowEvent e) { }
});
textarea.addCaretListener(new CaretListener() {
public void caretUpdate(CaretEvent e) {
updateEditorStatus();
}
});
}

View File

@@ -234,7 +234,7 @@ public class JavaTextAreaPainter extends PdeTextAreaPainter {
this.handles = handles;
this.colorBoxes = colorBoxes;
initTweakInterfacePositions();
updateTweakInterfacePositions();
repaint();
}
@@ -244,7 +244,7 @@ public class JavaTextAreaPainter extends PdeTextAreaPainter {
* synchronize this method to prevent the execution of 'paint' in the middle.
* (don't paint while we make changes to the text of the editor)
*/
private synchronized void initTweakInterfacePositions() {
private synchronized void updateTweakInterfacePositions() {
SketchCode[] code = getEditor().getSketch().getCode();
int prevScroll = textArea.getVerticalScrollPosition();
String prevText = textArea.getText();