Package org.uengine.processdesigner.mapper

Examples of org.uengine.processdesigner.mapper.Transformer


  int lastY = 0;
    final JPopupMenu popupMenu = new JPopupMenu();
   
    private void addMenuItem(JMenu parent, final String clsName) throws Exception {
     
      Transformer td = getTransformer(clsName);
      JMenuItem menuItem = new JMenuItem(td.getName());
        menuItem.addActionListener(new ActionListener() {
          public void actionPerformed(ActionEvent ae) {
            addTransformer(clsName);
          }
        });
View Full Code Here


        else
          parent.add(menuItem);
    }
   
    public void addTransformer(String clsName){
    Transformer transformer = null;
    try {
      transformer = getTransformer(clsName);
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here

      transformerCls = (Class<Transformer>) Class.forName(clsName);
    } catch(Throwable e) {
      e.printStackTrace();
    }
   
    Transformer transformer = transformerCls.newInstance();
   
    return transformer;
    }
View Full Code Here

          Map options = new HashMap();
          options.put(org.uengine.processdesigner.mapper.Transformer.OPTION_KEY_OUTPUT_ARGUMENT, param.getTransformerMapping().getLinkedArgumentName() );
          options.put(org.uengine.processdesigner.mapper.Transformer.OPTION_KEY_FORM_FIELD_NAME, targetFieldName);
         
          TransformerMapping tm = param.getTransformerMapping();
          Transformer transformer = tm.getTransformer();
         
          value = param.getTransformerMapping().getTransformer().letTransform(instance, options);
          System.out.println(value);
          instance.setBeanProperty(targetFieldName, (Serializable)value);
View Full Code Here

     for(int i=0; i<mappingElements.length; i++){
       MappingElement paramContext = (MappingElement) mappingElements[i];
      
       if(paramContext.getTransformerMapping()!=null){
         TransformerMapping transformerMapping = paramContext.getTransformerMapping();
         Transformer transformer = transformerMapping.getTransformer();
        
         /**
          * 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);
 
 
                  if(priorTransformerArgument==null)
                    continue; //anyway never be occurred... means priorTransformerArgument must exist.
                 
                   /**
                    * transformer argument is eager to be changed since the user interface occasionally re-rendered.
                    */
                   priorTransformerArgument = priorTransformer.getTransferArgument(priorTransformerArgument.getName());
 
                   //the output argument of transformer must be the source which should be linked in the first order
                   TransformerArgument source = priorTransformerArgument;
                  
                  
View Full Code Here

TOP

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

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.