@Override public float getRelativeX() { return this.getAbsoluteLeft() - this.getContainer().getAbsoluteLeft(); }
public float getRelativeY() { return this.getAbsoluteTop() - this.getContainer().getAbsoluteTop(); }
container.addContainerHandler(new IContainerHandler() {
int relMouseX = event.getClientX() - draggable.getContainer().getAbsoluteLeft(); int relMouseY = event.getClientY() - draggable.getContainer().getAbsoluteTop(); float newY = relMouseY-GlobalDragData.dragYdelta; draggable.setRelativeX(newX+draggable.getContainer().getScrollLeft()); draggable.setRelativeY(newY+draggable.getContainer().getScrollTop());
parentElementView.addUIElement(elView); elView.refresh(); relativeX = relativeX - (parentElementView.getAbsoluteLeft() - diagramView.getAbsoluteLeft()); relativeY = relativeY - (parentElementView.getAbsoluteTop() - diagramView.getAbsoluteTop());
int smallesty = elements.get(0).getAbsoluteTop(); Point nwPoint = new Point(elements.get(0).getAbsoluteLeft() - elements.get(0).getContainer().getAbsoluteLeft() , elements.get(0).getAbsoluteTop() - elements.get(0).getContainer().getAbsoluteTop()); nwPoint = new Point(s.getAbsoluteLeft()-s.getContainer().getAbsoluteLeft(), nwPoint.getY()); s.getAbsoluteTop()-s.getContainer().getAbsoluteTop());
draggedElement.getContainer().removeChildElement( draggedElement); container.addUIElement(draggedElement); draggedElement.setContainer(container); if (container.getElementFactory()==null){ throw new IllegalStateException("Actual container Factory is null, please ensure actual container has an associated element factory"); IUIElement createdElement = container.getElementFactory().getElement(hasdeproxy); container.addUIElement(createdElement); createdElement.setContainer(container);
IContainer container = (IContainer) uiElement; ArrayList<IUIElement> elToRemove = new ArrayList<IUIElement>(); for(IUIElement child:container.getChildrenUIElements().values()){ uiElement.getContainer().removeChildElement(uiElement);
private void updateMagnets(IContainer container){ for(IUIElement el:container.getChildrenUIElements().values()){ if(el instanceof IConnectableElement){ IConnectableElement cel = (IConnectableElement) el; cel.refreshMagnets(); } if (el instanceof IContainer){ updateMagnets((IContainer) el); } } }
if (droppableRegion.getSubject().getContainer().getId().equals(draggedElement.getId())){ continue;
int greatesty = (int) (randomS.getAbsoluteTop() + randomS.getHeight()); Point sePoint = new Point((randomS.getAbsoluteLeft()+randomS.getWidth())-randomS.getContainer().getAbsoluteLeft(), (randomS.getAbsoluteTop()+randomS.getHeight())-randomS.getContainer().getAbsoluteTop()); sePoint = new Point((s.getAbsoluteLeft()+s.getWidth())-s.getContainer().getAbsoluteLeft(), sePoint.getY()); (s.getAbsoluteTop()+s.getHeight())-s.getContainer().getAbsoluteTop());
@Override public void onStart(IResizeStartEvent event) { oldWidth = element.getWidth(); oldHeight = element.getHeight(); //if actual element is a container //store each child size before resize if (element instanceof IContainer){ IContainer container = (IContainer) element; childrenSize.clear(); for(IUIElement el:container.getChildrenUIElements().values()){ childrenSize.put(el, new Size(el.getWidth(), el.getHeight())); } } }
@Override public float getRelativeY() { return this.getAbsoluteTop() - this.getContainer().getAbsoluteTop(); }
@Override public float getRelativeX() { return this.getAbsoluteLeft() - this.getContainer().getAbsoluteLeft(); }
if (actualContainer.getChildrenUIElements()!=null){ for(IUIElement el:actualContainer.getChildrenUIElements().values()){
container.addContainerHandler(new IContainerHandler() {
@Override public float getRelativeY() { return this.getAbsoluteTop() - this.getContainer().getAbsoluteTop(); }
@Override public float getRelativeX() { return this.getAbsoluteLeft() - this.getContainer().getAbsoluteLeft(); }
@Override public float getRelativeY() { return this.getAbsoluteTop() - this.getContainer().getAbsoluteTop(); }
@Override public float getRelativeX() { return this.getAbsoluteLeft() - this.getContainer().getAbsoluteLeft(); }