Package org.uengine.processdesigner.mapper

Examples of org.uengine.processdesigner.mapper.TransformerDesigner


      addTransformer(transformer);

    }
   
    public void addTransformer(Transformer transformer){
      TransformerDesigner tfd = transformer.createDesigner(LinkPanel.this);
     
      add(tfd);
     
      Dimension preferredSize = tfd.getPreferredSize();
      tfd.setBounds(lastX,lastY,preferredSize.width,preferredSize.height);
     
      tfd.revalidate();
      transformer.afterAdded();
     
      revalidate();

    }
View Full Code Here


         /**
          * ban to add same transformers multiplicitly
          */
         if(!existingTransformers.containsKey(transformer)){
           //need to regenerate the instance of Designer since there's no graphical objects those are deserialized.
           TransformerDesigner tfd = transformer.createDesigner(mapToolPanel.getLinkPanel());
          
           //mapToolPanel.getLinkPanel().add(tfd);
          
           existingTransformers.put(transformer, tfd);
           //transformer.beforeSerialization();
         }

         Record target = (Record) sourceNodes.get(paramContext.getArgument().getText());
         //the output argument of transformer must be the source which should be linked in the first order
         TransformerArgument source = transformer.getTransferArgument(transformerMapping.getLinkedArgumentName());
        
         if(paramContext.isKey()){
           target.setKeyType(Record.KEY);
          }
         
         try{
           mapToolPanel.getModel().addLink(source, target);
         }catch(Exception e){
           e.printStackTrace();
         }
        
         new RecursiveLoop(){

          @Override
          public boolean logic(Object tree) {
            return false;
          }

          @Override
          public List getChildren(Object tree) {
           
            if(tree instanceof TransformerMapping){
              System.out.println();
            }
           
            // stops the recursive tracing when it meets the endpoints           
            if(!(tree instanceof Transformer)){
              return null;
            }
           
            Transformer transformer = (Transformer)tree;
           
            final ArrayList children = new ArrayList();

            if(transformer.getInputArguments()!=null)
            for(int i=0; i<transformer.getInputArguments().length; i++){
              Object argumentSource = transformer.getArgumentSourceMap().get(transformer.getInputArguments()[i]);
              TransformerArgument target = transformer.getTransferArgument(transformer.getInputArguments()[i]);
             
              if(argumentSource==null) continue;
             
              ArrayList argumentSources;
              if(argumentSource instanceof ArrayList){
                argumentSources = (ArrayList)argumentSource;
              }else{
                argumentSources = new ArrayList();
                argumentSources.add(argumentSource);
              }
             
              for(int j=0; j<argumentSources.size(); j++){
                argumentSource = argumentSources.get(j);
               
                if(argumentSource instanceof TransformerMapping){
                  TransformerMapping priorTransformerMapping = (TransformerMapping) argumentSource;
                 
                  Transformer priorTransformer = priorTransformerMapping.getTransformer();
                  argumentSource = priorTransformer;
                 
                  if(!existingTransformers.containsKey(priorTransformer)){
                    TransformerDesigner tfd = priorTransformer.createDesigner(mapToolPanel.getLinkPanel());
                    existingTransformers.put(priorTransformer, tfd);
                  }
                 
                  TransformerArgument priorTransformerArgument = priorTransformer.getTransferArgument(priorTransformerMapping.getLinkedArgumentName());
                  children.add(argumentSource);
View Full Code Here

TOP

Related Classes of org.uengine.processdesigner.mapper.TransformerDesigner

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.