Package de.FeatureModellingTool.FeatureModel

Examples of de.FeatureModellingTool.FeatureModel.CompositeConstraintPortType


    public ImageIcon getConstraintIcon(Object cons , ConstraintModel constraintModel , CustomizationVersion cv) {
      if (!(cons instanceof VPConstraint)) {
        return null;
      }
      VPConstraint vp = (VPConstraint)cons;
      CompositeConstraintPortType lType = null;
      if (vp.getType().equals(VPConstraintType.SingleVP)) {
        lType = CompositeConstraintPortType.Single;
      } else if (vp.getType().equals(VPConstraintType.MultiVP)) {
        lType = CompositeConstraintPortType.Multi;
      } else if (vp.getType().equals(VPConstraintType.AllVP)) {
        lType = CompositeConstraintPortType.All;
      }
      CompositeConstraintPortType rType = lType;
      if (cv==null) {
          return ImageManager.getInstance().getCompositeConstraintHeader(lType , rType , CompositeConstraintType.Equivalence , null , null , ImageManager.ConstraintStat.csNone);
      } else {
        List<Customization> sCustomization = new ArrayList<Customization>();
        for (Iterator<Feature> itFeature=vp.getSourceFeatureSet().iterator() ; itFeature.hasNext() ; ) {
          Feature feature = itFeature.next();
          CFRelation cf = constraintModel.getCFRelation(feature , vp , true);
          if (cf==null) {
              cf = constraintModel.getCFRelation(feature , vp , false);
          }
          sCustomization.add(super.convertCustomization(cv.getFinalCustomizationById(feature.getID()) , cf));
        }
        Customization lValue = Customization.Undecided;
        if (lType.getName().equals(CompositeConstraintPortType.Single.getName())) {
          if (super.getCustomizationCount(sCustomization , Customization.Undecided)>0) {
            lValue = Customization.Undecided;
          } else if (super.getCustomizationCount(sCustomization , Customization.Selected)==1) {
            lValue = Customization.Selected;
          } else {
            lValue = Customization.Unselected;
          }
        } else if (lType.getName().equals(CompositeConstraintPortType.All.getName())) {
          if (super.getCustomizationCount(sCustomization , Customization.Undecided)>0) {
            lValue = Customization.Undecided;
          } else if (super.getCustomizationCount(sCustomization , Customization.Unselected)==0) {
            lValue = Customization.Selected;
          } else {
            lValue = Customization.Unselected;
          }
        } else /*if (gc.getType().getName().equals(GroupConstraintType.SingleGroup))*/ {
          if (super.getCustomizationCount(sCustomization , Customization.Selected)>0) {
            lValue = Customization.Selected;
          } else if (super.getCustomizationCount(sCustomization , Customization.Undecided)>0) {
            lValue = Customization.Undecided;
          } else {
            lValue = Customization.Unselected;
          }
        }
       
        sCustomization = new ArrayList<Customization>();
        for (Iterator<Feature> itFeature=vp.getSinkFeatureSet().iterator() ; itFeature.hasNext() ; ) {
          Feature feature = itFeature.next();
          CFRelation cf = constraintModel.getCFRelation(feature , vp , true);
          if (cf==null) {
              cf = constraintModel.getCFRelation(feature , vp , false);
          }
          sCustomization.add(super.convertCustomization(cv.getFinalCustomizationById(feature.getID()) , cf));
        }
        Customization rValue = Customization.Undecided;
        if (rType.getName().equals(CompositeConstraintPortType.Single.getName())) {
          if (super.getCustomizationCount(sCustomization , Customization.Undecided)>0) {
            rValue = Customization.Undecided;
          } else if (super.getCustomizationCount(sCustomization , Customization.Selected)==1) {
            rValue = Customization.Selected;
          } else {
            rValue = Customization.Unselected;
          }
        } else if (rType.getName().equals(CompositeConstraintPortType.All.getName())) {
          if (super.getCustomizationCount(sCustomization , Customization.Undecided)>0) {
            rValue = Customization.Undecided;
          } else if (super.getCustomizationCount(sCustomization , Customization.Unselected)==0) {
            rValue = Customization.Selected;
          } else {
View Full Code Here


                    Set set = idToFigureMap.get(target.getID());
                    if (set == null) return;

                    //update the figure's display

                    CompositeConstraintPortType sourceType = target.getSourceType();

                    String value = null;

                    if (CompositeConstraintPortType.Single.equals(sourceType)) {
                        value = PLFigure.Single;
                    } else if (CompositeConstraintPortType.Multi.equals(sourceType)) {
                        value = PLFigure.Multi;
                    } else {
                        value = PLFigure.All;
                    }

                    Iterator iterator = set.iterator();
                    while (iterator.hasNext()) {
                        Figure fig = (Figure) iterator.next();
                        fig.setAttribute(PLFigure.SourceType, value);
                        fig.invalidate();
                    }
                } else if (propertyName.equals(CompositeConstraintProperties.SINK_TYPE)) {
                    //find the figure
                    Set set = idToFigureMap.get(target.getID());
                    if (set == null) return;

                    //update the figure's display

                    CompositeConstraintPortType sinkType = target.getSinkType();

                    String value = null;

                    if (CompositeConstraintPortType.Single.equals(sinkType)) {
                        value = PLFigure.Single;
View Full Code Here

                    Set set = idToFigureMap.get(target.getID());
                    if (set == null) return;

                    //update the figure's display

                    CompositeConstraintPortType sourceType = target.getSourceType();

                    String value = null;

                    if (CompositeConstraintPortType.Single.equals(sourceType)) {
                        value = PLFigure.Single;
                    } else if (CompositeConstraintPortType.Multi.equals(sourceType)) {
                        value = PLFigure.Multi;
                    } else {
                        value = PLFigure.All;
                    }

                    Iterator iterator = set.iterator();
                    while (iterator.hasNext()) {
                        Figure fig = (Figure) iterator.next();
                        fig.setAttribute(PLFigure.SourceType, value);
                        fig.invalidate();
                    }
                } else if (propertyName.equals(CompositeConstraintProperties.SINK_TYPE)) {
                    //find the figure
                    Set set = idToFigureMap.get(target.getID());
                    if (set == null) return;

                    //update the figure's display

                    CompositeConstraintPortType sinkType = target.getSinkType();

                    String value = null;

                    if (CompositeConstraintPortType.Single.equals(sinkType)) {
                        value = PLFigure.Single;
View Full Code Here

TOP

Related Classes of de.FeatureModellingTool.FeatureModel.CompositeConstraintPortType

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.