Package com.vaadin.classic.v8.ui
Class MarginInfo
- java.lang.Object
-
- com.vaadin.classic.v8.ui.MarginInfo
-
- All Implemented Interfaces:
java.io.Serializable
public class MarginInfo extends java.lang.Object implements java.io.SerializableDescribes the margin settings for each edge of a Component.- Author:
- Vaadin Ltd
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MarginInfo(boolean enabled)Creates a MarginInfo object with all edges set to either enabled or disabled.MarginInfo(boolean vertical, boolean horizontal)Creates a MarginInfo object by having horizontal and vertical margins specified (analogous to CSS).MarginInfo(boolean top, boolean right, boolean bottom, boolean left)Creates a MarginInfo object by having each edge specified in clockwise order (analogous to CSS).MarginInfo(MarginInfo other)Creates a MarginInfo with the same values as another MarginInfo object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)booleanhasAll()Checks if this MarginInfo object has margins on all edges enabled.booleanhasBottom()Checks if this MarginInfo object has the bottom edge margin enabled.inthashCode()booleanhasLeft()Checks if this MarginInfo object has the left edge margin enabled.booleanhasNone()Checks if this MarginInfo object has no margins enabled.booleanhasRight()Checks if this MarginInfo object has the right edge margin enabled.booleanhasTop()Checks if this MarginInfo object has the top edge margin enabled.voidsetMargins(boolean enabled)Enables or disables margins on all edges simultaneously.voidsetMargins(boolean top, boolean right, boolean bottom, boolean left)Sets margins on all edges individually.voidsetMargins(MarginInfo marginInfo)Copies margin values from another MarginInfo object.java.lang.StringtoString()
-
-
-
Constructor Detail
-
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
-
MarginInfo
public MarginInfo(boolean vertical, boolean horizontal)Creates a MarginInfo object by having horizontal and vertical margins specified (analogous to CSS).- Parameters:
vertical- enable or disable top and bottom marginshorizontal- enable or disable left and right margins
-
MarginInfo
public MarginInfo(MarginInfo other)
Creates a MarginInfo with the same values as another MarginInfo object.- Parameters:
other- another MarginInfo object
-
-
Method Detail
-
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
-
setMargins
public void setMargins(MarginInfo marginInfo)
Copies margin values from another MarginInfo object.- Parameters:
marginInfo- another marginInfo object
-
hasAll
public boolean hasAll()
Checks if this MarginInfo object has margins on all edges enabled.- Returns:
- true if all edges have margins enabled
-
hasNone
public boolean hasNone()
Checks if this MarginInfo object has no margins enabled.- Returns:
- true if all edges have margins disabled
-
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
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-