/** * Converts Centimeters and returns pixels using the resolution of the * given component's graphics object. * * @param cm Centimeters * @param component the component that provides the graphics object * @return the given Centimeters as pixels */ public int centimeterAsPixel(double cm, Component component) { return centimeterAsPixel(cm, getScreenResolution(component)); }
/** * Converts horizontal dialog units and returns pixels. * Honors the resolution, dialog font size, platform, and l&f. * * @param dluX the horizontal dialog units * @param c a Component that provides the font and graphics * @return the given horizontal dialog units as pixels */ public int dialogUnitXAsPixel(int dluX, Component c) { return dialogUnitXAsPixel(dluX, getDialogBaseUnitsX(c)); }
/** * Converts vertical dialog units and returns pixels. Honors the resolution, * dialog font size, platform, and l&f. * * @param dluY * the vertical dialog units * @param c * a Component that provides the font and graphics * @return the given vertical dialog units as pixels */ public int dialogUnitYAsPixel(int dluY, Component c) { return dialogUnitYAsPixel(dluY, getDialogBaseUnitsY(c)); }
/** * Converts DTP Points and returns pixels using the resolution of the * given component's graphics object. * * @param pt DTP Points * @param component the component that provides the graphics object * @return the given Points as pixels */ public int pointAsPixel(int pt, Component component) { return pointAsPixel(pt, getScreenResolution(component)); }
/** * Converts Millimeters and returns pixels using the resolution of the * given component's graphics object. * * @param mm Millimeters * @param component the component that provides the graphics object * @return the given Millimeters as pixels */ public int millimeterAsPixel(double mm, Component component) { return millimeterAsPixel(mm, getScreenResolution(component)); }
/** * Converts Inches and returns pixels using the specified resolution. * * @param in the Inches * @param component the component that provides the graphics object * @return the given Inches as pixels */ public int inchAsPixel(double in, Component component) { return inchAsPixel(in, getScreenResolution(component)); }
/** * Returns the components screen resolution or the default screen resolution * if the component is null or has no toolkit assigned yet. * * @param c * the component to ask for a toolkit * @return the component's screen resolution */ protected int getScreenResolution(Component c) { if (c == null) return getDefaultScreenResolution(); Toolkit toolkit = c.getToolkit(); return toolkit != null ? toolkit.getScreenResolution() : getDefaultScreenResolution(); }
/** * Converts DTP Points and returns pixels using the resolution of the given * component's graphics object. * * @param pt * DTP Points * @param component * the component that provides the graphics object * @return the given Points as pixels */ public int pointAsPixel(int pt, Component component) { return pointAsPixel(pt, getScreenResolution(component)); }
/** * Converts Millimeters and returns pixels using the resolution of the * given component's graphics object. * * @param mm Millimeters * @param component the component that provides the graphics object * @return the given Millimeters as pixels */ @Override public int millimeterAsPixel(double mm, Component component) { return millimeterAsPixel(mm, getScreenResolution(component)); }
/** * Converts Inches and returns pixels using the specified resolution. * * @param in * the Inches * @param component * the component that provides the graphics object * @return the given Inches as pixels */ public int inchAsPixel(double in, Component component) { return inchAsPixel(in, getScreenResolution(component)); }
/** * Returns the components screen resolution or the default screen * resolution if the component is null or has no toolkit assigned yet. * * @param c the component to ask for a toolkit * @return the component's screen resolution */ protected int getScreenResolution(Component c) { if (c == null) return getDefaultScreenResolution(); Toolkit toolkit = c.getToolkit(); return toolkit != null ? toolkit.getScreenResolution() : getDefaultScreenResolution(); }
/** * Converts horizontal dialog units and returns pixels. * Honors the resolution, dialog font size, platform, and l&f. * * @param dluX the horizontal dialog units * @param c a Component that provides the font and graphics * @return the given horizontal dialog units as pixels */ @Override public int dialogUnitXAsPixel(int dluX, Component c) { return dialogUnitXAsPixel(dluX, getDialogBaseUnitsX(c)); }
/** * Converts DTP Points and returns pixels using the resolution of the * given component's graphics object. * * @param pt DTP Points * @param component the component that provides the graphics object * @return the given Points as pixels */ @Override public int pointAsPixel(int pt, Component component) { return pointAsPixel(pt, getScreenResolution(component)); }
/** * Converts vertical dialog units and returns pixels. * Honors the resolution, dialog font size, platform, and l&f. * * @param dluY the vertical dialog units * @param c a Component that provides the font and graphics * @return the given vertical dialog units as pixels */ public int dialogUnitYAsPixel(int dluY, Component c) { return dialogUnitYAsPixel(dluY, getDialogBaseUnitsY(c)); }
/** * Converts Millimeters and returns pixels using the resolution of the given * component's graphics object. * * @param mm * Millimeters * @param component * the component that provides the graphics object * @return the given Millimeters as pixels */ public int millimeterAsPixel(double mm, Component component) { return millimeterAsPixel(mm, getScreenResolution(component)); }
/** * Converts Inches and returns pixels using the specified resolution. * * @param in the Inches * @param component the component that provides the graphics object * @return the given Inches as pixels */ @Override public int inchAsPixel(double in, Component component) { return inchAsPixel(in, getScreenResolution(component)); }
/** * Converts Centimeters and returns pixels using the resolution of the * given component's graphics object. * * @param cm Centimeters * @param component the component that provides the graphics object * @return the given Centimeters as pixels */ @Override public int centimeterAsPixel(double cm, Component component) { return centimeterAsPixel(cm, getScreenResolution(component)); }
/** * Returns the components screen resolution or the default screen * resolution if the component is null or has no toolkit assigned yet. * * @param c the component to ask for a toolkit * @return the component's screen resolution */ protected int getScreenResolution(Component c) { if (c == null) { return getDefaultScreenResolution(); } Toolkit toolkit = c.getToolkit(); return toolkit != null ? toolkit.getScreenResolution() : getDefaultScreenResolution(); }
/** * Converts horizontal dialog units and returns pixels. Honors the * resolution, dialog font size, platform, and l&f. * * @param dluX * the horizontal dialog units * @param c * a Component that provides the font and graphics * @return the given horizontal dialog units as pixels */ public int dialogUnitXAsPixel(int dluX, Component c) { return dialogUnitXAsPixel(dluX, getDialogBaseUnitsX(c)); }
/** * Converts vertical dialog units and returns pixels. * Honors the resolution, dialog font size, platform, and l&f. * * @param dluY the vertical dialog units * @param c a Component that provides the font and graphics * @return the given vertical dialog units as pixels */ @Override public int dialogUnitYAsPixel(int dluY, Component c) { return dialogUnitYAsPixel(dluY, getDialogBaseUnitsY(c)); }