public static class StyleParser.BorderInfo extends Object
Constructor and Description |
---|
BorderInfo() |
Modifier and Type | Method and Description |
---|---|
String |
colorString()
Returns the border color as a hex string.
|
Border |
createBorder(Resources theme)
Creates the border that is described by this border info.
|
Boolean |
getBottomLeftMode()
Used for roundRect border.
|
Boolean |
getBottomOnlyMode()
Used for roundRect border.
|
Boolean |
getBottomRightMode()
Used for roundRect border.
|
Integer |
getColor()
For a line/dashed/dotted/underline/round border, sets the color.
|
Float |
getCornerRadius()
Used for roundRect border.
|
String[] |
getImages()
Gets the images to use for image, horizontalImage, and verticalImage borders.
|
Integer |
getOpacity()
Gets the fill opacity of round border.
|
Boolean |
getRectangle()
Checks whether round border should grow to a rectangle.
|
Float |
getShadowBlur()
Gets the blur for round border.
|
Integer |
getShadowOpacity()
Sets the shadow opacity for round border.
|
StyleParser.ScalarValue |
getShadowSpread()
Gets the shadow spread for round border.
|
Float |
getShadowX()
Gets the shadowX property of round border.
|
Float |
getShadowY()
Gets the shadowY property of round border.
|
String |
getSpliceImage()
The image to use for a splicedImage border.
|
String |
getSpliceInsets()
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.
|
Integer |
getStrokeColor()
Gets the stroke color for round border.
|
Integer |
getStrokeOpacity()
Gets the stroke opacity for round border.
|
StyleParser.ScalarValue |
getThickness()
Gets the border thickness as a scalar value.
|
Boolean |
getTopLeftMode()
Used for roundRect border.
|
Boolean |
getTopOnlyMode()
Used only for roundRect border.
|
Boolean |
getTopRightMode()
Used for roundRect border.
|
String |
getType()
The border type.
|
Float |
getWidth()
For a line/dashed/dotted/underline/round border, the thickness value.
|
Integer |
getWidthInPixels()
For line/dashed/dotted/underline border.
|
byte |
getWidthUnit()
For a line/dashed/dotted/underline/round border, gets the unit of the thickness value.
|
void |
setBottomLeftMode(Boolean bottomLeftMode)
Used for roundRect border.
|
void |
setBottomOnlyMode(Boolean bottomOnlyMode)
Used for roundRect border.
|
void |
setBottomRightMode(Boolean bottomRightMode)
Used for roundRect border.
|
void |
setColor(Integer color)
For a line/dashed/dotted/underline/round border, gets the color.
|
void |
setCornerRadius(Float cornerRadius)
Used for roundRect border.
|
void |
setCornerRadius(String cornerRadius)
Used for roundRect border.
|
void |
setCornerRadius(StyleParser.ScalarValue sv)
Used for roundRect border.
|
void |
setImages(String[] images)
Sets the images used by image, horizontalImage, and verticalImage borders.
|
void |
setOpacity(Integer opacity)
Sets teh fill opacity of round border.
|
void |
setRectangle(Boolean rectangle)
Sets whether round border should grow to a rectangle.
|
void |
setShadowBlur(Float shadowBlur)
Sets the blur for round border.
|
void |
setShadowOpacity(Integer shadowOpacity)
Sets the shadow opacity for round border.
|
void |
setShadowSpread(String val)
Sets the shadow spread for round border as a string.
|
void |
setShadowSpread(StyleParser.ScalarValue shadowSpread)
Sets the shadow spread for round border.
|
void |
setShadowX(Float shadowX)
Sets the shadowX property of round border.
|
void |
setShadowY(Float shadowY)
Sets the shadowY property of round border.
|
void |
setSpliceImage(String spliceImage)
Sets the image to use for a splicedImage border.
|
void |
setSpliceInsets(double[] insets)
For a splicedImage border, sets the splice insets as a 4-element array.
|
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
|
void |
setSpliceInsets(String spliceInsets)
Sest the splice insets for a splicedImage border.
|
void |
setStrokeColor(Integer strokeColor)
Sets the stroke color for round border.
|
void |
setStrokeOpacity(Integer strokeOpacity)
Sets the stroke opacity for round border.
|
void |
setTopLeftMode(Boolean topLeftMode)
Used for roundRect border.
|
void |
setTopOnlyMode(Boolean topOnlyMode)
Used only for roundRect border.
|
void |
setTopRightMode(Boolean topRightMode)
Used for roundRect border.
|
void |
setType(String type)
Sets the border type.
|
void |
setWidth(Float width)
For a line/dashed/dotted/underline/round border, gets the thickness value.
|
void |
setWidthUnit(byte widthUnit)
For a line/dashed/dotted/underline/round border, sets the unit of the thickness value.
|
String |
toString()
Returns the border as a style string value.
|
String |
widthString()
Returns width as a string, including units.
|
public String toString()
public String widthString()
public String colorString()
public Border createBorder(Resources theme)
theme
- Theme resource file used to load images that are referenced.public double[] getSpliceInsets(double[] out)
out
- An out parameter. 4-element array of insets. Indices Component.TOP
, Component.BOTTOM
, Component.LEFT
, and Component.RIGHT
.Component.TOP
, Component.BOTTOM
, Component.LEFT
, and Component.RIGHT
.public String getType()
public void setType(String type)
type
- the type to set. E.g. line, dashed, dotted, underline, image, horizontalImage, verticalImage, splicedImage.public String getSpliceImage()
public void setSpliceImage(String spliceImage)
spliceImage
- the spliceImage to setpublic String[] getImages()
public void setImages(String[] images)
images
- the images to setpublic String getSpliceInsets()
public void setSpliceInsets(String spliceInsets)
spliceInsets
- the spliceInsets to setpublic void setSpliceInsets(double[] insets)
insets
- 4-element array. Indices Component#TOP , Component#BOTTOM, Component#LEFT, and Component#RIGHT.public void setSpliceInsets(double[] insets, int decimalPlaces)
insets
- 4-element array of insets.Indices Component#TOP , Component#BOTTOM, Component#LEFT, and Component#RIGHT.decimalPlaces
- Number of decimal places to round to.public Float getWidth()
getWidthUnit()
public StyleParser.ScalarValue getThickness()
getWidth()
and getWidthUnit()
public Integer getWidthInPixels()
public void setWidth(Float width)
width
- the width to setsetWidthUnit(byte)
public byte getWidthUnit()
getWidth()
public void setWidthUnit(byte widthUnit)
widthUnit
- the widthUnit to setsetWidth(java.lang.Float)
public Integer getColor()
public void setColor(Integer color)
color
- the color to setpublic Integer getOpacity()
public void setOpacity(Integer opacity)
opacity
- the opacity to setpublic Integer getStrokeColor()
getColor()
public void setStrokeColor(Integer strokeColor)
setColor(java.lang.Integer)
strokeColor
- the strokeColor to setpublic Integer getStrokeOpacity()
public void setStrokeOpacity(Integer strokeOpacity)
strokeOpacity
- the strokeOpacity to setpublic Integer getShadowOpacity()
public void setShadowOpacity(Integer shadowOpacity)
shadowOpacity
- the shadowOpacity to setpublic Float getShadowX()
public void setShadowX(Float shadowX)
shadowX
- the shadowX to setpublic Float getShadowY()
public void setShadowY(Float shadowY)
shadowY
- the shadowY to setpublic Float getShadowBlur()
public void setShadowBlur(Float shadowBlur)
shadowBlur
- the shadowBlur to setpublic StyleParser.ScalarValue getShadowSpread()
public void setShadowSpread(StyleParser.ScalarValue shadowSpread)
shadowSpread
- the shadowSpread to setpublic void setShadowSpread(String val)
val
- public Boolean getRectangle()
public void setRectangle(Boolean rectangle)
rectangle
- the rectangle to setpublic Boolean getTopOnlyMode()
RoundRectBorder.topOnlyMode(boolean)
. Returns null
if this flag isn't set at all.public void setTopOnlyMode(Boolean topOnlyMode)
RoundRectBorder.topOnlyMode(boolean)
. Set to null to
not set this flag at all.topOnlyMode
- the topOnlyMode to setpublic Boolean getBottomOnlyMode()
RoundRectBorder.bottomOnlyMode(boolean)
. Returns null if
this property is ignored.public void setBottomOnlyMode(Boolean bottomOnlyMode)
RoundRectBorder.bottomOnlyMode(boolean)
. Set to null to
ignore this property.bottomOnlyMode
- the bottomOnlyMode to setpublic Boolean getTopLeftMode()
RoundRectBorder.topLeftMode(boolean)
. Returns null if
this property is ignored.public void setTopLeftMode(Boolean topLeftMode)
RoundRectBorder.topLeftMode(boolean)
. Set null to ignore
property.topLeftMode
- the topLeftMode to setpublic Boolean getTopRightMode()
RoundRectBorder.topRightMode(boolean)
. Returns null if
property is ignored.public void setTopRightMode(Boolean topRightMode)
RoundRectBorder.topRightMode(boolean)
. Sets null to ignore
property.topRightMode
- the topRightMode to setpublic Boolean getBottomLeftMode()
RoundRectBorder.bottomLeftMode(boolean)
. Returns null if
property is ignored.public void setBottomLeftMode(Boolean bottomLeftMode)
RoundRectBorder.bottomLeftMode(boolean)
. Set null to ignore
property.bottomLeftMode
- the bottomLeftMode to setpublic Boolean getBottomRightMode()
RoundRectBorder.bottomRightMode(boolean)
. Returns null
if property is ignored.public void setBottomRightMode(Boolean bottomRightMode)
RoundRectBorder.bottomRightMode(boolean)
. Set null to ignore
property.bottomRightMode
- the bottomRightMode to setpublic Float getCornerRadius()
RoundRectBorder.cornerRadius(float)
public void setCornerRadius(Float cornerRadius)
cornerRadius
- the cornerRadius to setRoundRectBorder.cornerRadius(float)
public void setCornerRadius(String cornerRadius)
cornerRadius
- the cornerRadius to setRoundRectBorder.cornerRadius(float)
,
setCornerRadius(java.lang.Float)
,
setCornerRadius(com.codename1.ui.plaf.StyleParser.ScalarValue)
,
RoundRectBorder.cornerRadius(float)
public void setCornerRadius(StyleParser.ScalarValue sv)
sv
- The corner radius to set.setCornerRadius(java.lang.Float)
,
setCornerRadius(java.lang.String)
,
RoundRectBorder.cornerRadius(float)