public class Margins
extends java.lang.Object
Specifies the margins of a barcode image.
This class is used to manipulate margins in barcode image.
Note: The actual amount of the margins are determined by the specified mesure System.Drawing.GraphicsUnitunit of the barcode image.
Margins.LeftLeft, Margins.RightRight}, Margins.TopTop, and Margins.BottomBottom} are properties that define the margins.
Margins.EqualsEquals determines if another object is equal to a Margins object.
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Determines whether two Margins} instances are equal.
|
int |
getBottom()
Gets the bottom marign.
|
int |
getLeft()
Gets the left margin.
|
int |
getRight()
Gets the right margin.
|
int |
getTop()
Gets the top marign.
|
int |
hashCode()
Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
|
void |
set(int margin)
Sets the specified margin for all sides.
|
void |
set(int left,
int right,
int top,
int bottom)
Sets the specified margins.
|
void |
setBottom(int value)
Sets the bottom marign.
|
void |
setLeft(int value)
Sets the left margin.
|
void |
setRight(int value)
Sets the right margin.
|
void |
setTop(int value)
Sets the top marign.
|
java.lang.String |
toString()
Returns a String that represents the current MarginsMargins} instance.
|
public void set(int margin)
Sets the specified margin for all sides.
margin
- The margin for all sides.public void set(int left, int right, int top, int bottom)
Sets the specified margins.
left
- The left side.right
- The right side.top
- The top side.bottom
- The bottom side.public boolean equals(java.lang.Object obj)
Determines whether two Margins} instances are equal.
equals
in class java.lang.Object
obj
- The Margins} instance on the leftpublic int hashCode()
Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table.
hashCode
in class java.lang.Object
public java.lang.String toString()
Returns a String that represents the current MarginsMargins} instance.
toString
in class java.lang.Object
public int getBottom()
Gets the bottom marign.
java.lang.IllegalArgumentException
- The bottom parameter value is less than 0.public void setBottom(int value)
Sets the bottom marign.
java.lang.IllegalArgumentException
- The bottom parameter value is less than 0.public int getLeft()
Gets the left margin.
java.lang.IllegalArgumentException
- The Left parameter value is less than 0.public void setLeft(int value)
Sets the left margin.
java.lang.IllegalArgumentException
- The Left parameter value is less than 0.
public int getRight()
Gets the right margin.
java.lang.IllegalArgumentException
- The Right parameter value is less than 0.
public void setRight(int value)
Sets the right margin.
java.lang.IllegalArgumentException
- The Right parameter value is less than 0.
public int getTop()
Gets the top marign.
java.lang.IllegalArgumentException
- The Top parameter value is less than 0.
public void setTop(int value)
Sets the top marign.
java.lang.IllegalArgumentException
- The Top parameter value is less than 0.