com.businessobjects.crystalreports.designer.sdk.util
Class DNDHelper

java.lang.Object
  extended by com.businessobjects.crystalreports.designer.sdk.util.DNDHelper

public final class DNDHelper
extends java.lang.Object

This class provides utility methods for dragging and dropping objects on to Crystal Reports pages. Use the methods in this class to locate the editor and the report section at the screen location where an object is dropped.


Method Summary
static ICrystalReportsEditor getCrystalReportsEditorAtScreenLocation(int x, int y)
          Locates the Crystal Reports editor at the screen location defined by the x and y coordinates.
static ISection getDropTargetSection(ICrystalReportsEditorPage page, Point location)
          Returns the section of a report that is at the given location.
static void translateToLocation(ICrystalReportsEditorPage page, Point loc)
          Calculates the canvas location of the drop.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getCrystalReportsEditorAtScreenLocation

public static ICrystalReportsEditor getCrystalReportsEditorAtScreenLocation(int x,
                                                                            int y)
Locates the Crystal Reports editor at the screen location defined by the x and y coordinates. Use this method to determine which Crystal Reports editor an object was dropped on. The x and y coordinates are relative to the display.

Parameters:
x - the x coordinate of the screen location
y - the y coordinate of the screen location
Returns:
an ICrystalReportsEditor object representing the editor at the screen location, or null if there is no Crystal Reports editor at the screen location

getDropTargetSection

public static final ISection getDropTargetSection(ICrystalReportsEditorPage page,
                                                  Point location)
Returns the section of a report that is at the given location. Use this method to determine the section of a report that an object was dropped on.

Parameters:
page - the page that the object was dropped on
location - the location of the drop as defined by the drop event
Returns:
the section that the object was dropped on, or null if the section cannot be determined
See Also:
ICrystalReportsEditor.getActiveEditorPage()

translateToLocation

public static final void translateToLocation(ICrystalReportsEditorPage page,
                                             Point loc)
Calculates the canvas location of the drop. Note that this method modifies the loc parameter.

Parameters:
page - the page that the object was dropped on
loc - the location of the drop as defined by the drop event
See Also:
ICrystalReportsEditor.getActiveEditorPage()