private void disconnect() {
   if (session != null && session.isConnected()) {
     session.disconnect();
   }
   jToggleButtonConnect.setSelected(false);
   jToggleButtonConnect.setText("Connect");
   jToggleButtonRegister.setSelected(false);
   onlineUsers.clear();
   jToggleButtonRegister.setText("Register");
 }
  /**
   * Constructs the button with the given node type and image prefix. If the node type is "Select",
   * constructs a button that allows nodes to be selected and moved. If the node type is "Edge",
   * constructs a button that allows edges to be drawn. For other node types, constructs buttons
   * that allow those type of nodes to be added to the workbench. If a non-null image prefix is
   * provided, images for <prefix>Up.gif, <prefix>Down.gif, <prefix>Off.gif and <prefix>Roll.gif are
   * loaded from the /images directory relative to this compiled class and used to provide up, down,
   * off, and rollover images for the constructed button. On construction, nodes are mapped to their
   * node types in the Map, <code>nodeTypes</code>. Listeners are added to the node.
   *
   * @param buttonInfo contains the info needed to construct the button.
   */
  private JToggleButton constructButton(ButtonInfo buttonInfo) {
    String imagePrefix = buttonInfo.getImagePrefix();

    if (imagePrefix == null) {
      throw new NullPointerException("Image prefix must not be null.");
    }

    JToggleButton button = new JToggleButton();

    button.addMouseListener(
        new MouseAdapter() {
          public void mouseClicked(MouseEvent e) {
            super.mouseClicked(e);
            setShiftDown(e.isShiftDown());
            //                setControlDown(e.isControlDown());
          }
        });

    if ("Select".equals(buttonInfo.getNodeTypeName())) {
      button.setIcon(new ImageIcon(ImageUtils.getImage(this, "move.gif")));
    } else if ("Edge".equals(buttonInfo.getNodeTypeName())) {
      button.setIcon(new ImageIcon(ImageUtils.getImage(this, "flow.gif")));
    } else {
      button.setName(buttonInfo.getNodeTypeName());
      button.setText("<html><center>" + buttonInfo.getDisplayName() + "</center></html>");
    }

    button.setMaximumSize(new Dimension(110, 40)); // For a vertical box.
    button.setToolTipText(buttonInfo.getToolTipText());
    this.nodeTypes.put(button, buttonInfo.getNodeTypeName());

    return button;
  }
Exemple #3
0
 private void jbInit() throws Exception {
   panel1.setLayout(xYLayout1);
   panel1.setBackground(new Color(251, 236, 175));
   jToggleButton5.setText("Done");
   jToggleButton5.addActionListener(
       new java.awt.event.ActionListener() {
         public void actionPerformed(ActionEvent e) {
           jToggleButton5_actionPerformed(e);
         }
       });
   jLabel1.setToolTipText("");
   jList1.addMouseListener(
       new java.awt.event.MouseAdapter() {
         public void mouseClicked(MouseEvent e) {
           jList1_mouseClicked(e);
         }
       });
   HireFire.setText("Hire/Fire");
   HireFire.addActionListener(
       new java.awt.event.ActionListener() {
         public void actionPerformed(ActionEvent e) {
           HireFire_actionPerformed(e);
         }
       });
   jButtonAdvertise.setText("Advertise");
   jButtonAdvertise.addActionListener(
       new java.awt.event.ActionListener() {
         public void actionPerformed(ActionEvent e) {
           jButtonAdvertise_actionPerformed(e);
         }
       });
   jTextFieldWage.addActionListener(
       new java.awt.event.ActionListener() {
         public void actionPerformed(ActionEvent e) {
           jTextFieldWage_actionPerformed(e);
         }
       });
   jLabel3.setHorizontalAlignment(SwingConstants.RIGHT);
   jLabel3.setText("Amount");
   jLabel5.setText("jLabel5");
   jTextFieldWage.setText("100");
   panel1.add(jList1, new XYConstraints(9, 10, 206, 250));
   panel1.add(jTextPane2, new XYConstraints(9, 262, 467, 109));
   panel1.add(jLabel1, new XYConstraints(476, 9, 10, 226));
   panel1.add(jLabel2, new XYConstraints(2, 454, 58, 12));
   panel1.add(jToggleButton5, new XYConstraints(385, 397, 75, 26));
   panel1.add(HireFire, new XYConstraints(9, 429, 134, 26));
   panel1.add(jPanel1, new XYConstraints(217, 10, 259, 250));
   this.getContentPane().add(panel1, BorderLayout.SOUTH);
   panel1.add(jButtonAdvertise, new XYConstraints(183, 401, 116, -1));
   panel1.add(jTextFieldWage, new XYConstraints(69, 403, 102, 24));
   panel1.add(jLabel3, new XYConstraints(19, 400, 46, 29));
   panel1.add(jLabel4, new XYConstraints(155, 460, 44, 6));
   panel1.add(jLabel5, new XYConstraints(507, 92, 5, 47));
   this.setVisible(true);
 }
 private void handleRegister() {
   if (session == null || !session.isConnected()) {
     jToggleButtonRegister.setSelected(false);
     jMenuItemOptionsDeregister.setEnabled(false);
     jMenuItemOptionsRegister.setEnabled(true);
     return;
   }
   if (jToggleButtonRegister.isSelected() || jMenuItemOptionsRegister.isEnabled()) {
     register();
     jToggleButtonRegister.setText("Deregister");
     jMenuItemOptionsDeregister.setEnabled(true);
     jMenuItemOptionsRegister.setEnabled(false);
   } else {
     deregister();
     jToggleButtonRegister.setText("Register");
     jMenuItemOptionsDeregister.setEnabled(false);
     jMenuItemOptionsRegister.setEnabled(true);
   }
 }
 private void handleConnect() {
   if (jToggleButtonConnect.isSelected() || jMenuItemServerConnect.isEnabled())
     try {
       jTextPaneDisplayMessages.setText("");
       session = new Session();
       try {
         String userid = jTextFieldUser.getText();
         if (jPasswordFieldPwd.getPassword() != null) {
           String pwd = String.valueOf(jPasswordFieldPwd.getPassword()).trim();
           if (!pwd.equals("")) {
             userid += ":" + pwd;
           }
         }
         if (session.connect(jTextFieldServer.getText(), userid)) {
           displayMessage("Connected\n", incomingMsgAttrSet);
           session.addListener(this);
           jToggleButtonConnect.setText("Disconnect");
           jMenuItemServerConnect.setEnabled(false);
           jMenuItemServerDisconnect.setEnabled(true);
         } else {
           jToggleButtonConnect.setSelected(false);
           jMenuItemServerConnect.setEnabled(true);
           jMenuItemServerDisconnect.setEnabled(false);
           displayMessage("Connection attempt failed\n", offlineClientAttrSet);
         }
       } catch (ConnectionException ex1) {
         jToggleButtonConnect.setSelected(false);
         jMenuItemServerConnect.setEnabled(true);
         jMenuItemServerDisconnect.setEnabled(false);
         displayMessage(
             "Connection attempt failed: " + ex1.getMessage() + "\n", offlineClientAttrSet);
       }
     } catch (Exception ex) {
       ex.printStackTrace();
     }
   else {
     disconnect();
     jMenuItemServerConnect.setEnabled(true);
     jMenuItemServerDisconnect.setEnabled(false);
     displayMessage("Disconnected\n", offlineClientAttrSet);
   }
 }
Exemple #6
0
  private void initComponents() {
    try {
      for (LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
        if ("Nimbus".equals(info.getName())) {
          UIManager.setLookAndFeel(info.getClassName());
          break;
        }
      }
    } catch (Exception e) {
      // If Nimbus is not available, you can set the GUI to another look and feel.
    }

    usernameLabel = new JLabel();
    usernameField = new JTextField();
    chatroomScrollPane = new JScrollPane();
    chatroomArea = new JTextArea();
    chatMsgLabel = new JLabel();
    chatMsgField = new JTextField();
    chatIPLabel = new JLabel();
    chatIPField = new JTextField();
    portLabel = new JLabel();
    portField = new JTextField();
    joinButton = new JToggleButton();
    sendButton = new JButton();
    leaveButton = new JButton();
    exitButton = new JButton();

    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

    usernameLabel.setText("Username:"******" ");

    chatroomArea.setEditable(false);
    chatroomArea.setColumns(20);
    chatroomArea.setRows(5);
    chatroomScrollPane.setViewportView(chatroomArea);

    chatMsgLabel.setText("Chat Message:");

    chatIPLabel.setText("Chat Group IP");

    chatIPField.setText("224.27.43.188");

    portLabel.setText("Port");

    portField.setText("4001");

    joinButton.setText("JOIN CHAT");
    joinButton.addActionListener(this);

    sendButton.setText("SEND MESSAGE");
    sendButton.addActionListener(this);

    leaveButton.setText("LEAVE CHAT");
    leaveButton.addActionListener(this);

    exitButton.setText("EXIT");
    exitButton.addActionListener(this);

    GroupLayout layout = new GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(GroupLayout.Alignment.LEADING)
                            .addGroup(
                                GroupLayout.Alignment.TRAILING,
                                layout
                                    .createSequentialGroup()
                                    .addGap(0, 0, Short.MAX_VALUE)
                                    .addComponent(usernameLabel)
                                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                    .addComponent(
                                        usernameField,
                                        GroupLayout.PREFERRED_SIZE,
                                        83,
                                        GroupLayout.PREFERRED_SIZE))
                            .addComponent(chatroomScrollPane)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGroup(
                                        layout
                                            .createParallelGroup(GroupLayout.Alignment.LEADING)
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addComponent(chatMsgLabel)
                                                    .addPreferredGap(
                                                        LayoutStyle.ComponentPlacement.RELATED)
                                                    .addComponent(
                                                        chatMsgField,
                                                        GroupLayout.PREFERRED_SIZE,
                                                        296,
                                                        GroupLayout.PREFERRED_SIZE))
                                            .addGroup(
                                                layout
                                                    .createSequentialGroup()
                                                    .addGroup(
                                                        layout
                                                            .createParallelGroup(
                                                                GroupLayout.Alignment.TRAILING,
                                                                false)
                                                            .addComponent(
                                                                chatIPField,
                                                                GroupLayout.Alignment.LEADING)
                                                            .addComponent(
                                                                chatIPLabel,
                                                                GroupLayout.Alignment.LEADING,
                                                                GroupLayout.DEFAULT_SIZE,
                                                                GroupLayout.DEFAULT_SIZE,
                                                                Short.MAX_VALUE))
                                                    .addGap(18, 18, 18)
                                                    .addGroup(
                                                        layout
                                                            .createParallelGroup(
                                                                GroupLayout.Alignment.LEADING,
                                                                false)
                                                            .addComponent(
                                                                portField,
                                                                GroupLayout.DEFAULT_SIZE,
                                                                46,
                                                                Short.MAX_VALUE)
                                                            .addComponent(
                                                                portLabel,
                                                                GroupLayout.DEFAULT_SIZE,
                                                                GroupLayout.DEFAULT_SIZE,
                                                                Short.MAX_VALUE))
                                                    .addGap(18, 18, 18)
                                                    .addGroup(
                                                        layout
                                                            .createParallelGroup(
                                                                GroupLayout.Alignment.LEADING,
                                                                false)
                                                            .addGroup(
                                                                layout
                                                                    .createSequentialGroup()
                                                                    .addComponent(leaveButton)
                                                                    .addGap(18, 18, 18)
                                                                    .addComponent(
                                                                        exitButton,
                                                                        GroupLayout.DEFAULT_SIZE,
                                                                        GroupLayout.DEFAULT_SIZE,
                                                                        Short.MAX_VALUE))
                                                            .addGroup(
                                                                layout
                                                                    .createSequentialGroup()
                                                                    .addComponent(
                                                                        joinButton,
                                                                        GroupLayout.PREFERRED_SIZE,
                                                                        93,
                                                                        GroupLayout.PREFERRED_SIZE)
                                                                    .addGap(18, 18, 18)
                                                                    .addComponent(sendButton)))))
                                    .addGap(0, 8, Short.MAX_VALUE)))
                    .addContainerGap()));

    layout.setVerticalGroup(
        layout
            .createParallelGroup(GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(GroupLayout.Alignment.LEADING, false)
                            .addComponent(usernameField)
                            .addComponent(
                                usernameLabel,
                                GroupLayout.DEFAULT_SIZE,
                                GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE))
                    .addGap(3, 3, 3)
                    .addComponent(
                        chatroomScrollPane,
                        GroupLayout.PREFERRED_SIZE,
                        178,
                        GroupLayout.PREFERRED_SIZE)
                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                chatMsgLabel,
                                GroupLayout.DEFAULT_SIZE,
                                GroupLayout.DEFAULT_SIZE,
                                Short.MAX_VALUE)
                            .addComponent(
                                chatMsgField,
                                GroupLayout.PREFERRED_SIZE,
                                GroupLayout.DEFAULT_SIZE,
                                GroupLayout.PREFERRED_SIZE))
                    .addGroup(
                        layout
                            .createParallelGroup(GroupLayout.Alignment.LEADING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(GroupLayout.Alignment.BASELINE)
                                            .addComponent(chatIPLabel)
                                            .addComponent(portLabel))
                                    .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(GroupLayout.Alignment.BASELINE)
                                            .addComponent(
                                                chatIPField,
                                                GroupLayout.PREFERRED_SIZE,
                                                GroupLayout.DEFAULT_SIZE,
                                                GroupLayout.PREFERRED_SIZE)
                                            .addComponent(
                                                portField,
                                                GroupLayout.PREFERRED_SIZE,
                                                GroupLayout.DEFAULT_SIZE,
                                                GroupLayout.PREFERRED_SIZE)))
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addGap(16, 16, 16)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(
                                                GroupLayout.Alignment.LEADING, false)
                                            .addComponent(
                                                joinButton,
                                                GroupLayout.DEFAULT_SIZE,
                                                GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE)
                                            .addComponent(
                                                sendButton,
                                                GroupLayout.DEFAULT_SIZE,
                                                GroupLayout.DEFAULT_SIZE,
                                                Short.MAX_VALUE))
                                    .addGap(8, 8, 8)
                                    .addGroup(
                                        layout
                                            .createParallelGroup(GroupLayout.Alignment.BASELINE)
                                            .addComponent(leaveButton)
                                            .addComponent(exitButton))))
                    .addGap(17, 17, 17)));
    pack();
    setVisible(true);
  }
Exemple #7
0
  public void actionPerformed(ActionEvent e) {
    Object src = e.getSource();
    if (src == timer) {
      for (int i = 0; i < speed; i++) // integrate a few steps
      md.vv();
      repaint();
      return;
    }

    boolean adjCanvasScale = false;

    if (src == bTstat) md.thermostat = !md.thermostat;

    if (src == bPot) {
      md.ljPotential = !md.ljPotential;
      md.clearData();

      if (timer.isRunning()) timer.stop();
      bStart.setSelected(false);
      bStart.setText("Start");
      md.init(md.rho);
    }

    if (src == tTemp || src == bReset) {
      double kT = Double.parseDouble(tTemp.getText().trim());
      if (kT < 1e-8) {
        kT = 1e-8;
        tTemp.setText("  " + kT);
      }
      md.kT = kT;
      md.clearData();
    }

    if (src == tRho || src == bReset) {
      double rho = Double.parseDouble(tRho.getText().trim());
      if (rho < 1e-3) {
        rho = 1e-3;
        tRho.setText("   " + rho);
      }
      if (rho > 1.2) {
        rho = 1.2;
        tRho.setText("   " + rho);
      }
      md.setDensity(rho);
      md.clearData();
      adjCanvasScale = true;
    }

    if (src == tSpeed || src == bReset) {
      speed = Integer.parseInt(tSpeed.getText().trim());
      if (speed < 1) {
        speed = 1;
        tSpeed.setText("   " + speed);
      }
    }

    if (src == bRetime) md.clearData();

    if (src == bStart) {
      boolean on = bStart.isSelected();
      if (on) {
        timer.restart();
        bStart.setText("Pause");
      } else {
        timer.stop();
        bStart.setText("Resume");
      }
    }

    if (src == tNum) {
      int n = Integer.parseInt(tNum.getText().trim());
      if (n < 2) {
        n = 2;
        tNum.setText(" " + n);
      }
      md.N = n;
      md.init(md.rho);
      adjCanvasScale = true;
    }

    if (src == bReset) {
      if (timer.isRunning()) timer.stop();
      bStart.setSelected(false);
      bStart.setText("Start");
      md.init(md.rho);
    }

    canvas.refresh(md.getXWrap(), md.N, true, adjCanvasScale);

    repaint();
  }
  private void jbInit() throws Exception {
    border1 = new EtchedBorder(EtchedBorder.RAISED, Color.white, new Color(165, 163, 151));
    border2 = new EtchedBorder(EtchedBorder.RAISED, Color.white, new Color(165, 163, 151));
    border3 = new EtchedBorder(EtchedBorder.RAISED, Color.white, new Color(178, 178, 178));
    titledBorder1 = new TitledBorder(border3, "Subject");
    border4 = new EtchedBorder(EtchedBorder.RAISED, Color.white, new Color(178, 178, 178));
    titledBorder2 = new TitledBorder(border4, "Message");
    border5 = new EtchedBorder(EtchedBorder.RAISED, Color.white, new Color(178, 178, 178));
    titledBorder3 = new TitledBorder(border5, "Subject");
    border6 = new EtchedBorder(EtchedBorder.RAISED, Color.white, new Color(165, 163, 151));
    titledBorder4 = new TitledBorder(border6, "Message");
    border7 = new EtchedBorder(EtchedBorder.RAISED, Color.white, new Color(165, 163, 151));
    titledBorder5 = new TitledBorder(border7, "Messages");
    border8 = new EtchedBorder(EtchedBorder.RAISED, Color.white, new Color(165, 163, 151));
    titledBorder6 = new TitledBorder(border8, "Online Users");
    border9 = new EtchedBorder(EtchedBorder.RAISED, Color.white, new Color(178, 178, 178));
    titledBorder7 = new TitledBorder(border9, "Send Message");
    this.getContentPane().setLayout(borderLayout1);
    jSplitPane1.setOrientation(JSplitPane.VERTICAL_SPLIT);
    jSplitPane1.setBorder(border1);
    jSplitPane1.setLastDividerLocation(250);
    jSplitPane1.setResizeWeight(1.0);
    jLabelServer.setRequestFocusEnabled(true);
    jLabelServer.setText("Server");
    jLabelUserId.setText("User Id");
    jTextFieldServer.setPreferredSize(new Dimension(75, 20));
    jTextFieldServer.setText("");
    jTextFieldUser.setPreferredSize(new Dimension(75, 20));
    jTextFieldUser.setText("");
    this.setDefaultCloseOperation(EXIT_ON_CLOSE);
    this.setJMenuBar(jMenuBarMain);
    this.setTitle("Message Client");
    jLabeltargetUser.setText("Target");
    jTextFieldTargetUser.setPreferredSize(new Dimension(75, 20));
    jTextFieldTargetUser.setText("");
    jPanelSendMessages.setBorder(border2);
    jPanelSendMessages.setMaximumSize(new Dimension(32767, 32767));
    jPanelSendMessages.setOpaque(false);
    jPanelSendMessages.setPreferredSize(new Dimension(96, 107));
    jPanelSendMessages.setRequestFocusEnabled(true);
    jPanelSendMessages.setToolTipText("");
    jPanelSendMessages.setLayout(verticalFlowLayout1);
    jTextFieldSendSubject.setBorder(titledBorder3);
    jTextFieldSendSubject.setText("");
    jTextFieldSendSubject.addKeyListener(new Client_jTextFieldSendSubject_keyAdapter(this));
    jSplitPane2.setOrientation(JSplitPane.HORIZONTAL_SPLIT);
    jScrollPane1.setBorder(titledBorder5);
    jScrollPane2.setBorder(titledBorder6);
    jToggleButtonRegister.setText("Register");
    jToggleButtonRegister.addActionListener(new Client_jToggleButtonRegister_actionAdapter(this));
    jButtonMultiConnect.setText("Multi-Connect");
    jButtonMultiConnect.addActionListener(new Client_jButtonMultiConnect_actionAdapter(this));
    jListOnlineUsers.addMouseListener(new Client_jListOnlineUsers_mouseAdapter(this));
    jToggleButtonConnect.setText("Connect");
    jToggleButtonConnect.addActionListener(new Client_jToggleButtonConnect_actionAdapter(this));
    jTextPaneDisplayMessages.setEditable(false);
    jTextPaneDisplayMessages.addMouseListener(
        new Client_jTextPaneDisplayMessages_mouseAdapter(this));
    jTextFieldSendMessages.setBorder(titledBorder7);
    jTextFieldSendMessages.setToolTipText("");
    jTextFieldSendMessages.addKeyListener(new Client_jTextFieldSendMessages_keyAdapter(this));
    jButtonMessageStresser.setText("Msg Stresser");
    jButtonMessageStresser.addActionListener(
        new Client_jToggleButtonMessageStresser_actionAdapter(this));
    jMenuItemClearMessages.setText("Clear Messages");
    jMenuItemClearMessages.addActionListener(new Client_jMenuItemClearMessages_actionAdapter(this));
    jMenuServer.setText("Server");
    jMenuItemServerConnect.setText("Connect");
    jMenuItemServerConnect.addActionListener(new Client_jMenuItemServerConnect_actionAdapter(this));
    jMenuItemServerDisconnect.setText("Disconnect");
    jMenuItemServerDisconnect.addActionListener(
        new Client_jMenuItemServerDisconnect_actionAdapter(this));
    jMenuOptions.setText("Options");
    jMenuTest.setText("Test");
    jMenuItemOptionsRegister.setText("Register");
    jMenuItemOptionsRegister.addActionListener(
        new Client_jMenuItemOptionsRegister_actionAdapter(this));
    jMenuItemOptionsDeregister.setText("Deregister");
    jMenuItemOptionsDeregister.addActionListener(
        new Client_jMenuItemOptionsDeregister_actionAdapter(this));
    jMenuItemOptionsEavesdrop.setText("Eavesdrop");
    jMenuItemOptionsEavesdrop.addActionListener(
        new Client_jMenuItemOptionsEavesdrop_actionAdapter(this));
    jMenuItemOptionsUneavesdrop.setText("Uneavesdrop");
    jMenuItemOptionsUneavesdrop.addActionListener(
        new Client_jMenuItemOptionsUneavesdrop_actionAdapter(this));
    jMenuItemTestMulticonnect.setText("Multiconnect");
    jMenuItemTestMulticonnect.addActionListener(
        new Client_jMenuItemTestMulticonnect_actionAdapter(this));
    jMenuItemTestMessageStresser.setText("Message Stresser");
    jMenuItemTestMessageStresser.addActionListener(
        new Client_jMenuItemTestMessageStresser_actionAdapter(this));
    jMenuItemTestMultidisconnect.setText("Multidisconnect");
    jMenuItemTestMultidisconnect.addActionListener(
        new Client_jMenuItemTestMultidisconnect_actionAdapter(this));
    jMenuItemOptionsGlobalEavesdrop.setText("Global Eavesdrop");
    jMenuItemOptionsGlobalEavesdrop.addActionListener(
        new Client_jMenuItemOptionsGlobalEavesdrop_actionAdapter(this));
    jMenuItemOptionsGlobalUneavesdrop.setEnabled(false);
    jMenuItemOptionsGlobalUneavesdrop.setText("Global Uneavesdrop");
    jMenuItemOptionsGlobalUneavesdrop.addActionListener(
        new Client_jMenuItemOptionsGlobalUneavesdrop_actionAdapter(this));
    jLabelPwd.setText("Pwd");
    jPasswordFieldPwd.setMinimumSize(new Dimension(11, 20));
    jPasswordFieldPwd.setPreferredSize(new Dimension(75, 20));
    jPasswordFieldPwd.setText("");
    jMenuItemScheduleCommand.setText("Schedule Command");
    jMenuItemScheduleCommand.addActionListener(
        new Client_jMenuItemScheduleCommand_actionAdapter(this));
    jMenuItemEditScheduledCommands.setText("Edit Scheduled Commands");
    jMenuItemEditScheduledCommands.addActionListener(
        new Client_jMenuItemEditScheduledCommands_actionAdapter(this));
    jPanelSendMessages.add(jTextFieldSendSubject, null);
    jPanelSendMessages.add(jTextFieldSendMessages, null);
    jSplitPane1.add(jSplitPane2, JSplitPane.TOP);
    jSplitPane2.add(jScrollPane1, JSplitPane.TOP);
    jScrollPane1.getViewport().add(jTextPaneDisplayMessages, null);
    jSplitPane2.add(jScrollPane2, JSplitPane.BOTTOM);
    jScrollPane2.getViewport().add(jListOnlineUsers, null);
    this.getContentPane().add(jSplitPane1, BorderLayout.CENTER);
    jSplitPane1.add(jPanelSendMessages, JSplitPane.BOTTOM);
    this.getContentPane().add(jPanel1, BorderLayout.NORTH);
    jPanel1.add(jLabelServer, null);
    jPanel1.add(jTextFieldServer, null);
    jPanel1.add(jLabelUserId, null);
    jPanel1.add(jTextFieldUser, null);
    jPanel1.add(jLabelPwd, null);
    jPanel1.add(jPasswordFieldPwd, null);
    jPanel1.add(jLabeltargetUser, null);
    jPanel1.add(jTextFieldTargetUser, null);
    jPanel1.add(jToggleButtonConnect, null);
    jPanel1.add(jToggleButtonRegister, null);
    jPanel1.add(jButtonMultiConnect, null);
    jPanel1.add(jButtonMessageStresser, null);
    jPopupMenuMessageArea.add(jMenuItemClearMessages);
    jMenuBarMain.add(jMenuServer);
    jMenuBarMain.add(jMenuOptions);
    jMenuBarMain.add(jMenuTest);
    jMenuServer.add(jMenuItemServerConnect);
    jMenuServer.add(jMenuItemServerDisconnect);
    jMenuOptions.add(jMenuItemOptionsRegister);
    jMenuOptions.add(jMenuItemOptionsDeregister);
    jMenuOptions.add(jMenuItemOptionsEavesdrop);
    jMenuOptions.add(jMenuItemOptionsUneavesdrop);
    jMenuOptions.add(jMenuItemOptionsGlobalEavesdrop);
    jMenuOptions.add(jMenuItemOptionsGlobalUneavesdrop);
    jMenuTest.add(jMenuItemTestMulticonnect);
    jMenuTest.add(jMenuItemTestMultidisconnect);
    jMenuTest.add(jMenuItemTestMessageStresser);
    jMenuTest.add(jMenuItemScheduleCommand);
    jMenuTest.add(jMenuItemEditScheduledCommands);
    jSplitPane1.setDividerLocation(200);
    jSplitPane2.setDividerLocation(600);
    jListOnlineUsers.setCellRenderer(new OnlineListCellRenderer());
    jListOnlineUsers.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);

    jMenuItemTestMulticonnect.setEnabled(true);
    jMenuItemTestMultidisconnect.setEnabled(false);
    jMenuItemServerConnect.setEnabled(true);
    jMenuItemServerDisconnect.setEnabled(false);
    jMenuItemOptionsRegister.setEnabled(true);
    jMenuItemOptionsDeregister.setEnabled(false);
  }
Exemple #9
0
  public void jbInit() throws Exception {
    this.setLayout(null);
    fContractPriceTextField.setFont(new java.awt.Font("Dialog", 1, 11));
    fContractPriceTextField.setDisabledTextColor(Color.black);
    fContractPriceTextField.setEditable(false);
    fContractPriceTextField.setHorizontalAlignment(SwingConstants.RIGHT);
    fContractPriceTextField.setBounds(new java.awt.Rectangle(285, 182, 55, 21));
    fContractVolumeTextField.setFont(new java.awt.Font("Dialog", 1, 11));
    fContractVolumeTextField.setDisabledTextColor(Color.black);
    fContractVolumeTextField.setEditable(false);
    fContractVolumeTextField.setHorizontalAlignment(SwingConstants.RIGHT);
    fContractVolumeTextField.setBounds(new java.awt.Rectangle(285, 238, 55, 21));
    fContractVolumeLabel.setText(fRb.getString("CONTRACT_VOLUME"));
    fContractVolumeLabel.setForeground(Color.black);
    fContractVolumeLabel.setBounds(new java.awt.Rectangle(272, 218, 99, 17));
    fContractPriceLabel.setBounds(new java.awt.Rectangle(272, 160, 92, 17));
    fContractPriceLabel.setText(fRb.getString("CONTRACT_PRICE"));
    fContractPriceLabel.setForeground(Color.black);

    fBoardGraph.setLayout(borderLayout1);
    fDay.setBounds(new java.awt.Rectangle(337, 87, 42, 21));
    fDayLabel.setText(fRb.getString("DAY") + ":");
    fDayLabel.setForeground(Color.black);
    fDayLabel.setBounds(new java.awt.Rectangle(267, 89, 67, 17));
    fBoardLabel.setText(fRb.getString("SESSION") + ":");
    fBoardLabel.setForeground(Color.black);
    fBoardLabel.setBounds(new java.awt.Rectangle(267, 121, 68, 17));
    fBoard.setBounds(new java.awt.Rectangle(337, 119, 42, 22));
    fPreviousBoardLabel.setFont(new java.awt.Font("Dialog", 1, 12));
    fPreviousBoardLabel.setText(fRb.getString("PREVIOUS_PRICING"));
    fPreviousBoardLabel.setForeground(Color.black);
    fPreviousBoardLabel.setBounds(new java.awt.Rectangle(85, 4, 99, 17));
    fXYToggleButton.setBorder(BorderFactory.createRaisedBevelBorder());
    fXYToggleButton.setText("Exchange X-Y");
    fXYToggleButton.setBounds(new java.awt.Rectangle(268, 43, 114, 25));
    fXYToggleButton.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(ActionEvent e) {
            fIsExchangeXY = fXYToggleButton.isSelected();
            fIsUpdated = true;
            gUpdate();
          }
        });

    this.setBorder(BorderFactory.createEtchedBorder());
    this.setBounds(new java.awt.Rectangle(325, 7, 387, 283));
    this.setLayout(null);
    fBoardGraph.setBorder(BorderFactory.createEtchedBorder());
    fBoardGraph.setBounds(new java.awt.Rectangle(5, 26, 257, 243));
    fBoardGraph.getGraph().add(new UGraphData(fSellName, fSellColor));
    fBoardGraph.getGraph().add(new UGraphData(fBuyName, fBuyColor));
    fBoardGraph.setLeftMargin(60);
    this.add(fBoardGraph, null);
    this.add(fContractVolumeTextField, null);
    this.add(fContractVolumeLabel, null);
    this.add(fContractPriceTextField, null);
    this.add(fContractPriceLabel, null);
    this.add(fBoardLabel, null);
    this.add(fDayLabel, null);
    this.add(fXYToggleButton, null);
    this.add(fPreviousBoardLabel, null);
    this.add(fDay, null);
    this.add(fBoard, null);
    fBoardGraph.setBackground(Color.white);
    fBoardGraph.setNumOfHorizontalLine(0);
    fBoardGraph.setNumOfVerticalLine(0);
    fBoardGraph.setFixedMaxX(1);
    fBoardGraph.setFixedMinX(0);
    fBoardGraph.setFixedMaxY(1);
    fBoardGraph.setFixedMinY(0);
    addComponentListener(
        new ComponentAdapter() {
          public void componentShown(ComponentEvent ce) {
            gUpdate();
          }
        });
  }