diff options
Diffstat (limited to 'platform/java/com/artifex/mupdf/fitz/Path.java')
-rw-r--r-- | platform/java/com/artifex/mupdf/fitz/Path.java | 77 |
1 files changed, 29 insertions, 48 deletions
diff --git a/platform/java/com/artifex/mupdf/fitz/Path.java b/platform/java/com/artifex/mupdf/fitz/Path.java index 17257f10..fa925bab 100644 --- a/platform/java/com/artifex/mupdf/fitz/Path.java +++ b/platform/java/com/artifex/mupdf/fitz/Path.java @@ -1,82 +1,63 @@ package com.artifex.mupdf.fitz; -public class Path implements PathProcessor +public class Path implements PathWalker { - // Private data - private long nativePath = 0; + private long pointer; - // Construction - public Path() - { - nativePath = newNative(); + protected native void finalize(); + + public void destroy() { + finalize(); + pointer = 0; } private native long newNative(); + private native long cloneNative(); - private Path(long path) - { - nativePath = path; + public Path() { + pointer = newNative(); } - public Path(Path old) - { - nativePath = clone(old); + private Path(long p) { + pointer = p; } - private native long clone(Path old); + public Path(Path old) { + pointer = old.cloneNative(); + } - // Operation public native Point currentPoint(); - public void moveTo(Point xy) - { + public native void moveTo(float x, float y); + public native void lineTo(float x, float y); + public native void curveTo(float cx1, float cy1, float cx2, float cy2, float ex, float ey); + public native void curveToV(float cx, float cy, float ex, float ey); + public native void curveToY(float cx, float cy, float ex, float ey); + public native void closePath(); + + public void moveTo(Point xy) { moveTo(xy.x, xy.y); } - public native void moveTo(float x, float y); - - public void lineTo(Point xy) - { + public void lineTo(Point xy) { lineTo(xy.x, xy.y); } - public native void lineTo(float x, float y); - - public void curveTo(Point c1, Point c2, Point e) - { + public void curveTo(Point c1, Point c2, Point e) { curveTo(c1.x, c1.y, c2.x, c2.y, e.x, e.y); } - public native void curveTo(float cx1, float cy1, float cx2, float cy2, float ex, float ey); - - public void curveToV(Point c, Point e) - { + public void curveToV(Point c, Point e) { curveToV(c.x, c.y, e.x, e.y); } - public native void curveToV(float cx, float cy, float ex, float ey); - - public void curveToY(Point c, Point e) - { + public void curveToY(Point c, Point e) { curveToY(c.x, c.y, e.x, e.y); } - public native void curveToY(float cx, float cy, float ex, float ey); - - public native void close(); - public native void transform(Matrix mat); - public native Rect bound(StrokeState stroke, Matrix ctm); - - public native void process(PathProcessor proc); - - // Destruction - public void destroy() - { - finalize(); - nativePath = 0; - } + public native Rect getBounds(StrokeState stroke, Matrix ctm); - protected native void finalize(); + public native void walk(PathWalker walker); } |