Package org.dyno.visual.swing.plugin.spi

Examples of org.dyno.visual.swing.plugin.spi.CompositeAdapter


    super.mouseExited(e);
  }

  private boolean isInDropDown(Point p) {
    Container container = adapter.getContainer();
    CompositeAdapter parentAdapter = (CompositeAdapter) WidgetAdapter
        .getWidgetAdapter(container);
    int count = parentAdapter.getChildCount();
    for (int i = 0; i < count; i++) {
      Component child = parentAdapter.getChild(i);
      WidgetAdapter childAdapter = WidgetAdapter.getWidgetAdapter(child);
      if (childAdapter.isSelected()) {
        Rectangle rect = child.getBounds();
        Rectangle thumbRect = new Rectangle(rect.x + rect.width - 18,
            rect.y - 4, 10, 8);
View Full Code Here


      return new Thumb(pi, x, y);
    }
  }

  public boolean dragEnter(Point p) {
    CompositeAdapter parent = (CompositeAdapter) WidgetAdapter.getWidgetAdapter(container);
    parent.setMascotLocation(p);
    thumb = getClosetThumb(p);
    return true;
  }
View Full Code Here

    thumb = null;
    return true;
  }

  public boolean dragOver(Point p) {
    CompositeAdapter parent = (CompositeAdapter) WidgetAdapter.getWidgetAdapter(container);
    parent.setMascotLocation(p);
    thumb = getClosetThumb(p);
    return true;
  }
View Full Code Here

    thumb = getClosetThumb(p);
    return true;
  }

  public boolean drop(Point p) {
    CompositeAdapter parent = (CompositeAdapter) WidgetAdapter.getWidgetAdapter(container);
    thumb = getClosetThumb(p);
    parent.clearAllSelected();
    for (WidgetAdapter todrop : parent.getDropWidget()) {
      int size = container.getComponentCount();
      if (thumb.pi == size)
        container.add(todrop.getParentContainer());
      else
        container.add(todrop.getParentContainer(), thumb.pi);
      todrop.setSelected(true);
    }
    parent.getRootAdapter().getWidget().validate();
    thumb = null;
    return true;
  }
View Full Code Here

  public boolean isChildResizable() {
    return false;
 
  @Override
  public void paintAnchor(Graphics g) {
    CompositeAdapter parentAdapter = (CompositeAdapter) WidgetAdapter.getWidgetAdapter(container);
    int count = parentAdapter.getChildCount();
    for(int i=0;i<count;i++){
      Component child = parentAdapter.getChild(i);
      WidgetAdapter childAdapter = WidgetAdapter.getWidgetAdapter(child);
      if(childAdapter.isSelected()){
        Rectangle rect=child.getBounds();
        g.setColor(Color.white);
        g.fillRect(rect.x+rect.width-18, rect.y-4, 10, 8);
View Full Code Here

    MenuManager borderMenu = new MenuManager(Messages.WidgetAdapter_Border,
        "#BORDER"); //$NON-NLS-2$
    fillBorderAction(borderMenu);
    menu.add(borderMenu);
    if (!adaptable.isRoot()) {
      CompositeAdapter parentAdapter = adaptable.getParentAdapter();
      if (parentAdapter != null) {
        WidgetMenuContext context = (WidgetMenuContext) parentAdapter
            .getAdapter(IMenuContext.class);
        if (context != null)
          context.fillConstraintsAction(menu, adaptable.getWidget());
      }
    }
View Full Code Here

        if (jmbAdapter != null) {
          jmbAdapter.setSelected(true);
          ((CompositeAdapter) jmbAdapter).selectChildren();
        }
      }
      CompositeAdapter cAdapter = (CompositeAdapter) WidgetAdapter.getWidgetAdapter(jframe.getContentPane());
      cAdapter.setSelected(false);
      cAdapter.selectChildren();
    } else
      super.selectChildren();
  }
View Full Code Here

  @Override
  public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    parents = new ArrayList<CompositeAdapter>();
    for (Component child : selection) {
      WidgetAdapter adapter = WidgetAdapter.getWidgetAdapter(child);
      CompositeAdapter parentAdapter=adapter.getParentAdapter();
      boolean success = parentAdapter.removeChild(child);
      if (success)
        parentAdapter.setDirty(true);
      parents.add(parentAdapter);
    }
    return Status.OK_STATUS;
  }
View Full Code Here

  @Override
  public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    for(int i=0;i<selection.size();i++){
      Component child = selection.get(i);
      CompositeAdapter parentAdapter = parents.get(i);
      parentAdapter.addChild(child);
      parentAdapter.setDirty(true);
      parentAdapter.repaintDesigner();
    }
    return Status.OK_STATUS;
  }
View Full Code Here

  }

  @Override
  public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    constraints = new ArrayList<ParentConstraints>();
    CompositeAdapter rootAdapter = (CompositeAdapter) WidgetAdapter.getWidgetAdapter(root);
    for (Component child : selection) {
      WidgetAdapter adapter = WidgetAdapter.getWidgetAdapter(child);
      CompositeAdapter parentAdapter = (CompositeAdapter) adapter.getParentAdapter();
      ParentConstraints pc = new ParentConstraints();
      pc.parent = parentAdapter.getWidget();
      pc.constraints = parentAdapter.getChildConstraints(child);
      pc.child = child;
      constraints.add(pc);
      boolean success = parentAdapter.removeChild(child);
      parentAdapter.doLayout();
      parentAdapter.getWidget().validate();
      if (success){
        parentAdapter.setDirty(true);
        adapter.addNotify();
        WidgetEvent we = new WidgetEvent(parentAdapter, adapter);
        for(IWidgetListener listener:ExtensionRegistry.getWidgetListeners()){
          listener.widgetRemoved(we);
        }
View Full Code Here

TOP

Related Classes of org.dyno.visual.swing.plugin.spi.CompositeAdapter

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.