Class InfoPanelController
- java.lang.Object
-
- javax.swing.AbstractAction
-
- gov.nasa.worldwindx.applications.worldwindow.features.AbstractFeature
-
- gov.nasa.worldwindx.applications.worldwindow.core.InfoPanelController
-
- All Implemented Interfaces:
SelectListener
,Initializable
,Feature
,java.awt.event.ActionListener
,java.beans.PropertyChangeListener
,java.io.Serializable
,java.lang.Cloneable
,java.util.EventListener
,javax.swing.Action
public class InfoPanelController extends AbstractFeature implements SelectListener
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AnnotationLayer
annotationLayer
protected ScreenAnnotation
annotationPanel
protected static java.lang.String
HARD_SPACE
protected static java.lang.String
INDENT
protected AVList
lastSelectedObject
protected int
maxLineLength
-
Fields inherited from class gov.nasa.worldwindx.applications.worldwindow.features.AbstractFeature
controller, featureID
-
-
Constructor Summary
Constructors Constructor Description InfoPanelController(Registry registry)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.awt.Dimension
computeLengths(java.lang.String annoText)
Determine the number of lines in the annotation text and the length of the longest line.protected java.awt.Dimension
computePanelSize(java.lang.String annoText)
Determine the panel size needed to display the full annotation.protected AnnotationAttributes
getAnnotationPanelAttributes(java.lang.String annoText)
protected void
hideAnnotationPanel()
void
initialize(Controller controller)
void
selected(SelectEvent event)
protected void
showAnnotationPanel(java.lang.String annoText)
protected java.lang.String
splitLine(java.lang.String origLine)
Split a long line into several lines.protected java.lang.String
splitLines(java.lang.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
-
-
-
-
Field Detail
-
HARD_SPACE
protected static final java.lang.String HARD_SPACE
- See Also:
- Constant Field Values
-
INDENT
protected static final java.lang.String INDENT
- See Also:
- Constant Field Values
-
maxLineLength
protected int maxLineLength
-
annotationLayer
protected AnnotationLayer annotationLayer
-
annotationPanel
protected ScreenAnnotation annotationPanel
-
lastSelectedObject
protected AVList lastSelectedObject
-
-
Constructor Detail
-
InfoPanelController
public InfoPanelController(Registry registry)
-
-
Method Detail
-
initialize
public void initialize(Controller controller)
- Specified by:
initialize
in interfaceInitializable
- Overrides:
initialize
in classAbstractFeature
-
selected
public void selected(SelectEvent event)
- Specified by:
selected
in interfaceSelectListener
-
showAnnotationPanel
protected void showAnnotationPanel(java.lang.String annoText)
-
hideAnnotationPanel
protected void hideAnnotationPanel()
-
getAnnotationPanelAttributes
protected AnnotationAttributes getAnnotationPanelAttributes(java.lang.String annoText)
-
computePanelSize
protected java.awt.Dimension computePanelSize(java.lang.String annoText)
Determine the panel size needed to display the full annotation.- Parameters:
annoText
- the annotation text.- Returns:
- the required panel size.
-
computeLengths
protected java.awt.Dimension computeLengths(java.lang.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).
-
splitLines
protected java.lang.String splitLines(java.lang.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.
-
splitLine
protected java.lang.String splitLine(java.lang.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.
-
-