Class LabelImageProvider
- java.lang.Object
-
- org.eclipse.core.commands.common.EventManager
-
- org.eclipse.jface.viewers.BaseLabelProvider
-
- org.eclipse.jface.viewers.LabelProvider
-
- org.eclipse.nebula.widgets.geomap.jface.LabelImageProvider
-
- All Implemented Interfaces:
org.eclipse.jface.viewers.IBaseLabelProvider
,org.eclipse.jface.viewers.ILabelProvider
,IPinPointProvider
,IToolTipProvider
public class LabelImageProvider extends org.eclipse.jface.viewers.LabelProvider implements IPinPointProvider, IToolTipProvider
A default implementation of a LabelProvider that uses a GoogleIconDescriptor to create a bubble image with the text returned by getText.
-
-
Field Summary
Fields Modifier and Type Field Description private org.eclipse.swt.graphics.RGB
fillColor
private java.lang.String
frameStyle
private boolean
hasShadow
private java.lang.String
iconStyle
private org.eclipse.jface.resource.ImageRegistry
imageRegistry
private org.eclipse.swt.graphics.RGB
textColor
-
Constructor Summary
Constructors Constructor Description LabelImageProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.eclipse.jface.resource.ImageRegistry
createImageRegistry()
Creates the ImageRegistryvoid
dispose()
org.eclipse.swt.graphics.RGB
getFillColor()
Gets the setting for the fillColor argument provided to GoogleIconDescriptorjava.lang.String
getFrameStyle()
Gets the setting for the frameStyle argument provided to GoogleIconDescriptorjava.lang.String
getIconStyle()
Gets the setting for the iconStyle argument provided to GoogleIconDescriptororg.eclipse.swt.graphics.Image
getImage(java.lang.Object element)
protected org.eclipse.jface.resource.ImageRegistry
getImageRegistry()
Gets the ImageRegistry use by this LabelImageProviderprotected org.eclipse.swt.graphics.Image
getLabelImage(java.lang.Object element)
Gets the label image for the provided elementorg.eclipse.swt.graphics.Point
getPinPoint(java.lang.Object element)
Provides the relative position of the hot spot for the an image of an element, e.g.protected org.eclipse.swt.graphics.Point
getPinPoint(java.lang.Object element, float alignX, float alignY)
Helper method for computing the point based on the size of the image.org.eclipse.swt.graphics.RGB
getTextColor()
Gets the setting for the textColor argument provided to GoogleIconDescriptorjava.lang.Object
getToolTip(java.lang.Object element)
Gets the tool tip for the given elementboolean
hasShadow()
Gets the setting for the shadow argument provided to GoogleIconDescriptorvoid
setFillColor(org.eclipse.swt.graphics.RGB fillColor)
Sets the fillColor argument provided to GoogleIconDescriptorvoid
setFrameStyle(java.lang.String frameStyle)
Sets the frameStyle argument provided to GoogleIconDescriptorvoid
setHasShadow(boolean hasShadow)
Sets the shadow argument provided to GoogleIconDescriptorvoid
setIconStyle(java.lang.String iconStyle)
Sets the iconStyle argument provided to GoogleIconDescriptorvoid
setTextColor(org.eclipse.swt.graphics.RGB textColor)
Sets the textColor argument provided to GoogleIconDescriptor-
Methods inherited from class org.eclipse.jface.viewers.LabelProvider
createImageProvider, createTextImageProvider, createTextProvider, getText
-
Methods inherited from class org.eclipse.jface.viewers.BaseLabelProvider
addListener, fireLabelProviderChanged, isLabelProperty, removeListener
-
Methods inherited from class org.eclipse.core.commands.common.EventManager
addListenerObject, clearListeners, getListeners, isListenerAttached, removeListenerObject
-
-
-
-
Field Detail
-
imageRegistry
private org.eclipse.jface.resource.ImageRegistry imageRegistry
-
hasShadow
private boolean hasShadow
-
textColor
private org.eclipse.swt.graphics.RGB textColor
-
fillColor
private org.eclipse.swt.graphics.RGB fillColor
-
iconStyle
private java.lang.String iconStyle
-
frameStyle
private java.lang.String frameStyle
-
-
Method Detail
-
getImageRegistry
protected org.eclipse.jface.resource.ImageRegistry getImageRegistry()
Gets the ImageRegistry use by this LabelImageProvider- Returns:
- the
-
createImageRegistry
protected org.eclipse.jface.resource.ImageRegistry createImageRegistry()
Creates the ImageRegistry- Returns:
- the newly created ImageRegistry
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceorg.eclipse.jface.viewers.IBaseLabelProvider
- Overrides:
dispose
in classorg.eclipse.jface.viewers.BaseLabelProvider
-
hasShadow
public boolean hasShadow()
Gets the setting for the shadow argument provided to GoogleIconDescriptor- Returns:
- the current shaddow value
-
setHasShadow
public void setHasShadow(boolean hasShadow)
Sets the shadow argument provided to GoogleIconDescriptor- Parameters:
hasShadow
- the new shadow value
-
getTextColor
public org.eclipse.swt.graphics.RGB getTextColor()
Gets the setting for the textColor argument provided to GoogleIconDescriptor- Returns:
- the current textColor
-
setTextColor
public void setTextColor(org.eclipse.swt.graphics.RGB textColor)
Sets the textColor argument provided to GoogleIconDescriptor- Parameters:
textColor
- the new textColor value
-
getFillColor
public org.eclipse.swt.graphics.RGB getFillColor()
Gets the setting for the fillColor argument provided to GoogleIconDescriptor- Returns:
- the current fillColor
-
setFillColor
public void setFillColor(org.eclipse.swt.graphics.RGB fillColor)
Sets the fillColor argument provided to GoogleIconDescriptor- Parameters:
fillColor
- the new fillColor value
-
getIconStyle
public java.lang.String getIconStyle()
Gets the setting for the iconStyle argument provided to GoogleIconDescriptor- Returns:
- the current iconStyle
-
setIconStyle
public void setIconStyle(java.lang.String iconStyle)
Sets the iconStyle argument provided to GoogleIconDescriptor- Parameters:
iconStyle
- the new iconStyle value
-
getFrameStyle
public java.lang.String getFrameStyle()
Gets the setting for the frameStyle argument provided to GoogleIconDescriptor- Returns:
- the current frameStyle
-
setFrameStyle
public void setFrameStyle(java.lang.String frameStyle)
Sets the frameStyle argument provided to GoogleIconDescriptor- Parameters:
frameStyle
- the new frameStyle value
-
getLabelImage
protected org.eclipse.swt.graphics.Image getLabelImage(java.lang.Object element)
Gets the label image for the provided element- Parameters:
element
- the element- Returns:
- the label image
-
getImage
public org.eclipse.swt.graphics.Image getImage(java.lang.Object element)
- Specified by:
getImage
in interfaceorg.eclipse.jface.viewers.ILabelProvider
- Overrides:
getImage
in classorg.eclipse.jface.viewers.LabelProvider
-
getPinPoint
public org.eclipse.swt.graphics.Point getPinPoint(java.lang.Object element)
Description copied from interface:IPinPointProvider
Provides the relative position of the hot spot for the an image of an element, e.g. a pin on a map.- Specified by:
getPinPoint
in interfaceIPinPointProvider
- Parameters:
element
- the element for which to find the hot spot- Returns:
- the relative position, or null for 0, 0
-
getPinPoint
protected org.eclipse.swt.graphics.Point getPinPoint(java.lang.Object element, float alignX, float alignY)
Helper method for computing the point based on the size of the image. The float arguments alignX and alignY are multiplied with the width and height of the image, respectively.- Parameters:
element
- the element to provide the point foralignX
- a float that is multiplied with the width of the image, to give the x coordinate of the pointalignY
- a float that is multiplied with the height of the image, to give the y coordinate of the point- Returns:
- the computed point
-
getToolTip
public java.lang.Object getToolTip(java.lang.Object element)
Description copied from interface:IToolTipProvider
Gets the tool tip for the given element- Specified by:
getToolTip
in interfaceIToolTipProvider
- Returns:
- the tool tip for the given element
-
-