Class GoogleIconDescriptor


  • public class GoogleIconDescriptor
    extends org.eclipse.jface.resource.ImageDescriptor
    ImageDescriptor that downloads the image data from https://chart.googleapis.com/ Typically used by a LabelProvider with an ImageRegistry to provide map icons.
    See Also:
    LabelProvider, ImageRegistry
    • Constructor Detail

      • GoogleIconDescriptor

        public GoogleIconDescriptor​(GoogleIconDescriptor.Options options)
        Initializes this GoogleIconDescriptor based on the provided options
        Parameters:
        options -
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • getUrlString

        public java.lang.String getUrlString()
        Gets the URL used to fetch the map icon
        Returns:
        the URL used to fetch the map icon
      • getImageData

        public org.eclipse.swt.graphics.ImageData getImageData()
        Overrides:
        getImageData in class org.eclipse.jface.resource.ImageDescriptor
      • toHex

        private java.lang.String toHex​(org.eclipse.swt.graphics.RGB rgb)
      • getImageData

        private org.eclipse.swt.graphics.ImageData getImageData​(java.lang.String urlString)
      • letterPin

        public static GoogleIconDescriptor letterPin​(char c,
                                                     boolean hasShadow,
                                                     org.eclipse.swt.graphics.RGB fillColor,
                                                     org.eclipse.swt.graphics.RGB textColor)
        Helper method for creating a letter map icon
        Parameters:
        c - the letter
        hasShadow - if it as a shaddow
        fillColor - the fill color
        textColor - the text color
        Returns:
        the corresponding descriptor
      • textBubble

        public static GoogleIconDescriptor textBubble​(java.lang.String s,
                                                      boolean hasShadow,
                                                      org.eclipse.swt.graphics.RGB fillColor,
                                                      org.eclipse.swt.graphics.RGB textColor)
        Helper method for creating a text bubble map icon
        Parameters:
        s - the text
        hasShadow - if it as a shaddow
        fillColor - the fill color
        textColor - the text color
        Returns:
        the corresponding descriptor