/** {@inheritDoc} */ public T setColorBackground(int theColor) { color.setBackground(theColor); for (ControllerInterface<?> ci : controllers.get()) { ci.setColorBackground(theColor); } return me; }
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); } } } }
/** {@inheritDoc} */ public T setColorActive(int theColor) { color.setActive(theColor); for (ControllerInterface<?> ci : controllers.get()) { ci.setColorActive(theColor); } return me; }
/** {@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; }
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(); } }
/** * 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); } }
/** * 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; }
/** 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(""); } }
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"); } } }
/** {@inheritDoc} */ public T setColor(CColor theColor) { for (ControllerInterface<?> ci : controllers.get()) { ci.setColor(theColor); } return me; }