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.RGBfillColorprivate java.lang.StringframeStyleprivate booleanhasShadowprivate java.lang.StringiconStyleprivate org.eclipse.jface.resource.ImageRegistryimageRegistryprivate org.eclipse.swt.graphics.RGBtextColor
-
Constructor Summary
Constructors Constructor Description LabelImageProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.eclipse.jface.resource.ImageRegistrycreateImageRegistry()Creates the ImageRegistryvoiddispose()org.eclipse.swt.graphics.RGBgetFillColor()Gets the setting for the fillColor argument provided to GoogleIconDescriptorjava.lang.StringgetFrameStyle()Gets the setting for the frameStyle argument provided to GoogleIconDescriptorjava.lang.StringgetIconStyle()Gets the setting for the iconStyle argument provided to GoogleIconDescriptororg.eclipse.swt.graphics.ImagegetImage(java.lang.Object element)protected org.eclipse.jface.resource.ImageRegistrygetImageRegistry()Gets the ImageRegistry use by this LabelImageProviderprotected org.eclipse.swt.graphics.ImagegetLabelImage(java.lang.Object element)Gets the label image for the provided elementorg.eclipse.swt.graphics.PointgetPinPoint(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.PointgetPinPoint(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.RGBgetTextColor()Gets the setting for the textColor argument provided to GoogleIconDescriptorjava.lang.ObjectgetToolTip(java.lang.Object element)Gets the tool tip for the given elementbooleanhasShadow()Gets the setting for the shadow argument provided to GoogleIconDescriptorvoidsetFillColor(org.eclipse.swt.graphics.RGB fillColor)Sets the fillColor argument provided to GoogleIconDescriptorvoidsetFrameStyle(java.lang.String frameStyle)Sets the frameStyle argument provided to GoogleIconDescriptorvoidsetHasShadow(boolean hasShadow)Sets the shadow argument provided to GoogleIconDescriptorvoidsetIconStyle(java.lang.String iconStyle)Sets the iconStyle argument provided to GoogleIconDescriptorvoidsetTextColor(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:
disposein interfaceorg.eclipse.jface.viewers.IBaseLabelProvider- Overrides:
disposein 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:
getImagein interfaceorg.eclipse.jface.viewers.ILabelProvider- Overrides:
getImagein classorg.eclipse.jface.viewers.LabelProvider
-
getPinPoint
public org.eclipse.swt.graphics.Point getPinPoint(java.lang.Object element)
Description copied from interface:IPinPointProviderProvides the relative position of the hot spot for the an image of an element, e.g. a pin on a map.- Specified by:
getPinPointin 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:IToolTipProviderGets the tool tip for the given element- Specified by:
getToolTipin interfaceIToolTipProvider- Returns:
- the tool tip for the given element
-
-