com.intel.ui
Class Rectangle
- java.lang.Object
-
- com.intel.ui.Widget
-
- com.intel.ui.Rectangle
-
public abstract class Rectangle extends Widget
This abstract class represents a leafWidget
of a rectangle.
-
-
Field Summary
Fields Modifier and Type Field and Description static byte
FILL_TYPE_ALL
The rectangle will be completely filled withfillColor
(seecreate
method parameters).static byte
FILL_TYPE_BORDER
Only the rectangle's border will be filled withborderColor
(seecreate
method parameters).
-
Method Summary
Methods Modifier and Type Method and Description static Rectangle
create(short id, int fillColor, XYPair size, XYPair relLocation, byte fillType, boolean curvedEdges, int borderColor, short borderWidth)
Factory method for creating a concrete instance initialized with the specified parametersint
getBorderColor()
Returns the border color in RGB format (bits 0-7 are blue, bits 8-15 are green, bits 16-23 are red, bits 24-31 are reserved).short
getBorderWidth()
Returns the border width in pixels.byte
getFillType()
Returns the fill type.boolean
hasCurvedEdges()
Returns whether this Rectangle has curved edges.-
Methods inherited from class com.intel.ui.Widget
getColor, getId, getRelativeLocation, getSize
-
-
-
-
Field Detail
-
FILL_TYPE_ALL
public static final byte FILL_TYPE_ALL
The rectangle will be completely filled withfillColor
(seecreate
method parameters).- See Also:
- Constant Field Values
-
FILL_TYPE_BORDER
public static final byte FILL_TYPE_BORDER
Only the rectangle's border will be filled withborderColor
(seecreate
method parameters).- See Also:
- Constant Field Values
-
-
Method Detail
-
create
public static final Rectangle create(short id, int fillColor, XYPair size, XYPair relLocation, byte fillType, boolean curvedEdges, int borderColor, short borderWidth) throws UiException
Factory method for creating a concrete instance initialized with the specified parameters- 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.fillColor
- The fill color of theRectangle
in RGB format (bits 0-7 are blue, bits 8-15 are green, bits 16-23 are red, bits 24-31 are reserved).size
- The size of theWidget
relLocation
- The relative location from the parentWidget
fillType
- The fill type of the Rectangle (either draw an empty or full rectangle)curvedEdges
- Determines if the Rectangle has curved or straight edgesborderColor
- The border color from in RGB format (bits 0-7 are blue, bits 8-15 are green, bits 16-23 are red, bits 24-31 are reserved).borderWidth
- The border width in pixels- Returns:
Rectangle
instance- Throws:
UiIllegalParameterException
- in one of the following cases:- Size is negative.
- Location is negative.
- Size exceeds upper bound
Widget.MAX_WIDTH
and/orWidget.MAX_HEIGHT
. - Location exceeds upper bound
Widget.MAX_WIDTH
and/orWidget.MAX_HEIGHT
. -
fillType
is FILL_TYPE_BORDER, but the border width is 0. - Border width is illegal. For example, negative or exceeds half of the smaller rectangle side size.
- The provided fill type is not supported.
UiException
-
getFillType
public byte getFillType()
Returns the fill type.- Returns:
- Returns the fill type.
-
hasCurvedEdges
public boolean hasCurvedEdges()
Returns whether this Rectangle has curved edges.- Returns:
- Returns true if this Rectangle has curved edges, false if it has straight edges
-
getBorderColor
public int getBorderColor()
Returns the border color in RGB format (bits 0-7 are blue, bits 8-15 are green, bits 16-23 are red, bits 24-31 are reserved).- Returns:
- Returns the border color in RGB format.
-
getBorderWidth
public short getBorderWidth()
Returns the border width in pixels.- Returns:
- Returns the border width in pixels.
-
-