Пример #1
0
  @Override
  public Component getTableCellRendererComponent(
      JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    textLabel.setFont(table.getFont());
    textLabel.setText(Objects.toString(value, ""));
    textLabel.setBorder(hasFocus ? focusCellHighlightBorder : noFocusBorder);

    FontMetrics fm = table.getFontMetrics(table.getFont());
    Insets i = textLabel.getInsets();
    int swidth =
        iconLabel.getPreferredSize().width + fm.stringWidth(textLabel.getText()) + i.left + i.right;
    int cwidth = table.getColumnModel().getColumn(column).getWidth();
    dim.width = swidth > cwidth ? cwidth : swidth;

    if (isSelected) {
      textLabel.setOpaque(true);
      textLabel.setForeground(table.getSelectionForeground());
      textLabel.setBackground(table.getSelectionBackground());
      iconLabel.setIcon(sicon);
    } else {
      textLabel.setOpaque(false);
      textLabel.setForeground(table.getForeground());
      textLabel.setBackground(table.getBackground());
      iconLabel.setIcon(nicon);
    }
    return panel;
  }
 // Initializes this component
 private void jbInit() {
   partNameLbl.setFont(Utilities.bigLabelsFont);
   partNameLbl.setHorizontalAlignment(SwingConstants.CENTER);
   partNameLbl.setText("keyboard");
   partNameLbl.setForeground(Color.black);
   partNameLbl.setBounds(new Rectangle(62, 10, 102, 21));
   this.add(partNameLbl, null);
 }
Пример #3
0
 public Component getTableCellRendererComponent(
     JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
   JLabel l =
       (JLabel)
           super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
   if (hasFocus && table.isCellEditable(row, column)) return l;
   l.setText(((String) value).replace('!', Universe.curProfile.getEmptyString().charAt(0)));
   return l;
 }
  private void backBind() {
    status.setText(viewModel.getStatus());
    compute.setEnabled(viewModel.isButtonEnabled());

    monthlyPayment.setText(viewModel.getMonthlyPayment());
    overpaymentWithFees.setText(viewModel.getOverpaymentWithFees());
    overpayment.setText(viewModel.getOverpayment());

    DefaultTableModel model = viewModel.getGraphicOfPayments();
    graphicOfPayments.setModel(model);
    graphicOfPayments.setPreferredSize(
        new Dimension(
            graphicOfPayments.getWidth(), graphicOfPayments.getRowHeight() * model.getRowCount()));

    List<String> log = viewModel.getLog();
    String[] items = log.toArray(new String[log.size()]);
    logList.setListData(items);
  }
Пример #5
0
  public static void refreshCalendar(int month, int year) {
    // instantiation
    String[] months = {
      "January",
      "February",
      "March",
      "April",
      "May",
      "June",
      "July",
      "August",
      "September",
      "October",
      "November",
      "December"
    };
    int numoday, startom; // Number Of Days, Start Of Month

    // Allow/disallow buttons
    prev.setEnabled(true);
    next.setEnabled(true);
    if (month == 0 && year <= ryear) {
      prev.setEnabled(false);
    } // Cannot set an appointment back in time
    if (month == 11 && year >= ryear + 50) {
      next.setEnabled(false);
    } // Too early to set an appointment
    lmonth.setText(months[month]); // Refresh the month label (at the top)
    lmonth.setBounds(
        160 - lmonth.getPreferredSize().width / 2, 25, 180, 25); // Re-align label with calendar
    cyear.setSelectedItem(String.valueOf(year)); // Select the correct year in the combo box

    // deletes current table
    for (int i = 0; i < 6; i++) {
      for (int j = 0; j < 7; j++) {
        mcal.setValueAt(null, i, j);
      }
    }

    // Get first day of month and number of days
    GregorianCalendar cal = new GregorianCalendar(year, month, 1);
    numoday = cal.getActualMaximum(GregorianCalendar.DAY_OF_MONTH);
    startom = cal.get(GregorianCalendar.DAY_OF_WEEK);

    // Create calendar
    for (int i = 1; i <= numoday; i++) {
      int row = new Integer((i + startom - 2) / 7);
      int column = (i + startom - 2) % 7;
      mcal.setValueAt(i, row, column);
    }

    // Apply renderers
    Cal.setDefaultRenderer(Cal.getColumnClass(0), new tblCalendarRenderer());
  }
Пример #6
0
 @Override
 public void mouseClicked(MouseEvent e) {
   // TODO Auto-generated method stub
   if (e.getSource() == table) {
     if (e.getClickCount() == 2) // 더블클릭
     {
       int row = table.getSelectedRow();
       String no = model.getValueAt(row, 0).toString();
       bp.setPoster(Integer.parseInt(no));
       bp.repaint();
       Book book = bm.bookDetail(Integer.parseInt(no));
       la1.setText("번호:" + no);
       la2.setText("제목:" + book.getTitle());
       la3.setText("저자:" + book.getAuthor());
       la4.setText("출판사:" + book.getPublisher());
       la5.setText("가격:" + book.getPrice());
     }
   } else if (e.getSource() == b) {
     getData();
   }
 }
Пример #7
0
  // Initializing this component.
  private void jbInit() {
    callStackTable.addFocusListener(
        new FocusListener() {
          public void focusGained(FocusEvent e) {
            callStackTable_focusGained(e);
          }

          public void focusLost(FocusEvent e) {
            callStackTable_focusLost(e);
          }
        });
    callStackTable.setTableHeader(null);
    callStackTable.setDefaultRenderer(callStackTable.getColumnClass(0), getCellRenderer());
    scrollPane = new JScrollPane(callStackTable);
    setVisibleRows(DEFAULT_VISIBLE_ROWS);
    scrollPane.setLocation(0, 27);
    setBorder(BorderFactory.createEtchedBorder());
    // this.setLayout(null);
    this.setLayout(new GridBagLayout());
    nameLbl.setText("Call Stack");
    nameLbl.setBounds(new Rectangle(3, 4, 70, 23));
    nameLbl.setFont(Utilities.labelsFont);

    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.BOTH;
    c.ipadx = 0;
    c.ipady = 0;
    c.weightx = 1;
    c.weighty = 1;
    c.gridwidth = 7;
    c.gridheight = 1;
    c.anchor = GridBagConstraints.PAGE_END;
    c.gridx = 0;
    c.gridy = 2;
    this.add(scrollPane, c);

    c.fill = GridBagConstraints.HORIZONTAL;
    c.ipadx = 0;
    c.ipady = 0;
    c.weightx = 1;
    c.weighty = 0.0;
    c.gridwidth = 3;
    c.gridheight = 1;
    c.anchor = GridBagConstraints.FIRST_LINE_START;
    c.gridx = 0;
    c.gridy = 0;
    c.insets = new Insets(5, 0, 0, 0);
    this.add(nameLbl, c);
  }
Пример #8
0
 @Override
 public Component getListCellRendererComponent(
     JList<?> list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
   JLabel label =
       (JLabel)
           (super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus));
   if (value instanceof TypeColorEntry) {
     TypeColorEntry entry = (TypeColorEntry) value;
     Token.Type type = entry.getType();
     Color color = entry.getColor();
     label.setText(Utilities.normalize(type.toString()));
     if ((type == Token.Type.MATCHED_BRACKET) || (type == Token.Type.UNMATCHED_BRACKET)) {
       label.setBackground(color);
       label.setForeground(Color.BLACK);
     } else {
       label.setForeground(color);
     }
   }
   return label;
 }
 /** Listener to handle table selection changes */
 public void valueChanged(ListSelectionEvent e) {
   int row = table.getSelectedRow();
   // Check if they selected a specific row
   if (row > 0) {
     remove_button.setEnabled(true);
   } else {
     remove_button.setEnabled(false);
   }
   // Check for "most recent" selection
   if (row == 0) {
     row = model.getRowCount() - 1;
     if (row == 0) {
       row = -1;
     }
   }
   if (row == -1) {
     // Clear the details panel
     details_time_value.setText("");
     details_target_value.setText("");
     details_status_value.setText("");
     request_text.setText("");
     response_text.setText("");
   } else {
     // Show the details for the row
     SOAPMonitorData soap = model.getData(row);
     details_time_value.setText(soap.getTime());
     details_target_value.setText(soap.getTargetService());
     details_status_value.setText(soap.getStatus());
     if (soap.getSOAPRequest() == null) {
       request_text.setText("");
     } else {
       request_text.setText(soap.getSOAPRequest());
       request_text.setCaretPosition(0);
     }
     if (soap.getSOAPResponse() == null) {
       response_text.setText("");
     } else {
       response_text.setText(soap.getSOAPResponse());
       response_text.setCaretPosition(0);
     }
   }
 }
 /** Set the status text to an error */
 public void setErrorStatus(String txt) {
   status_text.setForeground(Color.red);
   status_text.setText("  " + txt);
 }
 /** Set the status text */
 public void setStatus(String txt) {
   status_text.setForeground(Color.black);
   status_text.setText("  " + txt);
 }
Пример #12
0
 @SuppressWarnings("serial")
 private void initGUI() {
   try {
     setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
     getContentPane().setLayout(null);
     this.setTitle("Overzicht");
     this.setVisible(true);
     {
       lStart = new JLabel();
       getContentPane().add(lStart);
       lStart.setText("Overzicht");
       lStart.setHorizontalAlignment(SwingConstants.CENTER);
       lStart.setBackground(new java.awt.Color(54, 190, 54));
       lStart.setFont(new java.awt.Font("Arial", 1, 36));
       lStart.setForeground(new java.awt.Color(0, 128, 64));
       lStart.setOpaque(true);
       lStart.setBounds(0, 0, 336, 49);
     }
     {
       pInzet = new JPanel();
       getContentPane().add(pInzet);
       pInzet.setBorder(
           BorderFactory.createTitledBorder(
               null,
               "Selectie",
               TitledBorder.LEADING,
               TitledBorder.DEFAULT_POSITION,
               new java.awt.Font("Tahoma", 1, 11)));
       pInzet.setLayout(null);
       pInzet.setBounds(14, 63, 308, 105);
       pInzet.setFont(new java.awt.Font("Tahoma", 1, 12));
       {
         lMin = new JLabel();
         pInzet.add(lMin);
         lMin.setText("Speler");
         lMin.setFont(new java.awt.Font("Arial", 0, 12));
         lMin.setBounds(17, 59, 62, 27);
       }
       {
         lMax = new JLabel();
         pInzet.add(lMax);
         lMax.setText("Spelronde");
         lMax.setFont(new java.awt.Font("Arial", 0, 12));
         lMax.setBounds(17, 26, 62, 25);
       }
       // Combo voor Spelrondes. Deze wordt eerst geladen. Na selectie
       // wordt de speler gevuld.
       {
         oc = new OverzichtController(this);
         String[] rondes = oc.GeefSpelrondes();
         ComboBoxModel cbSpelRondeModel = new DefaultComboBoxModel(rondes);
         cbSpelRonde = new JComboBox();
         pInzet.add(cbSpelRonde);
         cbSpelRonde.setModel(cbSpelRondeModel);
         cbSpelRonde.setBounds(91, 29, 156, 21);
         cbSpelRonde.setToolTipText("Maak een keuze uit de gespeelde speelronden.");
       }
       {
         bStart = new JButton();
         getContentPane().add(bStart);
         bStart.setText("Sluiten");
         bStart.setFont(new java.awt.Font("Arial", 0, 12));
         bStart.setBounds(196, 303, 75, 23);
         bStart.addActionListener(
             new ActionListener() {
               public void actionPerformed(ActionEvent evt) {
                 bStartActionPerformed(evt);
               }
             });
       }
     }
     pack();
     this.setSize(352, 364);
   } catch (Exception e) {
     e.printStackTrace();
   }
 } // private void initGUI()
Пример #13
0
    /**
     * Edit row
     *
     * @param paramInfo param info
     * @param removeOnCancel Should remove param info if user presses cancel_
     * @return ok
     */
    public boolean editRow(ParamInfo paramInfo, boolean removeOnCancel) {

      List comps = new ArrayList();
      ParamField nameFld = new ParamField(null, true);
      nameFld.setText(paramInfo.getName());
      JPanel topPanel = GuiUtils.hbox(GuiUtils.lLabel("Parameter:  "), nameFld);
      topPanel = GuiUtils.inset(topPanel, 5);

      comps.add(GuiUtils.inset(new JLabel("Defined"), new Insets(5, 0, 0, 0)));
      comps.add(GuiUtils.filler());
      comps.add(GuiUtils.filler());

      final JLabel ctPreviewLbl = new JLabel("");
      final JLabel ctLbl = new JLabel("");
      if (paramInfo.hasColorTableName()) {
        ctLbl.setText(paramInfo.getColorTableName());
        ColorTable ct =
            getIdv().getColorTableManager().getColorTable(paramInfo.getColorTableName());
        if (ct != null) {
          ctPreviewLbl.setIcon(ColorTableCanvas.getIcon(ct));
        } else {
          ctPreviewLbl.setIcon(null);
        }
      }
      String cbxLabel = "";
      final ArrayList menus = new ArrayList();
      getIdv()
          .getColorTableManager()
          .makeColorTableMenu(
              new ObjectListener(null) {
                public void actionPerformed(ActionEvent ae, Object data) {
                  ctLbl.setText(data.toString());
                  ColorTable ct = getIdv().getColorTableManager().getColorTable(ctLbl.getText());
                  if (ct != null) {
                    ctPreviewLbl.setIcon(ColorTableCanvas.getIcon(ct));
                  } else {
                    ctPreviewLbl.setIcon(null);
                  }
                }
              },
              menus);

      JCheckBox ctUseCbx = new JCheckBox(cbxLabel, paramInfo.hasColorTableName());
      final JButton ctPopup = new JButton("Change");
      ctPopup.addActionListener(
          new ActionListener() {
            public void actionPerformed(ActionEvent ae) {
              GuiUtils.showPopupMenu(menus, ctPopup);
            }
          });
      addEditComponents(
          comps,
          "Color Table:",
          ctUseCbx,
          GuiUtils.hbox(ctPopup, GuiUtils.vbox(ctLbl, ctPreviewLbl), 5));

      JCheckBox rangeUseCbx = new JCheckBox(cbxLabel, paramInfo.hasRange());
      JTextField minFld = new JTextField("" + paramInfo.getMin(), 4);
      JTextField maxFld = new JTextField("" + paramInfo.getMax(), 4);
      JPanel rangePanel = GuiUtils.hbox(minFld, maxFld, 5);
      addEditComponents(comps, "Range:", rangeUseCbx, rangePanel);

      JCheckBox unitUseCbx = new JCheckBox(cbxLabel, paramInfo.hasDisplayUnit());
      String unitLabel = "";
      Unit unit = null;
      if (paramInfo.hasDisplayUnit()) {
        unit = paramInfo.getDisplayUnit();
      }

      JComboBox unitFld = getIdv().getDisplayConventions().makeUnitBox(unit, null);
      //            JTextField unitFld = new JTextField(unitLabel, 15);
      addEditComponents(comps, "Unit:", unitUseCbx, unitFld);

      ContourInfo ci = paramInfo.getContourInfo();
      JCheckBox contourUseCbx = new JCheckBox(cbxLabel, ci != null);
      if (ci == null) {
        ci = new ContourInfo();
      }
      ContourInfoDialog contDialog =
          new ContourInfoDialog("Edit Contour Defaults", false, null, false);
      contDialog.setState(ci);
      addEditComponents(comps, "Contour:", contourUseCbx, contDialog.getContents());

      GuiUtils.tmpInsets = new Insets(5, 5, 5, 5);
      JComponent contents = GuiUtils.doLayout(comps, 3, GuiUtils.WT_NNY, GuiUtils.WT_N);

      contents = GuiUtils.topCenter(topPanel, contents);
      contents = GuiUtils.inset(contents, 5);
      while (true) {
        if (!GuiUtils.showOkCancelDialog(null, "Parameter Defaults", contents, null)) {
          if (removeOnCancel) {
            myParamInfos.remove(paramInfo);
            tableChanged();
          }
          return false;
        }
        String what = "";
        try {
          if (contourUseCbx.isSelected()) {
            what = "setting contour defaults";
            contDialog.doApply();
            ci.set(contDialog.getInfo());
            paramInfo.setContourInfo(ci);
          } else {
            paramInfo.clearContourInfo();
          }
          if (unitUseCbx.isSelected()) {
            what = "setting display unit";
            Object selected = unitFld.getSelectedItem();
            String unitName = TwoFacedObject.getIdString(selected);
            if ((unitName == null) || unitName.trim().equals("")) {
              paramInfo.setDisplayUnit(null);
            } else {
              paramInfo.setDisplayUnit(ucar.visad.Util.parseUnit(unitName));
            }
          } else {
            paramInfo.setDisplayUnit(null);
          }

          if (ctUseCbx.isSelected()) {
            paramInfo.setColorTableName(ctLbl.getText());
          } else {
            paramInfo.clearColorTableName();
          }

          if (rangeUseCbx.isSelected()) {
            what = "setting range";
            paramInfo.setRange(
                new Range(Misc.parseNumber(minFld.getText()), Misc.parseNumber(maxFld.getText())));
          } else {
            paramInfo.clearRange();
          }

          paramInfo.setName(nameFld.getText().trim());
          break;
        } catch (Exception exc) {
          errorMsg("An error occurred " + what + "\n " + exc.getMessage());
          //              exc.printStackTrace();
        }
      }
      repaint();
      saveData();
      return true;
    }
Пример #14
0
  /** the JbInit method */
  public void jbInit() throws Exception {
    // Layout definition for this panel
    dataPanel.setLayout(panelLayout);
    dataPanel.setMinimumSize(new Dimension(100, 100));
    this.setLayout(borderLayout);
    this.setSize(new Dimension(862, 514));
    this.setPreferredSize(new Dimension(479, 306));
    this.setMinimumSize(new Dimension(479, 306));
    this.setMaximumSize(new Dimension(479, 306));
    mIdtraslo.setDocument((Document) panelBinding.bindUIControl("Idtraslo", mIdtraslo));
    mIdtraslo.setEditable(false);
    mDescrip.setFocusable(false);
    mDescrip.setEditable(false);
    mEstadotraslotxt.setFocusable(false);
    mEstadopasillotxt.setFocusable(false);
    mEstadoprocesotraslotxt.setFocusable(false);
    mDescripvisualEntrada.setFocusable(false);
    mDescripvisualSalida.setFocusable(false);
    mPasilloactual.setFocusable(false);
    mPasillodestino.setFocusable(true);
    mPosplc.setFocusable(false);
    jCheckBoxTrasbordoEntrada.setText("Trasbord Entradas");
    jCheckBoxTrasbordoEntrada.setToolTipText(
        "Realitzar trasbord per ubicar containers en entrada de passadis");
    dataPanel.add(
        labelIdtraslo,
        new GridBagConstraints(
            0,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 5),
            1,
            1));
    dataPanel.add(
        mIdtraslo,
        new GridBagConstraints(
            1,
            0,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 5),
            1,
            1));
    labelIdtraslo.setLabelFor(mIdtraslo);
    mIdtraslo.setColumns(5);
    labelIdtraslo.setText(panelBinding.findCtrlValueBinding("Idtraslo").getLabel());
    mIdtraslo.setToolTipText(panelBinding.findCtrlValueBinding("Idtraslo").getTooltip());
    mDescrip.setDocument((Document) panelBinding.bindUIControl("Descrip", mDescrip));
    dataPanel.add(
        labelDescrip,
        new GridBagConstraints(
            0,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 5),
            1,
            1));
    dataPanel.add(
        mDescrip,
        new GridBagConstraints(
            1,
            1,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 5),
            1,
            1));
    labelDescrip.setLabelFor(mDescrip);
    mDescrip.setColumns(15);
    labelDescrip.setText(panelBinding.findCtrlValueBinding("Descrip").getLabel());
    mDescrip.setToolTipText(panelBinding.findCtrlValueBinding("Descrip").getTooltip());
    mEstadotraslotxt.setDocument(
        (Document) panelBinding.bindUIControl("Estadotraslotxt", mEstadotraslotxt));
    dataPanel.add(
        labelEstadotraslotxt,
        new GridBagConstraints(
            0,
            2,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 5),
            1,
            1));
    dataPanel.add(
        mEstadotraslotxt,
        new GridBagConstraints(
            1,
            2,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 5),
            1,
            1));
    labelEstadotraslotxt.setLabelFor(mEstadotraslotxt);
    mEstadotraslotxt.setColumns(20);
    labelEstadotraslotxt.setText(panelBinding.findCtrlValueBinding("Estadotraslotxt").getLabel());
    mEstadotraslotxt.setToolTipText(
        panelBinding.findCtrlValueBinding("Estadotraslotxt").getTooltip());
    mEstadopasillotxt.setDocument(
        (Document) panelBinding.bindUIControl("Estadopasillotxt", mEstadopasillotxt));
    dataPanel.add(
        labelEstadopasillotxt,
        new GridBagConstraints(
            0,
            3,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 5),
            1,
            1));
    dataPanel.add(
        mEstadopasillotxt,
        new GridBagConstraints(
            1,
            3,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 5),
            1,
            1));
    labelEstadopasillotxt.setLabelFor(mEstadopasillotxt);
    mEstadopasillotxt.setColumns(20);
    labelEstadopasillotxt.setText(panelBinding.findCtrlValueBinding("Estadopasillotxt").getLabel());
    mEstadopasillotxt.setToolTipText(
        panelBinding.findCtrlValueBinding("Estadopasillotxt").getTooltip());
    mEstadoprocesotraslotxt.setDocument(
        (Document) panelBinding.bindUIControl("Estadoprocesotraslotxt", mEstadoprocesotraslotxt));
    dataPanel.add(
        labelEstadoprocesotraslotxt,
        new GridBagConstraints(
            0,
            4,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 5),
            1,
            1));
    dataPanel.add(
        mEstadoprocesotraslotxt,
        new GridBagConstraints(
            1,
            4,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 5),
            1,
            1));
    labelEstadoprocesotraslotxt.setLabelFor(mEstadoprocesotraslotxt);
    mEstadoprocesotraslotxt.setColumns(20);
    labelEstadoprocesotraslotxt.setText(
        panelBinding.findCtrlValueBinding("Estadoprocesotraslotxt").getLabel());
    mEstadoprocesotraslotxt.setToolTipText(
        panelBinding.findCtrlValueBinding("Estadoprocesotraslotxt").getTooltip());
    mDescripvisualEntrada.setDocument(
        (Document) panelBinding.bindUIControl("DescripvisualEntrada", mDescripvisualEntrada));
    dataPanel.add(
        labelDescripvisualEntrada,
        new GridBagConstraints(
            0,
            5,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 5),
            1,
            1));
    dataPanel.add(
        mDescripvisualEntrada,
        new GridBagConstraints(
            1,
            5,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 5),
            1,
            1));
    labelDescripvisualEntrada.setLabelFor(mDescripvisualEntrada);
    mDescripvisualEntrada.setColumns(20);
    labelDescripvisualEntrada.setText(
        panelBinding.findCtrlValueBinding("DescripvisualEntrada").getLabel());
    mDescripvisualEntrada.setToolTipText(
        panelBinding.findCtrlValueBinding("DescripvisualEntrada").getTooltip());
    mDescripvisualSalida.setDocument(
        (Document) panelBinding.bindUIControl("DescripvisualSalida", mDescripvisualSalida));
    dataPanel.add(
        labelDescripvisualSalida,
        new GridBagConstraints(
            0,
            6,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 5),
            1,
            1));
    dataPanel.add(
        mDescripvisualSalida,
        new GridBagConstraints(
            1,
            6,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 5),
            1,
            1));
    labelDescripvisualSalida.setLabelFor(mDescripvisualSalida);
    mDescripvisualSalida.setColumns(20);
    labelDescripvisualSalida.setText(
        panelBinding.findCtrlValueBinding("DescripvisualSalida").getLabel());
    mDescripvisualSalida.setToolTipText(
        panelBinding.findCtrlValueBinding("DescripvisualSalida").getTooltip());
    mPasilloactual.setDocument(
        (Document) panelBinding.bindUIControl("Pasilloactual", mPasilloactual));
    dataPanel.add(
        labelPasilloactual,
        new GridBagConstraints(
            0,
            7,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 5),
            1,
            1));
    dataPanel.add(
        mPasilloactual,
        new GridBagConstraints(
            1,
            7,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 5),
            1,
            1));
    labelPasilloactual.setLabelFor(mPasilloactual);
    mPasilloactual.setColumns(3);
    labelPasilloactual.setText(panelBinding.findCtrlValueBinding("Pasilloactual").getLabel());
    mPasilloactual.setToolTipText(panelBinding.findCtrlValueBinding("Pasilloactual").getTooltip());
    mPasillodestino.setDocument(
        (Document) panelBinding.bindUIControl("Pasillodestino", mPasillodestino));
    dataPanel.add(
        labelPasillodestino,
        new GridBagConstraints(
            0,
            8,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 5),
            1,
            1));
    dataPanel.add(
        mPasillodestino,
        new GridBagConstraints(
            1,
            8,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 5),
            1,
            1));
    labelPasillodestino.setLabelFor(mPasillodestino);
    mPasillodestino.setColumns(3);
    labelPasillodestino.setText(panelBinding.findCtrlValueBinding("Pasillodestino").getLabel());
    mPasillodestino.setToolTipText(
        panelBinding.findCtrlValueBinding("Pasillodestino").getTooltip());
    mPosplc.setDocument((Document) panelBinding.bindUIControl("Posplc", mPosplc));
    dataPanel.add(
        labelPosplc,
        new GridBagConstraints(
            0,
            9,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 5),
            1,
            1));
    dataPanel.add(
        mPosplc,
        new GridBagConstraints(
            1,
            9,
            1,
            1,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 0, 5),
            1,
            1));
    // dataPanel.add(buttonArrancar, new GridBagConstraints(0, 10, 3, 2, 0.0, 0.0,
    // GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 0, 22, 63), -98, -13));
    dataPanel.add(
        buttonArrancar,
        new GridBagConstraints(
            0,
            10,
            3,
            2,
            0.0,
            0.0,
            GridBagConstraints.WEST,
            GridBagConstraints.NONE,
            new Insets(0, 0, 5, 5),
            0,
            0));
    // dataPanel.add(jCheckBoxTrasbordoEntrada, new GridBagConstraints(2, 8, 1, 1, 0.0, 0.0,
    // GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
    labelPosplc.setLabelFor(mPosplc);
    mPosplc.setColumns(5);
    labelPosplc.setText(panelBinding.findCtrlValueBinding("Posplc").getLabel());

    // Layout the datapanel and the navigation bar
    mPosplc.setToolTipText(panelBinding.findCtrlValueBinding("Posplc").getTooltip());
    add(dataPanel, BorderLayout.CENTER);

    navBar.setModel(
        JUNavigationBar.createViewBinding(
            panelBinding, navBar, "SgavtrasloEntSalView1", null, "SgavtrasloEntSal1Iter"));
    statusBar.setModel(JUStatusBar.createPanelBinding(panelBinding, statusBar));
    add(navBar, BorderLayout.NORTH);
    add(statusBar, BorderLayout.SOUTH);

    // Quitar botones de add / remove
    navBar.remove(navBar.getButton(JUNavigationBar.BUTTON_DELETE));
    navBar.remove(navBar.getButton(JUNavigationBar.BUTTON_INSERT));
    jCheckBoxTrasbordoEntrada.setModel(
        (ButtonModel) panelBinding.bindUIControl("Trasbordoentrada", jCheckBoxTrasbordoEntrada));
    if (getIdTraslo() == 0) jCheckBoxTrasbordoEntrada.setEnabled(false);
  }
Пример #15
0
 /**
  * Set the Name property.
  *
  * @param value The new value for Name
  */
 public void setName(String value) {
   name = value;
   if (displayLabel != null) {
     displayLabel.setText(value);
   }
 }
Пример #16
0
  // Initialize Components and set the layout of the dialog
  private void initComponents() {
    emailLabel = new JLabel();
    smtpLabel = new JLabel();
    smtpUserLabel = new JLabel();
    smtpPassword = new JPasswordField();
    smtp = new JTextField();
    smtpPort = new JTextField();
    smtpPsswdLabel = new JLabel();
    smtpUsername = new JTextField();
    jScrollPane1 = new JScrollPane();
    studentsTbl = new JXTable();
    ok = new JButton();
    cancel = new JButton();
    smtpPortLabel = new JLabel();
    email = new JTextField();

    setTitle("Send Email");
    setMinimumSize(new Dimension(100, 100));
    setResizable(false);

    emailLabel.setText("Source Email Address:");

    smtpLabel.setText("SMTP Server:");

    smtpUserLabel.setText("SMTP Username:"******"SMTP Password:"******"Send Email");
    ok.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            okActionPerformed(evt);
          }
        });

    cancel.setText("Cancel");
    cancel.addActionListener(
        new java.awt.event.ActionListener() {
          public void actionPerformed(java.awt.event.ActionEvent evt) {
            cancelActionPerformed(evt);
          }
        });

    smtpPortLabel.setText("SMTP Port:");

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addGroup(
                                layout
                                    .createSequentialGroup()
                                    .addComponent(ok)
                                    .addGap(18, 18, 18)
                                    .addComponent(cancel))
                            .addGroup(
                                layout
                                    .createParallelGroup(
                                        javax.swing.GroupLayout.Alignment.TRAILING, false)
                                    .addComponent(
                                        jScrollPane1,
                                        javax.swing.GroupLayout.Alignment.LEADING,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        0,
                                        Short.MAX_VALUE)
                                    .addGroup(
                                        javax.swing.GroupLayout.Alignment.LEADING,
                                        layout
                                            .createSequentialGroup()
                                            .addGroup(
                                                layout
                                                    .createParallelGroup(
                                                        javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addComponent(smtpLabel)
                                                    .addComponent(smtpPortLabel))
                                            .addPreferredGap(
                                                javax.swing.LayoutStyle.ComponentPlacement
                                                    .UNRELATED)
                                            .addGroup(
                                                layout
                                                    .createParallelGroup(
                                                        javax.swing.GroupLayout.Alignment.LEADING)
                                                    .addGroup(
                                                        layout
                                                            .createSequentialGroup()
                                                            .addGroup(
                                                                layout
                                                                    .createParallelGroup(
                                                                        javax.swing.GroupLayout
                                                                            .Alignment.LEADING)
                                                                    .addGroup(
                                                                        layout
                                                                            .createSequentialGroup()
                                                                            .addComponent(
                                                                                smtp,
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .PREFERRED_SIZE,
                                                                                90,
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .PREFERRED_SIZE)
                                                                            .addGap(18, 18, 18)
                                                                            .addComponent(
                                                                                smtpUserLabel))
                                                                    .addGroup(
                                                                        layout
                                                                            .createSequentialGroup()
                                                                            .addComponent(
                                                                                smtpPort,
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .PREFERRED_SIZE,
                                                                                90,
                                                                                javax.swing
                                                                                    .GroupLayout
                                                                                    .PREFERRED_SIZE)
                                                                            .addGap(18, 18, 18)
                                                                            .addComponent(
                                                                                smtpPsswdLabel)))
                                                            .addGap(18, 18, 18)
                                                            .addGroup(
                                                                layout
                                                                    .createParallelGroup(
                                                                        javax.swing.GroupLayout
                                                                            .Alignment.LEADING)
                                                                    .addComponent(
                                                                        smtpPassword,
                                                                        javax.swing.GroupLayout
                                                                            .PREFERRED_SIZE,
                                                                        90,
                                                                        javax.swing.GroupLayout
                                                                            .PREFERRED_SIZE)
                                                                    .addComponent(
                                                                        smtpUsername,
                                                                        javax.swing.GroupLayout
                                                                            .PREFERRED_SIZE,
                                                                        90,
                                                                        javax.swing.GroupLayout
                                                                            .PREFERRED_SIZE)))
                                                    .addGroup(
                                                        layout
                                                            .createSequentialGroup()
                                                            .addComponent(emailLabel)
                                                            .addPreferredGap(
                                                                javax.swing.LayoutStyle
                                                                    .ComponentPlacement.RELATED)
                                                            .addComponent(
                                                                email,
                                                                javax.swing.GroupLayout
                                                                    .PREFERRED_SIZE,
                                                                121,
                                                                javax.swing.GroupLayout
                                                                    .PREFERRED_SIZE))))))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));
    layout.setVerticalGroup(
        layout
            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(
                layout
                    .createSequentialGroup()
                    .addContainerGap()
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(
                                emailLabel,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                22,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(
                                email,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(smtpLabel)
                            .addComponent(
                                smtp,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(smtpUserLabel)
                            .addComponent(
                                smtpUsername,
                                javax.swing.GroupLayout.PREFERRED_SIZE,
                                javax.swing.GroupLayout.DEFAULT_SIZE,
                                javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(smtpPortLabel)
                            .addGroup(
                                layout
                                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                    .addComponent(
                                        smtpPort,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(
                                        smtpPassword,
                                        javax.swing.GroupLayout.PREFERRED_SIZE,
                                        javax.swing.GroupLayout.DEFAULT_SIZE,
                                        javax.swing.GroupLayout.PREFERRED_SIZE)
                                    .addComponent(smtpPsswdLabel)))
                    .addGap(18, 18, 18)
                    .addComponent(
                        jScrollPane1,
                        javax.swing.GroupLayout.PREFERRED_SIZE,
                        131,
                        javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGap(18, 18, 18)
                    .addGroup(
                        layout
                            .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(cancel)
                            .addComponent(ok))
                    .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)));

    pack();
    setLocationRelativeTo(null);
  }
 /** Sets the name of this MemorySegmentComponent. */
 public void setSegmentName(String name) {
   nameLbl.setText(name);
 }
 /** Sets the name of the part with the given name. */
 public void setPartName(String partName) {
   partNameLbl.setText(partName);
 }
Пример #19
0
  private void initComponents() {
    setLayout(new BorderLayout());
    final JPanel mainPanel = new TransparentPanel();
    add(mainPanel, BorderLayout.NORTH);

    mainPanel.setLayout(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    c.gridx = 0;
    c.gridy = 0;
    c.weightx = 1;
    c.anchor = GridBagConstraints.LINE_START;
    c.fill = GridBagConstraints.HORIZONTAL;

    // general encryption option
    enableDefaultEncryption =
        new SIPCommCheckBox(
            UtilActivator.getResources()
                .getI18NString("plugin.sipaccregwizz.ENABLE_DEFAULT_ENCRYPTION"),
            regform.isDefaultEncryption());
    enableDefaultEncryption.addActionListener(this);
    mainPanel.add(enableDefaultEncryption, c);

    // warning message and button to show advanced options
    JLabel lblWarning = new JLabel();
    lblWarning.setBorder(new EmptyBorder(10, 5, 10, 0));
    lblWarning.setText(
        UtilActivator.getResources()
            .getI18NString(
                "plugin.sipaccregwizz.SECURITY_WARNING",
                new String[] {
                  UtilActivator.getResources().getSettingsString("service.gui.APPLICATION_NAME")
                }));
    c.gridy++;
    mainPanel.add(lblWarning, c);

    cmdExpandAdvancedSettings = new JLabel();
    cmdExpandAdvancedSettings.setBorder(new EmptyBorder(0, 5, 0, 0));
    cmdExpandAdvancedSettings.setIcon(
        UtilActivator.getResources().getImage("service.gui.icons.RIGHT_ARROW_ICON"));
    cmdExpandAdvancedSettings.setText(
        UtilActivator.getResources().getI18NString("plugin.sipaccregwizz.SHOW_ADVANCED"));
    cmdExpandAdvancedSettings.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseClicked(MouseEvent e) {
            cmdExpandAdvancedSettings.setIcon(
                UtilActivator.getResources()
                    .getImage(
                        pnlAdvancedSettings.isVisible()
                            ? "service.gui.icons.RIGHT_ARROW_ICON"
                            : "service.gui.icons.DOWN_ARROW_ICON"));

            pnlAdvancedSettings.setVisible(!pnlAdvancedSettings.isVisible());

            pnlAdvancedSettings.revalidate();
          }
        });
    c.gridy++;
    mainPanel.add(cmdExpandAdvancedSettings, c);

    pnlAdvancedSettings = new TransparentPanel();
    pnlAdvancedSettings.setLayout(new GridBagLayout());
    pnlAdvancedSettings.setVisible(false);
    c.gridy++;
    mainPanel.add(pnlAdvancedSettings, c);

    c = new GridBagConstraints();
    c.gridx = 0;
    c.gridy = 0;
    c.gridwidth = 2;
    c.gridheight = 1;
    c.anchor = GridBagConstraints.LINE_START;
    c.fill = GridBagConstraints.HORIZONTAL;
    pnlAdvancedSettings.add(new JSeparator(), c);

    // Encryption protcol preferences.
    JLabel lblEncryptionProtocolPreferences = new JLabel();
    lblEncryptionProtocolPreferences.setText(
        UtilActivator.getResources()
            .getI18NString("plugin.sipaccregwizz.ENCRYPTION_PROTOCOL_PREFERENCES"));
    c.gridy++;
    pnlAdvancedSettings.add(lblEncryptionProtocolPreferences, c);

    int nbEncryptionProtocols = ENCRYPTION_PROTOCOLS.length;
    String[] encryptions = new String[nbEncryptionProtocols];
    boolean[] selectedEncryptions = new boolean[nbEncryptionProtocols];

    this.encryptionConfigurationTableModel =
        new EncryptionConfigurationTableModel(encryptions, selectedEncryptions);
    loadEncryptionProtocols(new HashMap<String, Integer>(), new HashMap<String, Boolean>());
    this.encryptionProtocolPreferences =
        new PriorityTable(this.encryptionConfigurationTableModel, 60);
    this.encryptionConfigurationTableModel.addTableModelListener(this);
    c.gridy++;
    pnlAdvancedSettings.add(this.encryptionProtocolPreferences, c);

    // ZRTP
    JLabel lblZrtpOption = new JLabel();
    lblZrtpOption.setBorder(new EmptyBorder(5, 5, 5, 0));
    lblZrtpOption.setText(
        UtilActivator.getResources().getI18NString("plugin.sipaccregwizz.ZRTP_OPTION"));
    c.gridx = 0;
    c.gridy++;
    c.gridwidth = 1;
    pnlAdvancedSettings.add(lblZrtpOption, c);
    c.gridx = 1;
    pnlAdvancedSettings.add(new JSeparator(), c);

    enableSipZrtpAttribute =
        new SIPCommCheckBox(
            UtilActivator.getResources()
                .getI18NString("plugin.sipaccregwizz.ENABLE_SIPZRTP_ATTRIBUTE"),
            regform.isSipZrtpAttribute());
    c.gridx = 0;
    c.gridy++;
    c.gridwidth = 2;
    pnlAdvancedSettings.add(enableSipZrtpAttribute, c);

    // SDES
    JLabel lblSDesOption = new JLabel();
    lblSDesOption.setBorder(new EmptyBorder(5, 5, 5, 0));
    lblSDesOption.setText(
        UtilActivator.getResources().getI18NString("plugin.sipaccregwizz.SDES_OPTION"));
    c.gridx = 0;
    c.gridy++;
    c.gridwidth = 1;
    pnlAdvancedSettings.add(lblSDesOption, c);
    c.gridx = 1;
    pnlAdvancedSettings.add(new JSeparator(), c);

    JLabel lblCipherInfo = new JLabel();
    lblCipherInfo.setText(
        UtilActivator.getResources().getI18NString("plugin.sipaccregwizz.CIPHER_SUITES"));
    c.gridx = 0;
    c.gridy++;
    c.gridwidth = 2;
    pnlAdvancedSettings.add(lblCipherInfo, c);

    cipherModel = new CipherTableModel(regform.getSDesCipherSuites());
    tabCiphers = new JTable(cipherModel);
    tabCiphers.setShowGrid(false);
    tabCiphers.setTableHeader(null);
    TableColumnModel tableColumnModel = tabCiphers.getColumnModel();
    TableColumn tableColumn = tableColumnModel.getColumn(0);
    tableColumn.setMaxWidth(tableColumn.getMinWidth());
    JScrollPane scrollPane = new JScrollPane(tabCiphers);
    scrollPane.setPreferredSize(new Dimension(tabCiphers.getWidth(), 100));
    c.gridy++;
    pnlAdvancedSettings.add(scrollPane, c);

    // SAVP selection
    c.gridx = 0;
    c.gridwidth = 1;
    JLabel lblSavpOption = new JLabel();
    lblSavpOption.setBorder(new EmptyBorder(5, 5, 5, 0));
    lblSavpOption.setText(
        UtilActivator.getResources().getI18NString("plugin.sipaccregwizz.SAVP_OPTION"));
    if (this.displaySavpOtions) {
      c.gridy++;
      pnlAdvancedSettings.add(lblSavpOption, c);
    }
    c.gridx = 1;
    if (this.displaySavpOtions) {
      pnlAdvancedSettings.add(new JSeparator(), c);
    }

    cboSavpOption =
        new JComboBox(new SavpOption[] {new SavpOption(0), new SavpOption(1), new SavpOption(2)});
    c.gridx = 0;
    c.gridwidth = 2;
    c.insets = new Insets(0, 20, 0, 0);
    if (this.displaySavpOtions) {
      c.gridy++;
      pnlAdvancedSettings.add(cboSavpOption, c);
    }
  }