Package gov.nasa.worldwind.drag
Class DragContext
- java.lang.Object
-
- gov.nasa.worldwind.drag.DragContext
-
public class DragContext extends java.lang.ObjectProvides information about mouse inputs andWorldWindowstate for use in dragging operations.
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringdragStateThe current drag state, which can be one of the three following values:AVKey.DRAG_BEGIN,AVKey.DRAG_CHANGE,AVKey.DRAG_ENDED.protected GlobeglobeThe currentGlobeof theWorldWindow.protected java.awt.PointinitialPointIn accordance with the AWT screen coordinates the top left point of the window is the origin.protected java.awt.PointpointIn accordance with the AWT screen coordinates the top left point of the window is the origin.protected java.awt.PointpreviousPointIn accordance with the AWT screen coordinates the top left point of the window is the origin.protected SceneControllersceneControllerThe currentSceneControllerof theWorldWindow.protected ViewviewThe currentViewof theWorldWindow.
-
Constructor Summary
Constructors Constructor Description DragContext()Creates a newDragContextinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDragState()Returns the current drag state for this drag event.GlobegetGlobe()Returns the currentGlobefor this drag event.java.awt.PointgetInitialPoint()Returns the initial screen point with the origin at the top left corner of the window.java.awt.PointgetPoint()Returns the current screen point with the origin at the top left corner of the window.java.awt.PointgetPreviousPoint()Returns the previous screen point with the origin at the top left corner of the window.SceneControllergetSceneController()Returns the currentSceneControllerfor this drag event.ViewgetView()Returns the currentViewfor this drag event.voidsetDragState(java.lang.String dragState)Set theDragContextdrag state, which must be one of the following three states:AVKey.DRAG_BEGIN,AVKey.DRAG_CHANGE, orAVKey.DRAG_ENDED.voidsetGlobe(Globe globe)Set theDragContextGlobe.voidsetInitialPoint(java.awt.Point initialPoint)Set theDragContextinitial screen point.voidsetPoint(java.awt.Point point)Set theDragContextcurrent screen point.voidsetPreviousPoint(java.awt.Point previousPoint)Set theDragContextprevious screen point.voidsetSceneController(SceneController sceneController)Set theDragContextSceneController.voidsetView(View view)Set theDragContextView.
-
-
-
Field Detail
-
point
protected java.awt.Point point
In accordance with the AWT screen coordinates the top left point of the window is the origin.
-
previousPoint
protected java.awt.Point previousPoint
In accordance with the AWT screen coordinates the top left point of the window is the origin. This point is the previous screen point.
-
initialPoint
protected java.awt.Point initialPoint
In accordance with the AWT screen coordinates the top left point of the window is the origin. This point refers to the initial point of the drag event.
-
sceneController
protected SceneController sceneController
The currentSceneControllerof theWorldWindow.
-
globe
protected Globe globe
The currentGlobeof theWorldWindow.
-
view
protected View view
The currentViewof theWorldWindow.
-
dragState
protected java.lang.String dragState
The current drag state, which can be one of the three following values:AVKey.DRAG_BEGIN,AVKey.DRAG_CHANGE,AVKey.DRAG_ENDED.
-
-
Constructor Detail
-
DragContext
public DragContext()
Creates a newDragContextinstance.
-
-
Method Detail
-
getPoint
public java.awt.Point getPoint()
Returns the current screen point with the origin at the top left corner of the window.- Returns:
- the current screen point.
-
setPoint
public void setPoint(java.awt.Point point)
Set theDragContextcurrent screen point.- Parameters:
point- the point to assign to the current screen point.- Throws:
java.lang.IllegalArgumentException- if the point is null.
-
getPreviousPoint
public java.awt.Point getPreviousPoint()
Returns the previous screen point with the origin at the top left corner of the window.- Returns:
- the previous point.
-
setPreviousPoint
public void setPreviousPoint(java.awt.Point previousPoint)
Set theDragContextprevious screen point.- Parameters:
previousPoint- the screen point to assign to the previous screen point.- Throws:
java.lang.IllegalArgumentException- if the previousPoint is null.
-
getInitialPoint
public java.awt.Point getInitialPoint()
Returns the initial screen point with the origin at the top left corner of the window. The initial point is the screen point at the initiation of the drag event.- Returns:
- the initial screen point.
-
setInitialPoint
public void setInitialPoint(java.awt.Point initialPoint)
Set theDragContextinitial screen point.- Parameters:
initialPoint- the screen point to assign to the initial screen point.- Throws:
java.lang.IllegalArgumentException- if the initialPoint is null.
-
getSceneController
public SceneController getSceneController()
Returns the currentSceneControllerfor this drag event.- Returns:
- the current
SceneController.
-
setSceneController
public void setSceneController(SceneController sceneController)
Set theDragContextSceneController.- Parameters:
sceneController- theSceneControllerto assign to theDragContext.- Throws:
java.lang.IllegalArgumentException- if the scene controller is null.
-
getGlobe
public Globe getGlobe()
Returns the currentGlobefor this drag event.- Returns:
- the current
Globe.
-
setGlobe
public void setGlobe(Globe globe)
Set theDragContextGlobe.- Parameters:
globe- theGlobeto assign to theDragContext.- Throws:
java.lang.IllegalArgumentException- if the globe is null.
-
getView
public View getView()
Returns the currentViewfor this drag event.- Returns:
- the current
View.
-
setView
public void setView(View view)
Set theDragContextView.- Parameters:
view- theViewto assign to theDragContext.- Throws:
java.lang.IllegalArgumentException- if the view is null.
-
getDragState
public java.lang.String getDragState()
Returns the current drag state for this drag event.- Returns:
- the drag state.
-
setDragState
public void setDragState(java.lang.String dragState)
Set theDragContextdrag state, which must be one of the following three states:AVKey.DRAG_BEGIN,AVKey.DRAG_CHANGE, orAVKey.DRAG_ENDED.- Parameters:
dragState- the drag state to assign to theDragContext.- Throws:
java.lang.IllegalArgumentException- if the drag state is null or not one of the three states defined for dragging.
-
-