From ac39443f9cd43163ae083b55822c7a2dff7d45cf Mon Sep 17 00:00:00 2001 From: Fredrik Osterlind Date: Tue, 1 Nov 2011 09:30:30 +0100 Subject: [PATCH] improved api --- tools/cooja/java/se/sics/cooja/plugins/Notes.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tools/cooja/java/se/sics/cooja/plugins/Notes.java b/tools/cooja/java/se/sics/cooja/plugins/Notes.java index 9c737969a..960eed103 100644 --- a/tools/cooja/java/se/sics/cooja/plugins/Notes.java +++ b/tools/cooja/java/se/sics/cooja/plugins/Notes.java @@ -42,6 +42,7 @@ import java.util.Collection; import javax.swing.JMenuItem; import javax.swing.JPopupMenu; +import javax.swing.JScrollPane; import javax.swing.JTextArea; import javax.swing.SwingUtilities; import javax.swing.plaf.basic.BasicInternalFrameUI; @@ -67,7 +68,7 @@ public class Notes extends VisPlugin { public Notes(Simulation simulation, GUI gui) { super("Notes", gui); - add(BorderLayout.CENTER, notes); + add(BorderLayout.CENTER, new JScrollPane(notes)); /* Popup menu */ if (Notes.this.getUI() instanceof BasicInternalFrameUI) { @@ -102,6 +103,14 @@ public class Notes extends VisPlugin { this.setSize(300, 300); } + public String getNotes() { + return notes.getText(); + } + + public void setNotes(String text) { + this.notes.setText(text); + } + private void setDecorationsVisible(boolean visible) { if (!(Notes.this.getUI() instanceof BasicInternalFrameUI)) { return;