Exemplo n.º 1
0
 public void actionPerformed(ActionEvent e) {
   if (cyear.getSelectedItem() != null) {
     String b = cyear.getSelectedItem().toString();
     currentYear = Integer.parseInt(b);
     refreshCalendar(currentMonth, currentYear);
   }
 }
  public TableCellRenderFrame() {
    setSize(DEFAULT_WIDTH, DEFAULT_HEIGHT);

    TableModel model = new PlanetTableModel();
    JTable table = new JTable(model);
    table.setRowSelectionAllowed(false);

    // set up renderers and editors

    table.setDefaultRenderer(Color.class, new ColorTableCellRenderer());
    table.setDefaultEditor(Color.class, new ColorTableCellEditor());

    JComboBox<Integer> moonCombo = new JComboBox<>();
    for (int i = 0; i <= 20; i++) moonCombo.addItem(i);

    TableColumnModel columnModel = table.getColumnModel();
    TableColumn moonColumn = columnModel.getColumn(PlanetTableModel.MOONS_COLUMN);
    moonColumn.setCellEditor(new DefaultCellEditor(moonCombo));
    moonColumn.setHeaderRenderer(table.getDefaultRenderer(ImageIcon.class));
    moonColumn.setHeaderValue(new ImageIcon(getClass().getResource("Moons.gif")));

    // show table

    table.setRowHeight(100);
    add(new JScrollPane(table), BorderLayout.CENTER);
  }
Exemplo n.º 3
0
 @Override
 public void actionPerformed(ActionEvent e) {
   ID = (Integer) hashRoomType.get(boxRoomTypeID.getSelectedItem().toString());
   IDSTATUS = (Integer) hashRoomStatus.get(boxRoomStatusID.getSelectedItem().toString());
   if (e.getSource() == buttonInsert) {
     try {
       Rooms rooms = new Rooms(txtRoomNumber.getText(), txtDescription.getText(), ID, IDSTATUS);
       RoomsController.roomsController.save(rooms);
       int c = model.getRowCount();
       for (int i = c - 1; i >= 0; i--) {
         model.removeRow(i);
         jRoom.revalidate();
       }
       all();
       JOptionPane.showMessageDialog(this, "ok");
     } catch (Exception ex) {
       ex.printStackTrace();
     }
   }
   if (e.getSource() == buttonUpdate) {
     try {
       Rooms rooms = new Rooms(txtRoomNumber.getText(), txtDescription.getText(), ID, IDSTATUS);
       rooms.setRoomID(IDROOM);
       RoomsController.roomsController.update(rooms);
       int c = model.getRowCount();
       for (int i = c - 1; i >= 0; i--) {
         model.removeRow(i);
         jRoom.revalidate();
       }
       all();
       JOptionPane.showMessageDialog(this, "Update to succeed !");
     } catch (Exception ex) {
       ex.printStackTrace();
     }
   }
   if (e.getSource() == buttonDelete) {
     try {
       List<CheckIn> temp = CheckInController.checkInController.all();
       for (int i = 0; i < temp.size(); i++) {
         if (IDROOM == temp.get(i).getRoomID()) {
           this.error = 0;
         } else {
           this.error = 0;
           RoomsController.roomsController.delete(IDROOM);
           int c = model.getRowCount();
           for (int ii = c - 1; ii >= 0; ii--) {
             model.removeRow(ii);
             jRoom.revalidate();
           }
           all();
         }
       }
       JOptionPane.showMessageDialog(this, "Delete to succeed !");
     } catch (Exception ex) {
       JOptionPane.showMessageDialog(this, "can't delete row bcause check still !");
     }
   }
   if (e.getSource() == buttonRefresh) {}
 }
 /**
  * Establishes combo box editor for 'from onramp' column.
  *
  * @param clmn
  */
 private void setUpToOnrampColumn() {
   JComboBox combo = new JComboBox();
   Vector<AbstractNetworkElement> nes =
       ((AbstractControllerComplex) controller).getMyMonitor().getSuccessors();
   for (int i = 0; i < nes.size(); i++)
     if ((nes.get(i).getType() & TypesHWC.MASK_LINK) > 0) combo.addItem(nes.get(i));
   TableColumn clmn = zonetab.getColumnModel().getColumn(3);
   clmn.setCellEditor(new DefaultCellEditor(combo));
   clmn.setCellRenderer(new DefaultTableCellRenderer());
   return;
 }
Exemplo n.º 5
0
 private void addPainter(myjava.gui.syntax.Painter painter) {
   EntryListPanel newPanel = new EntryListPanel(painter);
   listPanelSet.add(newPanel);
   centerPanel.add(newPanel, painter.getName());
   painterComboBox.removeItemListener(painterChangeListener);
   painterComboBox.removeAllItems();
   for (EntryListPanel p : listPanelSet) {
     painterComboBox.addItem(p.getPainter());
   }
   removedPainters.remove(painter);
   painterComboBox.addItemListener(painterChangeListener);
 }
Exemplo n.º 6
0
 @Override
 public void onExit() {
   // save all painters
   for (EntryListPanel panel : listPanelSet) {
     myjava.gui.syntax.Painter painter = panel.getPainter();
     if (!painter.equals(myjava.gui.syntax.Painter.getDefaultInstance())) {
       myjava.gui.syntax.Painter.add(painter);
       setConfig("painter.userDefined." + painter.getName(), painter.toWritableString());
     }
     if (painter.equals(painterComboBox.getSelectedItem())) {
       // selected painter
       setConfig("syntax.selectedPainter", painter.getName());
       myjava.gui.syntax.Painter.setCurrentInstance(painter);
     }
   }
   // remove "removed painters"
   for (myjava.gui.syntax.Painter removed : removedPainters) {
     removeConfig0("painter.userDefined." + removed.getName());
     myjava.gui.syntax.Painter.remove(removed);
   }
   // highlight?
   boolean _highlightSyntax = highlightSyntax.isSelected();
   boolean _matchBracket = matchBracket.isSelected();
   MyUmbrellaLayerUI.setHighlightingStatus(_highlightSyntax, _matchBracket);
   setConfig("syntax.highlight", _highlightSyntax + "");
   setConfig("syntax.matchBrackets", _matchBracket + "");
 }
Exemplo n.º 7
0
  /**
   * Constructs a ClutoTree diaplay which is initialized with tableModel as the data model, and the
   * given selection model.
   *
   * @param clutoSolution The clustering solution
   * @param tableContext The context which manages views and selections.
   * @param tableModel the data model for the parallel coordinate display
   */
  public ClutoTree(ClutoSolution clutoSolution, TableContext tableContext, TableModel tableModel) {
    ctx = tableContext;
    tm = tableModel;
    lsm = ctx.getRowSelectionModel(tm);

    // labelModel
    int ncol = tm.getColumnCount();
    for (int i = 0; i < ncol; i++) {
      labelModel.addElement(tm.getColumnName(i));
    }

    setLayout(new BorderLayout());
    btnP = new JToolBar();
    add(btnP, BorderLayout.NORTH);
    labelChoice.addItemListener(
        new ItemListener() {
          public void itemStateChanged(ItemEvent e) {
            if (e.getStateChange() == ItemEvent.SELECTED) {
              labelColumn = 0;
              String ln = (String) e.getItem();
              if (ln != null) {
                for (int c = 0; c < tm.getColumnCount(); c++) {
                  if (ln.equals(tm.getColumnName(c))) {
                    labelColumn = c;
                    break;
                  }
                }
              }
              graph.invalidate();
              validate();
              repaint();
            }
          }
        });
    btnP.add(labelChoice);

    graph = new SimpleGraph();
    graph.getGraphDisplay().setOpaque(true);
    graph.getGraphDisplay().setBackground(Color.white);
    graph.getGraphDisplay().setGridColor(new Color(220, 220, 220));
    graph.showGrid(false);
    graph.showAxis(BorderLayout.WEST, false);
    graph.showAxis(BorderLayout.EAST, true);
    graph.getAxisDisplay(BorderLayout.EAST).setZoomable(true);
    graph.getAxisDisplay(BorderLayout.EAST).setAxisLabeler(labeler);
    ((LinearAxis) graph.getYAxis()).setTickIncrement(-1.);
    graph.getAxisDisplay(BorderLayout.SOUTH).setZoomable(true);
    gs = new GraphSegments();
    gs.setColor(Color.blue);
    idxSelColor = new IndexSelectColor(Color.cyan, null, new DefaultListSelectionModel());
    gs.setIndexedColor(idxSelColor);
    graph.addGraphItem(gs);
    graph.getGraphDisplay().addMouseListener(ma);

    add(graph);
    if (lsm != null) {
      lsm.addListSelectionListener(selListener);
    }
    display(makeTree(clutoSolution));
  }
Exemplo n.º 8
0
  /**
   * Create preview component.
   *
   * @param type type
   * @param comboBox the options.
   * @param prefSize the preferred size
   * @return the component.
   */
  private static Component createPreview(int type, final JComboBox comboBox, Dimension prefSize) {
    JComponent preview = null;

    if (type == DeviceConfigurationComboBoxModel.AUDIO) {
      Object selectedItem = comboBox.getSelectedItem();

      if (selectedItem instanceof AudioSystem) {
        AudioSystem audioSystem = (AudioSystem) selectedItem;

        if (!NoneAudioSystem.LOCATOR_PROTOCOL.equalsIgnoreCase(audioSystem.getLocatorProtocol())) {
          preview = new TransparentPanel(new GridBagLayout());
          createAudioSystemControls(audioSystem, preview);
        }
      }
    } else if (type == DeviceConfigurationComboBoxModel.VIDEO) {
      JLabel noPreview =
          new JLabel(
              NeomediaActivator.getResources().getI18NString("impl.media.configform.NO_PREVIEW"));

      noPreview.setHorizontalAlignment(SwingConstants.CENTER);
      noPreview.setVerticalAlignment(SwingConstants.CENTER);

      preview = createVideoContainer(noPreview);
      preview.setPreferredSize(prefSize);

      Object selectedItem = comboBox.getSelectedItem();
      CaptureDeviceInfo device = null;
      if (selectedItem instanceof DeviceConfigurationComboBoxModel.CaptureDevice)
        device = ((DeviceConfigurationComboBoxModel.CaptureDevice) selectedItem).info;

      Exception exception;
      try {
        createVideoPreview(device, preview);
        exception = null;
      } catch (IOException ex) {
        exception = ex;
      } catch (MediaException ex) {
        exception = ex;
      }
      if (exception != null) {
        logger.error("Failed to create preview for device " + device, exception);
        device = null;
      }
    }

    return preview;
  }
Exemplo n.º 9
0
 public void secureMove() {
   int rw = tblItems.getSelectedRow();
   if (rw == -1) {
     JOptionPane.showMessageDialog(frm, "No item selected", "Error", JOptionPane.ERROR_MESSAGE);
     return;
   }
   int idx = tblItems.convertRowIndexToModel(rw);
   String[] opts = new String[storeLocs.size()];
   for (int i = 0; i < opts.length; i++) opts[i] = storeLocs.get(i).getAbsolutePath();
   JComboBox cmbMove = new JComboBox(opts);
   cmbMove.setSelectedIndex(store.curStore(idx));
   if (JOptionPane.showConfirmDialog(frm, cmbMove, "Move item", JOptionPane.OK_CANCEL_OPTION)
       != JOptionPane.OK_OPTION) return;
   File newLoc = store.move(idx, cmbMove.getSelectedIndex());
   if (newLoc == null) System.err.println("move " + store.plainName(idx) + " unsuccessful");
   else needsSave = true;
 }
Exemplo n.º 10
0
 private void loadStates() {
   boolean b = enableDefaultEncryption.isSelected();
   cboSavpOption.setEnabled(b);
   this.encryptionProtocolPreferences.setEnabled(b);
   enableSipZrtpAttribute.setEnabled(
       b && this.encryptionConfigurationTableModel.isEnabledLabel("ZRTP"));
   tabCiphers.setEnabled(b && this.encryptionConfigurationTableModel.isEnabledLabel("SDES"));
 }
Exemplo n.º 11
0
 {
   for (myjava.gui.syntax.Painter painter : myjava.gui.syntax.Painter.getPainters()) {
     painterComboBox.addItem(painter);
     EntryListPanel panel = new EntryListPanel(painter);
     listPanelSet.add(panel);
     centerPanel.add(panel, painter.getName());
   }
   componentSet.addAll(Arrays.asList(matchBracket, painterComboBox, centerPanel));
 }
Exemplo n.º 12
0
  protected void attachTo(Component jc) {
    if (extListener != null && extListener.accept(jc)) {
      extListener.startListeningTo(jc, extNotifier);
      listenedTo.add(jc);
      if (wizardPage.getMapKeyFor(jc) != null) {
        wizardPage.maybeUpdateMap(jc);
      }
      return;
    }
    if (isProbablyAContainer(jc)) {
      attachToHierarchyOf((Container) jc);
    } else if (jc instanceof JList) {
      listenedTo.add(jc);
      ((JList) jc).addListSelectionListener(this);
    } else if (jc instanceof JComboBox) {
      ((JComboBox) jc).addActionListener(this);
    } else if (jc instanceof JTree) {
      listenedTo.add(jc);
      ((JTree) jc).getSelectionModel().addTreeSelectionListener(this);
    } else if (jc instanceof JToggleButton) {
      ((AbstractButton) jc).addItemListener(this);
    } else if (jc
        instanceof JFormattedTextField) { // JFormattedTextField must be tested before JTextCompoent
      jc.addPropertyChangeListener("value", this);
    } else if (jc instanceof JTextComponent) {
      listenedTo.add(jc);
      ((JTextComponent) jc).getDocument().addDocumentListener(this);
    } else if (jc instanceof JColorChooser) {
      listenedTo.add(jc);
      ((JColorChooser) jc).getSelectionModel().addChangeListener(this);
    } else if (jc instanceof JSpinner) {
      ((JSpinner) jc).addChangeListener(this);
    } else if (jc instanceof JSlider) {
      ((JSlider) jc).addChangeListener(this);
    } else if (jc instanceof JTable) {
      listenedTo.add(jc);
      ((JTable) jc).getSelectionModel().addListSelectionListener(this);
    } else {
      if (logger.isLoggable(Level.FINE)) {
        logger.fine(
            "Don't know how to listen to a "
                + // NOI18N
                jc.getClass().getName());
      }
    }

    if (accept(jc) && !(jc instanceof JPanel)) {
      jc.addPropertyChangeListener("name", this);
      if (wizardPage.getMapKeyFor(jc) != null) {
        wizardPage.maybeUpdateMap(jc);
      }
    }

    if (logger.isLoggable(Level.FINE) && accept(jc)) {
      logger.fine("Begin listening to " + jc); // NOI18N
    }
  }
Exemplo n.º 13
0
  public EmpMain() {
    String[] col = {"사번", "이름", "직위", "입사일", "부서번호"};
    String[][] row = new String[0][5];
    model =
        new DefaultTableModel(row, col) {
          public boolean isCellEditable(int r, int c) {
            return false;
          }
        };
    table = new JTable(model);
    JScrollPane js = new JScrollPane(table);
    la = new JLabel("사원목록");
    la.setFont(new Font("나눔스퀘어", Font.BOLD, 30));
    table.setFont(new Font("나눔스퀘어", Font.PLAIN, 12));
    JPanel p = new JPanel();
    p.add(la);

    la1 = new JLabel("Search");
    tf = new JTextField(10);
    box = new JComboBox();
    box.addItem("이름");
    box.addItem("입사일");
    box.addItem("부서");
    b1 = new JButton("찾기");
    b2 = new JButton("목록");
    JPanel p1 = new JPanel();
    p1.add(la1);
    p1.add(box);
    p1.add(tf);
    p1.add(b1);
    p1.add(b2);
    add("South", p1);
    add("Center", js);
    add("North", p);
    setSize(640, 480);
    setVisible(true);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    getData();
    table.addMouseListener(this);
    b1.addActionListener(this);
    b2.addActionListener(this);
  }
Exemplo n.º 14
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());
  }
Exemplo n.º 15
0
 @SuppressWarnings("unchecked")
 private void addRoomStatus() {
   try {
     for (RoomStatus roomStatus : RoomStatusController.roomStatusController.all()) {
       boxRoomStatusID.addItem(roomStatus.getRoomStatusName());
       hashRoomStatus.put(roomStatus.getRoomStatusName(), roomStatus.getRoomStatusID());
     }
   } catch (Exception ex) {
     ex.printStackTrace();
   }
 }
Exemplo n.º 16
0
 @SuppressWarnings("unchecked")
 private void allRoomType() {
   try {
     for (RoomType roomType : RoomTypeController.roomTypeController.all()) {
       boxRoomTypeID.addItem(roomType.getRoomType());
       hashRoomType.put(roomType.getRoomType(), roomType.getRoomTypeID());
     }
   } catch (Exception ex) {
     ex.printStackTrace();
   }
 }
Exemplo n.º 17
0
  /**
   * Saves the user input when the "Next" wizard buttons is clicked.
   *
   * @param registration the SIPAccountRegistration
   * @return
   */
  public boolean commitPanel(SecurityAccountRegistration registration) {
    registration.setDefaultEncryption(enableDefaultEncryption.isSelected());
    registration.setEncryptionProtocols(encryptionConfigurationTableModel.getEncryptionProtocols());
    registration.setEncryptionProtocolStatus(
        encryptionConfigurationTableModel.getEncryptionProtocolStatus());
    registration.setSipZrtpAttribute(enableSipZrtpAttribute.isSelected());
    registration.setSavpOption(((SavpOption) cboSavpOption.getSelectedItem()).option);
    registration.setSDesCipherSuites(cipherModel.getEnabledCiphers());

    return true;
  }
Exemplo n.º 18
0
  @SuppressWarnings("unused")
  @Override
  public void mouseClicked(MouseEvent e) {
    int iDongDaChon = jRoom.getSelectedRow();
    if (iDongDaChon == -1) {
      JOptionPane.showMessageDialog(this, "you select 1 row");
    } else {
      buttonDelete.setVisible(true);
      buttonUpdate.setEnabled(true);
      Vector vDongDaChon = (Vector) tableRecords.get(iDongDaChon);
      IDROOM = Integer.parseInt(vDongDaChon.get(0).toString());
      String roomNumber = vDongDaChon.get(1).toString();
      String roomType = vDongDaChon.get(2).toString();
      String numBeds = vDongDaChon.get(3).toString();
      String roomTypeRate = vDongDaChon.get(4).toString();
      String roomStatus = vDongDaChon.get(5).toString();
      String des = vDongDaChon.get(6).toString();

      txtRoomNumber.setText(roomNumber);
      boxRoomTypeID.setSelectedItem(roomType.toString());
      boxRoomStatusID.setSelectedItem(roomStatus.toString());
      txtDescription.setText(des);
      try {
        List<CheckIn> temp = CheckInController.checkInController.all();
        for (int i = 0; i < temp.size(); i++) {
          if (IDROOM == temp.get(i).getRoomID()) {
            this.error = 0;
            buttonUpdate.setEnabled(false);
            buttonDelete.setEnabled(false);
            break;
          } else {
            this.error = 0;
            buttonUpdate.setEnabled(true);
            buttonDelete.setEnabled(true);
          }
        }
      } catch (Exception e2) {
        e2.printStackTrace();
      }
    }
  }
Exemplo n.º 19
0
  protected void detachFrom(Component jc) {
    listenedTo.remove(jc);
    if (extListener != null && extListener.accept(jc)) {
      extListener.stopListeningTo(jc);
    }
    if (isProbablyAContainer(jc)) {
      detachFromHierarchyOf((Container) jc);
    } else if (jc instanceof JList) {
      ((JList) jc).removeListSelectionListener(this);
    } else if (jc instanceof JComboBox) {
      ((JComboBox) jc).removeActionListener(this);
    } else if (jc instanceof JTree) {
      ((JTree) jc).getSelectionModel().removeTreeSelectionListener(this);
    } else if (jc instanceof JToggleButton) {
      ((AbstractButton) jc).removeActionListener(this);
    } else if (jc instanceof JTextComponent) {
    } else if (jc
        instanceof JFormattedTextField) { // JFormattedTextField must be tested before JTextCompoent
      jc.removePropertyChangeListener("value", this);
      ((JTextComponent) jc).getDocument().removeDocumentListener(this);
    } else if (jc instanceof JColorChooser) {
      ((JColorChooser) jc).getSelectionModel().removeChangeListener(this);
    } else if (jc instanceof JSpinner) {
      ((JSpinner) jc).removeChangeListener(this);
    } else if (jc instanceof JSlider) {
      ((JSlider) jc).removeChangeListener(this);
    } else if (jc instanceof JTable) {
      ((JTable) jc).getSelectionModel().removeListSelectionListener(this);
    }

    if (accept(jc) && !(jc instanceof JPanel)) {
      jc.removePropertyChangeListener("name", this);
      Object key = wizardPage.getMapKeyFor(jc);

      if (key != null) {
        if (logger.isLoggable(Level.FINE)) {
          logger.fine(
              "Named component removed from hierarchy: "
                  + // NOI18N
                  key
                  + ".  Removing any corresponding "
                  + // NOI18N
                  "value from the wizard settings map."); // NOI18N
        }

        wizardPage.removeFromMap(key);
      }
    }

    if (logger.isLoggable(Level.FINE) && accept(jc)) {
      logger.fine("Stop listening to " + jc); // NOI18N
    }
  }
Exemplo n.º 20
0
 public void getFindData() {
   for (int i = model.getRowCount() - 1; i >= 0; i--) {
     model.removeRow(i);
   }
   String pub = box.getSelectedItem().toString();
   ArrayList<Book> list = bm.bookFindData(pub);
   tf.setText(pub);
   for (Book book : list) {
     String[] data = {String.valueOf(book.getNo()), book.getTitle(), book.getAuthor()};
     model.addRow(data);
   }
 }
Exemplo n.º 21
0
  public Component getTableCellRendererComponent(
      JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
    if (isSelected) {
      setForeground(table.getSelectionForeground());
      super.setBackground(table.getSelectionBackground());
    } else {
      setForeground(table.getForeground());
      setBackground(table.getBackground());
    }

    // Select the current value
    setSelectedItem(value);
    return this;
  }
Exemplo n.º 22
0
  public void setModel(SkeletonProperty[] sprops) {
    if (sprops == null) sprops = new SkeletonProperty[0];

    SkeletonPropertyEditor.SkelPropTableModel model =
        new SkeletonPropertyEditor.SkelPropTableModel(sprops);
    m_table.setModel(model);
    m_model = model;
    m_table.createDefaultColumnsFromModel();

    // model.addColumn("DescriptiveString");
    // model.addColumn("DescriptiveString");
    // model.addColumn("DescriptiveString");
    // model.addColumn("DescriptiveString");
    // model.addColumn("DescriptiveString");

    TableColumn type = m_table.getColumnModel().getColumn(3);
    type.setHeaderValue("POUET");
    JComboBox typeCombo = new JComboBox();
    typeCombo.addItem(SkeletonProperty.TYPE_STRING);
    typeCombo.addItem(SkeletonProperty.TYPE_TEXTAREA);
    typeCombo.addItem(SkeletonProperty.TYPE_BOOLEAN);
    type.setCellEditor(new DefaultCellEditor(typeCombo));
  }
Exemplo n.º 23
0
  public void SpelersCombo(int ronde) {
    String[] spelers = null;
    if (ronde == 0) {
      spelers = new String[1];
      spelers[0] = "Geen Spelers";
    } else {
      spelers = oc.GeefSpelers(ronde);
    }

    ComboBoxModel cbSpelerModel = new DefaultComboBoxModel(spelers);
    cbSpeler = new JComboBox();
    pInzet.add(cbSpeler);
    cbSpeler.setModel(cbSpelerModel);
    cbSpeler.setBounds(91, 63, 156, 21);
    cbSpeler.setToolTipText("Maak een keuze uit een van de (meespelende) spelers.");
    cbSpeler.addItemListener(
        new ItemListener() {

          public void itemStateChanged(ItemEvent evt) {
            cbSpelerItemStateChanged(evt);
          }
        });
  } // public void SpelersCombo(int ronde)
 /** Reaction to buttons and combo boxes. */
 public void actionPerformed(ActionEvent e) {
   String cmd = e.getActionCommand();
   if (cmdCtrlProp.equals(cmd)) {
     try {
       Class c =
           Class.forName("aurora.hwc.control.Panel" + myController.getClass().getSimpleName());
       AbstractPanelController cp = (AbstractPanelController) c.newInstance();
       cp.initialize(myController, null);
     } catch (Exception ex) {
     }
   }
   if (cmdCtrlList.equals(cmd)) {
     JComboBox cb = (JComboBox) e.getSource();
     if (cb.getSelectedIndex() > 0) {
       myController = (AbstractControllerComplex) listCControllers.getSelectedItem();
       buttonProp.setEnabled(true);
     } else {
       buttonProp.setEnabled(false);
       myController = null;
     }
     myMonitor.setMyController(myController);
   }
   return;
 }
Exemplo n.º 25
0
 @Override
 public void actionPerformed(ActionEvent e) {
   // TODO Auto-generated method stub
   if (e.getSource() == b1) {
     int index = box.getSelectedIndex();
     String column = "";
     if (index == 0) column = "ename";
     else if (index == 1) column = "hiredate";
     else column = "deptno";
     String data = tf.getText().trim();
     if (data.length() < 1) {
       tf.requestFocus();
       return;
     }
     getFindData(column, data);
   }
   if (e.getSource() == b2) {
     getData();
   }
 }
Exemplo n.º 26
0
  /**
   * Loads the account with the given identifier.
   *
   * @param accountID the account identifier
   */
  public void loadAccount(AccountID accountID) {
    enableDefaultEncryption.setSelected(
        accountID.getAccountPropertyBoolean(ProtocolProviderFactory.DEFAULT_ENCRYPTION, true));

    Map<String, Integer> encryptionProtocols =
        accountID.getIntegerPropertiesByPrefix(ProtocolProviderFactory.ENCRYPTION_PROTOCOL, true);
    Map<String, Boolean> encryptionProtocolStatus =
        accountID.getBooleanPropertiesByPrefix(
            ProtocolProviderFactory.ENCRYPTION_PROTOCOL_STATUS, true, false);
    this.loadEncryptionProtocols(encryptionProtocols, encryptionProtocolStatus);

    enableSipZrtpAttribute.setSelected(
        accountID.getAccountPropertyBoolean(
            ProtocolProviderFactory.DEFAULT_SIPZRTP_ATTRIBUTE, true));
    cboSavpOption.setSelectedIndex(
        accountID.getAccountPropertyInt(
            ProtocolProviderFactory.SAVP_OPTION, ProtocolProviderFactory.SAVP_OFF));
    cipherModel.loadData(
        accountID.getAccountPropertyString(ProtocolProviderFactory.SDES_CIPHER_SUITES));
    loadStates();
  }
  private void bind() {
    viewModel.setHouseCost(houseCost.getText());
    viewModel.setDownPayment(downPayment.getText());
    viewModel.setCountOfPeriods(countOfPeriods.getText());
    viewModel.setInterestRate(interestRate.getText());
    viewModel.setFlatFee(flatFee.getText());
    viewModel.setMonthlyFee(monthlyFee.getText());

    viewModel.setCurrencyType((Hypothec.CurrencyType) currencyType.getSelectedItem());
    viewModel.setPeriodType((Hypothec.PeriodType) periodType.getSelectedItem());
    viewModel.setInterestRateType((Hypothec.InterestRateType) interestRateType.getSelectedItem());
    viewModel.setFlatFeeType((Hypothec.FlatFeeType) flatFeeType.getSelectedItem());
    viewModel.setMonthlyFeeType((Hypothec.MonthlyFeeType) monthlyFeeType.getSelectedItem());
    viewModel.setCreditType((Hypothec.CreditType) creditType.getSelectedItem());

    viewModel.setStartMonth(month.getText());
    viewModel.setStartYear(year.getText());
  }
  private void initialize() {
    loadAllLists();
    backBind();

    houseCost.setText(viewModel.getHouseCost());
    downPayment.setText(viewModel.getDownPayment());
    countOfPeriods.setText(viewModel.getCountOfPeriods());
    interestRate.setText(viewModel.getInterestRate());
    flatFee.setText(viewModel.getFlatFee());
    monthlyFee.setText(viewModel.getMonthlyFee());

    currencyType.setSelectedItem(viewModel.getCurrencyType());
    periodType.setSelectedItem(viewModel.getPeriodType());
    interestRateType.setSelectedItem(viewModel.getInterestRateType());
    flatFeeType.setSelectedItem(viewModel.getFlatFeeType());
    monthlyFeeType.setSelectedItem(viewModel.getMonthlyFeeType());
    creditType.setSelectedItem(viewModel.getCreditType());

    month.setText(viewModel.getStartMonth());
    year.setText(viewModel.getStartYear());
  }
  private HypothecCalculator() {
    initialize();

    KeyAdapter keyListener =
        new KeyAdapter() {
          public void keyReleased(final KeyEvent e) {
            bind();
            viewModel.checkInput();
            backBind();
          }
        };
    houseCost.addKeyListener(keyListener);
    interestRate.addKeyListener(keyListener);
    downPayment.addKeyListener(keyListener);
    countOfPeriods.addKeyListener(keyListener);
    flatFee.addKeyListener(keyListener);
    monthlyFee.addKeyListener(keyListener);
    month.addKeyListener(keyListener);
    year.addKeyListener(keyListener);

    currencyType.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(final ActionEvent e) {
            bind();
            backBind();
          }
        });
    periodType.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(final ActionEvent e) {
            bind();
            backBind();
          }
        });
    interestRateType.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(final ActionEvent e) {
            bind();
            backBind();
          }
        });
    flatFeeType.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(final ActionEvent e) {
            bind();
            backBind();
          }
        });
    monthlyFeeType.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(final ActionEvent e) {
            bind();
            backBind();
          }
        });
    creditType.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(final ActionEvent e) {
            bind();
            backBind();
          }
        });
    compute.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(final ActionEvent e) {
            bind();
            viewModel.compute();
            backBind();
          }
        });
  }
 private void loadListOfCreditTypes() {
   Hypothec.CreditType[] types = Hypothec.CreditType.values();
   creditType.setModel(new JComboBox<>(types).getModel());
 }