| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,7 +30,6 @@ | |||
| 30 | 30 | import processing.mode.java.debug.LineBreakpoint; | |
| 31 | 31 | import processing.mode.java.debug.LineHighlight; | |
| 32 | 32 | import processing.mode.java.debug.LineID; | |
| 33 | - import processing.mode.java.debug.VariableInspector; | ||
| 34 | 33 | import processing.mode.java.pdex.ErrorBar; | |
| 35 | 34 | import processing.mode.java.pdex.ErrorCheckerService; | |
| 36 | 35 | import processing.mode.java.pdex.ErrorMessageSimplifier; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,7 +18,7 @@ | |||
| 18 | 18 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |
| 19 | 19 | */ | |
| 20 | 20 | ||
| 21 | - package processing.mode.java.debug; | ||
| 21 | + package processing.mode.java; | ||
| 22 | 22 | ||
| 23 | 23 | import java.awt.*; | |
| 24 | 24 | import java.awt.event.ComponentEvent; | |
@@ -42,8 +42,7 @@ | |||
| 42 | 42 | import com.sun.jdi.Value; | |
| 43 | 43 | ||
| 44 | 44 | import processing.app.Mode; | |
| 45 | - import processing.mode.java.Debugger; | ||
| 46 | - import processing.mode.java.JavaEditor; | ||
| 45 | + import processing.mode.java.debug.VariableNode; | ||
| 47 | 46 | ||
| 48 | 47 | ||
| 49 | 48 | public class VariableInspector extends JFrame { | |
@@ -73,7 +72,7 @@ public class VariableInspector extends JFrame { | |||
| 73 | 72 | protected List<VariableNode> declaredThisFields; | |
| 74 | 73 | ||
| 75 | 74 | protected JavaEditor editor; | |
| 76 | - protected Debugger dbg; | ||
| 75 | + // protected Debugger dbg; | ||
| 77 | 76 | ||
| 78 | 77 | /// list of expanded tree paths. (using list to maintain the order of expansion) | |
| 79 | 78 | protected List<TreePath> expandedNodes = new ArrayList<TreePath>(); | |
@@ -84,16 +83,29 @@ public class VariableInspector extends JFrame { | |||
| 84 | 83 | final int VERTICAL_OFFSET = 64; | |
| 85 | 84 | ||
| 86 | 85 | ||
| 87 | - public VariableInspector(JavaEditor je) { | ||
| 88 | - editor = je; | ||
| 89 | - dbg = editor.getDebugger(); | ||
| 86 | + public VariableInspector(JavaEditor editor) { | ||
| 87 | + this.editor = editor; | ||
| 90 | 88 | ||
| 91 | 89 | setUndecorated(true); | |
| 92 | - | ||
| 93 | 90 | editor.addComponentListener(new EditorFollower()); | |
| 94 | - | ||
| 95 | - initComponents(); | ||
| 96 | 91 | ||
| 92 | + scrollPane = new JScrollPane(); | ||
| 93 | + tree = new Outline(); | ||
| 94 | + | ||
| 95 | + scrollPane.setViewportView(tree); | ||
| 96 | + | ||
| 97 | + GroupLayout layout = new GroupLayout(getContentPane()); | ||
| 98 | + getContentPane().setLayout(layout); | ||
| 99 | + layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) | ||
| 100 | + .addGap(0, 400, Short.MAX_VALUE) | ||
| 101 | + .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) | ||
| 102 | + .addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE))); | ||
| 103 | + layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) | ||
| 104 | + .addGap(0, 300, Short.MAX_VALUE) | ||
| 105 | + .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) | ||
| 106 | + .addComponent(scrollPane, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE))); | ||
| 107 | + pack(); | ||
| 108 | + | ||
| 97 | 109 | // setup Outline | |
| 98 | 110 | rootNode = new DefaultMutableTreeNode("root"); | |
| 99 | 111 | builtins = new DefaultMutableTreeNode("Processing"); | |
@@ -224,6 +236,7 @@ public boolean isCellEditable(Object o, int i) { | |||
| 224 | 236 | public void setValueFor(Object o, int i, Object o1) { | |
| 225 | 237 | VariableNode var = (VariableNode) o; | |
| 226 | 238 | String stringValue = (String) o1; | |
| 239 | + Debugger dbg = editor.getDebugger(); | ||
| 227 | 240 | ||
| 228 | 241 | Value value = null; | |
| 229 | 242 | try { | |
@@ -516,7 +529,7 @@ public void treeWillExpand(TreeExpansionEvent tee) throws ExpandVetoException { | |||
| 516 | 529 | } | |
| 517 | 530 | VariableNode var = (VariableNode) last; | |
| 518 | 531 | var.removeAllChildren(); // TODO: should we only load it once? | |
| 519 | - var.addChildren(filterNodes(dbg.getFields(var.getValue(), 0, true), new ThisFilter())); | ||
| 532 | + var.addChildren(filterNodes(editor.getDebugger().getFields(var.getValue(), 0, true), new ThisFilter())); | ||
| 520 | 533 | } | |
| 521 | 534 | ||
| 522 | 535 | @Override | |
@@ -560,26 +573,6 @@ public void treeExpansionVetoed(TreeExpansionEvent tee, ExpandVetoException eve) | |||
| 560 | 573 | } | |
| 561 | 574 | ||
| 562 | 575 | ||
| 563 | - private void initComponents() { | ||
| 564 | - scrollPane = new JScrollPane(); | ||
| 565 | - tree = new Outline(); | ||
| 566 | - | ||
| 567 | - scrollPane.setViewportView(tree); | ||
| 568 | - | ||
| 569 | - GroupLayout layout = new GroupLayout(getContentPane()); | ||
| 570 | - getContentPane().setLayout(layout); | ||
| 571 | - layout.setHorizontalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) | ||
| 572 | - .addGap(0, 400, Short.MAX_VALUE) | ||
| 573 | - .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) | ||
| 574 | - .addComponent(scrollPane, GroupLayout.DEFAULT_SIZE, 400, Short.MAX_VALUE))); | ||
| 575 | - layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) | ||
| 576 | - .addGap(0, 300, Short.MAX_VALUE) | ||
| 577 | - .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING) | ||
| 578 | - .addComponent(scrollPane, GroupLayout.Alignment.TRAILING, GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE))); | ||
| 579 | - pack(); | ||
| 580 | - } | ||
| 581 | - | ||
| 582 | - | ||
| 583 | 576 | protected static void run(final VariableInspector vi) { | |
| 584 | 577 | EventQueue.invokeLater(new Runnable() { | |
| 585 | 578 | @Override | |
| Back | FazBrowse Home | New Git URL |
0 commit comments