Java 类com.intellij.uiDesigner.designSurface.ComponentDropLocation 实例源码

项目:intellij-ce-playground    文件:RadBorderLayoutManager.java   
@Nullable
public ComponentDropLocation getAdjacentLocation(Direction direction) {
  String side = null;
  switch (direction) {
    case LEFT:
      side = getAdjacentSide(myQuadrant, 0, -1);
      break;
    case UP:
      side = getAdjacentSide(myQuadrant, -1, 0);
      break;
    case RIGHT:
      side = getAdjacentSide(myQuadrant, 0, 1);
      break;
    case DOWN:
      side = getAdjacentSide(myQuadrant, 1, 0);
      break;
  }
  if (side != null) {
    return new MyDropLocation(myContainer, side);
  }
  return null;
}
项目:tools-idea    文件:RadBorderLayoutManager.java   
@Nullable
public ComponentDropLocation getAdjacentLocation(Direction direction) {
  String side = null;
  switch (direction) {
    case LEFT:
      side = getAdjacentSide(myQuadrant, 0, -1);
      break;
    case UP:
      side = getAdjacentSide(myQuadrant, -1, 0);
      break;
    case RIGHT:
      side = getAdjacentSide(myQuadrant, 0, 1);
      break;
    case DOWN:
      side = getAdjacentSide(myQuadrant, 1, 0);
      break;
  }
  if (side != null) {
    return new MyDropLocation(myContainer, side);
  }
  return null;
}
项目:consulo-ui-designer    文件:FormEditingUtil.java   
public static boolean isDropOnChild(final DraggedComponentList draggedComponentList, final ComponentDropLocation location)
{
    if(location.getContainer() == null)
    {
        return false;
    }

    for(RadComponent component : draggedComponentList.getComponents())
    {
        if(isChild(location.getContainer(), component))
        {
            return true;
        }
    }
    return false;
}
项目:consulo-ui-designer    文件:RadBorderLayoutManager.java   
@Nullable
public ComponentDropLocation getAdjacentLocation(Direction direction) {
  String side = null;
  switch (direction) {
    case LEFT:
      side = getAdjacentSide(myQuadrant, 0, -1);
      break;
    case UP:
      side = getAdjacentSide(myQuadrant, -1, 0);
      break;
    case RIGHT:
      side = getAdjacentSide(myQuadrant, 0, 1);
      break;
    case DOWN:
      side = getAdjacentSide(myQuadrant, 1, 0);
      break;
  }
  if (side != null) {
    return new MyDropLocation(myContainer, side);
  }
  return null;
}
项目:intellij-ce-playground    文件:FormEditingUtil.java   
public static boolean isDropOnChild(final DraggedComponentList draggedComponentList,
                                    final ComponentDropLocation location) {
  if (location.getContainer() == null) {
    return false;
  }

  for (RadComponent component : draggedComponentList.getComponents()) {
    if (isChild(location.getContainer(), component)) {
      return true;
    }
  }
  return false;
}
项目:intellij-ce-playground    文件:AddTabAction.java   
protected void actionPerformed(final GuiEditor editor, final List<RadComponent> selection, final AnActionEvent e) {
  RadTabbedPane tabbedPane = (RadTabbedPane) selection.get(0);
  Palette palette = Palette.getInstance(editor.getProject());

  final RadComponent radComponent = InsertComponentProcessor.createPanelComponent(editor);
  final ComponentDropLocation dropLocation = tabbedPane.getDropLocation(null);
  dropLocation.processDrop(editor, new RadComponent[] { radComponent }, null, 
                           new ComponentItemDragObject(palette.getPanelItem()));
}
项目:intellij-ce-playground    文件:RadGridBagLayoutManager.java   
@NotNull
@Override
public ComponentDropLocation getDropLocation(@NotNull RadContainer container, @Nullable final Point location) {
  if (getGridRowCount(container) == 0 && getGridColumnCount(container) == 0) {
    return new FirstComponentInsertLocation(container, new Rectangle(0, 0, container.getWidth(), container.getHeight()), 0, 0);
  }
  return super.getDropLocation(container, location);
}
项目:intellij-ce-playground    文件:RadScrollPane.java   
@Override @NotNull
public ComponentDropLocation getDropLocation(RadContainer container, @Nullable final Point location) {
  if (myDropLocation == null) {
    myDropLocation = new MyDropLocation();
  }
  return myDropLocation;
}
项目:tools-idea    文件:FormEditingUtil.java   
public static boolean isDropOnChild(final DraggedComponentList draggedComponentList,
                                    final ComponentDropLocation location) {
  if (location.getContainer() == null) {
    return false;
  }

  for (RadComponent component : draggedComponentList.getComponents()) {
    if (isChild(location.getContainer(), component)) {
      return true;
    }
  }
  return false;
}
项目:tools-idea    文件:AddTabAction.java   
protected void actionPerformed(final GuiEditor editor, final List<RadComponent> selection, final AnActionEvent e) {
  RadTabbedPane tabbedPane = (RadTabbedPane) selection.get(0);
  Palette palette = Palette.getInstance(editor.getProject());

  final RadComponent radComponent = InsertComponentProcessor.createPanelComponent(editor);
  final ComponentDropLocation dropLocation = tabbedPane.getDropLocation(null);
  dropLocation.processDrop(editor, new RadComponent[] { radComponent }, null, 
                           new ComponentItemDragObject(palette.getPanelItem()));
}
项目:tools-idea    文件:RadGridBagLayoutManager.java   
@NotNull
@Override
public ComponentDropLocation getDropLocation(@NotNull RadContainer container, @Nullable final Point location) {
  if (getGridRowCount(container) == 0 && getGridColumnCount(container) == 0) {
    return new FirstComponentInsertLocation(container, new Rectangle(0, 0, container.getWidth(), container.getHeight()), 0, 0);
  }
  return super.getDropLocation(container, location);
}
项目:tools-idea    文件:RadScrollPane.java   
@Override @NotNull
public ComponentDropLocation getDropLocation(RadContainer container, @Nullable final Point location) {
  if (myDropLocation == null) {
    myDropLocation = new MyDropLocation();
  }
  return myDropLocation;
}
项目:consulo-ui-designer    文件:AddTabAction.java   
protected void actionPerformed(final GuiEditor editor, final List<RadComponent> selection, final AnActionEvent e) {
  RadTabbedPane tabbedPane = (RadTabbedPane) selection.get(0);
  Palette palette = Palette.getInstance(editor.getProject());

  final RadComponent radComponent = InsertComponentProcessor.createPanelComponent(editor);
  final ComponentDropLocation dropLocation = tabbedPane.getDropLocation(null);
  dropLocation.processDrop(editor, new RadComponent[] { radComponent }, null, 
                           new ComponentItemDragObject(palette.getPanelItem()));
}
项目:consulo-ui-designer    文件:RadGridBagLayoutManager.java   
@NotNull
@Override
public ComponentDropLocation getDropLocation(@NotNull RadContainer container, @Nullable final Point location) {
  if (getGridRowCount(container) == 0 && getGridColumnCount(container) == 0) {
    return new FirstComponentInsertLocation(container, new Rectangle(0, 0, container.getWidth(), container.getHeight()), 0, 0);
  }
  return super.getDropLocation(container, location);
}
项目:consulo-ui-designer    文件:RadScrollPane.java   
@Override @NotNull
public ComponentDropLocation getDropLocation(RadContainer container, @Nullable final Point location) {
  if (myDropLocation == null) {
    myDropLocation = new MyDropLocation();
  }
  return myDropLocation;
}
项目:intellij-ce-playground    文件:RadLayoutManager.java   
@NotNull
public ComponentDropLocation getDropLocation(RadContainer container, @Nullable final Point location) {
  return NoDropLocation.INSTANCE;
}
项目:intellij-ce-playground    文件:RadCardLayoutManager.java   
@Override @NotNull
public ComponentDropLocation getDropLocation(RadContainer container, @Nullable final Point location) {
  return new CardDropLocation(container);
}
项目:intellij-ce-playground    文件:RadCardLayoutManager.java   
@Nullable
public ComponentDropLocation getAdjacentLocation(Direction direction) {
  return null;
}
项目:intellij-ce-playground    文件:RadToolBar.java   
@Override @NotNull
public ComponentDropLocation getDropLocation(RadContainer container, @Nullable final Point location) {
  return new FlowDropLocation(RadToolBar.this, location, FlowLayout.LEFT, 0, 0);
}
项目:intellij-ce-playground    文件:RadBorderLayoutManager.java   
@NotNull @Override
public ComponentDropLocation getDropLocation(RadContainer container, final Point location) {
  return new MyDropLocation(container, getQuadrantAt(container, location));
}
项目:intellij-ce-playground    文件:RadContainer.java   
@NotNull
public ComponentDropLocation getDropLocation(@Nullable Point location) {
  return getLayoutManager().getDropLocation(this, location);
}
项目:intellij-ce-playground    文件:RadXYLayoutManager.java   
@NotNull @Override
public ComponentDropLocation getDropLocation(RadContainer container, @Nullable final Point location) {
  return new MyDropLocation(container, location != null ? location : new Point(5, 5));
}
项目:intellij-ce-playground    文件:RadXYLayoutManager.java   
@Nullable
public ComponentDropLocation getAdjacentLocation(Direction direction) {
  return null;
}
项目:intellij-ce-playground    文件:RadScrollPane.java   
@Nullable
public ComponentDropLocation getAdjacentLocation(Direction direction) {
  return null;
}
项目:intellij-ce-playground    文件:RadFlowLayoutManager.java   
@NotNull @Override
public ComponentDropLocation getDropLocation(RadContainer container, final Point location) {
  FlowLayout flowLayout = (FlowLayout) container.getLayout();
  return new FlowDropLocation(container, location, flowLayout.getAlignment(),
                              (flowLayout.getHgap()+1)/2, (flowLayout.getVgap()+1)/2);
}
项目:tools-idea    文件:RadLayoutManager.java   
@NotNull
public ComponentDropLocation getDropLocation(RadContainer container, @Nullable final Point location) {
  return NoDropLocation.INSTANCE;
}
项目:tools-idea    文件:RadCardLayoutManager.java   
@Override @NotNull
public ComponentDropLocation getDropLocation(RadContainer container, @Nullable final Point location) {
  return new CardDropLocation(container);
}
项目:tools-idea    文件:RadCardLayoutManager.java   
@Nullable
public ComponentDropLocation getAdjacentLocation(Direction direction) {
  return null;
}
项目:tools-idea    文件:RadToolBar.java   
@Override @NotNull
public ComponentDropLocation getDropLocation(RadContainer container, @Nullable final Point location) {
  return new FlowDropLocation(RadToolBar.this, location, FlowLayout.LEFT, 0, 0);
}
项目:tools-idea    文件:RadBorderLayoutManager.java   
@NotNull @Override
public ComponentDropLocation getDropLocation(RadContainer container, final Point location) {
  return new MyDropLocation(container, getQuadrantAt(container, location));
}
项目:tools-idea    文件:RadContainer.java   
@NotNull
public ComponentDropLocation getDropLocation(@Nullable Point location) {
  return getLayoutManager().getDropLocation(this, location);
}
项目:tools-idea    文件:RadXYLayoutManager.java   
@NotNull @Override
public ComponentDropLocation getDropLocation(RadContainer container, @Nullable final Point location) {
  return new MyDropLocation(container, location != null ? location : new Point(5, 5));
}
项目:tools-idea    文件:RadXYLayoutManager.java   
@Nullable
public ComponentDropLocation getAdjacentLocation(Direction direction) {
  return null;
}
项目:tools-idea    文件:RadScrollPane.java   
@Nullable
public ComponentDropLocation getAdjacentLocation(Direction direction) {
  return null;
}
项目:tools-idea    文件:RadFlowLayoutManager.java   
@NotNull @Override
public ComponentDropLocation getDropLocation(RadContainer container, final Point location) {
  FlowLayout flowLayout = (FlowLayout) container.getLayout();
  return new FlowDropLocation(container, location, flowLayout.getAlignment(),
                              (flowLayout.getHgap()+1)/2, (flowLayout.getVgap()+1)/2);
}
项目:consulo-ui-designer    文件:RadLayoutManager.java   
@NotNull
public ComponentDropLocation getDropLocation(RadContainer container, @Nullable final Point location) {
  return NoDropLocation.INSTANCE;
}
项目:consulo-ui-designer    文件:RadCardLayoutManager.java   
@Override @NotNull
public ComponentDropLocation getDropLocation(RadContainer container, @Nullable final Point location) {
  return new CardDropLocation(container);
}
项目:consulo-ui-designer    文件:RadCardLayoutManager.java   
@Nullable
public ComponentDropLocation getAdjacentLocation(Direction direction) {
  return null;
}
项目:consulo-ui-designer    文件:RadToolBar.java   
@Override @NotNull
public ComponentDropLocation getDropLocation(RadContainer container, @Nullable final Point location) {
  return new FlowDropLocation(RadToolBar.this, location, FlowLayout.LEFT, 0, 0);
}
项目:consulo-ui-designer    文件:RadBorderLayoutManager.java   
@NotNull @Override
public ComponentDropLocation getDropLocation(RadContainer container, final Point location) {
  return new MyDropLocation(container, getQuadrantAt(container, location));
}