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 booleandragEnabledprotected DraggableSupportdraggableSupportprotected Pathheadprotected Pathshaft
-
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 voiddoDrag(DragContext dragContext)voiddrag(DragContext dragContext)Drag the object given the providedDragContext.doublegetAltitude()intgetAltitudeMode()ShapeAttributesgetAttributes()Return the shape's current attributes.ShapeAttributesgetHighlightAttributes()Return the shape's highlight attributes.LatLon[]getLocations()PositiongetReferencePosition()A position associated with the object that indicates its aggregate geographic position.booleanisDragEnabled()Indicates whether the object is enabled for dragging.booleanisHighlighted()Indicates whether to highlight the shape.protected voidmakeArrowhead(DrawContext dc)voidmoveTo(Globe globe, Position position)Move the shape over the globe's surface while maintaining its original azimuth, its orientation relative to North.voidrender(DrawContext dc)Causes thisRenderableto render itself using the provided draw context.voidsetAttributes(ShapeAttributes attributes)Set the shape's attributes.voidsetDragEnabled(boolean enabled)Controls whether the object is enabled for dragging.voidsetHighlightAttributes(ShapeAttributes attributes)Set the shape's highlight attributes.voidsetHighlighted(boolean highlighted)Specifies whether to highlight the shape.voidsetLocations(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:AttributableSet the shape's attributes.- Specified by:
setAttributesin interfaceAttributable- Parameters:
attributes- the attributes to assign to the shape.
-
getAttributes
public ShapeAttributes getAttributes()
Description copied from interface:AttributableReturn the shape's current attributes.- Specified by:
getAttributesin interfaceAttributable- Returns:
- the shape's current attributes.
-
setHighlightAttributes
public void setHighlightAttributes(ShapeAttributes attributes)
Description copied from interface:AttributableSet the shape's highlight attributes.- Specified by:
setHighlightAttributesin interfaceAttributable- Parameters:
attributes- the highlight attributes to assign to the shape.
-
getHighlightAttributes
public ShapeAttributes getHighlightAttributes()
Description copied from interface:AttributableReturn the shape's highlight attributes.- Specified by:
getHighlightAttributesin interfaceAttributable- Returns:
- the shape's highlight attributes.
-
isHighlighted
public boolean isHighlighted()
Description copied from interface:HighlightableIndicates whether to highlight the shape.- Specified by:
isHighlightedin interfaceHighlightable- Returns:
- true to highlight the shape, otherwise false.
-
setHighlighted
public void setHighlighted(boolean highlighted)
Description copied from interface:HighlightableSpecifies whether to highlight the shape.- Specified by:
setHighlightedin interfaceHighlightable- Parameters:
highlighted- true to highlight the shape, otherwise false.
-
render
public void render(DrawContext dc)
Description copied from interface:RenderableCauses thisRenderableto render itself using the provided draw context.- Specified by:
renderin interfaceRenderable- Parameters:
dc- theDrawContextto be used- See Also:
DrawContext
-
makeArrowhead
protected void makeArrowhead(DrawContext dc)
-
getReferencePosition
public Position getReferencePosition()
Description copied from interface:Movable2A 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:
getReferencePositionin 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:Movable2Move 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:DraggableIndicates whether the object is enabled for dragging.- Specified by:
isDragEnabledin interfaceDraggable- Returns:
- true if the object is enabled, else false.
-
setDragEnabled
public void setDragEnabled(boolean enabled)
Description copied from interface:DraggableControls whether the object is enabled for dragging.- Specified by:
setDragEnabledin interfaceDraggable- Parameters:
enabled-trueif the object is enabled, elsefalse.
-
drag
public void drag(DragContext dragContext)
Description copied from interface:DraggableDrag the object given the providedDragContext.- Specified by:
dragin interfaceDraggable- Parameters:
dragContext- theDragContextof this dragging event.
-
doDrag
protected void doDrag(DragContext dragContext)
-
-