Beispiel #1
0
  // Mode modification
  public void modeModification() {
    resetCollection();
    loadCollection();
    resetCategorie();
    loadCategorie();
    comboCollection.setEnabled(true);

    textTitre.setVisible(true);
    textTitre.setEnabled(true);
    textTitre.setEditable(true);

    textAnnee.setVisible(true);
    textAnnee.setEnabled(true);
    textAnnee.setEditable(true);

    comboType.setVisible(true);
    comboType.setEnabled(true);

    comboEval.setVisible(true);
    comboEval.setEnabled(true);

    scrollCom.setEnabled(true);
    scrollCat.setEnabled(true);

    textCommentaires.setEnabled(true);
    textCommentaires.setEditable(true);
    textCommentaires.setBackground(Color.WHITE);
    textCommentaires.setText("");

    textCategories.setEnabled(true);
    textCategories.setEditable(false);
    textCategories.setBackground(GRIS);
    textCategories.setText("");

    for (int i = 0; i < infos_film.length; i++) {
      infos_film[i].setVisible(false);
    }

    for (int k = 0; k < modeButton.length; k++) {
      modeButton[k].setEnabled(false);
      modeButton[k].setVisible(false);
    }

    modeButton[3].setVisible(true); // Boutton Modifier
    modeButton[4].setVisible(true); // Boutton Supprimer
    boolean enabled = true;
    if (listeEstVide()) {
      enabled = false;
    }
    modeButton[3].setEnabled(enabled);
    modeButton[4].setEnabled(enabled);

    optionCategories[0].setEnabled(true); // Boutton ajouter categorie
    optionCategories[1].setEnabled(true);

    // Place the first element of combobox in the grid
    comboCollection.setSelectedIndex(0);
    Video video = this.obtenirVideo(comboCollection.getSelectedItem().toString());
    afficherFilmChoisis(video.getTitre());
  }
Beispiel #2
0
 private void doGenerateText() {
   parseChanges = false;
   if (getTarget() == null) {
     textArea.setEnabled(false);
     // TODO: Localize
     textArea.setText("Nothing selected");
     enabled = false;
   } else {
     textArea.setEnabled(true);
     if (isVisible()) {
       String generatedText = genText(getTarget());
       if (generatedText != null) {
         textArea.setText(generatedText);
         enabled = true;
         textArea.setCaretPosition(0);
       } else {
         textArea.setEnabled(false);
         // TODO: Localize
         textArea.setText("N/A");
         enabled = false;
       }
     }
   }
   parseChanges = true;
 }
Beispiel #3
0
  // Mode consultation
  public void modeConsultation() {
    resetCollection();
    loadCollection();
    comboCollection.setEnabled(true);

    textTitre.setVisible(false);
    textTitre.setEditable(false);
    textAnnee.setVisible(false);
    textAnnee.setEditable(false);
    comboType.setVisible(false);
    comboType.setEnabled(false);
    comboEval.setVisible(false);
    comboEval.setEnabled(false);

    // Juste au cas que ca foire
    scrollCom.setEnabled(true);
    scrollCat.setEnabled(true);

    textCommentaires.setEnabled(true);
    textCommentaires.setEditable(false);
    textCategories.setEnabled(true);
    textCategories.setEditable(false);

    textCommentaires.setBackground(GRIS);
    textCategories.setBackground(GRIS);

    for (int k = 0; k < infos_film.length; k++) {
      infos_film[k].setVisible(true);
    }

    // Place the first element of combobox in the grid DEPRECATED by Enoncé
    comboCollection.setSelectedIndex(comboCollection.getSelectedIndex());

    for (int l = 0; l < modeButton.length; l++) {
      if (l < 2) {
        modeButton[0].setEnabled(false);
        modeButton[0].setVisible(true);
        if (comboCollection.getItemCount() > 1) {
          modeButton[l].setEnabled(true);
          modeButton[l].setVisible(true);
        } else {
          modeButton[l].setEnabled(false);
          modeButton[l].setVisible(true);
        }
        // modeButton[l].setEnabled(true);
        // modeButton[l].setVisible(true);
      } else {
        modeButton[l].setEnabled(false);
        modeButton[l].setVisible(false);
      }
    }
    optionCategories[0].setEnabled(false);
    optionCategories[1].setEnabled(false);

    // Get the collection and place in combobox

    Video video = this.obtenirVideo(comboCollection.getSelectedItem().toString());
    afficherFilmChoisis(video.getTitre());
  }
Beispiel #4
0
  // Mode ajout
  public void modeAjout() {
    resetCollection();
    loadCollection();
    resetCategorie();
    loadCategorie();
    comboCollection.setEnabled(false);

    textTitre.setVisible(true);
    textTitre.setEnabled(true);
    textTitre.setEditable(true);
    textTitre.setText("");
    textTitre.requestFocusInWindow();

    textAnnee.setVisible(true);
    textAnnee.setEnabled(true);
    textAnnee.setEditable(true);
    textAnnee.setText("");

    comboType.setVisible(true);
    comboType.setEnabled(true);
    comboType.setSelectedIndex(1);

    comboEval.setVisible(true);
    comboEval.setEnabled(true);
    comboEval.setSelectedIndex(0);

    // Juste au cas que ca foire
    scrollCom.setEnabled(true);
    scrollCat.setEnabled(true);

    textCommentaires.setEnabled(true);
    textCommentaires.setEditable(true);
    textCommentaires.setBackground(Color.WHITE);
    textCommentaires.setText("");

    textCategories.setEnabled(true);
    textCategories.setEditable(false);
    textCategories.setBackground(GRIS);
    textCategories.setText("");

    optionCategories[0].setEnabled(true);
    optionCategories[1].setEnabled(false);

    for (int i = 0; i < infos_film.length; i++) {
      infos_film[i].setVisible(false);
    }

    for (int k = 0; k < modeButton.length; k++) {
      if (k == 2) {
        modeButton[k].setEnabled(true);
        modeButton[k].setVisible(true);
      } else {
        modeButton[k].setEnabled(false);
        modeButton[k].setVisible(false);
      }
    }
  }
Beispiel #5
0
  // Mode recherche
  public void modeRecherche() {
    resetCollection();

    comboCollection.setEnabled(false);

    textTitre.setVisible(true);
    textTitre.setEnabled(true);
    textTitre.setEditable(true);
    textTitre.setText("");
    textTitre.requestFocusInWindow();

    textAnnee.setVisible(true);
    textAnnee.setEnabled(true);
    textAnnee.setEditable(true);
    textAnnee.setText("");

    comboType.setVisible(true);
    comboType.setEnabled(true);
    comboType.setSelectedIndex(0);

    comboEval.setVisible(true);
    comboEval.setEnabled(false);
    // comboEval.setFont();
    comboEval.setSelectedIndex(0);

    textCommentaires.setEnabled(true);
    textCommentaires.setEditable(false);
    textCommentaires.setBackground(GRIS);
    textCommentaires.setText("");

    textCategories.setEnabled(true);
    textCategories.setEditable(false);
    textCategories.setBackground(GRIS);
    textCategories.setText("");

    for (int i = 0; i < infos_film.length; i++) {
      infos_film[i].setVisible(false);
    }

    for (int k = 0; k < modeButton.length; k++) {
      modeButton[k].setEnabled(false);
      modeButton[k].setVisible(false);
    }
    modeButton[5].setVisible(true);
    // modeButton[6].setVisible(true);

    boolean enabled = true;

    if (listeEstVide()) {
      enabled = false;
    }
    optionCategories[0].setEnabled(enabled);
    optionCategories[1].setEnabled(enabled);
    modeButton[5].setEnabled(enabled);
    modeButton[6].setEnabled(true);
  }
Beispiel #6
0
  @Override
  public void update(Observable arg0, Object arg1) {
    if (arg1 instanceof String) {
      String message = arg1.toString();
      if (message.startsWith("Forwarding: ")) {
        ForwardButton.setText("Stop Forwarding");
        SetChannelButton.setEnabled(false);
        BlockButton.setEnabled(false);
        Send.setEnabled(false);
        MessageInput.setEnabled(false);
        MessageDisplay.setEnabled(false);
        Availability.setEnabled(false);
      } else if (message.startsWith("End Forwarding:")) {
        ForwardButton.setText("Forward");
        SetChannelButton.setEnabled(true);
        BlockButton.setEnabled(true);
        Send.setEnabled(true);
        MessageInput.setEnabled(true);
        MessageDisplay.setEnabled(true);
        Availability.setEnabled(true);
      } else if (message.startsWith("#send")) {
        try {
          client.sendToServer(message.substring(6));
        } catch (IOException e) {
          e.printStackTrace();
        }
        return;
      } else if (message.startsWith("#linedraw")) {
        drawPad.updateDraw(message);
        return;
      } else if (message.startsWith("Login Error:")) {
        java.awt.EventQueue.invokeLater(
            new Runnable() {
              public void run() {
                chatFrame.setVisible(false);
                LoginGUI login = new LoginGUI(true);
              }
            });
      }

      if (!message.substring(message.length() - 1, message.length()).equals("\n")) message += "\n";

      // Update UI display safely
      final String msg = message;
      SwingUtilities.invokeLater(
          new Runnable() {
            public void run() {
              MessageDisplay.append(msg);
            }
          });
    }
  }
  public void startDeleting(final PartType pt) {
    isEditing = false;
    isDeleting = true;
    setUpLeftPanel();

    leftTitle.setText("Deleting Part " + pt.getName());
    nameField.setText(pt.getName());
    nameField.setEnabled(false);
    numField.setText(String.valueOf(pt.getPartNum()));
    numField.setEnabled(false);
    descField.setText(pt.getDescription());
    descField.setEnabled(false);
    badChanceScroller.setValue((int) (pt.getBadChance() * 100));
    badChanceScroller.setEnabled(false);
    imageClickablePanels.get(pt.getImagePath()).getHandler().mouseClicked();
    submitButton.setText("Confirm Delete >");

    removeAllActionListener(submitButton);
    submitButton.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent arg0) {
            manager.deletePart(pt);
            restoreLeftPanel();
          }
        });
  }
  public NotificacioGenerica(String missatge) {
    frame = new JFrame("Notificació");
    frame.getContentPane().setLayout(new GridBagLayout());
    label = new JTextArea(missatge);
    label.setEnabled(false);
    label.setEditable(false);
    button = new JButton("D'acord!");
    GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.BOTH;
    frame.getContentPane().add(label, c);
    c.gridy = 1;
    frame.getContentPane().add(button, c);
    button.requestFocusInWindow();

    button.addActionListener(
        new ActionListener() {
          @Override
          public void actionPerformed(ActionEvent actionEvent) {
            frame.dispose();
          }
        });

    setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
    pack();
    mostra(true);
  }
 private void luoKomponentit(Container container) {
   JTextArea karttapiirros = new JTextArea(this.peli.piirraPelitilanne());
   karttapiirros.setEnabled(false);
   Font fontti = new Font("Courier New", Font.BOLD, 20);
   karttapiirros.setFont(fontti);
   lisaaKuuntelijat(karttapiirros);
   container.add(karttapiirros);
 }
Beispiel #10
0
  private void addTextField() {
    messageArea = new JTextArea();
    messageArea.setEnabled(false);
    messageArea.setDisabledTextColor(Color.BLACK);

    listArea = new JTextArea();
    listArea.setEnabled(false);
    listArea.setDisabledTextColor(Color.BLACK);
    listArea.setBounds(275, 18, 70, 340);
    contentPane.add(listArea);

    textField = new JTextField();
    textField.setBounds(0, 312, 155, 42);
    textField.addKeyListener(this);
    contentPane.add(textField);
    textField.setColumns(10);
  }
Beispiel #11
0
 public void enableRunAndImport(boolean enable) {
   chkExec.setEnabled(enable);
   lblFileRpt.setEnabled(enable);
   txtFileRpt.setEnabled(enable);
   btnFileRpt.setEnabled(enable);
   chkImport.setEnabled(enable);
   lblResultName.setEnabled(enable);
   txtResultName.setEnabled(enable);
 }
Beispiel #12
0
 private void setupChatPane() {
   chatArea.setLineWrap(true);
   chatArea.setWrapStyleWord(true);
   chatArea.setEnabled(false);
   chatArea.setEditable(false);
   textPane = new JScrollPane(chatArea);
   textPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
   textPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
 }
  public void iniciarBaja() {

    Utilidades.habilitarPanel(pnlCliente, false);
    Utilidades.habilitarPanel(pnlResponsable, false);
    Utilidades.habilitarPanel(pnlDomicilio, false);
    txtFechaBaja.setText(Utilidades.parseFecha(new Date()));
    txtMotivoBaja.setEnabled(true);
    cargar(gestor.getProveedor());
  }
 public void Habilitar() {
   barra.setVisible(false);
   barra.setValue(0);
   Etiq.setVisible(false);
   texpresion.setEnabled(true);
   tvariables.setEnabled(true);
   tconstantes.setEnabled(true);
   vectores.setEnabled(true);
 }
Beispiel #15
0
  /**
   * As per the JPanle superclass setEnabled method. Also calls the setEnabled method of the text
   * area, load button, clear button and organize button on this panel.
   *
   * @param enable Whether to enable or disable this panel and its components.
   */
  public void setEnabled(boolean enable) {
    super.setEnabled(enable);

    text_area.setEnabled(enable);
    load_button.setEnabled(enable);
    save_button.setEnabled(enable);
    clear_button.setEnabled(enable);
    organize_button.setEnabled(enable);
  }
Beispiel #16
0
  @Override
  public void pageListener(Page page) {

    if (page != null) {

      middleButton.setEnabled(true);
      initButton.setEnabled(true);
      endButton.setEnabled(true);

      if (page.getPageType().equals(Page.START)) {
        initButton.setSelected(true);
      } else if (page.getPageType().equals(Page.MIDDLE)) {
        middleButton.setSelected(true);
      } else {
        endButton.setSelected(true);
      }

      textArea.setEnabled(true);
      textArea.setText(page.getContent());

      choiceList.setListData(page.getChoices().toArray(new Choice[] {}));

      newButton.setEnabled(true);
      saveButton.setEnabled(true);

      currentPage = page;
    } else {
      middleButton.setSelected(true);
      textArea.setText(null);
      choiceList.setListData(new Choice[] {});
      newButton.setEnabled(false);
      editButton.setEnabled(false);
      deleteButton.setEnabled(false);
      saveButton.setEnabled(false);
      middleButton.setEnabled(false);
      initButton.setEnabled(false);
      endButton.setEnabled(false);
      textArea.setEnabled(false);

      textArea.setText(null);

      currentPage = null;
    }
  }
  /** @see ComboBoxInputable */
  public void resetComboBox() {

    currentContactName = null;
    namesJComboBox.setSelectedItem(null);
    namesJComboBox.setSelectedIndex(0);
    institutionJTextArea.setEnabled(false);
    contactInfoJTextField.setEnabled(false);
    institutionJTextArea.setEditable(false);
    contactInfoJTextField.setEditable(false);
    namesJComboBoxActionPerformed(null);
  }
Beispiel #18
0
 /** adds all the gui components to the panel. */
 private void setupPanel() {
   this.setLayout(baseLayout);
   this.add(chatArea);
   this.add(typingField);
   this.add(promptLabel);
   this.add(submitButton);
   this.add(twitterButton);
   this.add(analyzeTwitterButton);
   typingField.setToolTipText("Type here for the chatbot");
   chatArea.setEnabled(false);
 }
Beispiel #19
0
  public void deactivate() {
    indexNode.deregisterChatListenter(this);

    message.setEnabled(false);
    message.setText("You are no longer connected to this index node.  No chats for you.");
    sendMessage.setEnabled(false);
    avatarTable.setEnabled(false);
    chatLog.setBackground(Color.lightGray);

    // Set status
    active = false;
  }
 private void setScriptArea() {
   String s = null;
   if (pageCheckBox.getAction() != null)
     s = (String) pageCheckBox.getAction().getValue(Action.SHORT_DESCRIPTION);
   if (actionComboBox.getSelectedItem() != null) s = actionComboBox.getSelectedItem().toString();
   if (s == null) return;
   boolean isScriptButton = isScriptActionKey(s);
   scriptAreaSelected.setEnabled(isScriptButton);
   scriptLabelSelected.setEnabled(isScriptButton);
   scriptAreaDeselected.setEnabled(isScriptButton);
   scriptLabelDeselected.setEnabled(isScriptButton);
   scriptAreaSelected.setText(
       isScriptButton ? (String) pageCheckBox.getClientProperty("selection script") : null);
   scriptAreaDeselected.setText(
       isScriptButton ? (String) pageCheckBox.getClientProperty("deselection script") : null);
   if (isScriptButton) {
     scriptAreaSelected.requestFocusInWindow();
     scriptAreaSelected.setCaretPosition(0);
     scriptAreaDeselected.setCaretPosition(0);
   }
 }
Beispiel #21
0
 /**
  * This method initializes jTextArea
  *
  * @return javax.swing.JTextArea
  */
 private JTextArea getJTextArea() {
   if (jTextArea == null) {
     jTextArea = new JTextArea();
     jTextArea.setEnabled(false);
     jTextArea.setText("");
     jTextArea.setEditable(false);
     jTextArea.setLineWrap(true);
     jTextArea.setWrapStyleWord(true);
     jTextArea.setPreferredSize(new Dimension(320, 170));
     jTextArea.addKeyListener(myAction);
   }
   return jTextArea;
 }
Beispiel #22
0
 private void setupPanel()
       /** delcaring the data member inside the class */
     {
   this.setPanel(BasePanel);
   this.setLayout(baseLayout);
   this.add(firstButton);
   this.add(TextField);
   this.setBackground(Color.GREEN);
   this.add(promptLabel);
   add(tweetButton);
   chatArea.setEnabled(false);
   TextField.setToolTipText("");
 }
Beispiel #23
0
  public void reactivate() {
    // Need to re-register incase the index node has been rebooted
    indexNode.registerChatListener(this);

    message.setEnabled(true);
    message.setText("");
    message.requestFocus();
    sendMessage.setEnabled(true);
    avatarTable.setEnabled(true);
    chatLog.setBackground(Color.white);

    // Set status
    active = true;
  }
  public AboutWindow() {
    this.setIconImages(Resources.iconList);
    setSize(Toolkit.getDefaultToolkit().getScreenSize());
    setType(Type.UTILITY);
    setTitle("Bytecode Viewer - About - https://bytecodeviewer.com | https://the.bytecode.club");
    getContentPane().setLayout(new CardLayout(0, 0));

    txtrBytecodeViewerIs.setDisabledTextColor(Color.BLACK);
    txtrBytecodeViewerIs.setWrapStyleWord(true);
    getContentPane().add(txtrBytecodeViewerIs, "name_140466526081695");
    txtrBytecodeViewerIs.setEnabled(false);
    this.setResizable(false);
    this.setLocationRelativeTo(null);
  }
Beispiel #25
0
  public void novo() { // método que define a ação do botão novo.

    jtnome.setEnabled(true);
    jtend.setEnabled(true);
    jtcpf.setEnabled(true);
    jtrg.setEnabled(true);
    jttel.setEnabled(true);
    jtcodigo.setEnabled(false);

    JBeditar.setEnabled(true);
    JBsalvar.setEnabled(true);
    JBcancelar.setEnabled(true);
    jrativo.setSelected(true);
    JBnovo.setEnabled(false);
  } // fim do método novo.
Beispiel #26
0
  @Override
  public void actionPerformed(ActionEvent e) {
    // TODO Auto-generated method stub
    JToggleButton spql = (JToggleButton) DIHelper.getInstance().getLocalProp(Constants.SPARQLBTN);
    JTextArea sparqlArea =
        (JTextArea) DIHelper.getInstance().getLocalProp(Constants.SPARQL_AREA_FIELD);
    JRadioButton rdBtnGraph =
        (JRadioButton) DIHelper.getInstance().getLocalProp(Constants.RADIO_GRAPH);
    JRadioButton rdBtnGrid =
        (JRadioButton) DIHelper.getInstance().getLocalProp(Constants.RADIO_GRID);
    JRadioButton rdBtnRaw = (JRadioButton) DIHelper.getInstance().getLocalProp(Constants.RADIO_RAW);

    if (spql.isSelected()) {
      rdBtnGraph.setEnabled(true);
      rdBtnGrid.setEnabled(true);
      rdBtnRaw.setEnabled(true);
      sparqlArea.setEnabled(true);
    } else {
      rdBtnGraph.setEnabled(false);
      rdBtnGrid.setEnabled(false);
      rdBtnRaw.setEnabled(false);
      sparqlArea.setEnabled(false);
    }
  }
  private void clear() {
    date.setText("");
    illnessName.setText("");
    illnessDescription.setText("");
    DrugUse.setText("");
    DrugName.setText("");

    date.setEnabled(true);
    illnessName.setEnabled(true);
    illnessDescription.setEnabled(true);
    DrugUse.setEnabled(true);
    DrugName.setEnabled(true);
    add.setVisible(true);
    addDrug.setVisible(true);

    for (int i = table.getRowCount() - 1; i >= 0; i--) model.removeRow(i);
  }
 private void enableItems() {
   boolean enabled = mRadioButton.isSelected();
   if (mDefaultColumn != -1) {
     mList.setEnabled(enabled);
     mButtonSort.setEnabled(enabled);
   } else {
     boolean listIsEnabled = enabled && !mRadioButtonSort.isSelected();
     mRadioButtonIsStructure.setEnabled(listIsEnabled);
     if (mStructurePane != null) mStructurePane.setEnabled(listIsEnabled);
     mTextArea.setEnabled(listIsEnabled);
     mRadioButtonSort.setEnabled(enabled);
   }
   boolean sortIsEnabled = enabled && (mRadioButtonSort == null || mRadioButtonSort.isSelected());
   mComboBoxSortOrder.setEnabled(sortIsEnabled);
   mComboBoxSortMode.setEnabled(sortIsEnabled);
   mComboBoxSortColumn.setEnabled(
       sortIsEnabled && mComboBoxSortMode.getSelectedIndex() != cSortModeSize);
 }
Beispiel #29
0
  private JPanel createInputBoxPanel() {

    JPanel inputPanel = new JPanel(new BorderLayout());
    JLabel boxLabel = new JLabel("Page contents:");

    textArea = new JTextArea(10, 10);
    textArea.setLineWrap(true);
    JScrollPane scrollPane = new JScrollPane(textArea);
    boxLabel.setLabelFor(textArea);
    textArea.setEnabled(false);

    inputPanel.add(boxLabel, BorderLayout.PAGE_START);
    inputPanel.add(scrollPane, BorderLayout.CENTER);
    inputPanel.add(createSavePanel(), BorderLayout.PAGE_END);
    inputPanel.setBorder(BorderFactory.createEmptyBorder(5, 0, 0, 0));

    return inputPanel;
  }
  /** @see ComboBoxInputable */
  public void insertIntoComboBox(String text) {

    this.currentContactName = text;

    String newName;
    newName = contactPath + currentContactName + ".con";

    try {
      FileWriter r = new FileWriter(newName);
      BufferedWriter bw = new BufferedWriter(r);

      bw.write("Name: " + currentContactName + "\n");
      bw.write("E-mail: " + "\n");
      bw.write("Institution: " + "\n");

      bw.close();
      r.close();

      institutionJTextArea.setEnabled(true);
      contactInfoJTextField.setEnabled(true);
      institutionJTextArea.setEditable(true);
      contactInfoJTextField.setEditable(true);

      readContactsFromFile();

    } catch (FileNotFoundException ex) {
      JOptionPane.showMessageDialog(
          this,
          "The file " + newName + " could not be found.",
          "File Not Found",
          JOptionPane.ERROR_MESSAGE);
      Util.writeToErrorLog("Error when trying to save file: ");
      ex.printStackTrace();
    } catch (IOException ex) {
      JOptionPane.showMessageDialog(
          this,
          "An error occured when trying to save the file " + newName + ".",
          "File Error",
          JOptionPane.ERROR_MESSAGE);
      Util.writeToErrorLog("Error when trying to save file: ");
      ex.printStackTrace();
    }
  }