NASA World Wind

gov.nasa.worldwind.examples.util
Class SectorSelector

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.WWObjectImpl
          extended by gov.nasa.worldwind.examples.util.SectorSelector
All Implemented Interfaces:
AVList, RenderingListener, SelectListener, WWObject, MouseListener, MouseMotionListener, PropertyChangeListener, EventListener

public class SectorSelector
extends WWObjectImpl
implements SelectListener, MouseListener, 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 via getSector().


Nested Class Summary
protected static class SectorSelector.RegionShape
           
 
Field Summary
protected static int EAST
           
protected static int MOVING
           
protected static int NONE
           
protected static int NORTH
           
protected static int NORTHEAST
           
protected static int NORTHWEST
           
static String SECTOR_PROPERTY
           
protected static int SIZING
           
protected static int SOUTH
           
protected static int SOUTHEAST
           
protected static int SOUTHWEST
           
protected static int WEST
           
 
Fields inherited from class gov.nasa.worldwind.avlist.AVListImpl
changeSupport
 
Constructor Summary
  SectorSelector(WorldWindow worldWindow)
           
protected SectorSelector(WorldWindow worldWindow, SectorSelector.RegionShape shape, RenderableLayer rLayer)
           
 
Method Summary
protected  int determineAdjustmentSide(Movable dragObject, double factor)
           
 void disable()
           
protected  void dragWholeShape(DragSelectEvent dragEvent, Movable dragObject)
           
 void enable()
           
 Color getBorderColor()
           
 double getBorderOpacity()
           
 double getBorderWidth()
           
protected  double getEdgeFactor()
           
 Color getInteriorColor()
           
 double getInteriorOpacity()
           
 Layer getLayer()
           
protected  int getOperation()
           
protected  Position getPreviousPosition()
           
 Sector getSector()
           
protected  SectorSelector.RegionShape getShape()
           
protected  int getSide()
           
 WorldWindow getWwd()
           
protected  boolean isArmed()
           
 void mouseClicked(MouseEvent e)
           
 void mouseDragged(MouseEvent mouseEvent)
           
 void mouseEntered(MouseEvent e)
           
 void mouseExited(MouseEvent e)
           
 void mouseMoved(MouseEvent e)
           
 void mousePressed(MouseEvent mouseEvent)
           
 void mouseReleased(MouseEvent mouseEvent)
           
protected  void notifySectorChanged()
           
protected  Sector resizeShape(Movable dragObject, int side)
           
 void selected(SelectEvent event)
           
protected  void setArmed(boolean armed)
           
 void setBorderColor(Color color)
           
 void setBorderOpacity(double opacity)
           
 void setBorderWidth(double width)
           
protected  void setCursor(Cursor cursor)
           
protected  void setCursor(int sideName)
           
protected  void setEdgeFactor(double edgeFactor)
           
 void setInteriorColor(Color color)
           
 void setInteriorOpacity(double opacity)
           
protected  void setOperation(int operation)
           
protected  void setPreviousPosition(Position previousPosition)
           
protected  void setSide(int side)
           
 void stageChanged(RenderingEvent event)
           
 
Methods inherited from class gov.nasa.worldwind.WWObjectImpl
propertyChange
 
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, 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

EAST

protected static final int EAST
See Also:
Constant Field Values

MOVING

protected static final int MOVING
See Also:
Constant Field Values

NONE

protected static final int NONE
See Also:
Constant Field Values

NORTH

protected static final int NORTH
See Also:
Constant Field Values

NORTHEAST

protected static final int NORTHEAST
See Also:
Constant Field Values

NORTHWEST

protected static final int NORTHWEST
See Also:
Constant Field Values

SECTOR_PROPERTY

public static final String SECTOR_PROPERTY
See Also:
Constant Field Values

SIZING

protected static final int SIZING
See Also:
Constant Field Values

SOUTH

protected static final int SOUTH
See Also:
Constant Field Values

SOUTHEAST

protected static final int SOUTHEAST
See Also:
Constant Field Values

SOUTHWEST

protected static final int SOUTHWEST
See Also:
Constant Field Values

WEST

protected static final int WEST
See Also:
Constant Field Values
Constructor Detail

SectorSelector

public SectorSelector(WorldWindow worldWindow)

SectorSelector

protected SectorSelector(WorldWindow worldWindow,
                         SectorSelector.RegionShape shape,
                         RenderableLayer rLayer)
Method Detail

determineAdjustmentSide

protected int determineAdjustmentSide(Movable dragObject,
                                      double factor)

disable

public void disable()

dragWholeShape

protected void dragWholeShape(DragSelectEvent dragEvent,
                              Movable dragObject)

enable

public void enable()

getBorderColor

public Color getBorderColor()

getBorderOpacity

public double getBorderOpacity()

getBorderWidth

public double getBorderWidth()

getEdgeFactor

protected double getEdgeFactor()

getInteriorColor

public Color getInteriorColor()

getInteriorOpacity

public double getInteriorOpacity()

getLayer

public Layer getLayer()

getOperation

protected int getOperation()

getPreviousPosition

protected Position getPreviousPosition()

getSector

public Sector getSector()

getShape

protected SectorSelector.RegionShape getShape()

getSide

protected int getSide()

getWwd

public WorldWindow getWwd()

isArmed

protected boolean isArmed()

mouseClicked

public void mouseClicked(MouseEvent e)
Specified by:
mouseClicked in interface MouseListener

mouseDragged

public void mouseDragged(MouseEvent mouseEvent)
Specified by:
mouseDragged in interface MouseMotionListener

mouseEntered

public void mouseEntered(MouseEvent e)
Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent e)
Specified by:
mouseExited in interface MouseListener

mouseMoved

public void mouseMoved(MouseEvent e)
Specified by:
mouseMoved in interface MouseMotionListener

mousePressed

public void mousePressed(MouseEvent mouseEvent)
Specified by:
mousePressed in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent mouseEvent)
Specified by:
mouseReleased in interface MouseListener

notifySectorChanged

protected void notifySectorChanged()

resizeShape

protected Sector resizeShape(Movable dragObject,
                             int side)

selected

public void selected(SelectEvent event)
Specified by:
selected in interface SelectListener

setArmed

protected void setArmed(boolean armed)

setBorderColor

public void setBorderColor(Color color)

setBorderOpacity

public void setBorderOpacity(double opacity)

setBorderWidth

public void setBorderWidth(double width)

setCursor

protected void setCursor(Cursor cursor)

setCursor

protected void setCursor(int sideName)

setEdgeFactor

protected void setEdgeFactor(double edgeFactor)

setInteriorColor

public void setInteriorColor(Color color)

setInteriorOpacity

public void setInteriorOpacity(double opacity)

setOperation

protected void setOperation(int operation)

setPreviousPosition

protected void setPreviousPosition(Position previousPosition)

setSide

protected void setSide(int side)

stageChanged

public void stageChanged(RenderingEvent event)
Specified by:
stageChanged in interface RenderingListener

NASA World Wind