Пример #1
0
  /**
   * Initializes a new hierarchy of partial discs according to a tree of cluster nodes and other
   * parameters.
   *
   * @param <E> Concrete Type of IHierarchyData
   * @param tree Tree of hierarchy data objects which is used to build the partial disc tree.
   * @param idType IDType of the hierarchy data objects.
   * @param dataEventManager Concrete DataEventManager that is responsible for handling and
   *     triggering data specific events.
   * @param alColorModes List of drawing strategies that shall be used as color modes.
   */
  public <E extends AHierarchyElement<E>> void initHierarchy(
      Tree<E> tree,
      E heRoot,
      ADataEventManager dataEventManager,
      ArrayList<EPDDrawingStrategyType> alColorModes) {

    hashPartialDiscs.clear();
    selectionManager = new SelectionManager(tree.getNodeIDType());
    partialDiscTree = new Tree<PartialDisc>();
    navigationHistory.reset();
    drawingController.setDrawingState(EDrawingStateType.DRAWING_STATE_FULL_HIERARCHY);
    LabelManager.get().clearLabels();
    drawingStrategyManager.init(pickingManager, uniqueID, alColorModes);

    PartialDisc pdRoot =
        new PartialDisc(
            partialDiscTree, heRoot, drawingStrategyManager.getDefaultDrawingStrategy());
    partialDiscTree.setRootNode(pdRoot);
    partialDiscTree.setLeafIDType(tree.getLeaveIDType());
    partialDiscTree.setNodeIDType(tree.getNodeIDType());
    hashPartialDiscs.put(heRoot.getID(), pdRoot);
    // selectionManager.initialAdd(heRoot.getID());
    buildTree(tree, heRoot, pdRoot);
    pdRoot.calculateLargestChildren();
    iMaxDisplayedHierarchyDepth = DISP_HIER_DEPTH_DEFAULT;

    this.dataEventManager = dataEventManager;
    this.dataEventManager.registerEventListeners();

    pdCurrentRootElement = pdRoot;
    pdCurrentSelectedElement = pdRoot;
    pdRealRootElement = pdRoot;

    navigationHistory.addNewHistoryEntry(
        drawingController.getCurrentDrawingState(),
        pdCurrentRootElement,
        pdCurrentSelectedElement,
        iMaxDisplayedHierarchyDepth);

    selectionManager.addToType(SelectionType.SELECTION, pdCurrentRootElement.getElementID());

    controlBox = new Rectangle(0, 0, 0.3f, 0.2f);
    upwardNavigationSlider =
        new OneWaySlider(
            new Vec2f(controlBox.getMinX() + 0.1f, controlBox.getMinY() + 0.1f),
            0.2f,
            1f,
            pdRealRootElement.getHierarchyLevel(),
            1,
            0,
            pdRealRootElement.getDepth() - 1);
    upwardNavigationSlider.setMinSize(80);
  }
Пример #2
0
 /**
  * Sets an element that will be displayed as root element.
  *
  * @param pdCurrentRootElement New element that will be displayed as root element.
  */
 public void setCurrentRootElement(PartialDisc pdCurrentRootElement) {
   this.pdCurrentRootElement = pdCurrentRootElement;
   upwardNavigationSlider.setSelectedValue(pdCurrentRootElement.getHierarchyLevel());
 }