Ejemplo n.º 1
1
  /**
   * Sets the mute status icon to the status panel.
   *
   * @param isMute indicates if the call with this peer is muted
   */
  public void setMute(final boolean isMute) {
    if (!SwingUtilities.isEventDispatchThread()) {
      SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
              setMute(isMute);
            }
          });
      return;
    }

    if (isMute) {
      muteStatusLabel.setIcon(new ImageIcon(ImageLoader.getImage(ImageLoader.MUTE_STATUS_ICON)));
      muteStatusLabel.setBorder(BorderFactory.createEmptyBorder(2, 3, 2, 3));
    } else {
      muteStatusLabel.setIcon(null);
      muteStatusLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    }

    // Update input volume control button state to reflect the current
    // mute status.
    if (localLevel.isSelected() != isMute) localLevel.setSelected(isMute);

    this.revalidate();
    this.repaint();
  }
    protected void initComponents() {
      int border = 2;
      this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
      this.setBorder(BorderFactory.createEmptyBorder(4, 4, 4, 4));

      // Description label
      JPanel descriptionPanel = new JPanel(new GridLayout(0, 1, 0, 0));
      descriptionPanel.setBorder(BorderFactory.createEmptyBorder(border, border, border, border));
      String text = thread.getRetrievable().getName();
      text = text.length() > 40 ? text.substring(0, 37) + "..." : text;
      descriptionLabel = new JLabel(text);
      descriptionPanel.add(descriptionLabel);
      this.add(descriptionPanel);

      // Progrees and cancel button
      JPanel progressPanel = new JPanel();
      progressPanel.setLayout(new BoxLayout(progressPanel, BoxLayout.X_AXIS));
      progressPanel.setBorder(BorderFactory.createEmptyBorder(border, border, border, border));
      progressBar = new JProgressBar(0, 100);
      progressBar.setPreferredSize(new Dimension(100, 16));
      progressPanel.add(progressBar);
      progressPanel.add(Box.createHorizontalStrut(8));
      cancelButton = new JButton("Cancel");
      cancelButton.setBackground(Color.RED);
      cancelButton.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent event) {
              cancelButtonActionPerformed(event);
            }
          });
      progressPanel.add(cancelButton);
      this.add(progressPanel);
    }
Ejemplo n.º 3
0
    public DisplayResults() {
      GridBagLayout gbl = new GridBagLayout();
      GridBagConstraints gbc = new GridBagConstraints();
      setLayout(gbl);

      gbc.anchor = GridBagConstraints.NORTHWEST;
      gbc.fill = GridBagConstraints.HORIZONTAL;

      text.setForeground(Color.black);
      add(text, gbc);
      gbc.gridy = 0;
      gbc.gridwidth = GridBagConstraints.REMAINDER;
      add(emptyLabel, gbc);
      add(Box.createVerticalStrut(0), gbc);
      add(emptyLabel, gbc);

      /*	 gbc.gridy = 1;
      VTextMsg result = new VTextMsg(sshare, vnmrif, null);
      result.setPreferredSize(new Dimension(300, 30));
      result.setForeground(Color.black);
      add( result, gbc );
      */
      setBorder(
          new CompoundBorder(
              BorderFactory.createTitledBorder("  Results  "),
              BorderFactory.createEmptyBorder(10, 10, 10, 10)));
    }
Ejemplo n.º 4
0
    public DisplayUserDirectory() {
      GridBagLayout gbl = new GridBagLayout();
      GridBagConstraints gbc = new GridBagConstraints();
      setLayout(gbl);

      gbc.anchor = GridBagConstraints.NORTHWEST;
      gbc.fill = GridBagConstraints.HORIZONTAL;

      hmlabel.setForeground(Color.black);
      add(hmlabel, gbc);
      add(Box.createHorizontalStrut(10), gbc);
      gbc.gridwidth = GridBagConstraints.REMAINDER;
      add(hmdir, gbc);
      add(Box.createVerticalStrut(15), gbc);

      gbc.gridwidth = 1;
      vjlabel.setForeground(Color.black);
      add(vjlabel, gbc);
      add(Box.createHorizontalStrut(10), gbc);
      gbc.gridwidth = GridBagConstraints.REMAINDER;
      add(vjdir, gbc);
      add(Box.createVerticalStrut(0), gbc);

      gbc.gridwidth = 1;
      vjlabel2.setForeground(Color.black);
      add(vjlabel2, gbc);
      setBorder(
          new CompoundBorder(
              // i18n
              // BorderFactory.createTitledBorder(" User_Directories "),
              BorderFactory.createTitledBorder(Util.getAdmLabel("_admin_User_Directories")),
              BorderFactory.createEmptyBorder(10, 10, 10, 10)));
    }
Ejemplo n.º 5
0
  /**
   * Creates the <tt>Component</tt> hierarchy of the area of status-related information such as
   * <tt>CallPeer</tt> display name, call duration, security status.
   *
   * @return the root of the <tt>Component</tt> hierarchy of the area of status-related information
   *     such as <tt>CallPeer</tt> display name, call duration, security status
   */
  private Component createStatusBar() {
    // stateLabel
    callStatusLabel.setForeground(Color.WHITE);
    dtmfLabel.setForeground(Color.WHITE);
    callStatusLabel.setText(callPeer.getState().getLocalizedStateString());

    PeerStatusPanel statusPanel = new PeerStatusPanel(new GridBagLayout());

    GridBagConstraints constraints = new GridBagConstraints();

    constraints.gridx = 0;
    constraints.gridy = 0;
    statusPanel.add(securityStatusLabel, constraints);
    initSecurityStatusLabel();

    constraints.gridx++;
    statusPanel.add(holdStatusLabel, constraints);

    constraints.gridx++;
    statusPanel.add(muteStatusLabel, constraints);

    constraints.gridx++;
    callStatusLabel.setBorder(BorderFactory.createEmptyBorder(2, 3, 2, 12));
    statusPanel.add(callStatusLabel, constraints);

    constraints.gridx++;
    constraints.weightx = 1f;
    statusPanel.add(dtmfLabel, constraints);

    return statusPanel;
  }
Ejemplo n.º 6
0
  /**
   * Sets the "on hold" property value.
   *
   * @param isOnHold indicates if the call with this peer is put on hold
   */
  public void setOnHold(final boolean isOnHold) {
    if (!SwingUtilities.isEventDispatchThread()) {
      SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
              setOnHold(isOnHold);
            }
          });
      return;
    }

    if (isOnHold) {
      holdStatusLabel.setIcon(new ImageIcon(ImageLoader.getImage(ImageLoader.HOLD_STATUS_ICON)));
      holdStatusLabel.setBorder(BorderFactory.createEmptyBorder(2, 3, 2, 3));
    } else {
      holdStatusLabel.setIcon(null);
      holdStatusLabel.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    }

    this.revalidate();
    this.repaint();
  }
Ejemplo n.º 7
0
    protected void layoutUIComponents(String strPath, boolean bDefaultFile) {
      JLabel label = null;

      // i18n
      // label = new JLabel( "File names can be constructed from a template. The LABEL field is " );
      label =
          new JLabel(
              Util.getAdmLabel(
                  "_admin_File_names_can_be_constructed_from_a_template._The_LABEL_field_is_"));
      label.setForeground(Color.black);
      // m_gbc.weightx = 0.5;
      showInstruction(m_gbl, m_gbc, 0, 0, 7, label);

      // i18n
      // label = new JLabel( "presented as the choice to the user in the \"Data save\" pop-up." );
      label =
          new JLabel(
              Util.getAdmLabel(
                  "_admin_presented_as_the_choice_to_the_user_in_the_Data_save_pop-up."));
      showInstruction(m_gbl, m_gbc, 0, 1, 7, label);
      showInstruction(m_gbl, m_gbc, 0, 2, 1, new JLabel(""));

      label = new JLabel(Util.getAdmLabel("_adm_LABEL"));
      label.setForeground(Color.black);
      m_gbc.gridx = 1;
      m_gbc.gridy = 2;
      m_gbc.ipadx = 10;
      m_gbl.setConstraints(label, m_gbc);
      m_pnlDisplay.add(label);

      label = new JLabel("     ");
      m_gbc.gridx = 2;
      m_gbc.gridy = 2;
      m_gbc.ipadx = 0; // reset to default
      m_gbc.gridwidth = 5;
      m_gbl.setConstraints(label, m_gbc);
      // add( label );

      showInstruction(m_gbl, m_gbc, 2, 2, 1, new JLabel(Util.getAdmLabel("_admin_TEMPLATE")));

      m_nRow = 3;
      m_bDefaultFile = bDefaultFile;
      m_objTxfValue.clearArrays();
      displayNewTxf(strPath);

      m_pnlDisplay.setBorder(
          new CompoundBorder(
              BorderFactory.createTitledBorder(Util.getAdmLabel("_admin_User_Directories")),
              BorderFactory.createEmptyBorder(10, 10, 10, 10)));
    }
Ejemplo n.º 8
0
    protected void layoutUIComponents(String strPath, boolean bDefaultFile) {
      // gbc.weightx = 0.5;

      showInstructions(m_gbl, m_gbc, 0, 0, 7, infoLabel1);
      showInstructions(m_gbl, m_gbc, 0, 1, 7, infoLabel2);
      showInstructions(m_gbl, m_gbc, 0, 2, 7, infoLabel3);
      /*showInstructions( gbl, gbc, 0, 3, 7, infoLabel4 );
      showInstructions( gbl, gbc, 0, 4, 7, infoLabel5 );*/
      showInstructions(m_gbl, m_gbc, 0, 5, 1, new JLabel(""));

      // i18n
      // label = new JLabel( "LABEL" );
      label = new JLabel(Util.getAdmLabel("_adm_LABEL"));
      label.setForeground(Color.black);
      m_gbc.gridx = 1;
      m_gbc.gridy = 5;
      // gbc.ipadx = 10;
      m_gbl.setConstraints(label, m_gbc);
      m_pnlDisplay.add(label);

      label = new JLabel("     ");
      m_gbc.gridx = 2;
      m_gbc.gridy = 5;
      m_gbc.ipadx = 0;
      m_gbc.gridwidth = 5;
      m_gbc.weightx = 0;
      m_gbl.setConstraints(label, m_gbc);
      // add( label );

      // i18n
      // showInstructions( m_gbl, m_gbc, 2, 5, 1, new JLabel( "DIRECTORY" ));
      showInstructions(m_gbl, m_gbc, 2, 5, 1, new JLabel(Util.getAdmLabel("_adm_DIRECTORY")));

      m_nRow = 5;

      m_bDefaultFile = bDefaultFile;
      m_objTxfValue.clearArrays();
      displayNewTxf(strPath);

      m_pnlDisplay.setBorder(
          new CompoundBorder(
              // i18n
              // BorderFactory.createTitledBorder( "  Parent Directories  "),
              BorderFactory.createTitledBorder(Util.getAdmLabel("_adm_Parent_Directories")),
              BorderFactory.createEmptyBorder(10, 10, 10, 10)));
    }
Ejemplo n.º 9
0
  private static JComponent makeUI() {
    // final JProgressBar progressBar = new JProgressBar(SwingConstants.VERTICAL);
    final JProgressBar progressBar = new JProgressBar();
    progressBar.setOpaque(false);
    progressBar.setUI(new GradientPalletProgressBarUI());

    GridBagConstraints c = new GridBagConstraints();
    JPanel p = new JPanel(new GridBagLayout());
    p.setBorder(BorderFactory.createEmptyBorder(32, 8, 0, 8));

    c.gridheight = 1;
    c.gridwidth = 1;
    c.gridy = 0;

    c.gridx = 0;
    c.insets = new Insets(0, 0, 0, 4);
    c.weightx = 1d;
    c.fill = GridBagConstraints.HORIZONTAL;
    p.add(progressBar, c);

    c.gridx = 1;
    c.weightx = 0d;
    p.add(
        new JButton(
            new AbstractAction("Start") {
              @Override
              public void actionPerformed(ActionEvent e) {
                final JButton b = (JButton) e.getSource();
                b.setEnabled(false);
                SwingWorker<Void, Void> worker =
                    new Task() {
                      @Override
                      public void done() {
                        if (b.isDisplayable()) {
                          b.setEnabled(true);
                        }
                      }
                    };
                worker.addPropertyChangeListener(new ProgressListener(progressBar));
                worker.execute();
              }
            }),
        c);
    return p;
  }
    protected void initComponents() {
      this.setLayout(new BorderLayout());
      this.setBorder(BorderFactory.createEmptyBorder(1, 1, 1, 1));

      // Check + name
      this.selectCheckBox = new JCheckBox(this.retrievable.getName());
      this.selectCheckBox.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent e) {
              if (((JCheckBox) e.getSource()).isSelected() && sector != null)
                updateDescription(sector);
            }
          });
      this.add(this.selectCheckBox, BorderLayout.WEST);
      // Description (size...)
      this.descriptionLabel = new JLabel();
      this.add(this.descriptionLabel, BorderLayout.EAST);
    }
Ejemplo n.º 11
0
  /**
   * Indicates that the security has gone off.
   *
   * @param evt the <tt>CallPeerSecurityOffEvent</tt> that notified us
   */
  public void securityOff(final CallPeerSecurityOffEvent evt) {
    if (!SwingUtilities.isEventDispatchThread()) {
      SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
              securityOff(evt);
            }
          });
      return;
    }

    if (evt.getSessionType() == CallPeerSecurityOffEvent.AUDIO_SESSION) {
      securityStatusLabel.setText("");
      securityStatusLabel.setSecurityOff();
      if (securityStatusLabel.getBorder() == null)
        securityStatusLabel.setBorder(BorderFactory.createEmptyBorder(2, 5, 2, 3));
    }

    securityPanel.securityOff(evt);
  }
Ejemplo n.º 12
0
  /**
   * ************************************************
   *
   * <pre>
   * Summary: Constructor, Add buttons to dialog box
   *
   * </pre>
   *
   * *************************************************
   */
  public TagAddRemoveDialog() {
    super(Util.getLabel("_Locator_Add_Remove"));

    // Make a panel for the buttons
    panelForBtns = new JPanel();
    // It looks better with a border
    panelForBtns.setBorder(BorderFactory.createEmptyBorder(20, 35, 20, 35));

    // Create the two items.
    addButton = new JButton("Add to Group");
    removeButton = new JButton("Remove From Group");

    // Add items to panel
    panelForBtns.add(addButton);
    panelForBtns.add(removeButton);

    // Add the panel top of the dialog.
    getContentPane().add(panelForBtns, BorderLayout.NORTH);

    // Set the buttons and the text item up with Listeners
    cancelButton.setActionCommand("cancel");
    cancelButton.addActionListener(this);
    helpButton.setActionCommand("help");
    helpButton.addActionListener(this);
    addButton.setActionCommand("add");
    addButton.addActionListener(this);
    addButton.setMnemonic('a');
    removeButton.setActionCommand("remove");
    removeButton.addActionListener(this);
    removeButton.setMnemonic('r');

    // OK disabled.
    okButton.setEnabled(false);

    setBgColor(Util.getBgColor());
    DisplayOptions.addChangeListener(this);

    // Make the frame fit its contents.
    pack();
  }
Ejemplo n.º 13
0
  /** Initializes the security status label, shown in the call status bar. */
  private void initSecurityStatusLabel() {
    securityStatusLabel.setBorder(BorderFactory.createEmptyBorder(2, 5, 2, 5));

    securityStatusLabel.addMouseListener(
        new MouseAdapter() {
          /** Invoked when a mouse button has been pressed on a component. */
          @Override
          public void mousePressed(MouseEvent e) {
            // Only show the security details if the security is on.
            SrtpControl ctrl = securityPanel.getSecurityControl();
            if (ctrl instanceof ZrtpControl && ctrl.getSecureCommunicationStatus()) {
              setSecurityPanelVisible(
                  !callRenderer
                      .getCallContainer()
                      .getCallWindow()
                      .getFrame()
                      .getGlassPane()
                      .isVisible());
            }
          }
        });
  }
Ejemplo n.º 14
0
  public Splitter() {
    super(new BorderLayout());

    // Create the demo's UI.
    startButton = new JButton("Start");
    startButton.setActionCommand("start");
    startButton.addActionListener(this);
    startButton.setVisible(false);

    taskOutput = new JTextArea(30, 130);
    taskOutput.setMargin(new Insets(5, 5, 5, 5));
    taskOutput.setEditable(false);

    JPanel panel = new JPanel();
    panel.add(startButton);

    add(panel, BorderLayout.PAGE_START);
    add(new JScrollPane(taskOutput), BorderLayout.CENTER);
    setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));

    startButton.doClick();
  }
Ejemplo n.º 15
0
  ApplicationFrame() {
    super("Ecuatii Neliniare");

    setSize(frameWidth, frameHeight);
    setDefaultCloseOperation(this.EXIT_ON_CLOSE);

    panel.setOpaque(true);
    getContentPane().add(panel);
    addComponentListener(this);

    for (int i = 0; i < Methods.length; i++) ChooseMethod.addItem(Methods[i]);
    buttonPanel.add(ChooseMethod);

    buttonPanel.setOpaque(true);
    JButton buttonAdd = new JButton("Aplica...");
    buttonAdd.setPreferredSize(new Dimension(125, 25));
    buttonAdd.addActionListener(this);
    buttonPanel.add(buttonAdd);

    unitXSlider.setMinorTickSpacing(5);
    unitXSlider.setPaintTicks(true);
    unitXSlider.addChangeListener(this);
    unitYSlider.setMinorTickSpacing(5);
    unitYSlider.setPaintTicks(true);
    unitYSlider.addChangeListener(this);
    buttonPanel.add(unitXSlider);
    buttonPanel.add(unitYSlider);

    Border padding = BorderFactory.createEmptyBorder(0, 20, 20, 20);
    panel.setBorder(padding);
    panel.add(buttonPanel, BorderLayout.NORTH);
    panel.add(graph, BorderLayout.CENTER);

    pack();

    setVisible(true);
  }
Ejemplo n.º 16
0
    private void makePanel(Dimension size) {
      JPanel buttonPanel = new JPanel(new GridLayout(1, 2, 5, 5));
      newButton = new JButton("New");
      newButton.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
              lineBuilder.clear();
              lineBuilder.setArmed(true);
              pauseButton.setText("Pause");
              pauseButton.setEnabled(true);
              endButton.setEnabled(true);
              newButton.setEnabled(false);
              ((Component) wwd).setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
            }
          });
      buttonPanel.add(newButton);
      newButton.setEnabled(true);

      pauseButton = new JButton("Pause");
      pauseButton.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
              lineBuilder.setArmed(!lineBuilder.isArmed());
              pauseButton.setText(!lineBuilder.isArmed() ? "Resume" : "Pause");
              ((Component) wwd).setCursor(Cursor.getDefaultCursor());
            }
          });
      buttonPanel.add(pauseButton);
      pauseButton.setEnabled(false);

      endButton = new JButton("End");
      endButton.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent actionEvent) {
              lineBuilder.setArmed(false);
              newButton.setEnabled(true);
              pauseButton.setEnabled(false);
              pauseButton.setText("Pause");
              endButton.setEnabled(false);
              ((Component) wwd).setCursor(Cursor.getDefaultCursor());
            }
          });
      buttonPanel.add(endButton);
      endButton.setEnabled(false);

      JPanel pointPanel = new JPanel(new GridLayout(0, 1, 0, 10));
      pointPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));

      this.pointLabels = new JLabel[20];
      for (int i = 0; i < this.pointLabels.length; i++) {
        this.pointLabels[i] = new JLabel("");
        pointPanel.add(this.pointLabels[i]);
      }

      // Put the point panel in a container to prevent scroll panel from stretching the vertical
      // spacing.
      JPanel dummyPanel = new JPanel(new BorderLayout());
      dummyPanel.add(pointPanel, BorderLayout.NORTH);

      // Put the point panel in a scroll bar.
      JScrollPane scrollPane = new JScrollPane(dummyPanel);
      scrollPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
      if (size != null) scrollPane.setPreferredSize(size);

      // Add the buttons, scroll bar and inner panel to a titled panel that will resize with the
      // main window.
      JPanel outerPanel = new JPanel(new BorderLayout());
      outerPanel.setBorder(
          new CompoundBorder(
              BorderFactory.createEmptyBorder(9, 9, 9, 9), new TitledBorder("Line")));
      outerPanel.setToolTipText("Line control and info");
      outerPanel.add(buttonPanel, BorderLayout.NORTH);
      outerPanel.add(scrollPane, BorderLayout.CENTER);
      this.add(outerPanel, BorderLayout.CENTER);
    }
Ejemplo n.º 17
0
  private void initUi() {
    String history;
    String undo;
    String close;
    String abandon;
    String help;
    String string;
    char helpMnemonic;
    char historyMnemonic;
    char undoMnemonic;
    char closeMnemonic;
    char abandonMnemonic;

    DisplayOptions.addChangeListener(this);

    // setAlwaysOnTop(true);

    // Get text for buttons from properties/resource file
    history = Util.getLabel("blHistory", "Edit...");
    undo = Util.getLabel("blUndo", "Undo");
    close = Util.getLabel("blClose", "Close");
    abandon = Util.getLabel("blAbandon", "Abandon");
    help = Util.getLabel("blHelp", "Help");

    // buttons
    undoButton = new JButton(undo);
    closeButton = new JButton(close);
    abandonButton = new JButton(abandon);
    helpButton = new JButton(help);

    // Create an ArrayList of menu items from properties file

    ArrayList<String> historyList = new ArrayList<String>();
    historyList.add(Util.getLabel("mlHistReturnInitState", "Return to initial state"));
    historyList.add(Util.getLabel("mlHistMakeSnapshot", "Make a snapshot"));
    historyList.add(Util.getLabel("mlHistReturnToSnapshot", "Return to snapshot"));
    historyList.add(Util.getLabel("mlHistReturnToDefault", "Return to system defaults"));

    // Pop Button for history menu
    historyButton = new MPopButton(historyList);
    historyButton.setText(history);

    // Only set mnemonics if found.

    if (Util.labelExists("blmHelp")) {
      string = Util.getLabel("blmHelp");
      helpMnemonic = string.charAt(0);
      helpButton.setMnemonic(helpMnemonic);
    }

    if (Util.labelExists("blmUndo")) {
      string = Util.getLabel("blmUndo");
      undoMnemonic = string.charAt(0);
      undoButton.setMnemonic(undoMnemonic);
    }

    if (Util.labelExists("blmAbandon")) {
      string = Util.getLabel("blmAbandon");
      abandonMnemonic = string.charAt(0);
      abandonButton.setMnemonic(abandonMnemonic);
    }

    if (Util.labelExists("blmClose")) {
      string = Util.getLabel("blmClose");
      closeMnemonic = string.charAt(0);
      closeButton.setMnemonic(closeMnemonic);
    }

    if (Util.labelExists("blmHistory")) {
      string = Util.getLabel("blmHistory");
      historyMnemonic = string.charAt(0);
      historyButton.setMnemonic(historyMnemonic);
    }

    helpButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent evt) {
            // Display Help if help file exists
            CSH_Util.displayCSHelp(dialogTitle);
          }
        });

    // Make a panel to hold the buttons
    buttonPane = new JPanel();

    // Put an empty border around the inside of the panel.
    buttonPane.setBorder(BorderFactory.createEmptyBorder(0, 5, 10, 5));
    buttonPane.setLayout(new SimpleH2Layout(SimpleH2Layout.CENTER));

    // Add the buttons to the panel with space between buttons.
    buttonPane.add(historyButton);
    // buttonPane.add(Box.createRigidArea(new Dimension(5, 0)));
    buttonPane.add(undoButton);
    // buttonPane.add(Box.createRigidArea(new Dimension(5, 0)));
    buttonPane.add(closeButton);
    // buttonPane.add(Box.createRigidArea(new Dimension(5, 0)));
    buttonPane.add(abandonButton);
    // buttonPane.add(Box.createRigidArea(new Dimension(5, 0)));
    buttonPane.add(helpButton);

    // Put everything together, using the content pane's BorderLayout.
    Container contentPane = getContentPane();
    contentPane.add(buttonPane, BorderLayout.SOUTH);

    setHistoryEnabled(false);
    // setCloseEnabled(false);
    setAbandonEnabled(false);
    setUndoEnabled(false);

    if (!CSH_Util.haveTopic(dialogTitle)) setHelpEnabled(false);

    // buttonPane.setVisible(false);
    // Add key listener to the whole dialog
    addKeyListener(this);
    // Make the frame fit its contents.
    // pack(); // nothing to pack.
  }
Ejemplo n.º 18
0
    protected void initComponents(
        AirspaceBuilderModel model, final AirspaceBuilderController controller) {
      final JCheckBox resizeNewShapesCheckBox;
      final JCheckBox enableEditCheckBox;

      JPanel newShapePanel = new JPanel();
      {
        JButton newShapeButton = new JButton("New shape");
        newShapeButton.setActionCommand(NEW_AIRSPACE);
        newShapeButton.addActionListener(controller);
        newShapeButton.setToolTipText("Create a new shape centered in the viewport");

        this.factoryComboBox = new JComboBox(defaultAirspaceFactories);
        this.factoryComboBox.setEditable(false);
        this.factoryComboBox.setToolTipText("Choose shape type to create");

        resizeNewShapesCheckBox = new JCheckBox("Fit new shapes to viewport");
        resizeNewShapesCheckBox.setActionCommand(SIZE_NEW_SHAPES_TO_VIEWPORT);
        resizeNewShapesCheckBox.addActionListener(controller);
        resizeNewShapesCheckBox.setSelected(controller.isResizeNewShapesToViewport());
        resizeNewShapesCheckBox.setAlignmentX(Component.LEFT_ALIGNMENT);
        resizeNewShapesCheckBox.setToolTipText(
            "New shapes are sized to fit the geographic viewport");

        enableEditCheckBox = new JCheckBox("Enable shape editing");
        enableEditCheckBox.setActionCommand(ENABLE_EDIT);
        enableEditCheckBox.addActionListener(controller);
        enableEditCheckBox.setSelected(controller.isEnableEdit());
        enableEditCheckBox.setAlignmentX(Component.LEFT_ALIGNMENT);
        enableEditCheckBox.setToolTipText("Allow modifications to shapes");

        Box newShapeBox = Box.createHorizontalBox();
        newShapeBox.add(newShapeButton);
        newShapeBox.add(Box.createHorizontalStrut(5));
        newShapeBox.add(this.factoryComboBox);
        newShapeBox.setAlignmentX(Component.LEFT_ALIGNMENT);

        JPanel gridPanel = new JPanel(new GridLayout(0, 1, 0, 5)); // rows, cols, hgap, vgap
        gridPanel.add(newShapeBox);
        gridPanel.add(resizeNewShapesCheckBox);
        gridPanel.add(enableEditCheckBox);

        newShapePanel.setLayout(new BorderLayout());
        newShapePanel.add(gridPanel, BorderLayout.NORTH);
      }

      JPanel entryPanel = new JPanel();
      {
        this.entryTable = new JTable(model);
        this.entryTable.setColumnSelectionAllowed(false);
        this.entryTable.setRowSelectionAllowed(true);
        this.entryTable.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
        this.entryTable
            .getSelectionModel()
            .addListSelectionListener(
                new ListSelectionListener() {
                  public void valueChanged(ListSelectionEvent e) {
                    if (!ignoreSelectEvents) {
                      controller.actionPerformed(
                          new ActionEvent(e.getSource(), -1, SELECTION_CHANGED));
                    }
                  }
                });
        this.entryTable.setToolTipText("<html>Click to select<br>Double-Click to rename</html>");

        JScrollPane tablePane = new JScrollPane(this.entryTable);
        tablePane.setPreferredSize(new Dimension(200, 100));

        entryPanel.setLayout(new BorderLayout(0, 0)); // hgap, vgap
        entryPanel.add(tablePane, BorderLayout.CENTER);
      }

      JPanel selectionPanel = new JPanel();
      {
        JButton delselectButton = new JButton("Deselect");
        delselectButton.setActionCommand(CLEAR_SELECTION);
        delselectButton.addActionListener(controller);
        delselectButton.setToolTipText("Clear the selection");

        JButton deleteButton = new JButton("Delete Selected");
        deleteButton.setActionCommand(REMOVE_SELECTED);
        deleteButton.addActionListener(controller);
        deleteButton.setToolTipText("Delete selected shapes");

        JPanel gridPanel = new JPanel(new GridLayout(0, 1, 0, 5)); // rows, cols, hgap, vgap
        gridPanel.add(delselectButton);
        gridPanel.add(deleteButton);

        selectionPanel.setLayout(new BorderLayout());
        selectionPanel.add(gridPanel, BorderLayout.NORTH);
      }

      this.setLayout(new BorderLayout(30, 0)); // hgap, vgap
      this.setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20)); // top, left, bottom, right
      this.add(newShapePanel, BorderLayout.WEST);
      this.add(entryPanel, BorderLayout.CENTER);
      this.add(selectionPanel, BorderLayout.EAST);

      controller.addPropertyChangeListener(
          new PropertyChangeListener() {
            public void propertyChange(PropertyChangeEvent e) {
              if (SIZE_NEW_SHAPES_TO_VIEWPORT.equals(e.getPropertyName())) {
                resizeNewShapesCheckBox.setSelected(controller.isResizeNewShapesToViewport());
              } else if (ENABLE_EDIT.equals(e.getPropertyName())) {
                enableEditCheckBox.setSelected(controller.isEnableEdit());
              }
            }
          });
    }
Ejemplo n.º 19
0
  public ProcessFrame(Properties theProperties) {
    super(new BorderLayout());
    // myFile = theFile;
    myProperties = theProperties;
    Properties props = System.getProperties();
    props.put("http.proxyHost", myProperties.getProperty("PROXYHOST"));
    props.put("http.proxyPort", myProperties.getProperty("PROXYPORT"));

    // Create the demo's UI.
    StartButton = new JButton("Start");
    StartButton.setActionCommand("start");
    StartButton.addActionListener(this);
    cancelButton = new JButton("Cancel");
    cancelButton.setActionCommand("cancel");
    cancelButton.addActionListener(this);
    cancelButton.setEnabled(false);

    myDownloadOptions = new JComboBox(myDownloadOptionsStr);

    progressBar = new JProgressBar(0, 100);
    progressBar.setValue(0);
    progressBar.setStringPainted(true);
    progressBar2 = new JProgressBar(0, 100);
    progressBar2.setValue(0);
    progressBar2.setStringPainted(true);
    progressBar3 = new JProgressBar(0, 100);
    progressBar4 = new JProgressBar(0, 100);
    progressBar5 = new JProgressBar(0, 100);
    progressBar3.setValue(0);
    progressBar3.setStringPainted(true);
    progressBar4.setValue(0);
    progressBar4.setStringPainted(true);
    progressBar5.setValue(0);
    progressBar5.setStringPainted(true);

    taskOutput = new JTextArea(5, 20);

    final JPopupMenu taskPopupMenu = new JPopupMenu();
    JMenuItem clearMenuItem = new JMenuItem("Clear");
    clearMenuItem.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent actionEvent) {
            if (actionEvent.getActionCommand().equals("Clear")) {
              taskOutput.setText("");
            }
          }
        });
    taskPopupMenu.add(clearMenuItem);
    taskOutput.setMargin(new Insets(5, 5, 5, 5));
    taskOutput.setEditable(false);
    taskOutput.addMouseListener(
        new MouseAdapter() {
          private void showIfPopupTrigger(MouseEvent mouseEvent) {
            if (mouseEvent.isPopupTrigger()) {
              taskPopupMenu.show(mouseEvent.getComponent(), mouseEvent.getX(), mouseEvent.getY());
            }
          }

          public void mousePressed(MouseEvent mouseEvent) {
            showIfPopupTrigger(mouseEvent);
          }

          public void mouseReleased(MouseEvent mouseEvent) {
            showIfPopupTrigger(mouseEvent);
          }
        });

    JPanel panel = new JPanel();
    JPanel panel2 = new JPanel();
    panel.setLayout(new GridBagLayout());
    panel2.setLayout(new GridBagLayout());
    panel.add(
        progressBar4,
        new GridBagConstraints(
            2,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.NONE,
            new Insets(11, 11, 0, 0),
            0,
            0));
    panel.add(
        new JLabel("TOTAL"),
        new GridBagConstraints(
            1,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(0, 11, 0, 0),
            0,
            0));
    panel.add(
        progressBar,
        new GridBagConstraints(
            2,
            2,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.NONE,
            new Insets(11, 11, 0, 0),
            0,
            0));
    panel.add(
        new JLabel("REMOTE DOWNLOAD"),
        new GridBagConstraints(
            1,
            2,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(0, 11, 0, 0),
            0,
            0));
    panel.add(
        progressBar2,
        new GridBagConstraints(
            2,
            3,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.NONE,
            new Insets(11, 11, 0, 0),
            0,
            0));
    panel.add(
        new JLabel("REMOTE SPLIT"),
        new GridBagConstraints(
            1,
            3,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(0, 11, 0, 0),
            0,
            0));
    panel.add(
        progressBar3,
        new GridBagConstraints(
            2,
            4,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.NONE,
            new Insets(11, 11, 0, 0),
            0,
            0));
    panel.add(
        new JLabel("LOCAL DOWNLOAD"),
        new GridBagConstraints(
            1,
            4,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(0, 11, 0, 0),
            0,
            0));
    panel.add(
        progressBar5,
        new GridBagConstraints(
            2,
            5,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.NONE,
            new Insets(11, 11, 0, 0),
            0,
            0));
    panel.add(
        new JLabel("LOCAL JOIN"),
        new GridBagConstraints(
            1,
            5,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.BOTH,
            new Insets(0, 11, 0, 0),
            0,
            0));
    panel2.add(
        myDownloadOptions,
        new GridBagConstraints(
            1,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(4, 13, 4, 0),
            0,
            0));
    panel2.add(
        StartButton,
        new GridBagConstraints(
            2,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(4, 13, 4, 0),
            0,
            0));
    panel2.add(
        cancelButton,
        new GridBagConstraints(
            3,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.CENTER,
            GridBagConstraints.HORIZONTAL,
            new Insets(4, 13, 4, 0),
            0,
            0));

    add(panel, BorderLayout.PAGE_START);
    add(panel2, BorderLayout.CENTER);
    add(new JScrollPane(taskOutput), BorderLayout.PAGE_END);

    setBorder(BorderFactory.createEmptyBorder(20, 20, 20, 20));
  }
Ejemplo n.º 20
0
  public SketchProperties(Editor e, Sketch s) {
    super();

    editor = e;
    sketch = s;

    fields = new HashMap<String, JComponent>();

    this.setPreferredSize(new Dimension(500, 400));
    this.setMinimumSize(new Dimension(500, 400));
    this.setMaximumSize(new Dimension(500, 400));
    this.setSize(new Dimension(500, 400));
    Point eLoc = editor.getLocation();
    int x = eLoc.x;
    int y = eLoc.y;

    Dimension eSize = editor.getSize();
    int w = eSize.width;
    int h = eSize.height;

    int cx = x + (w / 2);
    int cy = y + (h / 2);

    this.setLocation(new Point(cx - 250, cy - 200));
    this.setModal(true);

    outer = new JPanel(new BorderLayout());
    outer.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    this.add(outer);

    win = new JPanel();
    win.setLayout(new BorderLayout());
    outer.add(win, BorderLayout.CENTER);

    buttonBar = new JPanel(new FlowLayout(FlowLayout.RIGHT));

    saveButton = new JButton("OK");
    saveButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            save();
            SketchProperties.this.dispose();
          }
        });

    cancelButton = new JButton("Cancel");
    cancelButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            SketchProperties.this.dispose();
          }
        });

    buttonBar.add(saveButton);
    buttonBar.add(cancelButton);

    win.add(buttonBar, BorderLayout.SOUTH);

    tabs = new JTabbedPane();

    overviewPane = new JPanel();
    overviewPane.setLayout(new BoxLayout(overviewPane, BoxLayout.PAGE_AXIS));
    overviewPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    addTextField(overviewPane, "author", "Sketch author:");
    addTextArea(overviewPane, "summary", "Summary:");
    addTextArea(overviewPane, "license", "Copyright / License:");
    tabs.add("Overview", overviewPane);

    objectsPane = new JPanel();
    objectsPane.setLayout(new BoxLayout(objectsPane, BoxLayout.PAGE_AXIS));
    objectsPane.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
    addTextField(objectsPane, "board", "Board:");
    addTextField(objectsPane, "core", "Core:");
    addTextField(objectsPane, "compiler", "Compiler:");
    addTextField(objectsPane, "port", "Serial port:");
    addTextField(objectsPane, "programmer", "Programmer:");
    JButton setDef = new JButton("Set to current IDE values");
    setDef.setMaximumSize(setDef.getPreferredSize());
    setDef.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            setObjectValues();
          }
        });
    objectsPane.add(Box.createVerticalGlue());
    objectsPane.add(setDef);

    tabs.add("Objects", objectsPane);

    win.add(tabs, BorderLayout.CENTER);

    this.setTitle("Sketch Properties");

    this.pack();
    this.setVisible(true);
  }
Ejemplo n.º 21
0
 /**
  * Prints the given DTMG character through this <tt>CallPeerRenderer</tt>.
  *
  * @param dtmfChar the DTMF char to print
  */
 public void printDTMFTone(char dtmfChar) {
   dtmfLabel.setText(dtmfLabel.getText() + dtmfChar);
   if (dtmfLabel.getBorder() == null)
     dtmfLabel.setBorder(BorderFactory.createEmptyBorder(2, 1, 2, 5));
 }
  protected void initComponents() {
    int border = 6;
    this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    this.setBorder(
        new CompoundBorder(
            BorderFactory.createEmptyBorder(9, 9, 9, 9), new TitledBorder("Download")));
    this.setToolTipText("Layer imagery bulk download.");

    final JPanel locationPanel = new JPanel(new BorderLayout(5, 5));
    JLabel locationLabel = new JLabel(" Cache:");
    final JLabel locationName = new JLabel("");
    JButton locationButton = new JButton("...");
    locationPanel.add(locationLabel, BorderLayout.WEST);
    locationPanel.add(locationName, BorderLayout.CENTER);
    locationPanel.add(locationButton, BorderLayout.EAST);
    this.add(locationPanel);

    locationButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent e) {
            JFileChooser fc = new JFileChooser();
            fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            fc.setMultiSelectionEnabled(false);
            int status = fc.showOpenDialog(locationPanel);
            if (status == JFileChooser.APPROVE_OPTION) {
              File file = fc.getSelectedFile();
              if (file != null) {
                locationName.setText(file.getPath());
                cache = new BasicDataFileStore(file);
                updateRetrievablePanels(selector.getSector());
              }
            }
          }
        });

    // Select sector button
    JPanel sectorPanel = new JPanel(new GridLayout(0, 1, 0, 0));
    sectorPanel.setBorder(BorderFactory.createEmptyBorder(border, border, border, border));
    selectButton = new JButton("Select sector");
    selectButton.setToolTipText("Press Select then press and drag button 1 on globe");
    selectButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent event) {
            selectButtonActionPerformed(event);
          }
        });
    sectorPanel.add(selectButton);
    sectorLabel = new JLabel("-");
    sectorLabel.setPreferredSize(new Dimension(350, 16));
    sectorLabel.setHorizontalAlignment(JLabel.CENTER);
    sectorPanel.add(sectorLabel);
    this.add(sectorPanel);

    // Retrievable list combo and start button
    JPanel retrievablesPanel = new JPanel();
    retrievablesPanel.setLayout(new BoxLayout(retrievablesPanel, BoxLayout.Y_AXIS));
    retrievablesPanel.setBorder(BorderFactory.createEmptyBorder(border, border, border, border));

    // RetrievablePanel list
    for (JPanel panel : this.retrievables) {
      retrievablesPanel.add(panel);
    }
    this.add(retrievablesPanel);

    // Start button
    JPanel startPanel = new JPanel(new GridLayout(0, 1, 0, 0));
    startPanel.setBorder(BorderFactory.createEmptyBorder(border, border, border, border));
    startButton = new JButton("Start download");
    startButton.setEnabled(false);
    startButton.addActionListener(
        new ActionListener() {
          public void actionPerformed(ActionEvent event) {
            startButtonActionPerformed(event);
          }
        });
    startPanel.add(startButton);
    this.add(startPanel);

    // Download monitor panel
    monitorPanel = new JPanel();
    monitorPanel.setLayout(new BoxLayout(monitorPanel, BoxLayout.Y_AXIS));
    monitorPanel.setBorder(BorderFactory.createEmptyBorder(border, border, border, border));
    // this.add(monitorPanel);

    // Put the monitor panel in a scroll pane.
    JPanel dummyPanel = new JPanel(new BorderLayout());
    dummyPanel.add(monitorPanel, BorderLayout.NORTH);

    JScrollPane scrollPane = new JScrollPane(dummyPanel);
    scrollPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
    scrollPane.setPreferredSize(new Dimension(350, 200));
    this.add(scrollPane);
  }
Ejemplo n.º 23
0
 private void jbInit() throws Exception {
   ////////////////////////////////////////////////////////
   // Init LAF
   ////////////////////////////////////////////////////////
   ButtonGroup grpLAF = new ButtonGroup();
   ActionListener lsnLAF =
       new ActionListener() {
         public void actionPerformed(ActionEvent evt) {
           int iIndex = mvtLAFItem.indexOf(evt.getSource());
           if (iIndex >= 0) changeLAF(iIndex);
         }
       };
   ////////////////////////////////////////////////////////
   UIManager.LookAndFeelInfo laf =
       new UIManager.LookAndFeelInfo(
           "Kunststoff", "com.incors.plaf.kunststoff.KunststoffLookAndFeel");
   marrLaf = UIManager.getInstalledLookAndFeels();
   int iIndex = 0;
   while (iIndex < marrLaf.length && !marrLaf[iIndex].getName().equals(laf.getName())) iIndex++;
   if (iIndex >= marrLaf.length) {
     UIManager.installLookAndFeel(laf);
     marrLaf = UIManager.getInstalledLookAndFeels();
   }
   for (iIndex = 0; iIndex < marrLaf.length; iIndex++) {
     JMenuItem mnu = new JRadioButtonMenuItem(marrLaf[iIndex].getName());
     mnu.addActionListener(lsnLAF);
     mvtLAFItem.addElement(mnu);
     mnuUI.add(mnu);
     grpLAF.add(mnu);
   }
   mnuUI.addSeparator();
   ////////////////////////////////////////////////////////
   // Init language
   ////////////////////////////////////////////////////////
   ButtonGroup grpLanguage = new ButtonGroup();
   ActionListener lsnLanguage =
       new ActionListener() {
         public void actionPerformed(ActionEvent e) {
           int iIndex = mvtLanguageItem.indexOf(e.getSource());
           if (iIndex >= 0) changeDictionary((String) mvtLanguage.elementAt(iIndex));
         }
       };
   ////////////////////////////////////////////////////////
   String[] str = MonitorDictionary.getSupportedLanguage();
   for (iIndex = 0; iIndex < str.length; iIndex++) {
     JMenuItem mnu =
         new JRadioButtonMenuItem(MonitorDictionary.getDictionary(str[iIndex]).getLanguage());
     mnu.addActionListener(lsnLanguage);
     mvtLanguage.addElement(str[iIndex]);
     mvtLanguageItem.addElement(mnu);
     mnuUI.add(mnu);
     grpLanguage.add(mnu);
   }
   ////////////////////////////////////////////////////////
   // Add to main menu
   ////////////////////////////////////////////////////////
   mnuMain.removeAll();
   mnuMain.add(mnuSystem);
   mnuSystem.add(mnuSystem_Login);
   mnuSystem.add(mnuSystem_ChangePassword);
   mnuSystem.addSeparator();
   mnuSystem.add(mnuSystem_StopServer);
   mnuSystem.add(mnuSystem_EnableThreads);
   mnuMain.add(mnuUI);
   mnuMain.add(mnuHelp);
   mnuHelp.add(mnuHelp_About);
   ////////////////////////////////////////////////////////
   mnuMain.add(chkVietnamese);
   mnuMain.add(lblStatus);
   ////////////////////////////////////////////////////////
   pnlThread.setTabPlacement(JTabbedPane.LEFT);
   pnlThread.setTabLayoutPolicy(JTabbedPane.SCROLL_TAB_LAYOUT);
   ////////////////////////////////////////////////////////
   tblUser.addColumn("", 1, false);
   tblUser.addColumn("", 2, false, Global.FORMAT_DATE_TIME);
   tblUser.addColumn("", 3, false);
   ////////////////////////////////////////////////////////
   JPanel pnlMessage = new JPanel();
   pnlMessage.setLayout(new GridBagLayout());
   pnlMessage.add(
       new JScrollPane(txtBoard),
       new GridBagConstraints(
           0,
           0,
           2,
           1,
           1.0,
           1.0,
           GridBagConstraints.CENTER,
           GridBagConstraints.BOTH,
           new Insets(2, 2, 2, 2),
           0,
           0));
   pnlMessage.add(
       txtMessage,
       new GridBagConstraints(
           0,
           1,
           1,
           1,
           1.0,
           0.0,
           GridBagConstraints.CENTER,
           GridBagConstraints.BOTH,
           new Insets(2, 2, 2, 2),
           0,
           0));
   pnlMessage.add(
       btnSend,
       new GridBagConstraints(
           1,
           1,
           1,
           1,
           0.0,
           0.0,
           GridBagConstraints.CENTER,
           GridBagConstraints.NONE,
           new Insets(2, 2, 2, 2),
           0,
           0));
   txtBoard.setEditable(false);
   txtBoard.setAutoscrolls(true);
   txtBoard.setContentType("text/html");
   clearAll(txtBoard);
   ////////////////////////////////////////////////////////
   JPanel pnlUserButton = new JPanel(new GridLayout(1, 2, 4, 4));
   pnlUserButton.add(btnKick);
   pnlUserButton.add(btnRefresh);
   ////////////////////////////////////////////////////////
   JPanel pnlManager = new JPanel(new GridBagLayout());
   pnlManager.add(
       new JScrollPane(tblUser),
       new GridBagConstraints(
           0,
           0,
           1,
           1,
           1.0,
           1.0,
           GridBagConstraints.CENTER,
           GridBagConstraints.BOTH,
           new Insets(2, 2, 2, 2),
           0,
           0));
   pnlManager.add(
       pnlUserButton,
       new GridBagConstraints(
           0,
           1,
           1,
           1,
           0.0,
           0.0,
           GridBagConstraints.CENTER,
           GridBagConstraints.NONE,
           new Insets(4, 2, 4, 2),
           0,
           0));
   ////////////////////////////////////////////////////////
   pnlUser.setDividerLocation(320);
   pnlUser.setLeftComponent(pnlManager);
   pnlUser.setRightComponent(pnlMessage);
   pnlUser.setOneTouchExpandable(true);
   ////////////////////////////////////////////////////////
   setOrientation(JSplitPane.VERTICAL_SPLIT);
   setOneTouchExpandable(true);
   pnlThread.setVisible(false);
   pnlUser.setVisible(false);
   setTopComponent(pnlThread);
   setBottomComponent(pnlUser);
   ////////////////////////////////////////////////////////
   pmn.add(mnuSelectAll);
   pmn.addSeparator();
   pmn.add(mnuClearSelected);
   pmn.add(mnuClearAll);
   ////////////////////////////////////////////////////////
   setBorder(BorderFactory.createEmptyBorder());
   pnlUser.setBorder(BorderFactory.createEmptyBorder());
   pnlManager.setBorder(
       BorderFactory.createBevelBorder(
           javax.swing.border.BevelBorder.RAISED,
           Color.white,
           UIManager.getColor("Panel.background"),
           UIManager.getColor("Panel.background"),
           UIManager.getColor("Panel.background")));
   pnlMessage.setBorder(
       BorderFactory.createBevelBorder(
           javax.swing.border.BevelBorder.RAISED,
           Color.white,
           UIManager.getColor("Panel.background"),
           UIManager.getColor("Panel.background"),
           UIManager.getColor("Panel.background")));
   ////////////////////////////////////////////////////////
   Skin.applySkin(mnuMain);
   Skin.applySkin(tblUser);
   Skin.applySkin(pmn);
   Skin.applySkin(this);
   ////////////////////////////////////////////////////////
   // Default setting
   ////////////////////////////////////////////////////////
   Hashtable prt = null;
   try {
     prt = Global.loadHashtable(Global.FILE_CONFIG);
   } catch (Exception e) {
     prt = new Hashtable();
   }
   changeLAF(Integer.parseInt(StringUtil.nvl(prt.get("LAF"), "0")));
   changeDictionary(StringUtil.nvl(prt.get("Language"), "VN"));
   Skin.LANGUAGE_CHANGE_LISTENER = this;
   MonitorProcessor.setRootObject(this);
   updateKeyboardUI();
   ////////////////////////////////////////////////////////
   // Event handler
   ////////////////////////////////////////////////////////
   tblUser.addMouseListener(
       new MouseAdapter() {
         public void mouseClicked(MouseEvent e) {
           if (e.getClickCount() > 1) btnKick.doClick();
         }
       });
   ////////////////////////////////////////////////////////
   btnRefresh.addActionListener(
       new java.awt.event.ActionListener() {
         public void actionPerformed(ActionEvent evt) {
           try {
             DDTP request = new DDTP();
             request.setRequestID(String.valueOf(System.currentTimeMillis()));
             DDTP response = channel.sendRequest("ThreadProcessor", "queryUserList", request);
             if (response != null) {
               tblUser.setData((Vector) response.getReturn());
               if (mstrChannel != null) removeUser(mstrChannel);
             }
           } catch (Exception e) {
             e.printStackTrace();
             MessageBox.showMessageDialog(pnlThread, e, Global.APP_NAME, MessageBox.ERROR_MESSAGE);
           }
         }
       });
   ////////////////////////////////////////////////////////
   btnKick.addActionListener(
       new java.awt.event.ActionListener() {
         public void actionPerformed(ActionEvent evt) {
           int iSelected = tblUser.getSelectedRow();
           if (iSelected < 0) return;
           int iResult =
               MessageBox.showConfirmDialog(
                   pnlThread,
                   mdic.getString("ConfirmKick"),
                   Global.APP_NAME,
                   MessageBox.YES_NO_OPTION);
           if (iResult == MessageBox.NO_OPTION) return;
           try {
             String strChannel = (String) tblUser.getRow(iSelected).elementAt(0);
             DDTP request = new DDTP();
             request.setRequestID(String.valueOf(System.currentTimeMillis()));
             request.setString("strChannel", strChannel);
             DDTP response = channel.sendRequest("ThreadProcessor", "kickUser", request);
           } catch (Exception e) {
             e.printStackTrace();
             MessageBox.showMessageDialog(pnlThread, e, Global.APP_NAME, MessageBox.ERROR_MESSAGE);
           }
         }
       });
   ////////////////////////////////////////////////////////
   txtMessage.addActionListener(
       new java.awt.event.ActionListener() {
         public void actionPerformed(ActionEvent evt) {
           btnSend.doClick();
         }
       });
   ////////////////////////////////////////////////////////
   btnSend.addActionListener(
       new java.awt.event.ActionListener() {
         public void actionPerformed(ActionEvent evt) {
           if (txtMessage.getText().length() == 0) return;
           try {
             DDTP request = new DDTP();
             request.setString("strMessage", txtMessage.getText());
             channel.sendRequest("ThreadProcessor", "sendMessage", request);
             txtMessage.setText("");
           } catch (Exception e) {
             e.printStackTrace();
             MessageBox.showMessageDialog(pnlThread, e, Global.APP_NAME, MessageBox.ERROR_MESSAGE);
           }
         }
       });
   ////////////////////////////////////////////////////////
   mnuClearAll.addActionListener(
       new java.awt.event.ActionListener() {
         public void actionPerformed(ActionEvent e) {
           clearAll(txtBoard);
         }
       });
   ////////////////////////////////////////////////////////
   mnuClearSelected.addActionListener(
       new java.awt.event.ActionListener() {
         public void actionPerformed(ActionEvent e) {
           txtBoard.setEditable(true);
           txtBoard.replaceSelection("");
           txtBoard.setEditable(false);
         }
       });
   ////////////////////////////////////////////////////////
   mnuSelectAll.addActionListener(
       new java.awt.event.ActionListener() {
         public void actionPerformed(ActionEvent e) {
           txtBoard.requestFocus();
           txtBoard.selectAll();
         }
       });
   ////////////////////////////////////////////////////////
   txtBoard.addMouseListener(
       new MouseAdapter() {
         public void mouseClicked(MouseEvent e) {
           if (e.getButton() == e.BUTTON3) pmn.show(txtBoard, e.getX(), e.getY());
         }
       });
   ////////////////////////////////////////////////////////
   mnuSystem_Login.addActionListener(
       new ActionListener() {
         public void actionPerformed(ActionEvent e) {
           login();
         }
       });
   ////////////////////////////////////////////////////////
   mnuSystem_ChangePassword.addActionListener(
       new ActionListener() {
         public void actionPerformed(ActionEvent e) {
           changePassword();
         }
       });
   ////////////////////////////////////////////////////////
   mnuSystem_StopServer.addActionListener(
       new ActionListener() {
         public void actionPerformed(ActionEvent e) {
           stopServer();
         }
       });
   ////////////////////////////////////////////////////////
   mnuSystem_EnableThreads.addActionListener(
       new ActionListener() {
         public void actionPerformed(ActionEvent e) {
           manageThreads();
         }
       });
   ////////////////////////////////////////////////////////
   mnuHelp_About.addActionListener(
       new ActionListener() {
         public void actionPerformed(ActionEvent e) {
           WindowManager.centeredWindow(new DialogAbout(PanelThreadManager.this));
         }
       });
   ////////////////////////////////////////////////////////
   chkVietnamese.addActionListener(
       new java.awt.event.ActionListener() {
         public void actionPerformed(ActionEvent e) {
           switchKeyboard();
         }
       });
 }