remove interface that was only used a single time

This commit is contained in:
Ben Fry
2015-01-25 13:12:09 -05:00
parent 5cc6ed2e23
commit e8a3d634fb
5 changed files with 9 additions and 44 deletions

View File

@@ -80,6 +80,8 @@ public class DebugTray extends JFrame {
/// processing / "advanced" mode flag (currently not used)
protected boolean p5mode = true;
// The tray will be placed at this amount from the top of the editor window,
// and extend to this amount from the bottom of the editor window.
final int VERTICAL_OFFSET = 64;

View File

@@ -33,7 +33,7 @@ import processing.mode.java.JavaEditor;
*
* @author Martin Leopold <m@martinleopold.com>
*/
public class LineHighlight implements LineListener {
public class LineHighlight {
protected JavaEditor editor; // the view, used for highlighting lines by setting a background color
protected Color bgColor; // the background color for highlighting lines
@@ -154,7 +154,6 @@ public class LineHighlight implements LineListener {
* @param oldLineIdx the old line index (0-based)
* @param newLineIdx the new line index (0-based)
*/
@Override
public void lineChanged(LineID line, int oldLineIdx, int newLineIdx) {
// clear old line
if (editor.isInCurrentTab(new LineID(line.fileName(), oldLineIdx))) {

View File

@@ -45,7 +45,7 @@ public class LineID implements DocumentListener {
protected int lineIdx; // the line number, 0-based
protected Document doc; // the Document to use for line number tracking
protected Position pos; // the Position acquired during line number tracking
protected Set<LineListener> listeners = new HashSet<LineListener>(); // listeners for line number changes
protected Set<LineHighlight> listeners = new HashSet<LineHighlight>(); // listeners for line number changes
public LineID(String fileName, int lineIdx) {
this.fileName = fileName;
@@ -181,7 +181,7 @@ public class LineID implements DocumentListener {
int oldLineIdx = lineIdx;
lineIdx = doc.getDefaultRootElement().getElementIndex(offset); // offset to lineNo
if (lineIdx != oldLineIdx) {
for (LineListener l : listeners) {
for (LineHighlight l : listeners) {
if (l != null) {
l.lineChanged(this, oldLineIdx, lineIdx);
} else {
@@ -197,7 +197,7 @@ public class LineID implements DocumentListener {
*
* @param l the listener to add
*/
public void addListener(LineListener l) {
public void addListener(LineHighlight l) {
listeners.add(l);
}
@@ -206,7 +206,7 @@ public class LineID implements DocumentListener {
*
* @param l the listener to remove
*/
public void removeListener(LineListener l) {
public void removeListener(LineHighlight l) {
listeners.remove(l);
}

View File

@@ -1,38 +0,0 @@
/* -*- mode: java; c-basic-offset: 2; indent-tabs-mode: nil -*- */
/*
Part of the Processing project - http://processing.org
Copyright (c) 2012-15 The Processing Foundation
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software Foundation, Inc.
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package processing.mode.java.debug;
/**
* A Listener for line number changes.
*
* @author Martin Leopold <m@martinleopold.com>
*/
public interface LineListener {
/**
* Event handler for line number changes (due to editing).
*
* @param line the line that has changed
* @param oldLineIdx the old line index (0-based)
* @param newLineIdx the new line index (0-based)
*/
void lineChanged(LineID line, int oldLineIdx, int newLineIdx);
}