Package org.emftrace.metamodel.QUARCModel.GSS

Examples of org.emftrace.metamodel.QUARCModel.GSS.Element


   * @return a List with all incoming Decomposition-Ratings of Element of the node
   */
  protected List<Decomposition> getIncomingDecompositions(GraphNode node) {
    List<Decomposition> result = new ArrayList<Decomposition>();
    for (Object connection : node.getTargetConnections()){
      Element element = ((GSSElementGraphNode)((GraphConnection) connection).getSource()).getElement();
      PrioritizedElement priorizedElement = findPrioritizedElementForElement(element);
      if (priorizedElement!= null)
        result.add((Decomposition)findRelationForConnection((GraphConnection)connection));
     

View Full Code Here


   * @return a List with all outgoing Decomposition-Ratings of Element of the node
   */
  protected List<Decomposition> getOutgoingDecomposition(GraphNode node) {
    List<Decomposition> result = new ArrayList<Decomposition>();
    for (Object connection : node.getSourceConnections()){
      Element element =  ((GSSElementGraphNode)((GraphConnection) connection).getDestination()).getElement();
      PrioritizedElement priorizedElement = findPrioritizedElementForElement(element);
      if (priorizedElement!= null)
      result.add((Decomposition)findRelationForConnection((GraphConnection)connection));
    }
    return result;
View Full Code Here

    for (int i = priorizedElementSet
        .getPrioritizedElements().size()-1; i>=0;i--) {
      PrioritizedElement selectedPrinciple = priorizedElementSet
          .getPrioritizedElements().get(i);
      Element element = selectedPrinciple.getElement();
      GSSElementGraphNode node = (GSSElementGraphNode) getNodeForElement(selectedPrinciple
          .getElement());
     
     
      if (node == null) { //due to changes principle is no longer applicable
        if( displayQuestionMessagebox(element.getName() + " is no longer applicable. Deselect Principle?")){
         
          new RemovePrioritizedElementCommand(priorizedElementSet, selectedPrinciple).run();
          }
        continue;
      }
View Full Code Here

   */
  @Override
  protected void addCheckListeners() {
    for (Entry<GraphNode, CheckboxFigure> entry : selectionMap.entrySet()) {

      final Element element = ((GSSElementGraphNode) entry.getKey())
          .getElement();
      entry.getValue().addCheckListener(new ICheckListener() {

        @Override
        public void unchecked() {
View Full Code Here

            builder.getCacheManager());
      setLockStateForControls();
      // if (builder.getCacheManager().getRootPriorizedGoals().size() ==
      // 1)
    } else {
      Element target = builder.getSelectedElements().get(0);
      List<Element> elements = builder
          .getDirectChildrenOfSelectedElements();
      for (Element source : elements)
        buildScaleForInnerElement((Goal) target, (Goal) source,
            composite, builder, builder.getCacheManager());
View Full Code Here

        weightedImpactViewerColumn.getColumn().setMoveable(true);
        weightedImpactViewerColumn.getColumn().setResizable(true);
        new ColumnViewerSorter(tableViewer, weightedImpactViewerColumn) {

          protected int doCompare(Viewer viewer, Object e1, Object e2) {
            Element element = elementColumnMap.get(tableViewer
                .getTable().getSortColumn());
            Float v1 = calcWeightedImpact(builder, element,
                (Element) e1);
            Float v2 = calcWeightedImpact(builder, element,
                (Element) e2);
            return v1.compareTo(v2);
          }
        };

        weightedImpactViewerColumn
            .setLabelProvider(new CellLabelProvider() {
              public void update(ViewerCell cell) {

                String weightString = calcWeightedImpactString(
                    builder,(Element) leafElement,
                    (Element) cell.getElement());
                float impact = calcWeightedImpact(builder,
                    (Element)leafElement,
                    (Element) cell.getElement());

                Color backgroundColor = null;
                Color foregroundColor = null;
                if (symbolsCheckbox.getSelection()) {

                  setSymbol(cell, impact);
                } else if (grlSymbolsCheckbox.getSelection()) {
                  setGRLSymbol(cell, impact);
                } else {
                  cell.setFont(Display.getDefault()
                      .getSystemFont());
                  cell.setText(weightString);
                }

                if (attributeExplorerCheckbox.getSelection()) {
                  if (impact >= thresholdSpinner
                      .getSelection()) {
                    backgroundColor = new Color(null, 255,
                        255, 0);
                    foregroundColor = new Color(null, 0, 0,
                        0);
                  } else {
                    backgroundColor = new Color(null, 255,
                        255, 255);
                    foregroundColor = new Color(null, 0, 0,
                        0);
                  }
                } else if (heatmapCheckbox.getSelection()) {

                  backgroundColor = DefaultColors
                      .getBackgroundColor(impact);
                  foregroundColor = DefaultColors
                      .getForegroundColor(impact);
                } else {

                  backgroundColor = new Color(null, 255, 255,
                      255);
                  foregroundColor = new Color(null, 0, 0, 0);
                }

                cell.setBackground(backgroundColor);
                cell.setForeground(foregroundColor);

              }

            });

      }

      final TableViewerColumn unweightedImpactViewerColumn = new TableViewerColumn(
          tableViewer, SWT.NONE);

      elementColumnMap.put(unweightedImpactViewerColumn.getColumn(),
          (Element) leafElement);

      unweightedImpactViewerColumn.getColumn().setText(
          String.format("%s", ((Element) leafElement).getName()));
     
      unweightedImpactViewerColumn.getColumn().setToolTipText("the rating to "+((Element) leafElement).getName());
     
      unweightedImpactViewerColumn.getColumn().setWidth(100);

      unweightedImpactViewerColumn.getColumn().setMoveable(true);

      unweightedImpactViewerColumn.getColumn().setResizable(true);

      new ColumnViewerSorter(tableViewer, unweightedImpactViewerColumn) {

        protected int doCompare(Viewer viewer, Object e1, Object e2) {
          Element element = elementColumnMap.get(tableViewer
              .getTable().getSortColumn());
          Float v1 = getRating(builder, element, (Element) e1);
          Float v2 = getRating(builder, element, (Element) e2);
          return v1.compareTo(v2);
        }
View Full Code Here

  /**
   * @param tableViewer a TableViewer
   * @return the selected Element of the TableViewer
   */
  protected Element getSelectedElement(TableViewer tableViewer) {
    Element result = null;

    if (tableViewer.getTable().getSelectionIndex() != -1)
      result = (Element) tableViewer.getElementAt(tableViewer.getTable()
          .getSelectionIndex());
    return result;
View Full Code Here

        ((GSSElementGraphNode) node).setIsCollapsed();
    }

    for (PrioritizedElement selectedGoal : priorizedElementSet
        .getPrioritizedElements()) {
      Element element = selectedGoal.getElement();
      GSSElementGraphNode node = (GSSElementGraphNode) getNodeForElement(selectedGoal
          .getElement());
      node.show();
      node.expandParents();
      if (!cacheManager.isLeaf(element)) {
View Full Code Here

   */
  @Override
  protected void addCheckListeners() {
    for (Entry<GraphNode, CheckboxFigure> entry : selectionMap.entrySet()) {

      final Element element = ((GSSElementGraphNode) entry.getKey())
          .getElement();
      entry.getValue().addCheckListener(new ICheckListener() {

        @Override
        public void unchecked() {
View Full Code Here

   * @param decomposition a Decomposition
   */
  public void deselectDecomposition(Decomposition decomposition){
    cacheManager.markSelectedGoalDecompositionAsToRemove(decomposition);
   
    Element source = cacheManager.getSourceOfRelation(decomposition);
   
    GraphNode sourceNode = getNodeForElement(source);
   
    deselectTargets(sourceNode);
   
View Full Code Here

TOP

Related Classes of org.emftrace.metamodel.QUARCModel.GSS.Element

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.