2 Copyright (C) 2001, 2006 United States Government
3 as represented by the Administrator of the
4 National Aeronautics and Space Administration.
7 package gov
.nasa
.worldwind
;
9 import gov
.nasa
.worldwind
.geom
.*;
12 import java
.awt
.Color
;
18 public class UserFacingIcon
extends AVListImpl
implements WWIcon
20 private final String iconPath
;
21 private Position iconPosition
; // may be null because placement may be relative
22 private Dimension iconSize
; // may be null to indicate "use native image size"
23 private boolean isHighlighted
= false;
24 private boolean isVisible
= true;
25 private double highlightScale
= 1.2; // TODO: make configurable
26 private String toolTipText
;
27 private Font toolTipFont
;
28 private boolean showToolTip
= false;
29 private java
.awt
.Color textColor
;
31 public UserFacingIcon(String iconPath
, Position iconPosition
)
33 // TODO: argument checking
34 this.iconPath
= iconPath
;
35 this.iconPosition
= iconPosition
;
38 public String
getPath()
43 public Position
getPosition()
48 public void setPosition(Position iconPosition
)
50 this.iconPosition
= iconPosition
;
53 // public void setPosition(PolarPoint iconPosition)
55 // this.iconPosition = new Position(iconPosition.getLatitude(), iconPosition.getLongitude(),
56 // iconPosition.getRadius());
59 public boolean isHighlighted()
64 public void setHighlighted(boolean highlighted
)
66 isHighlighted
= highlighted
;
69 public double getHighlightScale()
71 return highlightScale
;
74 public void setHighlightScale(double highlightScale
)
76 this.highlightScale
= highlightScale
;
79 public Dimension
getSize()
84 public void setSize(Dimension size
)
89 public boolean isVisible()
94 public void setVisible(boolean visible
)
99 public String
getToolTipText()
104 public void setToolTipText(String toolTipText
)
106 this.toolTipText
= toolTipText
;
109 public Font
getToolTipFont()
114 public void setToolTipFont(Font toolTipFont
)
116 this.toolTipFont
= toolTipFont
;
119 public boolean isShowToolTip()
124 public void setShowToolTip(boolean showToolTip
)
126 this.showToolTip
= showToolTip
;
129 public Color
getToolTipTextColor()
134 public void setToolTipTextColor(Color textColor
)
136 this.textColor
= textColor
;
139 public String
toString()
141 return this.iconPath
!= null ?
this.iconPath
: this.getClass().getName();