Class AbstractLegend<T extends AbstractLegend<T>>

java.lang.Object
io.jmix.chartsflowui.kit.component.model.ChartObservableObject
io.jmix.chartsflowui.kit.component.model.legend.AbstractLegend<T>
Type Parameters:
T - origin legend class type
All Implemented Interfaces:
HasBorder<T>, HasPosition<T>, HasShadow<T>, HasPadding<T>, Serializable
Direct Known Subclasses:
Legend, ScrollableLegend

public abstract class AbstractLegend<T extends AbstractLegend<T>> extends ChartObservableObject implements HasShadow<T>, HasPosition<T>, HasBorder<T>, HasPadding<T>
Base class for legend component.
See Also:
  • Field Details

  • Constructor Details

    • AbstractLegend

      protected AbstractLegend(LegendType type)
  • Method Details

    • getType

      public LegendType getType()
    • getId

      public String getId()
    • setId

      public void setId(String id)
    • withId

      public T withId(String id)
    • getShow

      public Boolean getShow()
    • setShow

      public void setShow(Boolean show)
    • withShow

      public T withShow(Boolean show)
    • getZLevel

      public Integer getZLevel()
    • setZLevel

      public void setZLevel(Integer zLevel)
    • withZLevel

      public T withZLevel(Integer zLevel)
    • getZ

      public Integer getZ()
    • setZ

      public void setZ(Integer z)
    • withZ

      public T withZ(Integer z)
    • getLeft

      public String getLeft()
      Specified by:
      getLeft in interface HasPosition<T extends AbstractLegend<T>>
      Returns:
      distance between component and the left side of the container
    • setLeft

      public void setLeft(String left)
      Description copied from interface: HasPosition
      Sets a distance between component and the left side of the container.
      Possible values are:
      • A pixel value like "20".
      • Percentage value relative to container width like "20%".
      • Predefined values like "left", "center", "right".
      Specified by:
      setLeft in interface HasPosition<T extends AbstractLegend<T>>
      Parameters:
      left - distance to set
    • getTop

      public String getTop()
      Specified by:
      getTop in interface HasPosition<T extends AbstractLegend<T>>
      Returns:
      distance between component and the top side of the container
    • setTop

      public void setTop(String top)
      Description copied from interface: HasPosition
      Sets a distance between component and the top side of the container.
      Possible values are:
      • A pixel value like "20".
      • Percentage value relative to container width like "20%".
      • Predefined values like "top", "middle", "bottom".
      Specified by:
      setTop in interface HasPosition<T extends AbstractLegend<T>>
      Parameters:
      top - distance to set
    • getRight

      public String getRight()
      Specified by:
      getRight in interface HasPosition<T extends AbstractLegend<T>>
      Returns:
      distance between component and the right side of the container
    • setRight

      public void setRight(String right)
      Description copied from interface: HasPosition
      Sets a distance between component and the right side of the container.
      Possible values are:
      • A pixel value like "20".
      • Percentage value relative to container width like "20%".
      Specified by:
      setRight in interface HasPosition<T extends AbstractLegend<T>>
      Parameters:
      right - distance to set
    • getBottom

      public String getBottom()
      Specified by:
      getBottom in interface HasPosition<T extends AbstractLegend<T>>
      Returns:
      distance between component and the bottom side of the container
    • setBottom

      public void setBottom(String bottom)
      Description copied from interface: HasPosition
      Sets a distance between component and the bottom side of the container.
      Possible values are:
      • A pixel value like "20".
      • Percentage value relative to container width like "20%".
      Specified by:
      setBottom in interface HasPosition<T extends AbstractLegend<T>>
      Parameters:
      bottom - distance to set
    • getWidth

      public String getWidth()
    • setWidth

      public void setWidth(String width)
    • withWidth

      public T withWidth(String width)
    • getHeight

      public String getHeight()
    • setHeight

      public void setHeight(String height)
    • withHeight

      public T withHeight(String height)
    • getOrientation

      public Orientation getOrientation()
    • setOrientation

      public void setOrientation(Orientation orientation)
    • withOrientation

      public T withOrientation(Orientation orientation)
    • getAlign

      public AbstractLegend.Align getAlign()
    • setAlign

      public void setAlign(AbstractLegend.Align align)
    • withAlign

      public T withAlign(AbstractLegend.Align align)
    • getPadding

      public Padding getPadding()
      Specified by:
      getPadding in interface HasPadding<T extends AbstractLegend<T>>
      Returns:
      space around content
    • setPadding

      public void setPadding(Integer padding)
      Description copied from interface: HasPadding
      Sets padding on each of the four sides or replaces an existing one. The unit is px.
      Specified by:
      setPadding in interface HasPadding<T extends AbstractLegend<T>>
      Parameters:
      padding - padding to set
    • setPadding

      public void setPadding(Integer vertical, Integer horizontal)
      Description copied from interface: HasPadding
      Sets the top/bottom and left/right paddings or replaces an existing one. The unit is px.
      Specified by:
      setPadding in interface HasPadding<T extends AbstractLegend<T>>
      Parameters:
      vertical - top and bottom padding to set
      horizontal - left and right padding to set
    • setPadding

      public void setPadding(Integer top, Integer right, Integer bottom, Integer left)
      Description copied from interface: HasPadding
      Sets each of the four paddings separately. The unit is px.
      Specified by:
      setPadding in interface HasPadding<T extends AbstractLegend<T>>
      Parameters:
      top - top padding to set
      right - right padding to set
      bottom - bottom padding to set
      left - left padding to set
    • getItemGap

      public Integer getItemGap()
    • setItemGap

      public void setItemGap(Integer itemGap)
    • withItemGap

      public T withItemGap(Integer itemGap)
    • getItemWidth

      public Integer getItemWidth()
    • setItemWidth

      public void setItemWidth(Integer itemWidth)
    • withItemWidth

      public T withItemWidth(Integer itemWidth)
    • getItemHeight

      public Integer getItemHeight()
    • setItemHeight

      public void setItemHeight(Integer itemHeight)
    • withItemHeight

      public T withItemHeight(Integer itemHeight)
    • getItemStyle

      public ItemStyle getItemStyle()
    • setItemStyle

      public void setItemStyle(ItemStyle itemStyle)
    • withItemStyle

      public T withItemStyle(ItemStyle itemStyle)
    • getLineStyle

      public LineStyle getLineStyle()
    • setLineStyle

      public void setLineStyle(LineStyle lineStyle)
    • withLineStyle

      public T withLineStyle(LineStyle lineStyle)
    • getSymbolRotate

      public Integer getSymbolRotate()
    • setSymbolRotate

      public void setSymbolRotate(Integer symbolRotate)
    • withSymbolRotate

      public T withSymbolRotate(Integer symbolRotate)
    • getFormatter

      public String getFormatter()
    • setFormatter

      public void setFormatter(String formatter)
    • withFormatter

      public T withFormatter(String formatter)
    • getFormatterFunction

      public JsFunction getFormatterFunction()
    • setFormatterFunction

      public void setFormatterFunction(JsFunction formatterFunction)
    • setFormatterFunction

      public void setFormatterFunction(String formatterFunction)
    • withFormatterFunction

      public T withFormatterFunction(JsFunction formatterFunction)
    • withFormatterFunction

      public T withFormatterFunction(String formatterFunction)
    • getSelectedMode

      public SelectedMode getSelectedMode()
    • setSelectedMode

      public void setSelectedMode(SelectedMode selectedMode)
    • withSelectedMode

      public T withSelectedMode(SelectedMode selectedMode)
    • getInactiveColor

      public Color getInactiveColor()
    • setInactiveColor

      public void setInactiveColor(Color inactiveColor)
    • withInactiveColor

      public T withInactiveColor(Color inactiveColor)
    • getInactiveBorderColor

      public Color getInactiveBorderColor()
    • setInactiveBorderColor

      public void setInactiveBorderColor(Color inactiveBorderColor)
    • withInactiveBorderColor

      public T withInactiveBorderColor(Color inactiveBorderColor)
    • getInactiveBorderWidth

      public Integer getInactiveBorderWidth()
    • setInactiveBorderWidth

      public void setInactiveBorderWidth(Integer inactiveBorderWidth)
    • withInactiveBorderWidth

      public T withInactiveBorderWidth(Integer inactiveBorderWidth)
    • getSelectedSeries

      public Map<String,Boolean> getSelectedSeries()
    • setSelectedSeries

      public void setSelectedSeries(Map<String,Boolean> selectedSeries)
    • addSelectedSeries

      public void addSelectedSeries(String seriesName, Boolean select)
    • removeSelectedSeries

      public void removeSelectedSeries(String seriesName)
    • withSelectedSeries

      public T withSelectedSeries(String seriesName, Boolean select)
    • withSelectedSeries

      public T withSelectedSeries(Map<String,Boolean> selectedSeries)
    • getTextStyle

      public AbstractLegend.TextStyle getTextStyle()
    • setTextStyle

      public void setTextStyle(AbstractLegend.TextStyle textStyle)
    • withTextStyle

      public T withTextStyle(AbstractLegend.TextStyle textStyle)
    • getTooltip

      public Tooltip getTooltip()
    • setTooltip

      public void setTooltip(Tooltip tooltip)
    • withTooltip

      public T withTooltip(Tooltip tooltip)
    • getIcon

      public String getIcon()
    • setIcon

      public void setIcon(String icon)
    • withIcon

      public T withIcon(String icon)
    • getBackgroundColor

      public Color getBackgroundColor()
    • setBackgroundColor

      public void setBackgroundColor(Color backgroundColor)
    • withBackgroundColor

      public T withBackgroundColor(Color backgroundColor)
    • getBorderColor

      public Color getBorderColor()
      Specified by:
      getBorderColor in interface HasBorder<T extends AbstractLegend<T>>
      Returns:
      border color
    • setBorderColor

      public void setBorderColor(Color borderColor)
      Description copied from interface: HasBorder
      Sets a border color or replaces an existing one.
      Specified by:
      setBorderColor in interface HasBorder<T extends AbstractLegend<T>>
      Parameters:
      borderColor - color to set
    • getBorderWidth

      public Integer getBorderWidth()
      Specified by:
      getBorderWidth in interface HasBorder<T extends AbstractLegend<T>>
      Returns:
      border width in pixels
    • setBorderWidth

      public void setBorderWidth(Integer borderWidth)
      Description copied from interface: HasBorder
      Sets a border width or replaces an existing one.
      Specified by:
      setBorderWidth in interface HasBorder<T extends AbstractLegend<T>>
      Parameters:
      borderWidth - border width in pixels
    • getBorderRadius

      public Integer getBorderRadius()
      Specified by:
      getBorderRadius in interface HasBorder<T extends AbstractLegend<T>>
      Returns:
      border radius of the text fragment
    • setBorderRadius

      public void setBorderRadius(Integer borderRadius)
      Description copied from interface: HasBorder
      Sets a border radius of the text fragment or replaces an existing one.
      Specified by:
      setBorderRadius in interface HasBorder<T extends AbstractLegend<T>>
      Parameters:
      borderRadius - border radius to set in pixels
    • getShadowBlur

      public Integer getShadowBlur()
      Specified by:
      getShadowBlur in interface HasShadow<T extends AbstractLegend<T>>
      Returns:
      depth of shadow blur
    • setShadowBlur

      public void setShadowBlur(Integer shadowBlur)
      Description copied from interface: HasShadow
      Sets depth of shadow blur or replaces an existing one.
      Specified by:
      setShadowBlur in interface HasShadow<T extends AbstractLegend<T>>
      Parameters:
      shadowBlur - depth of shadow blur
    • getShadowColor

      public Color getShadowColor()
      Specified by:
      getShadowColor in interface HasShadow<T extends AbstractLegend<T>>
      Returns:
      shadow color
    • setShadowColor

      public void setShadowColor(Color shadowColor)
      Description copied from interface: HasShadow
      Sets a color for shadow or replaces an existing one.
      Specified by:
      setShadowColor in interface HasShadow<T extends AbstractLegend<T>>
      Parameters:
      shadowColor - color to set
    • getShadowOffsetX

      public Integer getShadowOffsetX()
      Specified by:
      getShadowOffsetX in interface HasShadow<T extends AbstractLegend<T>>
      Returns:
      horizontal offset for shadow in pixels
    • setShadowOffsetX

      public void setShadowOffsetX(Integer shadowOffsetX)
      Description copied from interface: HasShadow
      Sets horizontal offset for shadow or replaces an existing one.
      Specified by:
      setShadowOffsetX in interface HasShadow<T extends AbstractLegend<T>>
      Parameters:
      shadowOffsetX - offset to set in pixels
    • getShadowOffsetY

      public Integer getShadowOffsetY()
      Specified by:
      getShadowOffsetY in interface HasShadow<T extends AbstractLegend<T>>
      Returns:
      vertical offset for shadow in pixels
    • setShadowOffsetY

      public void setShadowOffsetY(Integer shadowOffsetY)
      Description copied from interface: HasShadow
      Sets vertical offset for shadow or replaces an existing one.
      Specified by:
      setShadowOffsetY in interface HasShadow<T extends AbstractLegend<T>>
      Parameters:
      shadowOffsetY - offset to set in pixels
    • getEmphasis

      public AbstractLegend.Emphasis getEmphasis()
    • setEmphasis

      public void setEmphasis(AbstractLegend.Emphasis emphasis)
    • withEmphasis

      public T withEmphasis(AbstractLegend.Emphasis emphasis)
    • getSelector

      public Boolean getSelector()
    • setSelector

      public void setSelector(Boolean selector)
    • withSelector

      public T withSelector(Boolean selector)
    • getSelectorLabel

      public AbstractLegend.SelectorLabel getSelectorLabel()
    • setSelectorLabel

      public void setSelectorLabel(AbstractLegend.SelectorLabel selectorLabel)
    • withSelectorLabel

      public T withSelectorLabel(AbstractLegend.SelectorLabel selectorLabel)
    • getSelectorPosition

      public AbstractLegend.Position getSelectorPosition()
    • setSelectorPosition

      public void setSelectorPosition(AbstractLegend.Position selectorPosition)
    • withSelectorPosition

      public T withSelectorPosition(AbstractLegend.Position selectorPosition)
    • getSelectorItemGap

      public Integer getSelectorItemGap()
    • setSelectorItemGap

      public void setSelectorItemGap(Integer selectorItemGap)
    • withSelectorItemGap

      public T withSelectorItemGap(Integer selectorItemGap)
    • getSelectorButtonGap

      public Integer getSelectorButtonGap()
    • setSelectorButtonGap

      public void setSelectorButtonGap(Integer selectorButtonGap)
    • withSelectorButtonGap

      public T withSelectorButtonGap(Integer selectorButtonGap)