forked from facchinm/Arduino
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSketchCodeDocument.java
More file actions
79 lines (58 loc) · 1.66 KB
/
Copy pathSketchCodeDocument.java
File metadata and controls
79 lines (58 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
package processing.app;
import java.io.File;
import javax.swing.text.Document;
public class SketchCodeDocument{
private SketchCode code;
private Document document;
// Undo Manager for this tab, each tab keeps track of their own Editor.undo
// will be set to this object when this code is the tab that's currently the
// front.
private LastUndoableEditAwareUndoManager undo = new LastUndoableEditAwareUndoManager();
// saved positions from last time this tab was used
private int selectionStart;
private int selectionStop;
private int scrollPosition;
public SketchCodeDocument(SketchCode code) {
this.code = code;
this.code.setMetadata(this);
}
public SketchCodeDocument(File file) {
this.code = new SketchCode(file, this);
}
public LastUndoableEditAwareUndoManager getUndo() {
return undo;
}
public void setUndo(LastUndoableEditAwareUndoManager undo) {
this.undo = undo;
}
public int getSelectionStart() {
return selectionStart;
}
public void setSelectionStart(int selectionStart) {
this.selectionStart = selectionStart;
}
public int getSelectionStop() {
return selectionStop;
}
public void setSelectionStop(int selectionStop) {
this.selectionStop = selectionStop;
}
public int getScrollPosition() {
return scrollPosition;
}
public void setScrollPosition(int scrollPosition) {
this.scrollPosition = scrollPosition;
}
public SketchCode getCode() {
return code;
}
public void setCode(SketchCode code) {
this.code = code;
}
public Document getDocument() {
return document;
}
public void setDocument(Document document) {
this.document = document;
}
}