Class StyleParser.BorderInfo
- Enclosing class:
StyleParser
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the border color as a hex string.createBorder(Resources theme) Creates the border that is described by this border info.Used for roundRect border.Used for roundRect border.Used for roundRect border.getColor()For a line/dashed/dotted/underline/round border, sets the color.Used for roundRect border.String[]Gets the images to use for image, horizontalImage, and verticalImage borders.Gets the fill opacity of round border.Checks whether round border should grow to a rectangle.Gets the blur for round border.Sets the shadow opacity for round border.Gets the shadow spread for round border.Gets the shadowX property of round border.Gets the shadowY property of round border.The image to use for a splicedImage border.For splicedImage border, this gets the splice insets as a single string.double[]getSpliceInsets(double[] out) For a splicedImage border, this gets the spliced insets as a 4-element array of double values.Gets the stroke color for round border.Gets the stroke opacity for round border.Gets the border thickness as a scalar value.Used for roundRect border.Used only for roundRect border.Used for roundRect border.getType()The border type.getWidth()For a line/dashed/dotted/underline/round border, the thickness value.For line/dashed/dotted/underline border.byteFor a line/dashed/dotted/underline/round border, gets the unit of the thickness value.voidsetBottomLeftMode(Boolean bottomLeftMode) Used for roundRect border.voidsetBottomOnlyMode(Boolean bottomOnlyMode) Used for roundRect border.voidsetBottomRightMode(Boolean bottomRightMode) Used for roundRect border.voidFor a line/dashed/dotted/underline/round border, gets the color.voidUsed for roundRect border.voidsetCornerRadius(Float cornerRadius) Used for roundRect border.voidsetCornerRadius(String cornerRadius) Used for roundRect border.voidSets the images used by image, horizontalImage, and verticalImage borders.voidsetOpacity(Integer opacity) Sets teh fill opacity of round border.voidsetRectangle(Boolean rectangle) Sets whether round border should grow to a rectangle.voidsetShadowBlur(Float shadowBlur) Sets the blur for round border.voidsetShadowOpacity(Integer shadowOpacity) Sets the shadow opacity for round border.voidsetShadowSpread(StyleParser.ScalarValue shadowSpread) Sets the shadow spread for round border.voidsetShadowSpread(String val) Sets the shadow spread for round border as a string.voidsetShadowX(Float shadowX) Sets the shadowX property of round border.voidsetShadowY(Float shadowY) Sets the shadowY property of round border.voidsetSpliceImage(String spliceImage) Sets the image to use for a splicedImage border.voidsetSpliceInsets(double[] insets) For a splicedImage border, sets the splice insets as a 4-element array.voidsetSpliceInsets(double[] insets, int decimalPlaces) Sets the splicedImage border insets as a 4-element array and rounds each entry to the specified number of decimal placesvoidsetSpliceInsets(String spliceInsets) Sest the splice insets for a splicedImage border.voidsetStrokeColor(Integer strokeColor) Sets the stroke color for round border.voidsetStrokeOpacity(Integer strokeOpacity) Sets the stroke opacity for round border.voidsetTopLeftMode(Boolean topLeftMode) Used for roundRect border.voidsetTopOnlyMode(Boolean topOnlyMode) Used only for roundRect border.voidsetTopRightMode(Boolean topRightMode) Used for roundRect border.voidSets the border type.voidFor a line/dashed/dotted/underline/round border, gets the thickness value.voidsetWidthUnit(byte widthUnit) For a line/dashed/dotted/underline/round border, sets the unit of the thickness value.toString()Returns the border as a style string value.Returns width as a string, including units.
-
Constructor Details
-
BorderInfo
public BorderInfo()
-
-
Method Details
-
toString
-
widthString
Returns width as a string, including units. If the width isn't set, this outputs "1px". -
colorString
Returns the border color as a hex string. If no color is set, this returns the empty string. -
createBorder
-
getSpliceInsets
public double[] getSpliceInsets(double[] out) For a splicedImage border, this gets the spliced insets as a 4-element array of double values.
Parameters
out: An out parameter. 4-element array of insets. IndicesComponent#TOP,Component#BOTTOM,Component#LEFT, andComponent#RIGHT.
Returns
4-element array of insets. Indices
Component#TOP,Component#BOTTOM,Component#LEFT, andComponent#RIGHT. -
getType
The border type. E.g. line, dashed, dotted, underline, image, horizontalImage, verticalImage, splicedImage.
Returns
the type
-
setType
Sets the border type.
Parameters
type: the type to set. E.g. line, dashed, dotted, underline, image, horizontalImage, verticalImage, splicedImage.
-
getSpliceImage
The image to use for a splicedImage border.
Returns
the spliceImage
-
setSpliceImage
Sets the image to use for a splicedImage border.
Parameters
spliceImage: the spliceImage to set
-
getImages
Gets the images to use for image, horizontalImage, and verticalImage borders.
Returns
the images
-
setImages
Sets the images used by image, horizontalImage, and verticalImage borders.
Parameters
images: the images to set
-
getSpliceInsets
For splicedImage border, this gets the splice insets as a single string.
Returns
the spliceInsets
-
setSpliceInsets
Sest the splice insets for a splicedImage border.
Parameters
spliceInsets: the spliceInsets to set
-
setSpliceInsets
public void setSpliceInsets(double[] insets) For a splicedImage border, sets the splice insets as a 4-element array.
Parameters
insets: 4-element array. Indices Component#TOP , Component#BOTTOM, Component#LEFT, and Component#RIGHT.
-
setSpliceInsets
public void setSpliceInsets(double[] insets, int decimalPlaces) Sets the splicedImage border insets as a 4-element array and rounds each entry to the specified number of decimal places
Parameters
-
insets: 4-element array of insets.Indices Component#TOP , Component#BOTTOM, Component#LEFT, and Component#RIGHT. -
decimalPlaces: Number of decimal places to round to.
-
-
getWidth
For a line/dashed/dotted/underline/round border, the thickness value.
Returns
the width
See also
- #getWidthUnit()
-
setWidth
For a line/dashed/dotted/underline/round border, gets the thickness value.
Parameters
width: the width to set
See also
- #setWidthUnit(byte)
-
getThickness
Gets the border thickness as a scalar value. This is effectively the same value as returned by
#getWidth()and#getWidthUnit()Returns
The thickness of the border. Used with line, dashed, dotted, underline, and round borders.
-
getWidthInPixels
For line/dashed/dotted/underline border. The thickness in pixels. -
getWidthUnit
public byte getWidthUnit()For a line/dashed/dotted/underline/round border, gets the unit of the thickness value.
Returns
the widthUnit
See also
- #getWidth()
-
setWidthUnit
public void setWidthUnit(byte widthUnit) For a line/dashed/dotted/underline/round border, sets the unit of the thickness value.
Parameters
widthUnit: the widthUnit to set
See also
- #setWidth(java.lang.Float)
-
getColor
For a line/dashed/dotted/underline/round border, sets the color. For round border this gets the fill color. For line border variants, it gets the stroke color.
Returns
the color
-
setColor
For a line/dashed/dotted/underline/round border, gets the color. For round border, this sets the fill color. For line border variants, it sets the stroke color.
Parameters
color: the color to set
-
getOpacity
Gets the fill opacity of round border. Only used for round border
Returns
the opacity The opacity of the round border.
-
setOpacity
Sets teh fill opacity of round border. Only used for round border.
Parameters
opacity: the opacity to set
-
getStrokeColor
Gets the stroke color for round border. This is only used for round border. Line border variants should use
#getColor()Returns
the strokeColor
-
setStrokeColor
Sets the stroke color for round border. This is only used for round border. Line border variants should use
#setColor(java.lang.Integer)Parameters
strokeColor: the strokeColor to set
-
getStrokeOpacity
Gets the stroke opacity for round border. This is only used for round border.
Returns
the strokeOpacity
-
setStrokeOpacity
Sets the stroke opacity for round border. This is only used for round border.
Parameters
strokeOpacity: the strokeOpacity to set
-
getShadowOpacity
Sets the shadow opacity for round border. This is only used for round border.
Returns
the shadowOpacity
-
setShadowOpacity
Sets the shadow opacity for round border. This is only used for round border.
Parameters
shadowOpacity: the shadowOpacity to set
-
getShadowX
Gets the shadowX property of round border.
Returns
the shadowX
-
setShadowX
Sets the shadowX property of round border.
Parameters
shadowX: the shadowX to set
-
getShadowY
Gets the shadowY property of round border.
Returns
the shadowY
-
setShadowY
Sets the shadowY property of round border.
Parameters
shadowY: the shadowY to set
-
getShadowBlur
Gets the blur for round border.
Returns
the shadowBlur
-
setShadowBlur
Sets the blur for round border.
Parameters
shadowBlur: the shadowBlur to set
-
getShadowSpread
Gets the shadow spread for round border.
Returns
the shadowSpread
-
setShadowSpread
Sets the shadow spread for round border.
Parameters
shadowSpread: the shadowSpread to set
-
setShadowSpread
Sets the shadow spread for round border as a string. String must be valid scalar value. E.g. 2mm, or 3px.
Parameters
val
-
getRectangle
Checks whether round border should grow to a rectangle. Only used for round border.
Returns
the rectangle
-
setRectangle
Sets whether round border should grow to a rectangle. Only used for round border.
Parameters
rectangle: the rectangle to set
-
getTopOnlyMode
Used only for roundRect border. The value to set for
RoundRectBorder#topOnlyMode(boolean). Returns null if this flag isn't set at all.Returns
the topOnlyMode
-
setTopOnlyMode
Used only for roundRect border. The value to set for
RoundRectBorder#topOnlyMode(boolean). Set to null to not set this flag at all.Parameters
topOnlyMode: the topOnlyMode to set
-
getBottomOnlyMode
Used for roundRect border. The value to set for
RoundRectBorder#bottomOnlyMode(boolean). Returns null if this property is ignored.Returns
the bottomOnlyMode
-
setBottomOnlyMode
Used for roundRect border. The value to set for
RoundRectBorder#bottomOnlyMode(boolean). Set to null to ignore this property.Parameters
bottomOnlyMode: the bottomOnlyMode to set
-
getTopLeftMode
Used for roundRect border. The value to set for
RoundRectBorder#topLeftMode(boolean). Returns null if this property is ignored.Returns
the topLeftMode
-
setTopLeftMode
Used for roundRect border. The value to set for
RoundRectBorder#topLeftMode(boolean). Set null to ignore property.Parameters
topLeftMode: the topLeftMode to set
-
getTopRightMode
Used for roundRect border. The value to set for
RoundRectBorder#topRightMode(boolean). Returns null if property is ignored.Returns
the topRightMode
-
setTopRightMode
Used for roundRect border. The value to set for
RoundRectBorder#topRightMode(boolean). Sets null to ignore property.Parameters
topRightMode: the topRightMode to set
-
getBottomLeftMode
Used for roundRect border. The value to set for
RoundRectBorder#bottomLeftMode(boolean). Returns null if property is ignored.Returns
the bottomLeftMode
-
setBottomLeftMode
Used for roundRect border. The value to set for
RoundRectBorder#bottomLeftMode(boolean). Set null to ignore property.Parameters
bottomLeftMode: the bottomLeftMode to set
-
getBottomRightMode
Used for roundRect border. The value to set for
RoundRectBorder#bottomRightMode(boolean). Returns null if property is ignored.Returns
the bottomRightMode
-
setBottomRightMode
Used for roundRect border. The value to set for
RoundRectBorder#bottomRightMode(boolean). Set null to ignore property.Parameters
bottomRightMode: the bottomRightMode to set
-
getCornerRadius
Used for roundRect border. The corner radius.
Returns
the cornerRadius
See also
- RoundRectBorder#cornerRadius(float)
-
setCornerRadius
Used for roundRect border. Sets the corner radius.
Parameters
cornerRadius: the cornerRadius to set
See also
- RoundRectBorder#cornerRadius(float)
-
setCornerRadius
Used for roundRect border. Sets the corner radius as a scalar value. E.g. "2mm" or "2px'
Parameters
cornerRadius: the cornerRadius to set
See also
-
RoundRectBorder#cornerRadius(float)
-
#setCornerRadius(java.lang.Float)
-
#setCornerRadius(com.codename1.ui.plaf.StyleParser.ScalarValue)
-
RoundRectBorder#cornerRadius(float)
-
setCornerRadius
Used for roundRect border. Sets the corner radius
Parameters
sv: The corner radius to set.
See also
-
#setCornerRadius(java.lang.Float)
-
#setCornerRadius(java.lang.String)
-
RoundRectBorder#cornerRadius(float)
-