/** * Instantiates a new dragged widget. * * @param widget the widget * @param model the model */ public DraggedWidget(final FormWidget widget, final AlphaForm model) { super(); this.widget = widget; this.model = model; if (widget.getParent() == null) { this.x = widget.getX(); this.y = widget.getY(); } else { this.parent = (ContainerWidget) widget.getParent(); this.x = widget.getX() + ((FormWidget) this.parent).getX(); this.y = widget.getY() + ((FormWidget) this.parent).getY(); } this.width = widget.getWidth(); this.height = widget.getHeight(); }