Package io.jmix.ui.component
Class MarginInfo
java.lang.Object
io.jmix.ui.component.MarginInfo
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMarginInfo
(boolean enabled) Creates a MarginInfo object with all edges set to either enabled or disabled.MarginInfo
(boolean top, boolean right, boolean bottom, boolean left) Creates a MarginInfo object by having each edge specified in clockwise order (analogous to CSS). -
Method Summary
Modifier and TypeMethodDescriptionprotected void
doSetMargins
(boolean top, boolean right, boolean bottom, boolean left) boolean
boolean
hasAll()
Checks if this MarginInfo object has margins on all edges enabled.boolean
Checks if this MarginInfo object has the bottom edge margin enabled.int
hashCode()
boolean
hasLeft()
Checks if this MarginInfo object has the left edge margin enabled.boolean
hasRight()
Checks if this MarginInfo object has the right edge margin enabled.boolean
hasTop()
Checks if this MarginInfo object has the top edge margin enabled.void
setMargins
(boolean enabled) Enables or disables margins on all edges simultaneously.void
setMargins
(boolean top, boolean right, boolean bottom, boolean left) Sets margins on all edges individually.toString()
-
Field Details
-
TOP
protected static final int TOP- See Also:
-
RIGHT
protected static final int RIGHT- See Also:
-
BOTTOM
protected static final int BOTTOM- See Also:
-
LEFT
protected static final int LEFT- See Also:
-
ALL
protected static final int ALL- See Also:
-
bitMask
protected int bitMask
-
-
Constructor Details
-
MarginInfo
public MarginInfo(boolean enabled) Creates a MarginInfo object with all edges set to either enabled or disabled.- Parameters:
enabled
- the value to set for all edges
-
MarginInfo
public MarginInfo(boolean top, boolean right, boolean bottom, boolean left) Creates a MarginInfo object by having each edge specified in clockwise order (analogous to CSS).- Parameters:
top
- enable or disable top marginright
- enable or disable right marginbottom
- enable or disable bottom marginleft
- enable or disable left margin
-
-
Method Details
-
setMargins
public void setMargins(boolean enabled) Enables or disables margins on all edges simultaneously.- Parameters:
enabled
- if true, enables margins on all edges. If false, disables margins on all edges.
-
setMargins
public void setMargins(boolean top, boolean right, boolean bottom, boolean left) Sets margins on all edges individually.- Parameters:
top
- enable or disable top marginright
- enable or disable right marginbottom
- enable or disable bottom marginleft
- enable or disable left margin
-
hasAll
public boolean hasAll()Checks if this MarginInfo object has margins on all edges enabled.- Returns:
- true if all edges have margins enabled
-
hasLeft
public boolean hasLeft()Checks if this MarginInfo object has the left edge margin enabled.- Returns:
- true if left edge margin is enabled
-
hasRight
public boolean hasRight()Checks if this MarginInfo object has the right edge margin enabled.- Returns:
- true if right edge margin is enabled
-
hasTop
public boolean hasTop()Checks if this MarginInfo object has the top edge margin enabled.- Returns:
- true if top edge margin is enabled
-
hasBottom
public boolean hasBottom()Checks if this MarginInfo object has the bottom edge margin enabled.- Returns:
- true if bottom edge margin is enabled
-
equals
-
hashCode
public int hashCode() -
toString
-
doSetMargins
protected void doSetMargins(boolean top, boolean right, boolean bottom, boolean left)
-