// 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);
 }
 public Component getTableCellRendererComponent(
     JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
   JLabel cell =
       (JLabel)
           super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
   cell.setFont(MONOSPACED_PLAIN_12POINT);
   cell.setHorizontalAlignment(SwingConstants.RIGHT);
   return cell;
 }
Exemple #3
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;
  }
  public void init() {

    // <Begin_init>
    if (getParameter("RESOURCE_PROPERTIES") != null) {
      localePropertiesFileName = getParameter("RESOURCE_PROPERTIES");
    }
    resourceBundle =
        com.adventnet.apiutils.Utility.getBundle(
            localePropertiesFileName, getParameter("RESOURCE_LOCALE"), applet);
    if (initialized) return;
    this.setSize(getPreferredSize().width + 495, getPreferredSize().height + 480);
    setTitle(resourceBundle.getString("ViewConfig"));
    Container container = getContentPane();
    container.setLayout(new BorderLayout());
    try {
      initVariables();
      setUpGUI(container);
      setUpProperties();
      setUpConnections();
    } catch (Exception ex) {
      showStatus(resourceBundle.getString("Error in init method"), ex);
    }
    // let us set the initialized variable to true so
    // we dont initialize again even if init is called
    initialized = true;

    // <End_init>
    setTitle(resourceBundle.getString("View Configuration"));
    setIconImage(AuthMain.getBuilderUiIfInstance().getFrameIcon());
    JLabel1.setIcon(AuthMain.getBuilderUiIfInstance().getImage("viewconfig.png"));
    com.adventnet.security.ui.ViewListCellRenderer ViewListCellRenderer1 =
        new com.adventnet.security.ui.ViewListCellRenderer();
    JTable1.setDefaultRenderer(JTable1.getColumnClass(0), ViewListCellRenderer1);

    JLabel2.setIcon(AuthMain.getBuilderUiIfInstance().getImage("addview1.png"));
    JTable1.getCellEditor(0, 0)
        .getTableCellEditorComponent(JTable1, null, true, 0, 0)
        .setEnabled(false);
    DefaultCellEditor te = (DefaultCellEditor) JTable1.getCellEditor(0, 0);
    te.setClickCountToStart(10);
    JTable1.setCellEditor(te);

    JViewport vp = new JViewport();
    JLabel lab = new JLabel(resourceBundle.getString("List of available views"));
    lab.setHorizontalAlignment((int) JLabel.CENTER_ALIGNMENT);
    lab.setForeground(Color.black);
    vp.setView(lab);

    AuthMain.getBuilderUiIfInstance().centerWindow(this);
    setData();

    viewc = this;

    addWindowListener(
        new WindowAdapter() {
          public void windowClosing(WindowEvent we) {
            close();
          }
        });

    /*
    TableColumn col2  = JTable1.getColumnModel().getColumn(1);
    DefaultTableCellRenderer ren = new DefaultTableCellRenderer();
    ren.setIcon(AuthMain.getBuilderUiIfInstance().getImage("task1.png"));
    	col2.setCellRenderer(ren);
     	col2.setMaxWidth(30);
    */

    DefaultListSelectionModel selModel = new DefaultListSelectionModel();
    selModel.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
    JTable1.setSelectionModel(selModel);
  }
 @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()