コード例 #1
0
  /**
   * Creates the geomerty input tabbed page
   *
   * @param tabbedPane The TabbedPane to add the tab to
   */
  private void getGeometryInput(JTabbedPane tabbedPane) {
    JPanel geometryInput = new JPanel(new GridBagLayout());

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridwidth = REMAINDER;
    gbc.fill = BOTH;
    gbc.anchor = NORTHWEST;
    gbc.weighty = 1.0;

    chainwheelGeometryInput.addContentChangeListener(this);
    geometryInput.add(chainwheelGeometryInput, gbc);

    sprocketGeometryInput.addContentChangeListener(this);
    geometryInput.add(sprocketGeometryInput, gbc);

    generalGeometryInput.addContentChangeListener(this);
    geometryInput.add(generalGeometryInput, gbc);

    driveTrainDrawing.addContentChangeListener(this);
    driveTrainOutput.addContentChangeListener(this);

    tabbedPane.addTab(
        Messages.getString("GeometryDetails"),
        null,
        geometryInput,
        Messages.getString("GeometryDetailsTip"));
  }
コード例 #2
0
 /** Support method to notify children of any changes to model or style. */
 public void update() {
   generalTranslationInput.update();
   generalGeometryInput.update();
   driveTrainDrawing.update();
   driveTrainOutput.update();
   chainwheelTranslationInput.update();
   chainwheelGeometryInput.update();
   sprocketTranslationInput.update();
   sprocketGeometryInput.update();
 }
コード例 #3
0
 /**
  * Sets the model and notofies children to reflect the changes.
  *
  * @param model The model to set.
  */
 public void setModel(DriveTrain model) {
   this.model = model;
   generalTranslationInput.setModel(model);
   generalGeometryInput.setModel(model);
   chainwheelTranslationInput.setModel(model.getChainwheels());
   chainwheelGeometryInput.setModel(model.getChainwheels());
   sprocketTranslationInput.setModel(model.getSprockets());
   sprocketGeometryInput.setModel(model.getSprockets());
   driveTrainDrawing.setModel(model);
   driveTrainOutput.setModel(model);
   update();
   driveTrainOutput.structureChanged();
 }