Class BorderImageSlice
java.lang.Object
com.webfirmframework.wffweb.css.core.AbstractCssProperty<BorderImageSlice>
com.webfirmframework.wffweb.css.css3.BorderImageSlice
- All Implemented Interfaces:
CssProperty
,Serializable
,Cloneable
border-image-slice: number|%|fill|initial|inherit; Examples: border-image-slice:5% 10% 15% 10%; top border is 5% right border is 10% bottom border is 15% border is 10% border-image-slice:5% 10% 15%; top border is 5% right and left borders are 10% bottom border is 15% border-image-slice:5% 10%; top and bottom borders are 5% right and left borders are 10% border-image-slice:5%; all four borders are 5% The border-image-slice property specifies how to slice the image specified by border-image-source. The image is always sliced into nine sections: four corners, four edges and the middle. The "middle" part is treated as fully transparent, unless the fill keyword is set. Tip: Also look at the border-image property (a shorthand property for setting all the border-image-* properties). Default value: 100% Inherited: no Animatable: no Version: CSS3 JavaScript syntax: object.style.borderImageSlice="30%"
- Since:
- 1.0.0
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionThe1
will be set as the valueBorderImageSlice
(float percent) BorderImageSlice
(float value, CssLengthUnit cssLengthUnit) BorderImageSlice
(BorderImageSlice bottom) BorderImageSlice
(String cssValue) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addFill()
adds the valuefill
in cssValue.getLeft()
protected static String
getProducedCssValue
(Float top, CssLengthUnit topUnit, Float right, CssLengthUnit rightUnit, Float bottom, CssLengthUnit bottomUnit, Float left, CssLengthUnit leftUnit, String middle) getRight()
getTop()
boolean
static boolean
validates if the given cssValue is valid for this class.void
void
sets asinherit
void
sets asinitial
void
setBorderImageTopRightBottomLeft
(Float top, CssLengthUnit topUnit, Float right, CssLengthUnit rightUnit, Float bottom, CssLengthUnit bottomUnit, Float left, CssLengthUnit leftUnit) void
setBorderImageTopRightBottomLeft
(Float top, Float right, Float bottom, Float left, CssLengthUnit unit) sets the top, right, bottom and left inBorderImageSlice
.void
setBottom
(Float bottom, CssLengthUnit bottomUnit) setCssValue
(String cssValue) void
setLeft
(Float left, CssLengthUnit leftUnit) void
setPercent
(float percent) void
setRight
(Float right, CssLengthUnit rightUnit) void
setTop
(Float top, CssLengthUnit topUnit) toString()
Methods inherited from class com.webfirmframework.wffweb.css.core.AbstractCssProperty
clone, getStateChangeInformer, isAlreadyInUse, setAlreadyInUse, setStateChangeInformer, toCssString
-
Field Details
-
FILL
- See Also:
-
INITIAL
- See Also:
-
INHERIT
- See Also:
-
DEFAULT_VALUE
- See Also:
-
-
Constructor Details
-
BorderImageSlice
public BorderImageSlice()The1
will be set as the value -
BorderImageSlice
- Parameters:
cssValue
- the css value to set.
-
BorderImageSlice
- Parameters:
bottom
- theBorderBottomSlice
object from which the cssValue to set.And,null
will throwNullValueException
-
BorderImageSlice
public BorderImageSlice(float percent) - Parameters:
percent
- the percentage value to set. The cssLengthUnit will automatically set to %.- Since:
- 1.0.0
-
BorderImageSlice
- Parameters:
value
-cssLengthUnit
-
-
-
Method Details
-
setPercent
public void setPercent(float percent) - Parameters:
percent
- the percent to set- Since:
- 1.0.0
-
getCssName
- Returns:
- the name portion in style, eg
align-content
for stylealign-content: center
.
-
getCssValue
- Returns:
- the value portion in style, eg
center
for stylealign-content: center
.
-
toString
-
setCssValue
- Specified by:
setCssValue
in classAbstractCssProperty<BorderImageSlice>
- Parameters:
cssValue
- the value should be in the format of55px
or95%
.null
is considered as an invalid value and it will throwNullValueException
.- Returns:
- the current object.
- Since:
- 1.0.0
-
setAsInitial
public void setAsInitial()sets asinitial
- Since:
- 1.0.0
-
setAsInherit
public void setAsInherit()sets asinherit
- Since:
- 1.0.0
-
addFill
public void addFill()adds the valuefill
in cssValue.- Since:
- 1.0.0
-
removeFill
public void removeFill() -
setBorderImageTopRightBottomLeft
public void setBorderImageTopRightBottomLeft(Float top, Float right, Float bottom, Float left, CssLengthUnit unit) sets the top, right, bottom and left inBorderImageSlice
.- Parameters:
top
- the value for top. The valuefill
will be assigned for null value.right
- the value for right. The valueauto
will be assigned for null value.bottom
- the value for bottom. The valueauto
will be assigned for null value.left
- the value for left. The valueauto
will be assigned for null value.unit
- theCssLengthUnit
for all of the given top, right, bottom and left values.- Since:
- 1.0.0
-
setBorderImageTopRightBottomLeft
public void setBorderImageTopRightBottomLeft(Float top, CssLengthUnit topUnit, Float right, CssLengthUnit rightUnit, Float bottom, CssLengthUnit bottomUnit, Float left, CssLengthUnit leftUnit) -
setTop
- Parameters:
top
- the top to set- Since:
- 1.0.0
-
setRight
- Parameters:
right
- the right to setrightUnit
-- Since:
- 1.0.0
-
setBottom
- Parameters:
bottom
- the bottom to setbottomUnit
-- Since:
- 1.0.0
-
setLeft
- Parameters:
left
- the left to setleftUnit
-- Since:
- 1.0.0
-
getTop
- Returns:
- the top. It will return null for auto or the cssValue is predefined constant.
- Since:
- 1.0.0
-
getTopUnit
- Returns:
- the topUnit
- Since:
- 1.0.0
-
getRight
- Returns:
- the right. It will return null for auto or the cssValue is predefined constant.
- Since:
- 1.0.0
-
getRightUnit
- Returns:
- the rightUnit
- Since:
- 1.0.0
-
getBottom
- Returns:
- the bottom. It will return null for auto or the cssValue is predefined constant.
- Since:
- 1.0.0
-
getBottomUnit
- Returns:
- the bottomUnit
- Since:
- 1.0.0
-
getLeft
- Returns:
- the left. It will return null for auto or the cssValue is predefined constant.
- Since:
- 1.0.0
-
getLeftUnit
- Returns:
- the leftUnit
- Since:
- 1.0.0
-
getProducedCssValue
protected static String getProducedCssValue(Float top, CssLengthUnit topUnit, Float right, CssLengthUnit rightUnit, Float bottom, CssLengthUnit bottomUnit, Float left, CssLengthUnit leftUnit, String middle) - Parameters:
top
- the value for top. The valueauto
will be assigned for null value.topUnit
-right
- the value for right. The valueauto
will be assigned for null value.rightUnit
-bottom
- the value for bottom. The valueauto
will be assigned for null value.bottomUnit
-left
- the value for left. The valueauto
will be assigned for null value.leftUnit
-middle
- TODO- Returns:
- Since:
- 1.0.0
-
isValid
validates if the given cssValue is valid for this class.- Parameters:
cssValue
- the value to check.- Returns:
- true if valid and false if invalid.
- Since:
- 1.0.0
-
hasPredefinedConstantValue
public boolean hasPredefinedConstantValue()- Returns:
- true if its cssValue is any of the values
auto, initial or inherit
. - Since:
- 1.0.0
-