/** * Converts the size if necessary and returns the value in pixels. * * @param component the associated component * @return the size in pixels */ public int getPixelSize(Component component) { if (unit == PIXEL) return intValue(); else if (unit == POINT) return Sizes.pointAsPixel(intValue(), component); else if (unit == INCH) return Sizes.inchAsPixel(value, component); else if (unit == MILLIMETER) return Sizes.millimeterAsPixel(value, component); else if (unit == CENTIMETER) return Sizes.centimeterAsPixel(value, component); else if (unit == DIALOG_UNITS_X) return Sizes.dialogUnitXAsPixel(intValue(), component); else if (unit == DIALOG_UNITS_Y) return Sizes.dialogUnitYAsPixel(intValue(), component); else throw new IllegalStateException("Invalid unit " + unit); }
/** * Converts the size if necessary and returns the value in pixels. * * @param component * the associated component * @return the size in pixels */ public int getPixelSize(Component component) { if (unit == PIXEL) return intValue(); else if (unit == POINT) return Sizes.pointAsPixel(intValue(), component); else if (unit == INCH) return Sizes.inchAsPixel(value, component); else if (unit == MILLIMETER) return Sizes.millimeterAsPixel(value, component); else if (unit == CENTIMETER) return Sizes.centimeterAsPixel(value, component); else if (unit == DIALOG_UNITS_X) return Sizes.dialogUnitXAsPixel(intValue(), component); else if (unit == DIALOG_UNITS_Y) return Sizes.dialogUnitYAsPixel(intValue(), component); else throw new IllegalStateException("Invalid unit " + unit); }
/** * Converts the size if necessary and returns the value in pixels. * * @param component the associated component * @return the size in pixels */ public int getPixelSize(Component component) { if (unit == PIXEL) { return intValue(); } else if (unit == POINT) { return Sizes.pointAsPixel(intValue(), component); } else if (unit == INCH) { return Sizes.inchAsPixel(value, component); } else if (unit == MILLIMETER) { return Sizes.millimeterAsPixel(value, component); } else if (unit == CENTIMETER) { return Sizes.centimeterAsPixel(value, component); } else if (unit == DIALOG_UNITS_X) { return Sizes.dialogUnitXAsPixel(intValue(), component); } else if (unit == DIALOG_UNITS_Y) { return Sizes.dialogUnitYAsPixel(intValue(), component); } else { throw new IllegalStateException("Invalid unit " + unit); } }