Unit
Inheritance: java.lang.Object
public final class Unit
Specifies the size value in different units (Pixel, Inches, etc.).
This sample shows how to create and save a BarCode image. BarcodeGenerator generator = new BarcodeGenerator(EncodeTypes.CODE_128); generator.getParameters().getBarcode().getBarHeight().setMillimeters(10); generator.save("test.png");
Constructors
Constructor | Description |
---|---|
Unit(Unit source) |
Methods
Method | Description |
---|---|
equals(Object obj) | Determines whether this instance and a specified object, which must also be a Unit object, have the same value. |
getClass() | |
getDocument() | Gets size value in document units. |
getInches() | Gets size value in inches. |
getMillimeters() | Gets size value in millimeters. |
getPixels() | Gets size value in pixels. |
getPoint() | Gets size value in point. |
getPx() | |
getResolution() | |
hashCode() | Returns the hash code for this object. |
notify() | |
notifyAll() | |
setDocument(float value) | Sets size value in document units. |
setInches(float value) | Sets size value in inches. |
setMillimeters(float value) | Sets size value in millimeters. |
setPixels(float value) | Sets size value in pixels. |
setPoint(float value) | Sets size value in point. |
toString() | Returns a human-readable string representation of this Unit . |
updateResolution(float dpi) | |
wait() | |
wait(long arg0) | |
wait(long arg0, int arg1) |
Unit(Unit source)
public Unit(Unit source)
Parameters:
Parameter | Type | Description |
---|---|---|
source | Unit |
equals(Object obj)
public boolean equals(Object obj)
Determines whether this instance and a specified object, which must also be a Unit object, have the same value.
Parameters:
Parameter | Type | Description |
---|---|---|
obj | java.lang.Object | The Unit to compare to this instance. |
Returns: boolean - true if obj is a Unit and its value is the same as this instance; otherwise, false. If obj is null, the method returns false.
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getDocument()
public float getDocument()
Gets size value in document units.
Returns: float
getInches()
public float getInches()
Gets size value in inches.
Returns: float
getMillimeters()
public float getMillimeters()
Gets size value in millimeters.
Returns: float
getPixels()
public float getPixels()
Gets size value in pixels.
Returns: float
getPoint()
public float getPoint()
Gets size value in point.
Returns: float
getPx()
public int getPx()
Returns: int
getResolution()
public float getResolution()
Returns: float
hashCode()
public int hashCode()
Returns the hash code for this object.
Returns: int - A 32-bit signed integer hash code.
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
setDocument(float value)
public void setDocument(float value)
Sets size value in document units.
Parameters:
Parameter | Type | Description |
---|---|---|
value | float |
setInches(float value)
public void setInches(float value)
Sets size value in inches.
Parameters:
Parameter | Type | Description |
---|---|---|
value | float |
setMillimeters(float value)
public void setMillimeters(float value)
Sets size value in millimeters.
Parameters:
Parameter | Type | Description |
---|---|---|
value | float |
setPixels(float value)
public void setPixels(float value)
Sets size value in pixels.
Parameters:
Parameter | Type | Description |
---|---|---|
value | float |
setPoint(float value)
public void setPoint(float value)
Sets size value in point.
Parameters:
Parameter | Type | Description |
---|---|---|
value | float |
toString()
public String toString()
Returns a human-readable string representation of this Unit .
Returns: java.lang.String - A string that represents this Unit .
updateResolution(float dpi)
public void updateResolution(float dpi)
Parameters:
Parameter | Type | Description |
---|---|---|
dpi | float |
wait()
public final void wait()
wait(long arg0)
public final native void wait(long arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |