private Rectangle calculateIconRect() { Rectangle iconR = new Rectangle(); Icon icon = isEnabled() ? getIcon() : getDisabledIcon(); iconR.x = iconR.y = iconR.width = iconR.height = 0; if (icon != null) { iconR.width = icon.getIconWidth(); iconR.height = icon.getIconHeight(); } else { iconR.width = iconR.height = 0; } return iconR; }
public static View createView(JXLabel c) { BasicEditorKit kit = getFactory(); float rightIndent = 0; if (c.getIcon() != null && c.getHorizontalTextPosition() != SwingConstants.CENTER) { rightIndent = c.getIcon().getIconWidth() + c.getIconTextGap(); } Document doc = kit.createDefaultDocument(c.getFont(), c.getForeground(), c.getTextAlignment(), rightIndent); Reader r = new StringReader(c.getText() == null ? "" : c.getText()); try { kit.read(r, doc, 0); } catch (Throwable e) { } ViewFactory f = kit.getViewFactory(); View hview = f.create(doc.getDefaultRootElement()); View v = new Renderer(c, f, hview, true); return v; }
public static View createView(JXLabel c) { BasicEditorKit kit = getFactory(); float rightIndent = 0; if (c.getIcon() != null && c.getHorizontalTextPosition() != SwingConstants.CENTER) { rightIndent = c.getIcon().getIconWidth() + c.getIconTextGap(); } Document doc = kit.createDefaultDocument(c.getFont(), c.getForeground(), c.getTextAlignment(), rightIndent); Reader r = new StringReader(c.getText() == null ? "" : c.getText()); try { kit.read(r, doc, 0); } catch (Throwable e) { } ViewFactory f = kit.getViewFactory(); View hview = f.create(doc.getDefaultRootElement()); View v = new Renderer(c, f, hview, true); return v; }
private Rectangle calculateIconRect() { Rectangle iconR = new Rectangle(); Icon icon = isEnabled() ? getIcon() : getDisabledIcon(); iconR.x = iconR.y = iconR.width = iconR.height = 0; if (icon != null) { iconR.width = icon.getIconWidth(); iconR.height = icon.getIconHeight(); } else { iconR.width = iconR.height = 0; } return iconR; }
public static View createView(JXLabel c) { BasicEditorKit kit = getFactory(); float rightIndent = 0; if (c.getIcon() != null && c.getHorizontalTextPosition() != SwingConstants.CENTER) { rightIndent = c.getIcon().getIconWidth() + c.getIconTextGap(); } Document doc = kit.createDefaultDocument(c.getFont(), c.getForeground(), c.getTextAlignment(), rightIndent); Reader r = new StringReader(c.getText() == null ? "" : c.getText()); try { kit.read(r, doc, 0); } catch (Throwable e) { } ViewFactory f = kit.getViewFactory(); View hview = f.create(doc.getDefaultRootElement()); View v = new Renderer(c, f, hview, true); return v; }
private Rectangle calculateIconRect() { Rectangle iconR = new Rectangle(); Icon icon = isEnabled() ? getIcon() : getDisabledIcon(); iconR.x = iconR.y = iconR.width = iconR.height = 0; if (icon != null) { iconR.width = icon.getIconWidth(); iconR.height = icon.getIconHeight(); } else { iconR.width = iconR.height = 0; } return iconR; }
public static View createView(JXLabel c) { BasicEditorKit kit = getFactory(); float rightIndent = 0; if (c.getIcon() != null && c.getHorizontalTextPosition() != SwingConstants.CENTER) { rightIndent = c.getIcon().getIconWidth() + c.getIconTextGap(); } Document doc = kit.createDefaultDocument(c.getFont(), c.getForeground(), c.getTextAlignment(), rightIndent); Reader r = new StringReader(c.getText() == null ? "" : c.getText()); try { kit.read(r, doc, 0); } catch (Throwable e) { } ViewFactory f = kit.getViewFactory(); View hview = f.create(doc.getDefaultRootElement()); View v = new Renderer(c, f, hview, true); return v; }
private Rectangle calculateIconRect() { Rectangle iconR = new Rectangle(); Icon icon = isEnabled() ? getIcon() : getDisabledIcon(); iconR.x = iconR.y = iconR.width = iconR.height = 0; if (icon != null) { iconR.width = icon.getIconWidth(); iconR.height = icon.getIconHeight(); } else { iconR.width = iconR.height = 0; } return iconR; }
public static View createView(JXLabel c) { BasicEditorKit kit = getFactory(); float rightIndent = 0; if (c.getIcon() != null && c.getHorizontalTextPosition() != SwingConstants.CENTER) { rightIndent = c.getIcon().getIconWidth() + c.getIconTextGap(); } Document doc = kit.createDefaultDocument(c.getFont(), c.getForeground(), c.getTextAlignment(), rightIndent); Reader r = new StringReader(c.getText() == null ? "" : c.getText()); try { kit.read(r, doc, 0); } catch (Throwable e) { } ViewFactory f = kit.getViewFactory(); View hview = f.create(doc.getDefaultRootElement()); View v = new Renderer(c, f, hview, true); return v; }
private Rectangle calculateIconRect() { Rectangle iconR = new Rectangle(); Icon icon = isEnabled() ? getIcon() : getDisabledIcon(); iconR.x = iconR.y = iconR.width = iconR.height = 0; if (icon != null) { iconR.width = icon.getIconWidth(); iconR.height = icon.getIconHeight(); } else { iconR.width = iconR.height = 0; } return iconR; }