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
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 itemSegment
setData(java.lang.Object data)
Set the data stored in this itemSegment
setData(java.lang.String key, java.lang.Object value)
Store a data associated to a given key in this itemSegment
setFont(org.eclipse.swt.graphics.Font font)
Set the font of this itemSegment
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 itemSegment
setTooltip(java.lang.String tooltip)
Set the tooltip of this itemSegment
setValue(java.lang.Double value)
Set the value associated to this item
-
Field Details
-
CORNER_RADIUS
static final int CORNER_RADIUS- See Also:
- Constant Field Values
-
drawingArea
org.eclipse.swt.graphics.Rectangle drawingArea
-
-
Constructor Details
-
Segment
public Segment()
-
-
Method Details
-
getTooltip
public java.lang.String getTooltip()- Returns:
- the tooltip of this item
-
setTooltip
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
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
Set the background color of this item- Parameters:
background
- the new value- Returns:
- the current segment
-
setFont
Set the font of this item- Parameters:
font
- new value- Returns:
- the current segment
-
setForeground
Set the foreground color of this item- Parameters:
foreground
- the new value- Returns:
- the current segment
-
setText
Set the text of this item- Parameters:
text
- the new value- Returns:
- the current segment
-
setData
Set the data stored in this item- Parameters:
data
- the new value- Returns:
- the current segment
-
setData
Store a data associated to a given key in this item- Parameters:
key
- keyvalue
- value associated to this key- Returns:
- the current segment
-
computeHeight
int computeHeight() -
setParent
-
draw
void draw(int segmentSize) -
create
-