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

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


    return execute(monitor, info);
  }

  @Override
  public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
    CompositeAdapter rootAdapter = (CompositeAdapter) WidgetAdapter.getWidgetAdapter(root);
    for (ParentConstraints pc : constraints) {
      CompositeAdapter parentAdapter = (CompositeAdapter) WidgetAdapter.getWidgetAdapter(pc.parent);
      parentAdapter.addChildByConstraints(pc.child, pc.constraints);
      parentAdapter.doLayout();
      parentAdapter.getWidget().validate();
      parentAdapter.setDirty(true);
    }
    rootAdapter.doLayout();
    root.validate();
    rootAdapter.repaintDesigner();
    rootAdapter.getDesigner().publishSelection();
View Full Code Here


      this.adapter = adapter;
    }
   
    public void run() {
      if (!adapter.isRoot()) {
        CompositeAdapter parent = adapter.getParentAdapter();
        Component widget = parent.getWidget();
        widget.doLayout();
        widget.validate();
      } else {
        Component widget = adapter.getWidget();
        widget.doLayout();
View Full Code Here

    paintHint(g, c);
  }

  private void paintGrid(Graphics g, JComponent c) {
    GlassPlane glassPlane = (GlassPlane) c;
    CompositeAdapter focused = glassPlane.getFocusedContainer();
    if (focused != null) {
      paintAdapterGrid(g, focused);
    }
  }
View Full Code Here

  private void tranverse(Graphics g, Component jc, Tranverse trans, int ad) {
    if (isDesigningWidget(jc))
      trans.paint(g, jc);
    WidgetAdapter widget = WidgetAdapter.getWidgetAdapter(jc);
    if (widget instanceof CompositeAdapter) {
      CompositeAdapter parent = (CompositeAdapter) widget;
      int size = parent.getChildCount();
      for (int i = 0; i < size; i++) {
        Component child = parent.getChild(i);
        Rectangle rect = new Rectangle(0, 0, child.getWidth(), child.getHeight());
        rect = SwingUtilities.convertRectangle(child, rect, jc);
        Graphics clipg = g.create(rect.x, rect.y, rect.width + 2 * ad, rect.height + 2 * ad);
        tranverse(clipg, (JComponent) child, trans, ad);
        clipg.dispose();
View Full Code Here

  private static Color SELECTION_COLOR = new Color(255, 164, 0);

  private void paintHovered(Graphics g, JComponent c) {
    GlassPlane glassPlane = (GlassPlane) c;
    CompositeAdapter hovered = glassPlane.getHoveredAdapter();
    if (hovered != null) {
      paintHoveredAdapter(g, hovered);
    }
  }
View Full Code Here

    }
  }

  private void paintHint(Graphics g, JComponent c) {
    GlassPlane glassPlane = (GlassPlane) c;
    CompositeAdapter hinted = glassPlane.getHintedAdapter();
    if (hinted != null) {
      paintHintAdapter(g, hinted);
    }
  }
View Full Code Here

    }
  }

  private void paintAnchor(Graphics g, JComponent c) {
    GlassPlane glassPlane = (GlassPlane) c;
    CompositeAdapter selected = glassPlane.getSelectedContainer();
    if (selected != null) {
      paintAdapterAnchor(g, selected);
    }
  }
View Full Code Here

  public static WidgetAdapter createAdapterAndItsChildren(Component comp) {
    WidgetAdapter adapter = createWidgetAdapter(comp.getClass());
    adapter.setWidget(comp);
    if (adapter instanceof CompositeAdapter) {
      CompositeAdapter compositeAdapter = (CompositeAdapter) adapter;
      int count = compositeAdapter.getChildCount();
      for (int i = 0; i < count; i++) {
        Component child = compositeAdapter.getChild(i);
        createAdapterAndItsChildren(child);
      }
    }
    return adapter;
  }
View Full Code Here

      if(jpopup!=null&&WidgetAdapter.getWidgetAdapter(jpopup)!=null){
        addSelection(jpopup);
      }
    }
    if (adapter instanceof CompositeAdapter) {
      CompositeAdapter compositeAdapter = (CompositeAdapter) adapter;
      int count = compositeAdapter.getChildCount();
      for (int i = 0; i < count; i++) {
        comp = compositeAdapter.getChild(i);
        addSelection(comp);
      }
    }
  }
View Full Code Here

    setLnfChanged(true);
  }

  public void selectWidgets(Rectangle selectionRegion) {
    if (root != null) {
      CompositeAdapter rootAdapter = (CompositeAdapter) WidgetAdapter.getWidgetAdapter(root);
      if (_selectWidget(selectionRegion, rootAdapter)) {
        if (rootAdapter != null) {
          rootAdapter.setSelected(false);
        }
      }
      publishSelection();
      repaint();
    }
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.