Package com.github.weisj.darklaf.util
Enum Alignment
- All Implemented Interfaces:
Serializable,Comparable<Alignment>,java.lang.constant.Constable
public enum Alignment extends Enum<Alignment>
-
Nested Class Summary
-
Enum Constant Summary
Enum Constants Enum Constant Description CENTEREASTNORTHNORTH_EASTNORTH_WESTSOUTHSOUTH_EASTSOUTH_WESTWEST -
Method Summary
Modifier and Type Method Description PointalignInside(Dimension toAlign, Rectangle outerBounds)Align Rectangle inside other rectangle with respect to the alignment.PointalignOutside(Dimension toAlign, Rectangle innerBounds)Align Rectangle outside other rectangle with respect to the alignment.Alignmentanticlockwise()booleancanBeAligned(Point point, Dimension size, Rectangle outerBounds)Check whether the given Rectangle can be aligned at point inside boundaries.Alignmentclockwise()static AlignmentgetAlignment(Point point, Dimension size, Rectangle outerBounds, Alignment hint)Get fitting alignment.intgetIndex()Get the index of the alignment.InsetsmaskInsets(int top, int left, int bottom, int right, int mask)InsetsmaskInsets(Insets insets)InsetsmaskInsets(Insets insets, int maskValue)InsetsmaskInsetsInverted(int top, int left, int bottom, int right, int mask)InsetsmaskInsetsInverted(Insets insets)InsetsmaskInsetsInverted(Insets insets, int mask)Alignmentopposite()Get the opposite alignment.PointrelativePos(Dimension toAlign, Point alignAt)Get the relative Position of Rectangle to Point with respect to the alignment.static AlignmentvalueOf(String name)Returns the enum constant of this type with the specified name.static Alignment[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
getAlignment
public static Alignment getAlignment(Point point, Dimension size, Rectangle outerBounds, Alignment hint)Get fitting alignment.- Parameters:
point- point to align at.size- Size of rectangle to align.outerBounds- outer boundaries to align in.hint- preferred alignment.- Returns:
- fitting alignment. If none is found the default is
CENTER.
-
canBeAligned
Check whether the given Rectangle can be aligned at point inside boundaries.- Parameters:
point- point to align at.size- size of rectangle to align.outerBounds- boundaries.- Returns:
- true if can be aligned.
-
relativePos
Get the relative Position of Rectangle to Point with respect to the alignment.- Parameters:
toAlign- size of Rectangle to align.alignAt- point to align at.- Returns:
- top/left position of aligned rectangle
-
alignOutside
Align Rectangle outside other rectangle with respect to the alignment.- Parameters:
toAlign- size of rectangle to aligninnerBounds- bounds of inside rectangle- Returns:
- top/left point of aligned rectangle
-
getIndex
public int getIndex()Get the index of the alignment. This function is for utility purposes where one might save settings based on alignment in an array.- Returns:
- the index.
-
opposite
Get the opposite alignment.- Returns:
- Alignment opposite on the compass.
-
anticlockwise
-
clockwise
-
maskInsets
-
maskInsets
-
maskInsets
-
maskInsetsInverted
-
maskInsetsInverted
-
maskInsetsInverted
-
alignInside
Align Rectangle inside other rectangle with respect to the alignment.- Parameters:
toAlign- size of rectangle to alignouterBounds- bounds of outer rectangle- Returns:
- top/left point of aligned rectangle
-