@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; }
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; }
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; }
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())); }
@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); }
@Override @NotNull public ComponentDropLocation getDropLocation(RadContainer container, @Nullable final Point location) { if (myDropLocation == null) { myDropLocation = new MyDropLocation(); } return myDropLocation; }
@NotNull public ComponentDropLocation getDropLocation(RadContainer container, @Nullable final Point location) { return NoDropLocation.INSTANCE; }
@Override @NotNull public ComponentDropLocation getDropLocation(RadContainer container, @Nullable final Point location) { return new CardDropLocation(container); }
@Nullable public ComponentDropLocation getAdjacentLocation(Direction direction) { return null; }
@Override @NotNull public ComponentDropLocation getDropLocation(RadContainer container, @Nullable final Point location) { return new FlowDropLocation(RadToolBar.this, location, FlowLayout.LEFT, 0, 0); }
@NotNull @Override public ComponentDropLocation getDropLocation(RadContainer container, final Point location) { return new MyDropLocation(container, getQuadrantAt(container, location)); }
@NotNull public ComponentDropLocation getDropLocation(@Nullable Point location) { return getLayoutManager().getDropLocation(this, location); }
@NotNull @Override public ComponentDropLocation getDropLocation(RadContainer container, @Nullable final Point location) { return new MyDropLocation(container, location != null ? location : new Point(5, 5)); }
@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); }