Java 类java.awt.font.ShapeGraphicAttribute 实例源码
项目:cn1
文件:ShapeGraphicAttributeTest.java
public final void testGetJustificationInfo() {
sga = new ShapeGraphicAttribute(shape, alignment, stroke);
float advance = sga.getAdvance();
GlyphJustificationInfo gji = new GlyphJustificationInfo(
advance,
false,
GlyphJustificationInfo.PRIORITY_INTERCHAR,
advance / 3,
advance / 3,
false,
GlyphJustificationInfo.PRIORITY_WHITESPACE,
0,
0);
equalsGlyphJustificationInfo(gji, sga.getJustificationInfo());
}
项目:freeVM
文件:ShapeGraphicAttributeTest.java
public final void testGetJustificationInfo() {
sga = new ShapeGraphicAttribute(shape, alignment, stroke);
float advance = sga.getAdvance();
GlyphJustificationInfo gji = new GlyphJustificationInfo(
advance,
false,
GlyphJustificationInfo.PRIORITY_INTERCHAR,
advance / 3,
advance / 3,
false,
GlyphJustificationInfo.PRIORITY_WHITESPACE,
0,
0);
equalsGlyphJustificationInfo(gji, sga.getJustificationInfo());
}
项目:freeVM
文件:ShapeGraphicAttributeTest.java
public final void testGetJustificationInfo() {
sga = new ShapeGraphicAttribute(shape, alignment, stroke);
float advance = sga.getAdvance();
GlyphJustificationInfo gji = new GlyphJustificationInfo(
advance,
false,
GlyphJustificationInfo.PRIORITY_INTERCHAR,
advance / 3,
advance / 3,
false,
GlyphJustificationInfo.PRIORITY_WHITESPACE,
0,
0);
equalsGlyphJustificationInfo(gji, sga.getJustificationInfo());
}
项目:jftgl
文件:FTGlyph.java
/**
* Constructor
* @param glyph The Shape to put in the FTGlyph.
*/
public FTGlyph(Shape glyph)
{
if(glyph != null)
{
this.bBox = new FTBBox(glyph);
this.glyph = glyph;
//several options:
/** due to {@link ShapeGraphicAttribute#getAdvance()} description */
this.advance = Math.abs(this.bBox.upperX - this.bBox.lowerX);
/** due to {@link ShapeGraphicAttribute} */
float shapeadvance = new ShapeGraphicAttribute(glyph, ShapeGraphicAttribute.CENTER_BASELINE, ShapeGraphicAttribute.STROKE).getAdvance();
/** or create a {@link java.awt.font.TextLayout} and get the advance for the letter, the shape represents */
//System.out.println("[Boxed] " + this.advance + " [ShapeAttribute] " + shapeadvance);
this.advance = shapeadvance;
}
}
项目:cn1
文件:ShapeGraphicAttributeTest.java
public final void testGetBounds() {
sga = new ShapeGraphicAttribute(shape, alignment, ShapeGraphicAttribute.FILL);
Rectangle2D.Float bounds = (Rectangle2D.Float)shape.getBounds2D();
assertEquals(bounds, sga.getBounds());
}
项目:cn1
文件:ShapeGraphicAttributeTest.java
public final void testEqualsShapeGraphicAttribute() {
sga = new ShapeGraphicAttribute(shape, alignment, stroke);
ShapeGraphicAttribute sga1 = new ShapeGraphicAttribute(shape, alignment, stroke);
assertTrue(sga.equals(sga1));
}
项目:cn1
文件:ShapeGraphicAttributeTest.java
public final void testEqualsObject() {
sga = new ShapeGraphicAttribute(shape, alignment, stroke);
ShapeGraphicAttribute sga1 = new ShapeGraphicAttribute(shape, alignment, stroke);
assertTrue(sga.equals((Object)sga1));
}
项目:cn1
文件:ShapeGraphicAttributeTest.java
public final void testGetAlignment() {
sga = new ShapeGraphicAttribute(shape, alignment, stroke);
assertEquals(alignment, sga.getAlignment());
}
项目:freeVM
文件:ShapeGraphicAttributeTest.java
public final void testGetBounds() {
sga = new ShapeGraphicAttribute(shape, alignment, ShapeGraphicAttribute.FILL);
Rectangle2D.Float bounds = (Rectangle2D.Float)shape.getBounds2D();
assertEquals(bounds, sga.getBounds());
}
项目:freeVM
文件:ShapeGraphicAttributeTest.java
public final void testEqualsShapeGraphicAttribute() {
sga = new ShapeGraphicAttribute(shape, alignment, stroke);
ShapeGraphicAttribute sga1 = new ShapeGraphicAttribute(shape, alignment, stroke);
assertTrue(sga.equals(sga1));
}
项目:freeVM
文件:ShapeGraphicAttributeTest.java
public final void testEqualsObject() {
sga = new ShapeGraphicAttribute(shape, alignment, stroke);
ShapeGraphicAttribute sga1 = new ShapeGraphicAttribute(shape, alignment, stroke);
assertTrue(sga.equals((Object)sga1));
}
项目:freeVM
文件:ShapeGraphicAttributeTest.java
public final void testGetAlignment() {
sga = new ShapeGraphicAttribute(shape, alignment, stroke);
assertEquals(alignment, sga.getAlignment());
}
项目:freeVM
文件:ShapeGraphicAttributeTest.java
public final void testGetBounds() {
sga = new ShapeGraphicAttribute(shape, alignment, ShapeGraphicAttribute.FILL);
Rectangle2D.Float bounds = (Rectangle2D.Float)shape.getBounds2D();
assertEquals(bounds, sga.getBounds());
}
项目:freeVM
文件:ShapeGraphicAttributeTest.java
public final void testEqualsShapeGraphicAttribute() {
sga = new ShapeGraphicAttribute(shape, alignment, stroke);
ShapeGraphicAttribute sga1 = new ShapeGraphicAttribute(shape, alignment, stroke);
assertTrue(sga.equals(sga1));
}
项目:freeVM
文件:ShapeGraphicAttributeTest.java
public final void testEqualsObject() {
sga = new ShapeGraphicAttribute(shape, alignment, stroke);
ShapeGraphicAttribute sga1 = new ShapeGraphicAttribute(shape, alignment, stroke);
assertTrue(sga.equals((Object)sga1));
}
项目:freeVM
文件:ShapeGraphicAttributeTest.java
public final void testGetAlignment() {
sga = new ShapeGraphicAttribute(shape, alignment, stroke);
assertEquals(alignment, sga.getAlignment());
}