NASA World Wind

gov.nasa.worldwind.examples.util
Class ButtonAnnotation

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.render.AbstractAnnotation
          extended by gov.nasa.worldwind.render.ScreenAnnotation
              extended by gov.nasa.worldwind.examples.util.ImageAnnotation
                  extended by gov.nasa.worldwind.examples.util.ButtonAnnotation
All Implemented Interfaces:
AVList, Disposable, SelectListener, Pickable, Annotation, Renderable, Restorable, EventListener

public class ButtonAnnotation
extends ImageAnnotation
implements SelectListener


Nested Class Summary
 
Nested classes/interfaces inherited from class gov.nasa.worldwind.render.AbstractAnnotation
AbstractAnnotation.TextCacheKey
 
Field Summary
protected  String actionCommand
           
protected  double disabledOpacity
           
protected  boolean enabled
           
protected  EventListenerList listenerList
           
protected  boolean pressed
           
protected  Object pressedMask
           
 
Fields inherited from class gov.nasa.worldwind.examples.util.ImageAnnotation
enableSmoothing, fitSizeToImage, showToolTip, toolTipPoint, toolTipText, useImageAspectRatio, useMipmaps
 
Fields inherited from class gov.nasa.worldwind.render.AbstractAnnotation
attributes, childList, delegateOwner, layoutManager, text, textBoundsMap, wrappedTextMap
 
Fields inherited from class gov.nasa.worldwind.avlist.AVListImpl
changeSupport
 
Fields inherited from interface gov.nasa.worldwind.render.Annotation
ANTIALIAS_DONT_CARE, ANTIALIAS_FASTEST, ANTIALIAS_NICEST, IMAGE_REPEAT_NONE, IMAGE_REPEAT_X, IMAGE_REPEAT_XY, IMAGE_REPEAT_Y, SIZE_FIT_TEXT, SIZE_FIXED
 
Constructor Summary
ButtonAnnotation()
           
ButtonAnnotation(Object imageSource)
           
ButtonAnnotation(Object imageSource, Object pressedMaskSource)
           
 
Method Summary
 void addActionListener(ActionListener listener)
           
protected  void doDrawPressedMask(DrawContext dc, int width, int height, double opacity, Position pickPosition)
           
 void drawContent(DrawContext dc, int width, int height, double opacity, Position pickPosition)
           
protected  void drawPressedMask(DrawContext dc, int width, int height, double opacity, Position pickPosition)
           
protected  void fireActionPerformed(int id, long when, int modifiers)
           
 String getActionCommand()
           
 ActionListener[] getActionListeners()
           
 double getDisabledOpacity()
           
 Object getPressedMaskSource()
           
protected  boolean isButtonPressed(SelectEvent e)
           
protected  boolean isButtonTrigger(SelectEvent e)
           
 boolean isEnabled()
           
 boolean isPressed()
           
protected  void onButtonPressed(SelectEvent e)
           
 void removeActionListener(ActionListener listener)
           
 void selected(SelectEvent e)
           
 void setActionCommand(String actionCommand)
           
 void setDisabledOpacity(double opacity)
           
 void setEnabled(boolean enabled)
           
 void setPressed(boolean pressed)
           
 void setPressedMaskSource(Object source)
           
protected  void setupAnnotationAttributes(Annotation annotation)
           
 
Methods inherited from class gov.nasa.worldwind.examples.util.ImageAnnotation
adjustTextureToSize, applyBackgroundTextureState, applyBackgroundTextureTransform, doDrawToolTip, drawToolTip, getImageDimensions, getImageDimensions, getImageSource, getPreferredSize, getToolTipPoint, getToolTipText, isEnableSmoothing, isFitSizeToImage, isShowToolTip, isUseImageAspectRatio, isUseMipmaps, setEnableSmoothing, setFitSizeToImage, setImageSource, setShowToolTip, setToolTipPoint, setToolTipText, setUseImageAspectRatio, setUseMipmaps
 
Methods inherited from class gov.nasa.worldwind.render.ScreenAnnotation
doRenderNow, getRestorableState, getScreenPoint, restoreState, setScreenPoint
 
Methods inherited from class gov.nasa.worldwind.render.AbstractAnnotation
addChild, adjustSizeToChildren, adjustSizeToText, applyScreenTransform, beginDraw, beginDrawChildren, bindPickableObject, computeFreeBounds, computeInsetBounds, computeOpacity, computeScale, computeTextBounds, dispose, doDraw, doDrawBackgroundTexture, doDrawChildren, draw, drawBackground, drawBackgroundImage, drawBorder, drawCallout, drawChildren, drawHTML, drawPlainText, drawText, drawText, drawTopLevelAnnotation, endDraw, endDrawChildren, getAnnotationTexture, getAttributes, getCachedImage, getChildren, getDelegateOwner, getLayout, getMultiLineTextRenderer, getPickSupport, getText, getTextBounds, getTextRenderer, getWrappedText, glPointFromAWTPoint, isAlwaysOnTop, isPickEnabled, modulateColorOpacity, pick, removeAllChildren, removeChild, render, renderNow, setAlwaysOnTop, setAttributes, setCachedImage, setDelegateOwner, setDrawColor, setLayout, setPickEnabled, setPickSupport, setText, transformByModelview, wrapText
 
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
 

Field Detail

actionCommand

protected String actionCommand

disabledOpacity

protected double disabledOpacity

enabled

protected boolean enabled

listenerList

protected EventListenerList listenerList

pressed

protected boolean pressed

pressedMask

protected Object pressedMask
Constructor Detail

ButtonAnnotation

public ButtonAnnotation()

ButtonAnnotation

public ButtonAnnotation(Object imageSource)

ButtonAnnotation

public ButtonAnnotation(Object imageSource,
                        Object pressedMaskSource)
Method Detail

addActionListener

public void addActionListener(ActionListener listener)

doDrawPressedMask

protected void doDrawPressedMask(DrawContext dc,
                                 int width,
                                 int height,
                                 double opacity,
                                 Position pickPosition)

drawContent

public void drawContent(DrawContext dc,
                        int width,
                        int height,
                        double opacity,
                        Position pickPosition)
Overrides:
drawContent in class ImageAnnotation

drawPressedMask

protected void drawPressedMask(DrawContext dc,
                               int width,
                               int height,
                               double opacity,
                               Position pickPosition)

fireActionPerformed

protected void fireActionPerformed(int id,
                                   long when,
                                   int modifiers)

getActionCommand

public String getActionCommand()

getActionListeners

public ActionListener[] getActionListeners()

getDisabledOpacity

public double getDisabledOpacity()

getPressedMaskSource

public Object getPressedMaskSource()

isButtonPressed

protected boolean isButtonPressed(SelectEvent e)

isButtonTrigger

protected boolean isButtonTrigger(SelectEvent e)

isEnabled

public boolean isEnabled()

isPressed

public boolean isPressed()

onButtonPressed

protected void onButtonPressed(SelectEvent e)

removeActionListener

public void removeActionListener(ActionListener listener)

selected

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

setActionCommand

public void setActionCommand(String actionCommand)

setDisabledOpacity

public void setDisabledOpacity(double opacity)

setEnabled

public void setEnabled(boolean enabled)

setPressed

public void setPressed(boolean pressed)

setPressedMaskSource

public void setPressedMaskSource(Object source)

setupAnnotationAttributes

protected void setupAnnotationAttributes(Annotation annotation)
Overrides:
setupAnnotationAttributes in class ImageAnnotation

NASA World Wind