From 61d3b742760267891bccd96b89aeb2b6827aeee5 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Fri, 21 Aug 2015 12:28:45 -0400 Subject: [PATCH] cleanups --- java/src/processing/mode/java/JavaEditor.java | 64 ++----------------- 1 file changed, 7 insertions(+), 57 deletions(-) diff --git a/java/src/processing/mode/java/JavaEditor.java b/java/src/processing/mode/java/JavaEditor.java index 68121f518..4ade62a2e 100644 --- a/java/src/processing/mode/java/JavaEditor.java +++ b/java/src/processing/mode/java/JavaEditor.java @@ -76,10 +76,6 @@ public class JavaEditor extends Editor { protected final String breakpointMarkerComment = " //<>//"; protected JMenu debugMenu; -// JCheckBoxMenuItem enableDebug; -// boolean debugEnabled; -// JMenuItem enableDebug; - protected JMenuItem debugItem; protected Debugger debugger; protected boolean debugEnabled; @@ -87,15 +83,9 @@ public class JavaEditor extends Editor { protected VariableInspector inspector; protected JMenuItem inspectorItem; -// private EditorToolbar javaToolbar; -// private DebugToolbar debugToolbar; + private ErrorColumn errorColumn; - private ErrorColumn errorBar; - -// protected XQConsoleToggle btnShowConsole; -// protected XQConsoleToggle btnShowErrors; protected JScrollPane errorTableScrollPane; -// protected JPanel consoleProblemsPane; protected XQErrorTable errorTable; static final int ERROR_TAB_INDEX = 0; @@ -174,9 +164,9 @@ public class JavaEditor extends Editor { // remove the text area temporarily box.remove(2); textAndError.setLayout(new BorderLayout()); - errorBar = new ErrorColumn(this, textarea.getMinimumSize().height, jmode); - textAndError.add(errorBar, BorderLayout.EAST); - textarea.setBounds(0, 0, errorBar.getX() - 1, textarea.getHeight()); + errorColumn = new ErrorColumn(this, textarea.getMinimumSize().height, jmode); + textAndError.add(errorColumn, BorderLayout.EAST); + textarea.setBounds(0, 0, errorColumn.getX() - 1, textarea.getHeight()); textAndError.add(textarea); // add our hacked version back to the editor box.add(textAndError); @@ -219,16 +209,6 @@ public class JavaEditor extends Editor { @Override public EditorFooter createFooter() { -// //JPanel consolePanel = new JPanel(); -// JTabbedPane footer = new JTabbedPane(JTabbedPane.BOTTOM); -//// tabPane.setUI(new BasicTabbedPaneUI()); -// footer.setUI(new SimpleTabbedPaneUI()); -//// tabPane.setUI(new SillyTabbedPaneUI()); -//// tabPane.setUI(new PlasticTabbedPaneUI()); -//// tabPane.setBorder(BorderFactory.createEmptyBorder()); -//// tabPane.setBackground(Color.RED); - -// EditorFooter footer = new EditorFooter(this); EditorFooter footer = super.createFooter(); // Adding Error Table in a scroll pane @@ -239,38 +219,8 @@ public class JavaEditor extends Editor { errorTableScrollPane.setBorder(BorderFactory.createEmptyBorder()); // errorTableScrollPane.setBorder(new EmptyBorder(0, Editor.LEFT_GUTTER, 0, 0)); errorTableScrollPane.setViewportView(errorTable); - -// // Adding toggle console button -//// consolePanel.remove(2); // removes the line status -// JPanel lineStatusPanel = new JPanel(); -// lineStatusPanel.setLayout(new BorderLayout()); -// btnShowConsole = new XQConsoleToggle(this, Language.text("editor.footer.console"), mode.getInteger("linestatus.height")); -// btnShowErrors = new XQConsoleToggle(this, Language.text("editor.footer.errors"), mode.getInteger("linestatus.height")); -// btnShowConsole.addMouseListener(btnShowConsole); -// btnShowErrors.addMouseListener(btnShowErrors); - -// JPanel toggleButtonPanel = new JPanel(new BorderLayout()); -// toggleButtonPanel.add(btnShowConsole, BorderLayout.EAST); -// toggleButtonPanel.add(btnShowErrors, BorderLayout.WEST); -// lineStatusPanel.add(toggleButtonPanel, BorderLayout.EAST); -//// lineStatus.setBounds(0, 0, toggleButtonPanel.getX() - 1, -//// toggleButtonPanel.getHeight()); -//// lineStatusPanel.add(lineStatus); -// consolePanel.add(lineStatusPanel, BorderLayout.SOUTH); -// lineStatusPanel.repaint(); - -// // Adding JPanel with CardLayout for Console/Problems Toggle -//// consolePanel.remove(1); // removes the console itself -// consoleProblemsPane = new JPanel(new CardLayout()); -// consoleProblemsPane.add(errorTableScrollPane, Language.text("editor.footer.errors")); -// consoleProblemsPane.add(super.createConsolePanel(), Language.text("editor.footer.console")); -// consolePanel.add(consoleProblemsPane, BorderLayout.CENTER); - -// console = new EditorConsole(this); -// footer.addPanel(Language.text("editor.footer.console"), console); footer.addPanel(errorTableScrollPane, Language.text("editor.footer.errors"), "/lib/footer/error"); - //return consolePanel; return footer; } @@ -2593,17 +2543,17 @@ public class JavaEditor extends Editor { public void updateErrorBar(List problems) { - errorBar.updateErrorPoints(problems); + errorColumn.updateErrorPoints(problems); } public List getErrorPoints() { - return errorBar.errorPoints; + return errorColumn.errorPoints; } public void repaintErrorBar() { - errorBar.repaint(); + errorColumn.repaint(); }