Package gov.nasa.worldwind.drag
Class DragContext
- java.lang.Object
-
- gov.nasa.worldwind.drag.DragContext
-
public class DragContext extends java.lang.Object
Provides information about mouse inputs andWorldWindow
state for use in dragging operations.
-
-
Field Summary
Fields Modifier and Type Field Description 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
.protected Globe
globe
The currentGlobe
of theWorldWindow
.protected java.awt.Point
initialPoint
In accordance with the AWT screen coordinates the top left point of the window is the origin.protected java.awt.Point
point
In accordance with the AWT screen coordinates the top left point of the window is the origin.protected java.awt.Point
previousPoint
In accordance with the AWT screen coordinates the top left point of the window is the origin.protected SceneController
sceneController
The currentSceneController
of theWorldWindow
.protected View
view
The currentView
of theWorldWindow
.
-
Constructor Summary
Constructors Constructor Description DragContext()
Creates a newDragContext
instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDragState()
Returns the current drag state for this drag event.Globe
getGlobe()
Returns the currentGlobe
for this drag event.java.awt.Point
getInitialPoint()
Returns the initial screen point with the origin at the top left corner of the window.java.awt.Point
getPoint()
Returns the current screen point with the origin at the top left corner of the window.java.awt.Point
getPreviousPoint()
Returns the previous screen point with the origin at the top left corner of the window.SceneController
getSceneController()
Returns the currentSceneController
for this drag event.View
getView()
Returns the currentView
for this drag event.void
setDragState(java.lang.String dragState)
Set theDragContext
drag state, which must be one of the following three states:AVKey.DRAG_BEGIN
,AVKey.DRAG_CHANGE
, orAVKey.DRAG_ENDED
.void
setGlobe(Globe globe)
Set theDragContext
Globe
.void
setInitialPoint(java.awt.Point initialPoint)
Set theDragContext
initial screen point.void
setPoint(java.awt.Point point)
Set theDragContext
current screen point.void
setPreviousPoint(java.awt.Point previousPoint)
Set theDragContext
previous screen point.void
setSceneController(SceneController sceneController)
Set theDragContext
SceneController
.void
setView(View view)
Set theDragContext
View
.
-
-
-
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 currentSceneController
of theWorldWindow
.
-
globe
protected Globe globe
The currentGlobe
of theWorldWindow
.
-
view
protected View view
The currentView
of 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 newDragContext
instance.
-
-
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 theDragContext
current 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 theDragContext
previous 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 theDragContext
initial 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 currentSceneController
for this drag event.- Returns:
- the current
SceneController
.
-
setSceneController
public void setSceneController(SceneController sceneController)
Set theDragContext
SceneController
.- Parameters:
sceneController
- theSceneController
to assign to theDragContext
.- Throws:
java.lang.IllegalArgumentException
- if the scene controller is null.
-
getGlobe
public Globe getGlobe()
Returns the currentGlobe
for this drag event.- Returns:
- the current
Globe
.
-
setGlobe
public void setGlobe(Globe globe)
Set theDragContext
Globe
.- Parameters:
globe
- theGlobe
to assign to theDragContext
.- Throws:
java.lang.IllegalArgumentException
- if the globe is null.
-
getView
public View getView()
Returns the currentView
for this drag event.- Returns:
- the current
View
.
-
setView
public void setView(View view)
Set theDragContext
View
.- Parameters:
view
- theView
to 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 theDragContext
drag 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.
-
-