set default location and size

This commit is contained in:
fros4943 2008-10-03 14:30:51 +00:00
parent 4db4a211bf
commit 4f5ff657d4
2 changed files with 30 additions and 26 deletions

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: LogListener.java,v 1.11 2008/10/03 10:39:49 fros4943 Exp $
* $Id: LogListener.java,v 1.12 2008/10/03 14:30:51 fros4943 Exp $
*/
package se.sics.cooja.plugins;
@ -50,7 +50,7 @@ import se.sics.cooja.interfaces.Log;
* @author Fredrik Osterlind, Niclas Finne
*/
@ClassDescription("Log Listener")
@PluginType(PluginType.SIM_PLUGIN)
@PluginType(PluginType.SIM_STANDARD_PLUGIN)
public class LogListener extends VisPlugin {
private static final long serialVersionUID = 1L;
private static Logger logger = Logger.getLogger(LogListener.class);
@ -247,6 +247,8 @@ public class LogListener extends VisPlugin {
setTitle("Log Listener - Listening on " + nrLogs + " mote logs");
pack();
setSize(gui.getDesktopPane().getWidth(), getHeight());
setLocation(0, gui.getDesktopPane().getHeight() - getHeight());
try {
setSelected(true);

View file

@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: VisState.java,v 1.4 2007/01/09 09:49:24 fros4943 Exp $
* $Id: VisState.java,v 1.5 2008/10/03 14:30:51 fros4943 Exp $
*/
package se.sics.cooja.plugins;
@ -49,7 +49,7 @@ import se.sics.cooja.Mote.State;
* @author Fredrik Osterlind
*/
@ClassDescription("State Visualizer")
@PluginType(PluginType.SIM_PLUGIN)
@PluginType(PluginType.SIM_STANDARD_PLUGIN)
public class VisState extends Visualizer2D {
private static final long serialVersionUID = 1L;
private static Logger logger = Logger.getLogger(VisState.class);
@ -99,21 +99,23 @@ public class VisState extends Visualizer2D {
});
simObserver.update(null, null);
setLocation(
gui.getDesktopPane().getWidth() - getWidth(),
0);
}
public Color[] getColorOf(Mote mote) {
Color[] returnColors = new Color[2];
// If mote is sleeping, make outer circle blue
if (mote.getState() == Mote.State.LPM)
if (mote.getState() == Mote.State.LPM) {
returnColors[1] = Color.GRAY;
// If mote is dead, make outer circle red
else if (mote.getState() == State.DEAD)
} else if (mote.getState() == State.DEAD) {
returnColors[1] = Color.RED;
else
} else {
returnColors[1] = Color.GREEN; // make outer circle green
}
// Associate different colors with different mote types