当前位置: 首页>>代码示例>>Java>>正文


Java AffineTransform类代码示例

本文整理汇总了Java中harmony.java.awt.geom.AffineTransform的典型用法代码示例。如果您正苦于以下问题:Java AffineTransform类的具体用法?Java AffineTransform怎么用?Java AffineTransform使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AffineTransform类属于harmony.java.awt.geom包,在下文中一共展示了AffineTransform类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: transform

import harmony.java.awt.geom.AffineTransform; //导入依赖的package包/类
/** Concatenates a transformation to the current transformation
 * matrix.
 * @param af the transformation
 */
public void transform(AffineTransform af) {
    double arr[] = new double[6];
    af.getMatrix(arr);
    content.append(arr[0]).append(' ').append(arr[1]).append(' ').append(arr[2]).append(' ');
    content.append(arr[3]).append(' ').append(arr[4]).append(' ').append(arr[5]).append(" cm").append_i(separator);
}
 
开发者ID:bullda,项目名称:DroidText,代码行数:11,代码来源:PdfContentByte.java

示例2: transform

import harmony.java.awt.geom.AffineTransform; //导入依赖的package包/类
@Override
public void transform(IAffineTransformMatrix m) {
	delegate.saveState();
	delegate.transform(new AffineTransform(m.getM00(), m.getM10(), m.getM01(), m.getM11(), m.getM02(), m.getM12()));		
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter,代码行数:6,代码来源:Page.java

示例3: main

import harmony.java.awt.geom.AffineTransform; //导入依赖的package包/类
/**
 * Changes the transformation matrix with AffineTransform.
 * 
 * @param args
 *            no arguments needed here
 */
public static void main(String[] args) {

	System.out.println("Affine Transformation");
	// step 1: creation of a document-object
	Document document = new Document(PageSize.A4);

	try {
		// step 2: creation of the writer
		PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(android.os.Environment.getExternalStorageDirectory() + java.io.File.separator + "droidtext" + java.io.File.separator + "affinetransformation.pdf"));

		// step 3: we open the document
		document.open();

		// step 4:
		PdfContentByte cb = writer.getDirectContent();
		cb.transform(AffineTransform.getScaleInstance(1.2, 0.75));

		// we create a PdfTemplate
		PdfTemplate template = cb.createTemplate(25, 25);

		// we add some crosses to visualize the coordinates
		template.moveTo(13, 0);
		template.lineTo(13, 25);
		template.moveTo(0, 13);
		template.lineTo(50, 13);
		template.stroke();
		template.sanityCheck();

		// we add the template on different positions
		cb.addTemplate(template, 216 - 13, 720 - 13);
		cb.addTemplate(template, 360 - 13, 360 - 13);
		cb.addTemplate(template, 360 - 13, 504 - 13);
		cb.addTemplate(template, 72 - 13, 144 - 13);
		cb.addTemplate(template, 144 - 13, 288 - 13);

		cb.moveTo(216, 720);
		cb.lineTo(360, 360);
		cb.lineTo(360, 504);
		cb.lineTo(72, 144);
		cb.lineTo(144, 288);
		cb.stroke();

		BaseFont bf = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
		cb.beginText();
		cb.setFontAndSize(bf, 12);
		cb.showTextAligned(PdfContentByte.ALIGN_CENTER, "(3\" * 1.2, 10\" * .75)", 216 + 25, 720 + 5, 0);
		cb.showTextAligned(PdfContentByte.ALIGN_CENTER, "(5\" * 1.2, 5\" * .75)", 360 + 25, 360 + 5, 0);
		cb.showTextAligned(PdfContentByte.ALIGN_CENTER, "(5\" * 1.2, 7\" * .75)", 360 + 25, 504 + 5, 0);
		cb.showTextAligned(PdfContentByte.ALIGN_CENTER, "(1\" * 1.2, 2\" * .75)", 72 + 25, 144 + 5, 0);
		cb.showTextAligned(PdfContentByte.ALIGN_CENTER, "(2\" * 1.2, 4\" * .75)", 144 + 25, 288 + 5, 0);
		cb.endText();

		cb.sanityCheck();
	} catch (DocumentException de) {
		System.err.println(de.getMessage());
	} catch (IOException ioe) {
		System.err.println(ioe.getMessage());
	}

	// step 5: we close the document
	document.close();
}
 
开发者ID:fc-dream,项目名称:PDFTestForAndroid,代码行数:69,代码来源:AffineTransformation.java

示例4: getPathIterator

import harmony.java.awt.geom.AffineTransform; //导入依赖的package包/类
public PathIterator getPathIterator(AffineTransform t) {
	return new Iterator(t, this);
}
 
开发者ID:bullda,项目名称:DroidText,代码行数:4,代码来源:Polygon.java

示例5: PolylineShapeIterator

import harmony.java.awt.geom.AffineTransform; //导入依赖的package包/类
/** Creates a PolylineShapeIterator. */
PolylineShapeIterator(PolylineShape l, AffineTransform at) {
	this.poly = l;
	this.affine = at;
}
 
开发者ID:bullda,项目名称:DroidText,代码行数:6,代码来源:PolylineShapeIterator.java

示例6: Iterator

import harmony.java.awt.geom.AffineTransform; //导入依赖的package包/类
/**
 * Constructs a new Polygon.Iterator for given polygon and
 * transformation
 * 
 * @param l
 *            - the source Line2D object
 * @param at
 *            - the AffineTransform object to apply rectangle path
 */
public Iterator(AffineTransform at, Polygon p) {
	this.p = p;
	this.t = at;
	if (p.npoints == 0) {
		index = 1;
	}
}
 
开发者ID:bullda,项目名称:DroidText,代码行数:17,代码来源:Polygon.java

示例7: getPathIterator

import harmony.java.awt.geom.AffineTransform; //导入依赖的package包/类
/**
 * Returns an iteration object that defines the boundary of the polyline.
 * @param at the specified {@link AffineTransform}
 * @return a {@link PathIterator} that defines the boundary of this polyline.
 * @see java.awt.Shape#intersects(java.awt.geom.Rectangle2D)
 */
public PathIterator getPathIterator(AffineTransform at) {
	return new PolylineShapeIterator(this, at);
}
 
开发者ID:bullda,项目名称:DroidText,代码行数:10,代码来源:PolylineShape.java

示例8: getPathIterator

import harmony.java.awt.geom.AffineTransform; //导入依赖的package包/类
public PathIterator getPathIterator(AffineTransform at); 
开发者ID:bullda,项目名称:DroidText,代码行数:2,代码来源:Shape.java


注:本文中的harmony.java.awt.geom.AffineTransform类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。