Пример #1
0
  /**
   * Mouse Listener Methods Handle double click on the getMulticastGroupConfigTable
   *
   * @param e
   */
  public void mouseClicked(MouseEvent e) {
    if (e.getClickCount() == 2) {
      JTable target = (JTable) e.getSource();

      int row = target.getSelectedRow();

      if (e.getSource() != this.multicastConnectivityPanel.getMulticastGroupConfigTable()) {
        System.err.println("Non standard table");
        return;
      }

      if (row < 0) {
        return;
      }

      int modelIndex = target.convertRowIndexToModel(row);

      MulticastGroupConfigModel model = (MulticastGroupConfigModel) target.getModel();

      MulticastChannelPairInfo info = model.getMulticastChannelPairInfo(modelIndex);

      chooseConfiguration();

      this.dispose();
    }

    return;
  }
  public MulticastConnectivityConfigPanel(
      String environment,
      MulticastChannelContext context,
      ActionListener actionListener,
      MouseListener mouseListener) {
    setBorder(
        new TitledBorder(
            BorderFactory.createEmptyBorder(),
            "Multicast Connectivity Config",
            TitledBorder.LEADING,
            TitledBorder.TOP,
            MDFUtil.fontArialBold12));
    setFont(MDFUtil.fontArialPlain12);
    setLayout(new BorderLayout());

    /**
     * Panel containing the TCP connectivity for the selected environment Table containing the
     * multicast groups for the selected environment
     */
    add(createConnectionConfigPanel(environment), BorderLayout.NORTH);

    multicastGroupConfigModel = new MulticastGroupConfigModel(environment, context);
    multicastGroupConfigTable =
        new MulticastGroupConfigTable(multicastGroupConfigModel, mouseListener);

    multicastGroupConfigTable.autoSelectFirstRow();

    //        JScrollPane scrollPane=new JScrollPane(multicastGroupConfigTable);
    //        scrollPane.getHorizontalScrollBar().setEnabled(true);

    add(multicastGroupConfigTable, BorderLayout.CENTER);

    /** Panel containing the available market types that match the selected multicast group */
    interestedMarketTypesPanel =
        new InterestedMarketTypesPanel(actionListener, multicastGroupConfigTable);

    if (!multicastGroupConfigModel
        .getMulticastChannelPairInfo(0)
        .getGroupName()
        .contains(MDFClientConfigurator.MULTICAST_GROUP_NAME_OPTIONS_KEY_WORD)) {
      interestedMarketTypesPanel.disableUDSCheckbox();
    }

    JScrollPane marketTypesScrollPane = new JScrollPane(interestedMarketTypesPanel);

    add(marketTypesScrollPane, BorderLayout.SOUTH);
  }