/** * The relative left coordinate in pixels measured from the containers left * edge * * @return The amount of pixels from the left edge */ public int getRelativeLeft() { return Integer.valueOf( getData(Constants.DROP_DETAIL_RELATIVE_LEFT).toString()); }
/** * The absolute top coordinate in pixels measured from the windows top edge * * @return The amount of pixels from the top edge */ public int getAbsoluteTop() { return Integer.valueOf( getData(Constants.DROP_DETAIL_ABSOLUTE_TOP).toString()); }
/** * The height of the dragged component measured in pixels * * @return The height in pixels */ public int getComponentWidth() { return Integer.valueOf( getData(Constants.DROP_DETAIL_COMPONENT_WIDTH).toString()); }
/** * The absolute left coordinate in pixels measured from the windows left * edge * * @return The amount of pixels from the left edge */ public int getAbsoluteLeft() { return Integer.valueOf( getData(Constants.DROP_DETAIL_ABSOLUTE_LEFT).toString()); }
/** * The relative top coordinate in pixels measured from the containers top * edge * * @return The amount of pixels from the top edge */ public int getRelativeTop() { return Integer.valueOf( getData(Constants.DROP_DETAIL_RELATIVE_TOP).toString()); }
/** * The width of the dragged component measured in pixels * * @return The width in pixels */ public int getComponentHeight() { return Integer.valueOf( getData(Constants.DROP_DETAIL_COMPONENT_HEIGHT).toString()); }
/** * Some details about the mouse event * * @return details about the actual event that caused the event details. * Practically mouse move or mouse up. */ public MouseEventDetails getMouseEvent() { return MouseEventDetails.deSerialize( (String) getData(Constants.DROP_DETAIL_MOUSE_EVENT)); } }
@Override public TargetDetails convertTargetDetails(com.vaadin.event.dd.TargetDetails targetDetails) { AbsoluteLayoutTargetDetails details = (AbsoluteLayoutTargetDetails) targetDetails; Map<String, Object> dataDetails = new HashMap<>(); dataDetails.put(Constants.DROP_DETAIL_ABSOLUTE_TOP, details.getAbsoluteTop()); dataDetails.put(Constants.DROP_DETAIL_MOUSE_EVENT, details.getData(Constants.DROP_DETAIL_MOUSE_EVENT)); dataDetails.put(Constants.DROP_DETAIL_RELATIVE_LEFT, details.getRelativeLeft()); dataDetails.put(Constants.DROP_DETAIL_RELATIVE_TOP, details.getRelativeTop()); dataDetails.put(Constants.DROP_DETAIL_COMPONENT_HEIGHT, details.getComponentHeight()); dataDetails.put(Constants.DROP_DETAIL_ABSOLUTE_LEFT, details.getAbsoluteLeft()); dataDetails.put(Constants.DROP_DETAIL_COMPONENT_WIDTH, details.getComponentWidth()); return new DDAbsoluteLayoutTargetDetails(this, dataDetails); }