@Override protected void encode(Font font) { putName("font-family", font.getFontFamily()); put("font-size", font.getSize()); putName("font-style", font.getStyle()); putName("font-weight", font.getWeight()); } }
@Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { JLabel lbl = (JLabel) super.getTableCellRendererComponent(table, text, isSelected, hasFocus, row, column); Font f = (Font) value; java.awt.Font font = new java.awt.Font(f.getFontFamily().toString(), java.awt.Font.PLAIN, 12); lbl.setFont(font); return lbl; } }
@SuppressWarnings("deprecation") @Test public void font() throws Exception { List<Expression> family = new ArrayList<Expression>(); family.add(ff.literal("ariel")); family.add(ff.literal("Helvetica")); family.add(ff.literal("sanserif")); Expression style = ff.literal("noraml"); Expression weight = ff.literal("normal"); Expression size = ff.literal(12); Font font = sf.font(family, style, weight, size); assertEquals(family, font.getFamily()); assertEquals(style, font.getStyle()); // oblique or italic assertEquals(weight, font.getWeight()); // bold or normal assertEquals(size, font.getSize()); assertSame(font.getFontStyle(), font.getStyle()); assertSame(font.getFontFamily(), family.get(0)); assertSame(font.getFontWeight(), font.getWeight()); assertSame(font.getFontSize(), font.getSize()); FontImpl cast = FontImpl.cast(font); assertSame(cast, font); }
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) { if (value != null && value instanceof Font) { font = (Font) value; java.awt.Font f = new java.awt.Font(font.getFontFamily().toString(), java.awt.Font.PLAIN, 12); but.setFont(f); } else { but.setFont(new java.awt.Font("Arial", java.awt.Font.PLAIN, 12)); font = null; } return but; }
assertEquals("Arial", Filters.asString(font.getFontFamily())); assertEquals(10, Filters.asInt(font.getSize())); assertEquals("normal", Filters.asString(font.getStyle()));
requestedFont = fonts[k].getFontFamily().evaluate(feature).toString();
String requestedFont = evalToString(curr.getFontFamily(), feature, null); java.awt.Font javaFont = FontCache.getDefaultInstance().getFont(
public void setEdited(Font font){ this.font = font; if(font != null){ guiFamily.setExpression(font.getFontFamily()); guiSize.setExpression(font.getFontSize()); guiStyle.setExpression(font.getFontStyle()); guiWeight.setExpression(font.getFontWeight()); } }
@Override protected void encode(Font font) { putName("font-family", font.getFontFamily()); put("font-size", font.getSize()); putName("font-style", font.getStyle()); putName("font-weight", font.getWeight()); } }
assertEquals("Arial", Filters.asString(font.getFontFamily())); assertEquals(11, Filters.asInt(font.getSize())); assertEquals("normal", Filters.asString(font.getStyle()));
/** Null safe copy of a single font */ protected Font copy(Font font) { if( font == null) return font; Expression fontFamily = copy( font.getFontFamily() ); Expression fontStyle = copy( font.getFontStyle() ); Expression fontWeight = copy( font.getFontWeight() ); Expression fontSize = copy( font.getFontSize() ); Font copy = sf.createFont(fontFamily, fontStyle, fontWeight, fontSize); return copy; }
Font font = fonts[i]; if (font.getFontFamily() != null) { font.getFontFamily().accept(this, null);
Font font = fonts[i]; if (font.getFontFamily() != null) { font.getFontFamily().accept(this,null);
Font font = fonts[i]; if (font.getFontFamily() != null) { font.getFontFamily().accept(this,null);
encodeCssParam("font-family", fonts[i].getFontFamily());
Font font = fonts[i]; if (font.getFontFamily() != null) { font.getFontFamily().accept(this,null);
encodeCssParam("font-family", fonts[i].getFontFamily());