コード例 #1
0
 /** {@inheritDoc} */
 public T setColorBackground(int theColor) {
   color.setBackground(theColor);
   for (ControllerInterface<?> ci : controllers.get()) {
     ci.setColorBackground(theColor);
   }
   return me;
 }
コード例 #2
0
  protected void drawControllers(PApplet theApplet) {
    if (isOpen) {

      for (ControlWindowCanvas cc : _myControlCanvas) {
        if (cc.mode() == ControlWindowCanvas.PRE) {
          cc.draw(theApplet);
        }
      }
      for (ControllerInterface<?> ci : controllers.get()) {
        if (ci.isVisible()) {
          ci.updateInternalEvents(theApplet);
          ci.draw(theApplet);
        }
      }

      for (CDrawable cd : controllers.getDrawables()) {
        cd.draw(theApplet);
      }

      for (ControlWindowCanvas cc : _myControlCanvas) {
        if (cc.mode() == ControlWindowCanvas.POST) {
          cc.draw(theApplet);
        }
      }
    }
  }
コード例 #3
0
 /** {@inheritDoc} */
 public T setColorActive(int theColor) {
   color.setActive(theColor);
   for (ControllerInterface<?> ci : controllers.get()) {
     ci.setColorActive(theColor);
   }
   return me;
 }
コード例 #4
0
 /** {@inheritDoc} */
 public T setColorValue(int theColor) {
   color.setValueLabel(theColor);
   if (_myValueLabel != null) {
     _myValueLabel.setColor(color.getValueLabel());
   }
   for (ControllerInterface<?> ci : controllers.get()) {
     ci.setColorValue(theColor);
   }
   return me;
 }
コード例 #5
0
 public void actionPerformed(ActionEvent event) {
   if (event.getSource() == setBPMButton) {
     // try{
     int bpm = Integer.parseInt(bpmTextField.getText());
     controller.setBPM(bpm); // }
     //	catch(NumberFormatException e){}
   } else if (event.getSource() == increaseBPMButton) {
     controller.increaseBPM();
   } else if (event.getSource() == decreaseBPMButton) {
     controller.decreaseBPM();
   }
 }
コード例 #6
0
 /**
  * Searches for InsuranceCompanies. Calls the controller and updates the tableData to the
  * searchMap.
  */
 private void searchInsuranceCompany() {
   String query = searchTextField.getText();
   controller.searchInsuranceCompanies(query);
   tableData.update(
       model.getSearchMap(), model.getSortingStrategy()); // Updates tableData and sortingStrategy
   // Enable automatic selection while searching
   if (tableData.getRowCount() > 0) {
     selectRow();
     int selectedCompanyId =
         Integer.valueOf(
             (String)
                 insuranceCompaniesTable.getValueAt(insuranceCompaniesTable.getSelectedRow(), 0));
     controller.selectInsuranceCompany(selectedCompanyId);
   }
 }
コード例 #7
0
 /**
  * Removes a controller from the group, but use Controller.setGroup() instead.
  *
  * @param theElement ControllerInterface
  * @return ControllerGroup
  */
 public T remove(ControllerInterface<?> theElement) {
   if (theElement != null) {
     theElement.setMouseOver(false);
   }
   controllers.remove(theElement);
   return me;
 }
コード例 #8
0
  /** Observer method to update the insuranceCompanyTable */
  public void updateTable() {

    tableData.update(
        model.getInsuranceCompanies(), model.getSortingStrategy()); // Populate the table

    // Check if InsuranceCompany map is empty
    if (model.getInsuranceCompanies().size() > 0) {
      selectRow();
      int selectedCompanyId =
          Integer.valueOf(
              (String)
                  insuranceCompaniesTable.getValueAt(insuranceCompaniesTable.getSelectedRow(), 0));
      controller.selectInsuranceCompany(selectedCompanyId);
      recordEdited = -1; // Reset the recordEdited field
    } else {
      // If all records are deleted, clear the edit panel
      companyIdTextField.setText("");
      companyNameTextField.setText("");
      urlTextField.setText("");
      generalDescriptionTextField.setText("");
      insuranceTypesTextField.setText("");
      telephoneTextField.setText("");
      percentageTextField.setText("");
    }
  }
コード例 #9
0
  public void run() {

    try {
      ObjectInputStream in = new ObjectInputStream(_socket.getInputStream());
      DebugMessage mess = (DebugMessage) in.readObject();
      _ctrl.onMessageRecieved(mess);
      in.close();
    } catch (Exception e) {
      e.printStackTrace();
    } finally {
      try {
        _socket.close();
      } catch (IOException ex) {
        System.err.println("Error closing server socket");
      }
    }
  }
コード例 #10
0
 /** {@inheritDoc} */
 public T setColor(CColor theColor) {
   for (ControllerInterface<?> ci : controllers.get()) {
     ci.setColor(theColor);
   }
   return me;
 }