Package org.uengine.processdesigner

Examples of org.uengine.processdesigner.ProxyPanel


    super.onDropped(components);
  }
 
  protected JPanel boxComponent(final ActivityDesigner designer){
    Component comp = designer.getComponent();
    JPanel compPanel = new ProxyPanel(new BorderLayout(0,0));

    if(getChildDesigners().size() == 0)
       compPanel.add("North", new JLabel("commitment"));
    if(getChildDesigners().size() == 1)
       compPanel.add("North", new JLabel("onCompensate"));
    compPanel.add("Center", comp);
      
    return compPanel;
  }
View Full Code Here


      eventHandlerPanel.setScopeActivity((ScopeActivity)act);
  }

  protected void initialize(){
   
    JPanel designArea = new ProxyPanel();
   
    designArea.setLayout(new BorderLayout());
    designArea.setBorder(BorderFactory.createEmptyBorder());
   
     
    innerPanel = new ProxyPanel();
   
    //innerPanel.setBorder(BorderFactory.createLineBorder(Color.GRAY, 1));
    innerPanel.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 2));
    innerPanel.setBorder(BorderFactory.createEmptyBorder(10,0,20,0));

    centerPanel = new ProxyPanel(new FlowLayout(FlowLayout.CENTER, 0, 0));
    innerPanel.add(centerPanel);
   
    innerPanel.add(new ArrowLabel(){       
      public void onDropped() {
        setSelected(false);
        //TODO: change to use the standard drag&drop framework
        Vector selectedComps = ActivityDesignerListener.getSelectedComponents();
        if(selectedComps!=null){
          insertActivityDesigners(selectedComps, -1);
        }
 
        ActivityDesignerListener.bDragging = false;
      }
    });
   
    designArea.add("Center", innerPanel);
   
    eventHandlerPanel = new EventHandlerPanel();
   
   
   
    designArea.add("South", eventHandlerPanel);
   
    setLayout(new BorderLayout());
    //add("West", new ActivityLabel(ScopeActivity.class));
    add("Center", designArea);
   
View Full Code Here

    spacer.setPreferredSize(new Dimension(20,1));
    add(spacer);
*/   
    //This line make dicision how the child activities are aligned.
   
    centerPanel = new ProxyPanel(){
      @Override
      public void removeAll() {
        // TODO Auto-generated method stub
        super.removeAll();
        centerPanel.add(firstPlaceHolder);
        centerPanel.add(secondPlaceHolder);
      }

    };
   
    if(isVertical) {
      centerPanel.setLayout(new BoxLayout(centerPanel, BoxLayout.X_AXIS));
    } else {
      centerPanel.setLayout(new BoxLayout(centerPanel, BoxLayout.Y_AXIS));
    }
   
/*    final GridBagConstraints c = new GridBagConstraints();
    c.fill = GridBagConstraints.NONE;
    c.ipadx=10;
    c.ipady=2;
   
    centerPanel = new ProxyPanel(new GridBagLayout()){
      public Component add(Component comp, int index){
       
       
        return super.add(comp);
      }
    };*/
   
    ProxyPanel firstPlaceHolder = new ProxyPanel();{
      PlaceHolder innerHolder = new PlaceHolder(new Dimension(50,40), false){

        @Override
        public void onDropped() {
          super.onDropped();
          if(ActivityDesignerListener.getSelectedComponents()!=null && ActivityDesignerListener.getSelectedComponents().size()>0)
            AllActivityDesigner.this.onDropped(ActivityDesignerListener.getSelectedComponents());
        }
       
      };
      //innerHolder.setAlwaysDrawRegion(true);
      innerHolder.setText("drop here");
     
      firstPlaceHolder.setLayout(new BorderLayout(0, 0));
      firstPlaceHolder.add("West", new ArrowLabel());
      firstPlaceHolder.add("Center", innerHolder);
      firstPlaceHolder.add("East", new ArrowLabel());
      this.firstPlaceHolder = firstPlaceHolder;
    }
   
    ProxyPanel secondPlaceHolder = new ProxyPanel();{
      secondPlaceHolder.setLayout(new BorderLayout(0, 0));
      secondPlaceHolder.add("West", new ArrowLabel());
     
      ProxyPanel innerPanel = new ProxyPanel(new BorderLayout(0,0));
      innerPanel.add("Center", new HorizontalSeparator());
     
/*      if(this instanceof SwitchActivityDesigner){
        innerPanel.add("West", new JLabel("otherwise"));
      }
*/     
 
View Full Code Here

 
  protected JPanel boxComponent(final ActivityDesigner designer){
    Component comp = designer.getComponent();
    JPanel compPanel;      
      
    ProxyPanel innerPanel= new ProxyPanel();
    innerPanel.setArrowReceiveOrNot(!(designer instanceof ComplexActivityDesigner));
   
    if (isVertical) {
      innerPanel.setLayout(new BoxLayout(innerPanel, BoxLayout.Y_AXIS));
      innerPanel.add(comp);
      innerPanel.add(new Separator(true));
    } else {
      innerPanel.setLayout(new BorderLayout(0, 0));

      innerPanel.add("West", comp);
      innerPanel.add("Center", new HorizontalSeparator());
      innerPanel.add("South", new PlaceHolder(new Dimension(30,5), true){
        public void onDropped() {
          setSelected(false);

          Vector selectedComps = ActivityDesignerListener
            .getSelectedComponents();
         
          if (selectedComps != null) {
            int where = designer.getParentDesigner().indexOf(
                designer);
           
            insertActivityDesigners(selectedComps, where+1);
          }
        }
      });
      innerPanel.add("North", new PlaceHolder(new Dimension(30,5), true){
        public void onDropped() {
          setSelected(false);

          Vector selectedComps = ActivityDesignerListener
            .getSelectedComponents();
         
          if (selectedComps != null) {
            int where = designer.getParentDesigner().indexOf(
                designer);
           
            insertActivityDesigners(selectedComps, where);
          }
        }
      });
    }

    ArrowLabel startArrowLabel = new ArrowLabel() {
      public void onDropped() {
        Vector selectedComps = ActivityDesignerListener
            .getSelectedComponents();
        if (selectedComps != null) {

          if (designer instanceof SequenceActivityDesigner) {
            ((SequenceActivityDesigner) designer)
                .insertActivityDesigners(selectedComps, 0);
          } else {
            // ActivityDesigner droppingActivity =
            // ((ActivityDesigner)selectedComps.elementAt(0));
            SequenceActivity wrapperActivity = new SequenceActivity();
            SequenceActivityDesigner wrapperActivityDesigner =
              (SequenceActivityDesigner) wrapperActivity.createDesigner();

            wrapperActivityDesigner.onDropped(selectedComps);

            int where = designer.getParentDesigner().indexOf(
                designer);
            Vector compBag = new Vector();
            compBag.add(designer);
            wrapperActivityDesigner.onDropped(compBag);

            selectedComps = new Vector();
            selectedComps.add(wrapperActivityDesigner);
            insertActivityDesigners(selectedComps, where);
          }
        }
        setSelected(false);
      }
    };
    ArrowLabel endArrowLabel = new ArrowLabel() {
      public void onDropped() {
        Vector selectedComps = ActivityDesignerListener
            .getSelectedComponents();
        if (selectedComps != null) {

          if (designer instanceof SequenceActivityDesigner) {
            designer.onDropped(selectedComps);
          } else {
            // ActivityDesigner droppingActivity =
            // ((ActivityDesigner)selectedComps.elementAt(0));
            SequenceActivity wrapperActivity = new SequenceActivity();
            ActivityDesigner wrapperActivityDesigner = wrapperActivity
                .createDesigner();

            int where = designer.getParentDesigner().indexOf(
                designer);
            Vector compBag = new Vector();
            compBag.add(designer);
            wrapperActivityDesigner.onDropped(compBag);

            wrapperActivityDesigner.onDropped(selectedComps);

            selectedComps = new Vector();
            selectedComps.add(wrapperActivityDesigner);
            insertActivityDesigners(selectedComps, where);
          }
        }
        setSelected(false);
      }
    };
    if (isVertical) {
      compPanel = new ProxyPanel();
      compPanel.setLayout(new BoxLayout(compPanel, BoxLayout.Y_AXIS));
      compPanel.add(startArrowLabel);
      compPanel.add(innerPanel);
      compPanel.add(endArrowLabel);
    } else {
      compPanel = new ProxyPanel(new BorderLayout(0, 0));
      compPanel.add("West", startArrowLabel);
      compPanel.add("Center", innerPanel);
      compPanel.add("East", endArrowLabel);
    }
      
View Full Code Here

  }
 
  protected JPanel boxComponent(final ActivityDesigner designer){
    Component comp = designer.getComponent();
   
    JPanel compPanel = new ProxyPanel(new BorderLayout(0,0));
    if(getChildDesigners().size() == 0)
       compPanel.add("North", new JLabel("try"));
    else
    if(getChildDesigners().size() == 1)
       compPanel.add("North", new JLabel("catch"));
      
    compPanel.add("Center", comp);
      
    return compPanel;
  }
View Full Code Here

TOP

Related Classes of org.uengine.processdesigner.ProxyPanel

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.