Package gov.nasa.worldwindx.examples
Class ShapeEditingExtension.Arrow
- java.lang.Object
-
- gov.nasa.worldwindx.examples.ShapeEditingExtension.Arrow
-
- All Implemented Interfaces:
Draggable
,Movable2
,Attributable
,Highlightable
,Renderable
- Enclosing class:
- ShapeEditingExtension
public static class ShapeEditingExtension.Arrow extends java.lang.Object implements Renderable, Movable2, Highlightable, Attributable, Draggable
Defines a custom Renderable that we'll use to illustrate editing extension.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
dragEnabled
protected DraggableSupport
draggableSupport
protected Path
head
protected Path
shaft
-
Constructor Summary
Constructors Constructor Description Arrow(LatLon location0, LatLon location1, double altitude)
Arrow(ShapeEditingExtension.Arrow source)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
doDrag(DragContext dragContext)
void
drag(DragContext dragContext)
Drag the object given the providedDragContext
.double
getAltitude()
int
getAltitudeMode()
ShapeAttributes
getAttributes()
Return the shape's current attributes.ShapeAttributes
getHighlightAttributes()
Return the shape's highlight attributes.LatLon[]
getLocations()
Position
getReferencePosition()
A position associated with the object that indicates its aggregate geographic position.boolean
isDragEnabled()
Indicates whether the object is enabled for dragging.boolean
isHighlighted()
Indicates whether to highlight the shape.protected void
makeArrowhead(DrawContext dc)
void
moveTo(Globe globe, Position position)
Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.void
render(DrawContext dc)
Causes thisRenderable
to render itself using the provided draw context.void
setAttributes(ShapeAttributes attributes)
Set the shape's attributes.void
setDragEnabled(boolean enabled)
Controls whether the object is enabled for dragging.void
setHighlightAttributes(ShapeAttributes attributes)
Set the shape's highlight attributes.void
setHighlighted(boolean highlighted)
Specifies whether to highlight the shape.void
setLocations(LatLon location0, LatLon location1)
-
-
-
Field Detail
-
shaft
protected Path shaft
-
head
protected Path head
-
dragEnabled
protected boolean dragEnabled
-
draggableSupport
protected DraggableSupport draggableSupport
-
-
Constructor Detail
-
Arrow
public Arrow(ShapeEditingExtension.Arrow source)
-
-
Method Detail
-
getLocations
public LatLon[] getLocations()
-
getAltitude
public double getAltitude()
-
getAltitudeMode
public int getAltitudeMode()
-
setAttributes
public void setAttributes(ShapeAttributes attributes)
Description copied from interface:Attributable
Set the shape's attributes.- Specified by:
setAttributes
in interfaceAttributable
- Parameters:
attributes
- the attributes to assign to the shape.
-
getAttributes
public ShapeAttributes getAttributes()
Description copied from interface:Attributable
Return the shape's current attributes.- Specified by:
getAttributes
in interfaceAttributable
- Returns:
- the shape's current attributes.
-
setHighlightAttributes
public void setHighlightAttributes(ShapeAttributes attributes)
Description copied from interface:Attributable
Set the shape's highlight attributes.- Specified by:
setHighlightAttributes
in interfaceAttributable
- Parameters:
attributes
- the highlight attributes to assign to the shape.
-
getHighlightAttributes
public ShapeAttributes getHighlightAttributes()
Description copied from interface:Attributable
Return the shape's highlight attributes.- Specified by:
getHighlightAttributes
in interfaceAttributable
- Returns:
- the shape's highlight attributes.
-
isHighlighted
public boolean isHighlighted()
Description copied from interface:Highlightable
Indicates whether to highlight the shape.- Specified by:
isHighlighted
in interfaceHighlightable
- Returns:
- true to highlight the shape, otherwise false.
-
setHighlighted
public void setHighlighted(boolean highlighted)
Description copied from interface:Highlightable
Specifies whether to highlight the shape.- Specified by:
setHighlighted
in interfaceHighlightable
- Parameters:
highlighted
- true to highlight the shape, otherwise false.
-
render
public void render(DrawContext dc)
Description copied from interface:Renderable
Causes thisRenderable
to render itself using the provided draw context.- Specified by:
render
in interfaceRenderable
- Parameters:
dc
- theDrawContext
to be used- See Also:
DrawContext
-
makeArrowhead
protected void makeArrowhead(DrawContext dc)
-
getReferencePosition
public Position getReferencePosition()
Description copied from interface:Movable2
A position associated with the object that indicates its aggregate geographic position. The chosen position varies among implementers of this interface. For objects defined by a list of positions, the reference position is typically the first position in the list. For symmetric objects the reference position is often the center of the object. In many cases the object's reference position may be explicitly specified by the application.- Specified by:
getReferencePosition
in interfaceMovable2
- Returns:
- the object's reference position, or null if no reference position is available.
-
moveTo
public void moveTo(Globe globe, Position position)
Description copied from interface:Movable2
Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.
-
isDragEnabled
public boolean isDragEnabled()
Description copied from interface:Draggable
Indicates whether the object is enabled for dragging.- Specified by:
isDragEnabled
in interfaceDraggable
- Returns:
- true if the object is enabled, else false.
-
setDragEnabled
public void setDragEnabled(boolean enabled)
Description copied from interface:Draggable
Controls whether the object is enabled for dragging.- Specified by:
setDragEnabled
in interfaceDraggable
- Parameters:
enabled
-true
if the object is enabled, elsefalse
.
-
drag
public void drag(DragContext dragContext)
Description copied from interface:Draggable
Drag the object given the providedDragContext
.- Specified by:
drag
in interfaceDraggable
- Parameters:
dragContext
- theDragContext
of this dragging event.
-
doDrag
protected void doDrag(DragContext dragContext)
-
-