コード例 #1
0
  /** Called when a choice was made in the animation type combo box. */
  public void animationCombo_actionPerformed() {
    int selectedIndex = animationCombo.getSelectedIndex();
    switch (selectedIndex) {
      case HackController.DISPLAY_CHANGES:
        if (!partAnimMenuItem.isSelected()) partAnimMenuItem.setSelected(true);
        break;

      case HackController.ANIMATION:
        if (!fullAnimMenuItem.isSelected()) fullAnimMenuItem.setSelected(true);
        break;

      case HackController.NO_DISPLAY_CHANGES:
        if (!noAnimMenuItem.isSelected()) noAnimMenuItem.setSelected(true);
        break;
    }

    notifyControllerListeners(ControllerEvent.ANIMATION_MODE_CHANGE, new Integer(selectedIndex));
  }
コード例 #2
0
  /** Called when a choice was made in the numeric format combo box. */
  public void formatCombo_actionPerformed() {
    int selectedIndex = formatCombo.getSelectedIndex();
    switch (selectedIndex) {
      case HackController.DECIMAL_FORMAT:
        if (!decMenuItem.isSelected()) decMenuItem.setSelected(true);
        break;

      case HackController.HEXA_FORMAT:
        if (!hexaMenuItem.isSelected()) hexaMenuItem.setSelected(true);
        break;

      case HackController.BINARY_FORMAT:
        if (!binMenuItem.isSelected()) binMenuItem.setSelected(true);
        break;
    }

    notifyControllerListeners(ControllerEvent.NUMERIC_FORMAT_CHANGE, selectedIndex);
  }
コード例 #3
0
  /** Called when a choice was made in the additional display combo box. */
  public void additionalDisplayCombo_actionPerformed() {
    int selectedIndex = additionalDisplayCombo.getSelectedIndex();
    switch (selectedIndex) {
      case HackController.SCRIPT_ADDITIONAL_DISPLAY:
        if (!scriptMenuItem.isSelected()) scriptMenuItem.setSelected(true);
        break;

      case HackController.OUTPUT_ADDITIONAL_DISPLAY:
        if (!outputMenuItem.isSelected()) outputMenuItem.setSelected(true);
        break;

      case HackController.COMPARISON_ADDITIONAL_DISPLAY:
        if (!compareMenuItem.isSelected()) compareMenuItem.setSelected(true);
        break;

      case HackController.NO_ADDITIONAL_DISPLAY:
        if (!noAdditionalDisplayMenuItem.isSelected())
          noAdditionalDisplayMenuItem.setSelected(true);
        break;
    }

    notifyControllerListeners(
        ControllerEvent.ADDITIONAL_DISPLAY_CHANGE, new Integer(selectedIndex));
  }
コード例 #4
0
 public void actionPerformed(ActionEvent e) {
   if (e.getActionCommand().equals("No coloring")) {
     ((TreeWindow) parent).removeColor();
   } else if (e.getActionCommand().equals("Majority coloring")) {
     ((TreeWindow) parent).tree.setMajorityColoring(majorityColoringMenuItem.isSelected());
     ((TreeWindow) parent).tree.getTree().updateBranchColorFromChildren();
     // frame.recolorBranches();
   } else if (e.getActionCommand().equals("Number of OTUs")) {
     tree.getTree().sortByNumberOfOtus();
     tree.setYOffsets(tree.getTree(), 0);
     tree.setTOffsets(tree.getTree(), 0);
     tree.setROffsets(tree.getTree(), 0);
     tree.setRadialOffsets(tree.getTree());
   } else if (e.getActionCommand().equals("Number of immediate children")) {
     tree.getTree().sortByNumberOfChildren();
     tree.setYOffsets(tree.getTree(), 0);
     tree.setTOffsets(tree.getTree(), 0);
     tree.setROffsets(tree.getTree(), 0);
     tree.setRadialOffsets(tree.getTree());
   }
 }