public class CoreUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
JAVA_DEFAULT_DPI |
| Constructor and Description |
|---|
CoreUtils() |
| Modifier and Type | Method and Description |
|---|---|
static float |
convertEMUtoPoints(float emu) |
static double |
convertFromPixels(double valueInPixels,
int inputDpi,
MeasurementUnit toUnit)
Returns a value in specified measurement unit for a number of pixels in
specified pixel density.
|
static double |
convertFromPoints(MeasurementUnit unit,
double valueInPoints)
Returns a value in a specified measurement unit after converting it from
points.
|
static double |
convertToPixels(double valueInMeasurementUnit,
int outputDpi,
MeasurementUnit fromUnit)
Returns number of pixels in a given value in specified measurement unit and
pixel density.
|
static double |
convertToPoints(MeasurementUnit unit,
double valueInMeasurementUnit)
Returns a specified value in points after converting it from a specified
measurement unit.
|
static float |
convertTwipstoInches(float twips)
Returns specified twips value in inches.
|
static float |
convertTwipstoPoints(float twips)
Returns specified twips in points.
|
static double |
convertValue(double value,
MeasurementUnit fromUnit,
MeasurementUnit toUnit)
Returns a value in specified measurement unit after converting it from
another measurement unit.
|
static String |
getBaseFileNameWithoutExtension(String filePath)
Returns file name without the extension for a specified file pathname.
|
static Rectangle2D |
getRectangle2D(Rectangle rect)
Returns the
Rectangle2D version of a specified
Rectangle. |
static boolean |
isEmptyString(String inputString)
Returns whether the specified string is empty.
|
static boolean |
isValidWholeWordDelimiter(char ch)
Returns whether the specified character is a valid whole-word delimiter.
|
static String[] |
splitFilePath(String filePath)
Returns the pathname of the parent directory, name of the file and the
extension of the file for a specified file pathname.
|
public static final int JAVA_DEFAULT_DPI
public static float convertTwipstoInches(float twips)
twips - value in twipspublic static float convertTwipstoPoints(float twips)
twips - value in twipspublic static float convertEMUtoPoints(float emu)
public static boolean isEmptyString(String inputString)
inputString - string that needs to be checkedpublic static double convertToPoints(MeasurementUnit unit, double valueInMeasurementUnit)
unit - measurement unit in which the value is specifiedvalueInMeasurementUnit - value that needs to be convertedpublic static double convertFromPoints(MeasurementUnit unit, double valueInPoints)
unit - measurement unit in which the value needs to be converted tovalueInPoints - value that needs to be converted from pointspublic static double convertValue(double value,
MeasurementUnit fromUnit,
MeasurementUnit toUnit)
value - value that needs to be convertedfromUnit - measurement unit from which the value needs to be convertedtoUnit - measurement unit to which the value needs to be convertedpublic static double convertToPixels(double valueInMeasurementUnit,
int outputDpi,
MeasurementUnit fromUnit)
valueInMeasurementUnit - value that needs to be convertedoutputDpi - pixel density with which the number of pixels needs to be countedfromUnit - value that needs to be convertedpublic static double convertFromPixels(double valueInPixels,
int inputDpi,
MeasurementUnit toUnit)
valueInPixels - number of pixelsinputDpi - pixel densitytoUnit - measurement unit to which the pixels need to be convertedpublic static String[] splitFilePath(String filePath)
filePath - pathname of the filepublic static String getBaseFileNameWithoutExtension(String filePath)
filePath - pathname of the filepublic static Rectangle2D getRectangle2D(Rectangle rect)
Rectangle2D version of a specified
Rectangle.rect - Rectangle that needs to be converted.Rectangle2D version of the rectanglepublic static boolean isValidWholeWordDelimiter(char ch)
ch - character that needs to be checked