From 927d9a31536fdd2f96faa4128bf4fc3b7e3ab5aa Mon Sep 17 00:00:00 2001 From: Enrico Joerns Date: Thu, 2 Oct 2014 02:05:14 +0200 Subject: [PATCH] [cooja] dialogs/MessageList: Added @Override annotations --- .../java/org/contikios/cooja/dialogs/MessageList.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/cooja/java/org/contikios/cooja/dialogs/MessageList.java b/tools/cooja/java/org/contikios/cooja/dialogs/MessageList.java index cb4dd926a..212a65e34 100644 --- a/tools/cooja/java/org/contikios/cooja/dialogs/MessageList.java +++ b/tools/cooja/java/org/contikios/cooja/dialogs/MessageList.java @@ -130,6 +130,7 @@ public class MessageList extends JList { final BufferedReader stringInput = new BufferedReader(new InputStreamReader(input)); Thread readThread = new Thread(new Runnable() { + @Override public void run() { String readLine; try { @@ -184,6 +185,7 @@ public class MessageList extends JList { messages.add(msg); java.awt.EventQueue.invokeLater(new Runnable() { + @Override public void run() { updateModel(); } @@ -195,6 +197,7 @@ public class MessageList extends JList { ((DefaultListModel) getModel()).clear(); } + @Override public void setModel(ListModel model) { throw new IllegalArgumentException("changing model not permitted"); } @@ -203,16 +206,19 @@ public class MessageList extends JList { if (popup == null) { popup = new JPopupMenu(); addMouseListener(new MouseAdapter() { + @Override public void mouseClicked(MouseEvent e) { if (e.isPopupTrigger()) { popup.show(MessageList.this, e.getX(), e.getY()); } } + @Override public void mousePressed(MouseEvent e) { if (e.isPopupTrigger()) { popup.show(MessageList.this, e.getX(), e.getY()); } } + @Override public void mouseReleased(MouseEvent e) { if (e.isPopupTrigger()) { popup.show(MessageList.this, e.getX(), e.getY()); @@ -230,6 +236,7 @@ public class MessageList extends JList { final JMenuItem hideNormalMenuItem = new JCheckBoxMenuItem("Hide normal output"); hideNormalMenuItem.setEnabled(true); hideNormalMenuItem.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { MessageList.this.hideNormal = hideNormalMenuItem.isSelected(); ((MessageModel)getModel()).updateList(); @@ -240,6 +247,7 @@ public class MessageList extends JList { JMenuItem consoleOutputMenuItem = new JMenuItem("Output to console"); consoleOutputMenuItem.setEnabled(true); consoleOutputMenuItem.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { MessageContainer[] messages = getMessages(); System.out.println("\nCOMPILATION OUTPUT:\n"); @@ -257,6 +265,7 @@ public class MessageList extends JList { JMenuItem clipboardMenuItem = new JMenuItem("Copy to clipboard"); clipboardMenuItem.setEnabled(true); clipboardMenuItem.addActionListener(new ActionListener() { + @Override public void actionPerformed(ActionEvent e) { Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); @@ -299,6 +308,7 @@ public class MessageList extends JList { this.type = type; } + @Override public String toString() { return message; } @@ -318,6 +328,7 @@ public class MessageList extends JList { private class MessageRenderer extends DefaultListCellRenderer { private Dimension nullDimension = new Dimension(0,0); + @Override public Component getListCellRendererComponent( JList list, Object value,