Package com.jalios.util
Class Orientation
java.lang.Object
com.jalios.util.Orientation
A 2 dimensional object with an orientation.
- Since:
- jcms-9.0.1
- Author:
- Sylvain Devaux
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final doubleDefault minimum ratio (width / height) for an object to be considered as Landscape oriented.static final doubleDefault maximum ratio (width / height) for an object to be considered as Portrait oriented. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
LANDSCAPE_THRESHOLD
public static final double LANDSCAPE_THRESHOLDDefault minimum ratio (width / height) for an object to be considered as Landscape oriented.- Since:
- jcms-9.0.1
- See Also:
-
PORTRAIT_THRESHOLD
public static final double PORTRAIT_THRESHOLDDefault maximum ratio (width / height) for an object to be considered as Portrait oriented.- Since:
- jcms-9.0.1
- See Also:
-
-
Constructor Details
-
Orientation
- Parameters:
dimension- the sourceDimension.- Since:
- jcms-9.0.1
-
Orientation
- Parameters:
file- the oriented object File.- Since:
- jcms-9.0.1
-
-
Method Details
-
getRatio
protected double getRatio()- Returns:
- the ratio
- Since:
- jcms-9.0.1
-
getWidth
public double getWidth()- Returns:
- the width if set, or '-1'.
- Since:
- jcms-9.0.1
-
getHeight
public double getHeight()- Returns:
- the height if set, or '-1'.
- Since:
- jcms-9.0.1
-
isLandscape
public boolean isLandscape()- Returns:
- true if ratio is superior to
LANDSCAPE_THRESHOLD. - Since:
- jcms-9.0.1
-
isPortrait
public boolean isPortrait()- Returns:
- true if ratio is inferior to
PORTRAIT_THRESHOLD. - Since:
- jcms-9.0.1
-
isSquare
public boolean isSquare()- Returns:
- true if ratio is inferior to
PORTRAIT_THRESHOLD. - Since:
- jcms-9.0.1
-
toString
-