Umbenennungen von
authorfelix <felix@a944a559-bf0e-0410-8ddc-85264b264b6c>
Thu, 17 May 2007 14:21:55 +0000 (14:21 +0000)
committerfelix <felix@a944a559-bf0e-0410-8ddc-85264b264b6c>
Thu, 17 May 2007 14:21:55 +0000 (14:21 +0000)
 command -> commandField
 cmd -> command
 answers -> answersArea

git-svn-id: https://www.internetallee.de/svn/bytewurf@35 a944a559-bf0e-0410-8ddc-85264b264b6c

projekte/netzschalter/src/de/bytewurf/projekte/netzschalter/CommandPanel.java

index 584dfce..575715e 100644 (file)
@@ -32,11 +32,11 @@ public class CommandPanel extends JPanel {
 
        private JLabel commandLabel;
 
-       private JTextField command;
+       private JTextField commandField;
 
        private JLabel answersLabel;
 
-       private JTextArea answers;
+       private JTextArea answersArea;
 
        public CommandPanel(Netzdose netzdose) {
                this.netzdose = netzdose;
@@ -47,14 +47,14 @@ public class CommandPanel extends JPanel {
                top.setLayout(new BorderLayout());
                commandLabel = new JLabel("Command:");
                top.add(commandLabel, BorderLayout.WEST);
-               command = new JTextField();
-               command.addActionListener(new ActionListener() {
+               commandField = new JTextField();
+               commandField.addActionListener(new ActionListener() {
 
                        public void actionPerformed(ActionEvent e) {
                                apply();
                        }
                });
-               top.add(command, BorderLayout.CENTER);
+               top.add(commandField, BorderLayout.CENTER);
                add(top, BorderLayout.NORTH);
 
                JPanel middle = new JPanel();
@@ -62,9 +62,9 @@ public class CommandPanel extends JPanel {
                commandCounter = 0;
                answersLabel = new JLabel("Answers:");
                middle.add(answersLabel, BorderLayout.WEST);
-               answers = new JTextArea();
-               answers.setEditable(false);
-               middle.add(new JScrollPane(answers,
+               answersArea = new JTextArea();
+               answersArea.setEditable(false);
+               middle.add(new JScrollPane(answersArea,
                                JScrollPane.VERTICAL_SCROLLBAR_ALWAYS,
                                JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED),
                                BorderLayout.CENTER);
@@ -90,24 +90,24 @@ public class CommandPanel extends JPanel {
        }
 
        protected void reset() {
-               command.setText("");
+               commandField.setText("");
        }
 
        protected void apply() {
-               Command cmd;
-               String commandText = command.getText();
+               Command command;
+               String commandText = commandField.getText();
                try {
-                       cmd = new Command(commandText);
+                       command = new Command(commandText);
                } catch (RuntimeException e) {
                        LogMediator.getInstance(this.getClass()).log(
                                        "Kann \"" + commandText + "\" nicht in Command wandeln.");
                        return;
                }
-               LogMediator.getInstance(this.getClass()).log("Sende " + cmd);
-               byte[] answerBytes = netzdose.sendCommand(cmd);
-               answers.append(++commandCounter + ": "
+               LogMediator.getInstance(this.getClass()).log("Sende " + command);
+               byte[] answerBytes = netzdose.sendCommand(command);
+               answersArea.append(++commandCounter + ": "
                                + new Command(answerBytes).toString() + "\n");
-               command.setText("");
+               commandField.setText("");
        }
 
 }