Example #1
0
  /**
   * Responds to property change events.
   *
   * @param e the property change event
   */
  public void propertyChange(PropertyChangeEvent e) {
    super.propertyChange(e);
    if (trackerPanel == null) return;
    String name = e.getPropertyName();
    //		System.out.println(name);
    if (name.equals("function") && !loading) { // $NON-NLS-1$
      trackerPanel.changed = true;
    } else if (name.equals("tab") && inspector != null) { // $NON-NLS-1$
      if (trackerPanel != null
          && e.getNewValue() == trackerPanel
          && trackerPanel.isModelBuilderVisible) {
        inspector.setVisible(true);
      } else if (inspector.isVisible()) {
        inspector.setVisible(false);
        trackerPanel.isModelBuilderVisible = true;
      }

    } else if (name.equals("selectedtrack") // $NON-NLS-1$
        && e.getNewValue() == this
        && inspector != null
        && !inspector.getSelectedName().equals(getName())) {
      inspector.setSelectedPanel(getName());
    }
    if (name.equals("function") // $NON-NLS-1$
        || name.equals("starttime") // $NON-NLS-1$
        || name.equals("frameduration") // $NON-NLS-1$
        || name.equals("startframe") // $NON-NLS-1$
        || name.equals("stepsize")) { // $NON-NLS-1$
      lastValidFrame = -1;
    }
    if (name.equals("transform")) { // $NON-NLS-1$
      // workaround to prevent infinite loop
      ImageCoordSystem coords = trackerPanel.getCoords();
      if (!(coords instanceof ReferenceFrame
          && ((ReferenceFrame) coords).getOriginTrack() == this)) {
        lastValidFrame = -1;
      }
    }
    if (!refreshing && isModelsVisible()) {
      if (name.equals("function")) { // $NON-NLS-1$
        repaint();
      } else if (name.equals("adjusting")) { // $NON-NLS-1$
        refreshStepsLater = (Boolean) e.getNewValue();
        if (!refreshStepsLater) { // stopped adjusting, so refresh steps
          refreshSteps();
        }
      }
      if (name.equals("transform")) { // $NON-NLS-1$
        // workaround to prevent infinite loop
        ImageCoordSystem coords = trackerPanel.getCoords();
        if (!(coords instanceof ReferenceFrame
            && ((ReferenceFrame) coords).getOriginTrack() == this)) {
          refreshSteps();
        }
      } else if (name.equals("starttime") // $NON-NLS-1$
          || name.equals("frameduration") // $NON-NLS-1$
          || name.equals("startframe")) { // $NON-NLS-1$
        refreshInitialTime();
        refreshSteps();
      } else if (name.equals("stepsize")) { // $NON-NLS-1$
        refreshSteps();
      }
    }
  }