private Font createFont(String fontString) { Font font = FontHelper.fromString(fontString); return font; }
@Override public Object getValueForState(RemoteValueState state, Object originalValue) { if (originalValue instanceof String && FontHelper.isFontSpec((String) originalValue)) { return FontHelper.fromString((String) originalValue); } return null; } };
static Font createFont(String fontString, Font defaultFont) { org.jspresso.framework.util.gui.Font font = FontHelper.fromString(fontString); int fontStyle; if (font.isBold() && font.isItalic()) { fontStyle = Font.BOLD | Font.ITALIC; } else if (font.isBold()) { fontStyle = Font.BOLD; } else if (font.isItalic()) { fontStyle = Font.ITALIC; } else { fontStyle = Font.PLAIN; } if (font.getName() == null || font.getName().length() == 0) { font.setName(defaultFont.getName()); } if (font.getSize() < 0) { font.setSize(defaultFont.getSize()); } return new Font(font.getName(), fontStyle, font.getSize()); }
private SFont createFont(String fontString, SFont defaultFont) { SFont actualDefaultFont; if (defaultFont != null) { actualDefaultFont = defaultFont; } else { actualDefaultFont = DEFAULT_FONT; } org.jspresso.framework.util.gui.Font font = FontHelper .fromString(fontString); int fontStyle; if (font.isBold() && font.isItalic()) { fontStyle = SFont.BOLD | SFont.ITALIC; } else if (font.isBold()) { fontStyle = SFont.BOLD; } else if (font.isItalic()) { fontStyle = SFont.ITALIC; } else { fontStyle = SFont.PLAIN; } if (font.getName() == null || font.getName().length() == 0) { font.setName(actualDefaultFont.getFace()); } if (font.getSize() < 0) { font.setSize(actualDefaultFont.getSize()); } return new SFont(font.getName(), fontStyle, font.getSize()); }