示例#1
0
  /**
   * Sets up the current display of the RadialHierarchy view according to the specified parameters.
   *
   * @param drawingStateType DrawingState that shall be used.
   * @param drawingStrategyType Default drawing strategy that shall be used.
   * @param isNewSelection Determines if the selected element has been newly selected.
   * @param rootElementID ID of current root element.
   * @param selectedElementID ID of selected element.
   * @param rootElementStartAngle Start angle of the root element.
   * @param selectedElementStartAngle Start angle of the selected element.
   * @param maxDisplayedHierarchyDepth Maximum hierarchy depth that shall be displayed.
   */
  public void setupDisplay(
      EDrawingStateType drawingStateType,
      EPDDrawingStrategyType drawingStrategyType,
      boolean isNewSelection,
      int rootElementID,
      int selectedElementID,
      float rootElementStartAngle,
      float selectedElementStartAngle,
      int maxDisplayedHierarchyDepth) {

    this.iMaxDisplayedHierarchyDepth = maxDisplayedHierarchyDepth;
    bIsNewSelection = isNewSelection;
    PartialDisc pdTemp = hashPartialDiscs.get(rootElementID);
    drawingController.setDrawingState(drawingStateType);
    drawingStrategyManager.setDefaultStrategy(drawingStrategyType);

    if (pdTemp != null) {
      setCurrentRootElement(pdTemp);
      pdCurrentSelectedElement = hashPartialDiscs.get(selectedElementID);
      pdCurrentRootElement.setCurrentStartAngle(rootElementStartAngle);
      if (pdCurrentSelectedElement != null) {
        pdCurrentSelectedElement.setCurrentStartAngle(selectedElementStartAngle);
      }
    }
    setDisplayListDirty();
  }
示例#2
0
  /**
   * Updates the current root element according to the position of the upward navigation silder,
   * i.e. a parent of the current root element with the hierarchy level of the slider position will
   * be the new root element.
   */
  private void updateHierarchyAccordingToNavigationSlider() {
    PartialDisc pdNewRootElement =
        pdCurrentRootElement.getParentWithLevel(upwardNavigationSlider.getSelectedValue());
    if (pdNewRootElement != null) {
      pdCurrentRootElement = pdNewRootElement;

      bIsNewSelection = true;

      PartialDisc pdSelectedElement =
          drawingController.getCurrentDrawingState().getSelectedElement();
      if (pdSelectedElement != null) {
        pdCurrentSelectedElement = pdSelectedElement;
        pdSelectedElement.setCurrentStartAngle(0);
      }
      navigationHistory.addNewHistoryEntry(
          drawingController.getCurrentDrawingState(),
          pdCurrentRootElement,
          pdCurrentSelectedElement,
          iMaxDisplayedHierarchyDepth);
      setDisplayListDirty();

      setNewSelection(SelectionType.SELECTION, pdCurrentSelectedElement);
    }
  }