public void processDrop(GuiEditor editor, RadComponent[] components, GridConstraints[] constraintsToAdjust, ComponentDragObject dragObject) { int cardIndex = 1; while(myContainer.findComponentWithConstraints(CARD_NAME_PREFIX + cardIndex) != null) { cardIndex++; } components [0].setCustomLayoutConstraints(CARD_NAME_PREFIX + cardIndex); myContainer.addComponent(components [0]); }
public void processDrop(GuiEditor editor, RadComponent[] components, GridConstraints[] constraintsToAdjust, ComponentDragObject dragObject) { components [0].setCustomLayoutConstraints(myQuadrant); myContainer.addComponent(components [0]); }
public boolean canDrop(ComponentDragObject dragObject) { if (myLocation == null || dragObject.getComponentCount() != 1) { return false; } for(RadComponent component: myContainer.getComponents()) { if (!component.isDragging()) { return false; } } return true; }
public void processDrop(GuiEditor editor, RadComponent[] components, GridConstraints[] constraintsToAdjust, ComponentDragObject dragObject) { int patchX = 0; int patchY = 0; for (int i = 0; i < components.length; i++) { final RadComponent c = components[i]; final Point p = new Point(myLocation); Point delta = dragObject.getDelta(i); if (delta != null) { p.translate(delta.x, delta.y); } c.setLocation(p); patchX = Math.min(patchX, p.x); patchY = Math.min(patchY, p.y); myContainer.addComponent(c); } // shift components if necessary to make sure that no component has negative x or y if (patchX < 0 || patchY < 0) { for(RadComponent component : components) { component.shift(-patchX, -patchY); } } }
public boolean canDrop(ComponentDragObject dragObject) { return dragObject.getComponentCount() == 1; }
public void placeFeedback(FeedbackLayer feedbackLayer, ComponentDragObject dragObject) { Rectangle rc = myContainer.getBounds(); feedbackLayer.putFeedback(myContainer.getParent().getDelegee(), rc, null); }
public boolean canDrop(ComponentDragObject dragObject) { return dragObject.getComponentCount() == 1 && ((BorderLayout) myContainer.getLayout()).getLayoutComponent(myQuadrant) == null; }
public void placeFeedback(FeedbackLayer feedbackLayer, ComponentDragObject dragObject) { Dimension initialSize = dragObject.getInitialSize(myContainer); feedbackLayer.putFeedback(myContainer.getDelegee(), getFeedbackRect(myQuadrant, initialSize), myContainer.getDisplayName() + " (" + myQuadrant.toLowerCase() + ")"); }
public void placeFeedback(FeedbackLayer feedbackLayer, ComponentDragObject dragObject) { }
public boolean canDrop(ComponentDragObject dragObject) { return dragObject.getComponentCount() == 1 && getComponentCount() == 0; }
public void placeFeedback(FeedbackLayer feedbackLayer, ComponentDragObject dragObject) { feedbackLayer.putFeedback(getDelegee(), new Rectangle(0, 0, getWidth(), getHeight()), getDisplayName()); }
public void processDrop(GuiEditor editor, RadComponent[] components, GridConstraints[] constraintsToAdjust, ComponentDragObject dragObject) { addComponent(components[0]); }