當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。