Example #1
0
  @Override
  public ASerializedView getSerializableRepresentation() {
    SerializedRadialHierarchyView serializedForm = new SerializedRadialHierarchyView(this);
    serializedForm.setMaxDisplayedHierarchyDepth(iMaxDisplayedHierarchyDepth);
    serializedForm.setNewSelection(bIsNewSelection);
    serializedForm.setDefaultDrawingStrategyType(
        drawingStrategyManager.getDefaultDrawingStrategy().getDrawingStrategyType());

    ADrawingState currentDrawingState = drawingController.getCurrentDrawingState();

    if (pdCurrentRootElement != null) {
      if ((currentDrawingState.getType() == EDrawingStateType.DRAWING_STATE_DETAIL_OUTSIDE)
          || (currentDrawingState.getType() == EDrawingStateType.DRAWING_STATE_FULL_HIERARCHY)) {

        serializedForm.setDrawingStateType(currentDrawingState.getType());
        serializedForm.setRootElementID(pdCurrentRootElement.getElementID());
        serializedForm.setSelectedElementID(pdCurrentSelectedElement.getElementID());
        serializedForm.setRootElementStartAngle(pdCurrentRootElement.getCurrentStartAngle());
        serializedForm.setSelectedElementStartAngle(
            pdCurrentSelectedElement.getCurrentStartAngle());
      } else {
        HistoryEntry historyEntry = navigationHistory.getCurrentHistoryEntry();
        serializedForm.setDrawingStateType(historyEntry.getDrawingState().getType());
        serializedForm.setRootElementID(historyEntry.getRootElement().getElementID());
        serializedForm.setSelectedElementID(historyEntry.getSelectedElement().getElementID());
        serializedForm.setRootElementStartAngle(historyEntry.getRootElementStartAngle());
        serializedForm.setSelectedElementStartAngle(historyEntry.getSelectedElementStartAngle());
      }
    }

    return serializedForm;
  }
Example #2
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);
  }
Example #3
0
  /**
   * A new selection will be set in the selection manager with the specified parameters. A
   * ClusterNodeSelectionEvent with the new selection will be triggered. If the selected element
   * corresponds to a gene, a SelectionUpdateEvent will also be triggered.
   *
   * @param selectionType Type of selection.
   * @param pdSelected Element that has been selected.
   */
  public void setNewSelection(SelectionType selectionType, PartialDisc pdSelected) {

    selectionManager.clearSelections();
    selectionManager.addToType(selectionType, pdSelected.getElementID());

    dataEventManager.triggerDataSelectionEvents(selectionType, pdSelected);

    if (selectionType == SelectionType.SELECTION) {
      bIsNewSelection = true;
    } else {
      bIsNewSelection = false;
    }
  }