com.intel.ui
Class Line
java.lang.Objectcom.intel.ui.Widget
com.intel.ui.Line
public abstract class Line
- extends Widget
This abstract class represents a leaf Widget
of a line drawn from a start position to an end position.
Method Summary | |
---|---|
static Line |
create(short id,
int color,
XYPair start,
XYPair end,
short thickness)
Factory method for creating a concrete instance initialized with the specified parameters. |
XYPair |
getEnd()
Returns the end position of the Line relative to the parent Widget . |
XYPair |
getSize()
This method is not supported for this widget type and will throw UiNotSupportedException . |
XYPair |
getStart()
Returns the start position of the Line relative to the parent Widget . |
short |
getThickness()
Returns the width of the line. |
Methods inherited from class com.intel.ui.Widget |
---|
getColor, getId, getRelativeLocation |
Methods inherited from class java.lang.Object |
---|
equals, hashCode, toString |
Method Detail |
---|
create
public static final Line create(short id, int color, XYPair start, XYPair end, short thickness) throws UiException
- Factory method for creating a concrete instance initialized with the specified parameters.
The following types of lines are supported:
- horizontal lines
- vertical lines
- diagonal lines are only supported with slope = +/-45 degrees
- Parameters:
id
- An ID representing thisWidget
for quick reference by the calling application. The ID does not have to be unique and is not used internally by the package.color
- The color of the line in RGB format (bits 0-7 are blue, bits 8-15 are green, bits 16-23 are red, bits 24-31 are reserved).start
- The beginning of the Line relative to the parentWidget
end
- The end of the Line relative to the parentWidget
thickness
- The width of theLine
in pixels- Returns:
Line
instance- Throws:
UiIllegalParameterException
- in one of the following cases:- Start, end or width are negative.
- Width is 0.
- Start or end parameters exceed upper bound
Widget.MAX_WIDTH
and/orWidget.MAX_HEIGHT
. - The line type is not supported. For example, this is a diagonal line with slope different than +/-45 degrees.
UiException
getStart
public XYPair getStart()
- Returns the start position of the Line relative to the parent
Widget
.- Returns:
- Returns the start position of the Line relative to the parent
Widget
.
getEnd
public XYPair getEnd()
- Returns the end position of the Line relative to the parent
Widget
.- Returns:
- Returns the end position of the Line relative to the parent
Widget
.
getThickness
public short getThickness()
- Returns the width of the line.
- Returns:
- Returns the width of the line.
getSize
public XYPair getSize() throws UiException
- This method is not supported for this widget type and will throw
UiNotSupportedException
.- Returns:
- Returns the size of the
Widget
. - Throws:
UiNotSupportedException
- always.UiException