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

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


  }

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


  @Override
  public boolean drop(Point p) {
    horizontal_baseline = null;
    vertical_baseline = null;
    hovered = false;
    CompositeAdapter parent = (CompositeAdapter) WidgetAdapter.getWidgetAdapter(container);
    int state = parent.getState();
    if (state == Azimuth.STATE_BEAN_HOVER)
      parent.setMascotLocation(p);
    List<IDragOperation> dragOperations = getCurrentOperation();
    if (dragOperations != null) {
      for (IDragOperation operation : dragOperations) {
        operation.drop(p);
      }
View Full Code Here

  @Override
  public boolean cloneLayout(JComponent panel) {
    panel.setLayout(copyLayout(panel));
    GroupLayout layout = (GroupLayout) container.getLayout();
    CompositeAdapter parent = (CompositeAdapter) WidgetAdapter.getWidgetAdapter(container);
    int count = parent.getChildCount();
    for (int i = 0; i < count; i++) {
      JComponent child = (JComponent) parent.getChild(i);
      WidgetAdapter cAdapter = WidgetAdapter.getWidgetAdapter(child);
      Constraints childConstraints = layout.getConstraints(child);
      panel.add(cAdapter.cloneWidget(), childConstraints==null?null:childConstraints.clone());
    }
    return true;
View Full Code Here

    }
  }

  private void adjustVerticalTrailingBy(Component widget, int delta_height) {
    GroupLayout layout = (GroupLayout) container.getLayout();
    CompositeAdapter containerAdapter = (CompositeAdapter) WidgetAdapter.getWidgetAdapter(container);
    int count = containerAdapter.getChildCount();
    for (int i = 0; i < count; i++) {
      Component target = containerAdapter.getChild(i);
      if (target != widget) {
        if (isTopRelatedTo((JComponent) target, (JComponent) widget)) {
          Constraints constraints = layout.getConstraints(target);
          Alignment vertical = constraints.getHorizontal();
          if (vertical instanceof Trailing) {
View Full Code Here

    return false;
  }

  private void adjustVerticalLeadingBy(Component widget, int delta_height) {
    GroupLayout layout = (GroupLayout) container.getLayout();
    CompositeAdapter containerAdapter = (CompositeAdapter) WidgetAdapter.getWidgetAdapter(container);
    int count = containerAdapter.getChildCount();
    for (int i = 0; i < count; i++) {
      Component target = containerAdapter.getChild(i);
      if (target != widget) {
        if (isBottomRelatedTo((JComponent) target, (JComponent) widget)) {
          Constraints constraints = layout.getConstraints(target);
          Alignment vertical = constraints.getVertical();
          if (vertical instanceof Leading) {
View Full Code Here

    return false;
  }

  private void adjustHorizontalTrailingBy(Component widget, int delta_width) {
    GroupLayout layout = (GroupLayout) container.getLayout();
    CompositeAdapter containerAdapter = (CompositeAdapter) WidgetAdapter.getWidgetAdapter(container);
    int count = containerAdapter.getChildCount();
    for (int i = 0; i < count; i++) {
      Component target = containerAdapter.getChild(i);
      if (target != widget) {
        if (isLeftRelatedTo((JComponent) target, (JComponent) widget)) {
          Constraints constraints = layout.getConstraints(target);
          Alignment horizontal = constraints.getHorizontal();
          if (horizontal instanceof Trailing) {
View Full Code Here

    return false;
  }

  private void adjustHorizontalLeadingBy(Component widget, int delta_width) {
    GroupLayout layout = (GroupLayout) container.getLayout();
    CompositeAdapter containerAdapter = (CompositeAdapter) WidgetAdapter.getWidgetAdapter(container);
    int count = containerAdapter.getChildCount();
    for (int i = 0; i < count; i++) {
      Component target = containerAdapter.getChild(i);
      if (target != widget) {
        if (isRightRelatedTo((JComponent) target, (JComponent) widget)) {
          Constraints constraints = layout.getConstraints(target);
          Alignment horizontal = constraints.getHorizontal();
          if (horizontal instanceof Leading) {
View Full Code Here

  @Override
  public boolean isSelectionAlignResize(String id) {
    if (id == null)
      return false;
    CompositeAdapter containerAdapter = (CompositeAdapter) WidgetAdapter.getWidgetAdapter(container);
    return containerAdapter.getChildCount() > 1;
  }
View Full Code Here

      operation = getRight();
    } else if (id.equals("top")) { //$NON-NLS-1$
      operation = getTop();
    }
    if (operation != null) {
      CompositeAdapter parent = (CompositeAdapter) WidgetAdapter.getWidgetAdapter(container);
      operation.addContext(parent.getUndoContext());
      IOperationHistory operationHist = PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();
      try {
        operationHist.execute(operation, null, null);
        return true;
      } catch (ExecutionException e) {
View Full Code Here

    super(layout, tracingAdapter,op, container);
  }

 
  public boolean dragOver(Point p) {
    CompositeAdapter parent = (CompositeAdapter) WidgetAdapter.getWidgetAdapter(container);
    JComponent todrop = (JComponent)tracingAdapter.getWidget();
    Point lp = p;
    if (last_point == null) {
      last_point = p;
      adapter.setHovered(true);
      return false;
    }
    if (lp.equals(last_point))
      return false;
    pair = calculateMascotLocation(todrop, lp, azimuth);
    Point np = pair == null ? lp : new Point(pair.vQuart == null ? lp.x : pair.vQuart.masc, pair.hQuart == null ? lp.y : pair.hQuart.masc);
    Point sp = parent.getMascotLocation();
    int cw = np.x - sp.x;
    int ch = np.y - sp.y;
    todrop.setSize(cw, ch);
    azimuth = getAzimuth(p, last_point);
    last_point = p;
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.