NASA World Wind

gov.nasa.worldwindx.applications.worldwindow.core
Class InfoPanelController

java.lang.Object
  extended by javax.swing.AbstractAction
      extended by gov.nasa.worldwindx.applications.worldwindow.features.AbstractFeature
          extended by gov.nasa.worldwindx.applications.worldwindow.core.InfoPanelController
All Implemented Interfaces:
SelectListener, Initializable, Feature, ActionListener, PropertyChangeListener, Serializable, Cloneable, EventListener, Action

public class InfoPanelController
extends AbstractFeature
implements SelectListener

See Also:
Serialized Form

Field Summary
protected  AnnotationLayer annotationLayer
           
protected  ScreenAnnotation annotationPanel
           
protected static String HARD_SPACE
           
protected static String INDENT
           
protected  AVList lastSelectedObject
           
protected  int maxLineLength
           
 
Fields inherited from class gov.nasa.worldwindx.applications.worldwindow.features.AbstractFeature
controller, featureID
 
Fields inherited from class javax.swing.AbstractAction
changeSupport, enabled
 
Fields inherited from interface javax.swing.Action
ACCELERATOR_KEY, ACTION_COMMAND_KEY, DEFAULT, DISPLAYED_MNEMONIC_INDEX_KEY, LARGE_ICON_KEY, LONG_DESCRIPTION, MNEMONIC_KEY, NAME, SELECTED_KEY, SHORT_DESCRIPTION, SMALL_ICON
 
Constructor Summary
InfoPanelController(Registry registry)
           
 
Method Summary
protected  Dimension computeLengths(String annoText)
          Determine the number of lines in the annotation text and the length of the longest line.
protected  Dimension computePanelSize(String annoText)
          Determine the panel size needed to display the full annotation.
protected  AnnotationAttributes getAnnotationPanelAttributes(String annoText)
           
protected  void hideAnnotationPanel()
           
 void initialize(Controller controller)
           
 void selected(SelectEvent event)
           
protected  void showAnnotationPanel(String annoText)
           
protected  String splitLine(String origLine)
          Split a long line into several lines.
protected  String splitLines(String origText)
          Split a collection of lines into a new collection whose lines are all less than the maximum allowed line length.
 
Methods inherited from class gov.nasa.worldwindx.applications.worldwindow.features.AbstractFeature
actionPerformed, addToToolBar, doActionPerformed, doPropertyChange, getController, getFeatureID, getName, getStringValue, isInitialized, isOn, isTwoState, propertyChange, register, setMenuAccellerator, turnOn
 
Methods inherited from class javax.swing.AbstractAction
addPropertyChangeListener, clone, firePropertyChange, getKeys, getPropertyChangeListeners, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.Action
addPropertyChangeListener, getValue, isEnabled, putValue, removePropertyChangeListener, setEnabled
 

Field Detail

annotationLayer

protected AnnotationLayer annotationLayer

annotationPanel

protected ScreenAnnotation annotationPanel

HARD_SPACE

protected static final String HARD_SPACE
See Also:
Constant Field Values

INDENT

protected static final String INDENT
See Also:
Constant Field Values

lastSelectedObject

protected AVList lastSelectedObject

maxLineLength

protected int maxLineLength
Constructor Detail

InfoPanelController

public InfoPanelController(Registry registry)
Method Detail

computeLengths

protected Dimension computeLengths(String annoText)
Determine the number of lines in the annotation text and the length of the longest line.

Parameters:
annoText - the annotation text.
Returns:
the length of the longest line (width) and number of lines (height).

computePanelSize

protected Dimension computePanelSize(String annoText)
Determine the panel size needed to display the full annotation.

Parameters:
annoText - the annotation text.
Returns:
the required panel size.

getAnnotationPanelAttributes

protected AnnotationAttributes getAnnotationPanelAttributes(String annoText)

hideAnnotationPanel

protected void hideAnnotationPanel()

initialize

public void initialize(Controller controller)
Specified by:
initialize in interface Initializable
Overrides:
initialize in class AbstractFeature

selected

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

showAnnotationPanel

protected void showAnnotationPanel(String annoText)

splitLine

protected String splitLine(String origLine)
Split a long line into several lines.

Parameters:
origLine - the original line
Returns:
a string with new-line characters at the line-split locations.

splitLines

protected String splitLines(String origText)
Split a collection of lines into a new collection whose lines are all less than the maximum allowed line length.

Parameters:
origText - the original lines.
Returns:
the new lines.

NASA World Wind