Class Segment

java.lang.Object
org.eclipse.nebula.widgets.segmentedbar.Segment

public class Segment
extends java.lang.Object
Instances of this object are items manipulated by the Segmented Bar widget. These items are highly customizable, you can set :
  • Background and foreground colors
  • Font
  • Image
  • Text
  • Tooltip
You can also store data using the setData methods.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    (package private) static int CORNER_RADIUS  
    (package private) org.eclipse.swt.graphics.Rectangle drawingArea  
  • Constructor Summary

    Constructors 
    Constructor Description
    Segment()  
  • Method Summary

    Modifier and Type Method Description
    (package private) int computeHeight()  
    static Segment create()  
    (package private) void draw​(int segmentSize)  
    org.eclipse.swt.graphics.Color getBackground()  
    java.lang.Object getData()  
    java.lang.Object getData​(java.lang.String key)  
    org.eclipse.swt.graphics.Font getFont()  
    org.eclipse.swt.graphics.Color getForeground()  
    java.lang.String getText()  
    java.lang.String getTooltip()  
    java.lang.Double getValue()  
    Segment setBackground​(org.eclipse.swt.graphics.Color background)
    Set the background color of this item
    Segment setData​(java.lang.Object data)
    Set the data stored in this item
    Segment setData​(java.lang.String key, java.lang.Object value)
    Store a data associated to a given key in this item
    Segment setFont​(org.eclipse.swt.graphics.Font font)
    Set the font of this item
    Segment setForeground​(org.eclipse.swt.graphics.Color foreground)
    Set the foreground color of this item
    (package private) void setParent​(SegmentedBar parent)  
    Segment setText​(java.lang.String text)
    Set the text of this item
    Segment setTooltip​(java.lang.String tooltip)
    Set the tooltip of this item
    Segment setValue​(java.lang.Double value)
    Set the value associated to this item

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • getTooltip

      public java.lang.String getTooltip()
      Returns:
      the tooltip of this item
    • setTooltip

      public Segment setTooltip​(java.lang.String tooltip)
      Set the tooltip of this item
      Parameters:
      tooltip - the new value
      Returns:
      the current segment
    • getValue

      public java.lang.Double getValue()
      Returns:
      the value associated to this item
    • setValue

      public Segment setValue​(java.lang.Double value)
      Set the value associated to this item
      Parameters:
      value - the new value
      Returns:
      the current segment
    • getBackground

      public org.eclipse.swt.graphics.Color getBackground()
      Returns:
      the background color of the item
    • getData

      public java.lang.Object getData()
      Returns:
      the the data stored in this item
    • getData

      public java.lang.Object getData​(java.lang.String key)
      Parameters:
      key - a key
      Returns:
      the the data stored in this item associated to this key
    • getFont

      public org.eclipse.swt.graphics.Font getFont()
      Returns:
      the font of the item
    • getForeground

      public org.eclipse.swt.graphics.Color getForeground()
      Returns:
      the foreground color of the item
    • getText

      public java.lang.String getText()
      Returns:
      the text stored in this item
    • setBackground

      public Segment setBackground​(org.eclipse.swt.graphics.Color background)
      Set the background color of this item
      Parameters:
      background - the new value
      Returns:
      the current segment
    • setFont

      public Segment setFont​(org.eclipse.swt.graphics.Font font)
      Set the font of this item
      Parameters:
      font - new value
      Returns:
      the current segment
    • setForeground

      public Segment setForeground​(org.eclipse.swt.graphics.Color foreground)
      Set the foreground color of this item
      Parameters:
      foreground - the new value
      Returns:
      the current segment
    • setText

      public Segment setText​(java.lang.String text)
      Set the text of this item
      Parameters:
      text - the new value
      Returns:
      the current segment
    • setData

      public Segment setData​(java.lang.Object data)
      Set the data stored in this item
      Parameters:
      data - the new value
      Returns:
      the current segment
    • setData

      public Segment setData​(java.lang.String key, java.lang.Object value)
      Store a data associated to a given key in this item
      Parameters:
      key - key
      value - value associated to this key
      Returns:
      the current segment
    • computeHeight

      int computeHeight()
    • setParent

      void setParent​(SegmentedBar parent)
    • draw

      void draw​(int segmentSize)
    • create

      public static Segment create()