Class SectorSelector
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.WWObjectImpl
-
- gov.nasa.worldwindx.examples.util.SectorSelector
-
- All Implemented Interfaces:
AVList,MessageListener,RenderingListener,SelectListener,WWObject,java.awt.event.MouseListener,java.awt.event.MouseMotionListener,java.beans.PropertyChangeListener,java.util.EventListener
public class SectorSelector extends WWObjectImpl implements SelectListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, RenderingListener
Provides an interactive region selector. To use, construct and call enable/disable. Register a property listener to receive changes to the sector as they occur, or just wait until the user is done and then query the result viagetSector().
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classSectorSelector.RegionShape
-
Field Summary
Fields Modifier and Type Field Description protected static intEASTprotected static intMOVINGprotected static intNONEprotected static intNORTHprotected static intNORTHEASTprotected static intNORTHWESTstatic java.lang.StringSECTOR_PROPERTYprotected static intSIZINGprotected static intSOUTHprotected static intSOUTHEASTprotected static intSOUTHWESTprotected static intWEST
-
Constructor Summary
Constructors Modifier Constructor Description SectorSelector(WorldWindow worldWindow)protectedSectorSelector(WorldWindow worldWindow, SectorSelector.RegionShape shape, RenderableLayer rLayer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intdetermineAdjustmentSide(Movable dragObject, double factor)voiddisable()protected voiddragWholeShape(DragSelectEvent dragEvent, Movable dragObject)voidenable()java.awt.ColorgetBorderColor()doublegetBorderOpacity()doublegetBorderWidth()protected doublegetEdgeFactor()java.awt.ColorgetInteriorColor()doublegetInteriorOpacity()LayergetLayer()protected intgetOperation()protected PositiongetPreviousPosition()SectorgetSector()protected SectorSelector.RegionShapegetShape()protected intgetSide()WorldWindowgetWwd()protected booleanisArmed()voidmouseClicked(java.awt.event.MouseEvent e)voidmouseDragged(java.awt.event.MouseEvent mouseEvent)voidmouseEntered(java.awt.event.MouseEvent e)voidmouseExited(java.awt.event.MouseEvent e)voidmouseMoved(java.awt.event.MouseEvent e)voidmousePressed(java.awt.event.MouseEvent mouseEvent)voidmouseReleased(java.awt.event.MouseEvent mouseEvent)protected voidnotifySectorChanged()protected SectorresizeShape(Movable dragObject, int side)voidselected(SelectEvent event)protected voidsetArmed(boolean armed)voidsetBorderColor(java.awt.Color color)voidsetBorderOpacity(double opacity)voidsetBorderWidth(double width)protected voidsetCursor(int sideName)protected voidsetCursor(java.awt.Cursor cursor)protected voidsetEdgeFactor(double edgeFactor)voidsetInteriorColor(java.awt.Color color)voidsetInteriorOpacity(double opacity)protected voidsetOperation(int operation)protected voidsetPreviousPosition(Position previousPosition)protected voidsetSide(int side)voidstageChanged(RenderingEvent event)-
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
onMessage, propertyChange
-
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
-
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface gov.nasa.worldwind.avlist.AVList
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
-
-
-
-
Field Detail
-
SECTOR_PROPERTY
public static final java.lang.String SECTOR_PROPERTY
- See Also:
- Constant Field Values
-
NONE
protected static final int NONE
- See Also:
- Constant Field Values
-
MOVING
protected static final int MOVING
- See Also:
- Constant Field Values
-
SIZING
protected static final int SIZING
- See Also:
- Constant Field Values
-
NORTH
protected static final int NORTH
- See Also:
- Constant Field Values
-
SOUTH
protected static final int SOUTH
- See Also:
- Constant Field Values
-
EAST
protected static final int EAST
- See Also:
- Constant Field Values
-
WEST
protected static final int WEST
- See Also:
- Constant Field Values
-
NORTHWEST
protected static final int NORTHWEST
- See Also:
- Constant Field Values
-
NORTHEAST
protected static final int NORTHEAST
- See Also:
- Constant Field Values
-
SOUTHWEST
protected static final int SOUTHWEST
- See Also:
- Constant Field Values
-
SOUTHEAST
protected static final int SOUTHEAST
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SectorSelector
public SectorSelector(WorldWindow worldWindow)
-
SectorSelector
protected SectorSelector(WorldWindow worldWindow, SectorSelector.RegionShape shape, RenderableLayer rLayer)
-
-
Method Detail
-
getWwd
public WorldWindow getWwd()
-
getLayer
public Layer getLayer()
-
enable
public void enable()
-
disable
public void disable()
-
getSector
public Sector getSector()
-
getInteriorColor
public java.awt.Color getInteriorColor()
-
setInteriorColor
public void setInteriorColor(java.awt.Color color)
-
getBorderColor
public java.awt.Color getBorderColor()
-
setBorderColor
public void setBorderColor(java.awt.Color color)
-
getInteriorOpacity
public double getInteriorOpacity()
-
setInteriorOpacity
public void setInteriorOpacity(double opacity)
-
getBorderOpacity
public double getBorderOpacity()
-
setBorderOpacity
public void setBorderOpacity(double opacity)
-
getBorderWidth
public double getBorderWidth()
-
setBorderWidth
public void setBorderWidth(double width)
-
getShape
protected SectorSelector.RegionShape getShape()
-
isArmed
protected boolean isArmed()
-
setArmed
protected void setArmed(boolean armed)
-
getOperation
protected int getOperation()
-
setOperation
protected void setOperation(int operation)
-
getSide
protected int getSide()
-
setSide
protected void setSide(int side)
-
getPreviousPosition
protected Position getPreviousPosition()
-
setPreviousPosition
protected void setPreviousPosition(Position previousPosition)
-
getEdgeFactor
protected double getEdgeFactor()
-
setEdgeFactor
protected void setEdgeFactor(double edgeFactor)
-
stageChanged
public void stageChanged(RenderingEvent event)
- Specified by:
stageChangedin interfaceRenderingListener
-
notifySectorChanged
protected void notifySectorChanged()
-
mousePressed
public void mousePressed(java.awt.event.MouseEvent mouseEvent)
- Specified by:
mousePressedin interfacejava.awt.event.MouseListener
-
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent mouseEvent)
- Specified by:
mouseReleasedin interfacejava.awt.event.MouseListener
-
mouseDragged
public void mouseDragged(java.awt.event.MouseEvent mouseEvent)
- Specified by:
mouseDraggedin interfacejava.awt.event.MouseMotionListener
-
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent e)
- Specified by:
mouseClickedin interfacejava.awt.event.MouseListener
-
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent e)
- Specified by:
mouseEnteredin interfacejava.awt.event.MouseListener
-
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
- Specified by:
mouseExitedin interfacejava.awt.event.MouseListener
-
mouseMoved
public void mouseMoved(java.awt.event.MouseEvent e)
- Specified by:
mouseMovedin interfacejava.awt.event.MouseMotionListener
-
selected
public void selected(SelectEvent event)
- Specified by:
selectedin interfaceSelectListener
-
determineAdjustmentSide
protected int determineAdjustmentSide(Movable dragObject, double factor)
-
dragWholeShape
protected void dragWholeShape(DragSelectEvent dragEvent, Movable dragObject)
-
setCursor
protected void setCursor(int sideName)
-
setCursor
protected void setCursor(java.awt.Cursor cursor)
-
-