public class

LegendItem

extends Object
java.lang.Object
   ↳ com.sap.cloud.mobile.fiori.maps.LegendItem

Class Overview

Class representing an item in the legend.

Summary

Nested Classes
enum LegendItem.LegendType  
Fields
protected Drawable mDrawable
protected LegendItem.LegendType mLegendType
protected String mTitle
Public Constructors
LegendItem(String title, Drawable drawable)
Construct a legend item.
LegendItem(String title, Drawable drawable, LegendItem.LegendType legendType)
Construct a legend item.
Public Methods
static boolean canMerge(String title1, LegendItem.LegendType legendType1, String title2, LegendItem.LegendType legendType2)
Drawable getDrawable()
Drawable for this legend item.
LegendItem.LegendType getLegendType()
Returns the legend type
String getTitle()
Title for this legend item.
boolean merge(LegendItem item1, Context context)
Merges the given legend item with the current item if possible, which is, titles are equal and one type is POINT and another is LINE.
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected Drawable mDrawable

protected LegendItem.LegendType mLegendType

protected String mTitle

Public Constructors

public LegendItem (String title, Drawable drawable)

Construct a legend item.

Parameters
title The title for the legend item.
drawable The drawable for the legend item.

public LegendItem (String title, Drawable drawable, LegendItem.LegendType legendType)

Construct a legend item.

Parameters
title The title for the legend item.
drawable The drawable for the legend item.

Public Methods

public static boolean canMerge (String title1, LegendItem.LegendType legendType1, String title2, LegendItem.LegendType legendType2)

public Drawable getDrawable ()

Drawable for this legend item.

Returns
  • This legend items drawable.

public LegendItem.LegendType getLegendType ()

Returns the legend type

public String getTitle ()

Title for this legend item.

Returns
  • This legend items title.

public boolean merge (LegendItem item1, Context context)

Merges the given legend item with the current item if possible, which is, titles are equal and one type is POINT and another is LINE. The current item's drawable will be updated after the merge. The LINE drawable must be a 2dp high drawable or an InsetDrawable which wraps a 2dp drawable.

Parameters
item1 legend item to be merged
Returns
  • true if merged, false otherwise