Class Perspective
java.lang.Object
com.webfirmframework.wffweb.css.core.AbstractCssProperty<Perspective>
com.webfirmframework.wffweb.css.css3.Perspective
- All Implemented Interfaces:
CssProperty
,Serializable
,Cloneable
perspective: length|none; The perspective property defines how many pixels a 3D element is placed from the view. This property allows you to change the perspective on how 3D elements are viewed. When defining the perspective property for an element, it is the CHILD elements that get the perspective view, NOT the element itself. Note: The perspective property only affects 3D transformed elements! Tip: Use this property together with the perspective-origin property, which allows you to change the bottom position of 3D elements. To better understand the perspective property, view a demo. Default value: none Inherited: no Animatable: yes Version: CSS3 JavaScript syntax: object.style.perspective="50px"
- Since:
- 1.0.0
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionThenone
will be set as the valuePerspective
(float percent) Perspective
(float value, CssLengthUnit cssLengthUnit) Perspective
(Perspective perspective) Perspective
(String cssValue) -
Method Summary
Modifier and TypeMethodDescriptiongetUnit()
getValue()
gets the value inFloat
.static boolean
validates if the given cssValue is valid for this class.void
sets asauto
.setCssValue
(String cssValue) void
setPercent
(float percent) setValue
(float value, CssLengthUnit cssLengthUnit) toString()
Methods inherited from class com.webfirmframework.wffweb.css.core.AbstractCssProperty
clone, getStateChangeInformer, isAlreadyInUse, setAlreadyInUse, setStateChangeInformer, toCssString
-
Field Details
-
NONE
- See Also:
-
-
Constructor Details
-
Perspective
public Perspective()Thenone
will be set as the value -
Perspective
- Parameters:
cssValue
- the css value to set.
-
Perspective
- Parameters:
perspective
- thePerspective
object from which the cssValue to set.And,null
will throwNullValueException
-
Perspective
public Perspective(float percent) - Parameters:
percent
- the percentage value to set. The cssLengthUnit will automatically set to %.- Since:
- 1.0.0
-
Perspective
- Parameters:
value
-cssLengthUnit
-
-
-
Method Details
-
setValue
- Parameters:
value
-cssLengthUnit
-- Returns:
- the current object
- Since:
- 1.0.0
-
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
-
getValue
gets the value inFloat
.Perspective#getUnit()
should be used to get the cssLengthUnit for this value.- Returns:
- the value in float or null if the cssValue is
initial
orinherit
. - Since:
- 1.0.0
-
getUnit
- Returns:
- the cssLengthUnit
PX
/PER
, ornull
if the value is any inbuilt value likeinherit
. - Since:
- 1.0.0
-
setCssValue
- Specified by:
setCssValue
in classAbstractCssProperty<Perspective>
- 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
-
setAsAuto
public void setAsAuto()sets asauto
.- 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
-