/** * Creates an empty font registry. * * @param display * the <code>Display</code> * @param cleanOnDisplayDisposal * whether all fonts allocated by this <code>FontRegistry</code> * should be disposed when the display is disposed * @since 3.1 */ public FontRegistry(Display display, boolean cleanOnDisplayDisposal) { Assert.isNotNull(display); this.cleanOnDisplayDisposal = cleanOnDisplayDisposal; if (cleanOnDisplayDisposal) { hookDisplayDispose(display); } }
/** * Creates an empty font registry. * * @param display * the <code>Display</code> * @param cleanOnDisplayDisposal * whether all fonts allocated by this <code>FontRegistry</code> * should be disposed when the display is disposed * @since 1.0 */ public FontRegistry(Display display, boolean cleanOnDisplayDisposal) { Assert.isNotNull(display); this.cleanOnDisplayDisposal = cleanOnDisplayDisposal; if (cleanOnDisplayDisposal) { hookDisplayDispose(display); } }
/** * Creates an empty font registry. * * @param display * the <code>Display</code> * @param cleanOnDisplayDisposal * whether all fonts allocated by this <code>FontRegistry</code> * should be disposed when the display is disposed * @since 3.1 */ public FontRegistry(Display display, boolean cleanOnDisplayDisposal) { Assert.isNotNull(display); this.cleanOnDisplayDisposal = cleanOnDisplayDisposal; if (cleanOnDisplayDisposal) { hookDisplayDispose(display); } }
/** * Creates a new font with the given font datas or <code>null</code> * if there is no data. * @return FontRecord for the new Font or <code>null</code>. */ private FontRecord createFont(String symbolicName, FontData[] fonts) { Display display = Display.getCurrent(); if (display == null) { return null; } if (cleanOnDisplayDisposal && !displayDisposeHooked) { hookDisplayDispose(display); } FontData[] validData = filterData(fonts, display); if (validData.length == 0) { //Nothing specified return null; } //Do not fire the update from creation as it is not a property change put(symbolicName, validData, false); Font newFont = new Font(display, validData); return new FontRecord(newFont, validData); }
/** * Creates a new font with the given font datas or <code>null</code> * if there is no data. * @return FontRecord for the new Font or <code>null</code>. */ private FontRecord createFont(String symbolicName, FontData[] fonts) { Display display = Display.getCurrent(); if (display == null) { return null; } if (cleanOnDisplayDisposal && !displayDisposeHooked) { hookDisplayDispose(display); } FontData[] validData = filterData(fonts, display); if (validData.length == 0) { //Nothing specified return null; } //Do not fire the update from creation as it is not a property change put(symbolicName, validData, false); Font newFont = new Font(display, validData); return new FontRecord(newFont, validData); }
/** * Creates a new font with the given font datas or <code>null</code> * if there is no data. * @return FontRecord for the new Font or <code>null</code>. */ private FontRecord createFont(String symbolicName, FontData[] fonts) { Display display = Display.getCurrent(); if (display == null) { return null; } if (cleanOnDisplayDisposal && !displayDisposeHooked) { hookDisplayDispose(display); } FontData[] validData = filterData(fonts, display); if (validData.length == 0) { //Nothing specified return null; } //Do not fire the update from creation as it is not a property change put(symbolicName, validData, false); Font newFont = new Font(display, validData); return new FontRecord(newFont, validData); }