com.intel.ui
Class Line
- java.lang.Object
-
- com.intel.ui.Widget
-
- com.intel.ui.Line
-
public abstract class Line extends Widget
This abstract class represents a leafWidget
of a line drawn from a start position to an end position.
-
-
Method Summary
Methods Modifier and Type Method and Description 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 parentWidget
.XYPair
getSize()
This method is not supported for this widget type and will throwUiNotSupportedException
.XYPair
getStart()
Returns the start position of the Line relative to the parentWidget
.short
getThickness()
Returns the width of the line.-
Methods inherited from class com.intel.ui.Widget
getColor, getId, getRelativeLocation
-
-
-
-
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.
- Start and end parameters are the same point.
UiException
-
getStart
public XYPair getStart()
Returns the start position of the Line relative to the parentWidget
.- 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 parentWidget
.- 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 throwUiNotSupportedException
.- Overrides:
getSize
in classWidget
- Returns:
- Returns the size of the
Widget
. - Throws:
UiNotSupportedException
- always.UiException
-
-