Package de.FeatureModellingTool.PatternBase

Examples of de.FeatureModellingTool.PatternBase.Templete


            List<Templete> childrenTemplete = pattern.getChildrenTempletes();
            if (!childrenTemplete.isEmpty()) {
                Element childTempleteElement = new Element("childTempleteList", pbd);
                Iterator childTempleteIterator = childrenTemplete.iterator();
                while (childTempleteIterator.hasNext()) {
                    Templete childTemplete = (Templete) childTempleteIterator.next();
                    String childTempleteName = childTemplete.getName();
                    childTempleteElement.addContent(new Element("templete", pbd).setAttribute("name", childTempleteName));
                }
                childrenElement.addContent(childTempleteElement);
            }
            patternElement.addContent(childrenElement);
            //�Ѹ�ģʽ����ģʽ�б�
            patternList.addContent(patternElement);
        }
        //�洢����ģ��
        Map<String, Templete> allTempletes = patternBase.getAllTempletes();
        Iterator templeteIterator = allTempletes.values().iterator();
        while (templeteIterator.hasNext()) {
            Templete templete = (Templete) templeteIterator.next();
            String templeteName = templete.getName();
            Element templeteElement = new Element("templete", pbd);
            templeteElement.setAttribute("name", templeteName);
            String parentType;
            String parentName;
            //���ø���������ģʽ��Ҳ������ģ��
            if (templete.getParentType() == "templete") {
                parentType = "templete";
                parentName = ((Templete) templete.getParent()).getName();
            } else {
                parentType = "pattern";
                parentName = ((Pattern) templete.getParent()).getName();
            }
            Element parentElement = new Element("parent", pbd);
            parentElement.setAttribute("type", parentType).setAttribute("name", parentName);
            templeteElement.addContent(parentElement);

            List<Templete> tChildTempletes = templete.getChildrenTempletes();
            if (!tChildTempletes.isEmpty()) {
                Element tChildTempleteElement = new Element("childTempleteList", pbd);
                Iterator tChildTempleteIterator = tChildTempletes.iterator();
                while (tChildTempleteIterator.hasNext()) {
                    Templete tChildTemplete = (Templete) tChildTempleteIterator.next();
                    String tChildTempleteName = tChildTemplete.getName();
                    Element childElement = new Element("Templete", pbd);
                    childElement.setAttribute("name", tChildTempleteName);
                    tChildTempleteElement.addContent(childElement);
                }
                templeteElement.addContent(tChildTempleteElement);
View Full Code Here


            if (childrenTempleteList != null) {
                Iterator childrenTempleteIterator = childrenTempleteList.getChildren().iterator();
                while (childrenTempleteIterator.hasNext()) {
                    Element childTempleteElement = (Element) childrenTempleteIterator.next();
                    Templete childTemplete = patternBase.getTemplete(childTempleteElement.getAttributeValue("name"));
                    pattern.addChildTemplete(childTemplete);
                }
            }
        }

        Iterator templeteIteratorAgain = templeteList.getChildren().iterator();
        while (templeteIteratorAgain.hasNext()) {
            Element templeteElement = (Element) templeteIteratorAgain.next();
            Templete templete = patternBase.getTemplete(templeteElement.getAttributeValue("name"));

            Element parent = templeteElement.getChild("parent", pbd);
            if (parent.getAttributeValue("type") == "templete") {
                Templete parentTemplete = patternBase.getTemplete(parent.getAttributeValue("name"));
                templete.setParentTemplete(parentTemplete);
            } else {
                Pattern parentPattern = patternBase.getPattern(parent.getAttributeValue("name"));
                templete.setParentPattern(parentPattern);
            }

            Element childList = templeteElement.getChild("childTempleteList", pbd);
            if (childList != null) {
                Iterator childTempleteIterator = childList.getChildren().iterator();
                while (childTempleteIterator.hasNext()) {
                    Element childTempleteElement = (Element) childTempleteIterator.next();
                    Templete childTemplete = patternBase.getTemplete(childTempleteElement.getAttributeValue("name"));
                    templete.addChildTemplete(childTemplete);
                }
            }
        }
        return patternBase;
View Full Code Here

 
    protected class CurrentTemplateChangeListener implements PropertyChangeListener {
       
        public void propertyChange(PropertyChangeEvent evt) {
          if (evt.getPropertyName().equals(ConstantDefinition.CURRENT_TEMPLATE)) {
            Templete template = (Templete)evt.getNewValue();
            setTemplate(template);
          }
        }
View Full Code Here

  }
 
    protected class CurrentTemplateChangeListener implements PropertyChangeListener {
        public void propertyChange(PropertyChangeEvent evt) {
          if (evt.getPropertyName().equals(ConstantDefinition.CURRENT_TEMPLATE)) {
            Templete template = (Templete)evt.getNewValue();
            setTemplate(template);
          }
        }
View Full Code Here

                PatternTreeNode newPTN = null;
                if (this.patternType == PatternType.ptPattern) {
                    Pattern newPattern = newPattern(parentId, pie.getEditName());
                    newPTN = new PatternTreeNode(newPattern);
                } else {
                    Templete newTemplate = newTemplate(parentId, pie.getEditName());
                    newTemplate.getFeatureModelEditor().addFeature("root");
                    newPTN = new PatternTreeNode(newTemplate);
                }

                if (ptn == null) {
                    PatternTreeNode root = (PatternTreeNode) patternTreeModel.getRoot();
View Full Code Here

                    ptn = (PatternTreeNode) node;
                }
            }

            if (ptn != null && (e.getButton() == MouseEvent.BUTTON1 || e.getButton() == MouseEvent.BUTTON3)) {
                Templete template = ptn.getNodeType() == NodeType.ntTemplate
                        ? ptn.getTemplate()
                        : null;
                firePropertyChange(ConstantDefinition.CURRENT_TEMPLATE, null, template);
            }
View Full Code Here

  }
 
    protected class CurrentTemplateChangeListener implements PropertyChangeListener {
        public void propertyChange(PropertyChangeEvent evt) {
          if (evt.getPropertyName().equals(ConstantDefinition.CURRENT_TEMPLATE)) {
            Templete template = (Templete)evt.getNewValue();
            setTemplate(template);
          }
        }
View Full Code Here

  }
 
    protected class CurrentTemplateChangeListener implements PropertyChangeListener {
        public void propertyChange(PropertyChangeEvent evt) {
          if (evt.getPropertyName().equals(ConstantDefinition.CURRENT_TEMPLATE)) {
            Templete template = (Templete)evt.getNewValue();
            setTemplate(template);
          }
        }
View Full Code Here

    private void removePattern(String patternName) {
        this.patternBase.removePattern(patternName);
    }

    private Templete newTemplate(String parentId, String templateName) {
        Templete template = this.patternBase.addTemplete(templateName);
        if (this.patternBase.containsPattern(parentId)) {
            this.patternBase.getPattern(parentId).addChildTemplete(template);
            template.setParentPattern(this.patternBase.getPattern(parentId));
        } else {
            this.patternBase.getTemplete(parentId).addChildTemplete(template);
            template.setParentTemplete(this.patternBase.getTemplete(parentId));
        }

        return template;
    }
View Full Code Here

                PatternTreeNode newPTN = null;
                if (this.patternType == PatternType.Pattern) {
                    Pattern newPattern = newPattern(parentId, pie.getEditName());
                    newPTN = new PatternTreeNode(newPattern);
                } else {
                    Templete newTemplate = newTemplate(parentId, pie.getEditName());
                    newTemplate.getFeatureModelEditor().addFeature("root");
                    newPTN = new PatternTreeNode(newTemplate);
                }

                if (ptn == null) {
                    PatternTreeNode root = (PatternTreeNode) patternTreeModel.getRoot();
View Full Code Here

TOP

Related Classes of de.FeatureModellingTool.PatternBase.Templete

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.