simplified usage of Watchpoint and WatchpointMote interfaces

This commit is contained in:
Fredrik Osterlind 2012-03-21 16:56:32 +01:00
parent 090d77c5a2
commit 088f2e12a8
2 changed files with 33 additions and 27 deletions

View file

@ -32,24 +32,26 @@
package se.sics.cooja;
import java.awt.Color;
import java.io.File;
/**
* @author Fredrik Osterlind
*/
public interface Watchpoint {
/**
* @return Short watchpoint description
*/
public String getDescription();
public WatchpointMote getMote();
/**
* @return Mote
*/
public Mote getMote();
/**
* @return Color
*/
public Color getColor();
public void setColor(Color newColor);
public String getDescription();
public void setUserMessage(String msg);
public String getUserMessage();
public File getCodeFile();
public int getLineNumber();
public int getExecutableAddress();
public void setStopsSimulation(boolean b);
public boolean stopsSimulation();
}

View file

@ -31,12 +31,17 @@
package se.sics.cooja;
import java.awt.event.ActionListener;
import java.io.File;
/**
* @author Fredrik Osterlind
*/
public interface WatchpointMote {
public interface WatchpointMote extends Mote {
public interface WatchpointListener {
public void watchpointTriggered(Watchpoint watchpoint);
public void watchpointsChanged();
}
/**
* Adds a breakpoint listener.
@ -44,28 +49,27 @@ public interface WatchpointMote {
*
* @param listener Action listener
*/
public void addWatchpointListener(ActionListener listener);
public void addWatchpointListener(WatchpointListener listener);
/**
* Removes previously registered listener.
*
* @param listener Listeners
*/
public void removeWatchpointListener(ActionListener listener);
public void removeWatchpointListener(WatchpointListener listener);
/**
* @return All registered listeners
*/
public ActionListener[] getWatchpointListeners();
public WatchpointListener[] getWatchpointListeners();
/**
* @return Last triggered watchpoint
*/
public Watchpoint getLastWatchpoint();
public Watchpoint addBreakpoint(File codeFile, int lineNr, int address);
public void removeBreakpoint(Watchpoint watchpoint);
public Watchpoint[] getBreakpoints();
/**
* @return Mote
*/
public Mote getMote();
public boolean breakpointExists(int address);
public boolean breakpointExists(File file, int lineNr);
public Integer getExecutableAddressOf(File file, int lineNr);
}