home *** CD-ROM | disk | FTP | other *** search
- package sun.font;
-
- import java.awt.Shape;
- import java.awt.geom.AffineTransform;
- import java.awt.geom.GeneralPath;
- import java.awt.geom.PathIterator;
- import java.awt.geom.Point2D;
- import java.util.ArrayList;
- import sun.font.LayoutPathImpl.SegmentPath;
-
- class LayoutPathImpl$SegmentPath$Mapper {
- // $FF: renamed from: li sun.font.LayoutPathImpl.SegmentPath.LineInfo
- final LayoutPathImpl.SegmentPath.LineInfo field_0;
- final ArrayList<LayoutPathImpl.SegmentPath.Segment> segments;
- final Point2D.Double mpt;
- final Point2D.Double cpt;
- boolean haveMT;
- // $FF: synthetic field
- final LayoutPathImpl.SegmentPath this$0;
-
- LayoutPathImpl$SegmentPath$Mapper(LayoutPathImpl.SegmentPath var1) {
- this.this$0 = var1;
- this.field_0 = new LayoutPathImpl.SegmentPath.LineInfo(var1);
- this.segments = new ArrayList();
-
- for(int var2 = 3; var2 < SegmentPath.access$000(var1).length; var2 += 3) {
- if (SegmentPath.access$000(var1)[var2 + 2] != SegmentPath.access$000(var1)[var2 - 1]) {
- this.segments.add(new LayoutPathImpl.SegmentPath.Segment(var1, var2));
- }
- }
-
- this.mpt = new Point2D.Double();
- this.cpt = new Point2D.Double();
- }
-
- void init() {
- this.haveMT = false;
-
- for(LayoutPathImpl.SegmentPath.Segment var2 : this.segments) {
- var2.init();
- }
-
- }
-
- void moveTo(double var1, double var3) {
- this.mpt.x = var1;
- this.mpt.y = var3;
- this.haveMT = true;
- }
-
- void lineTo(double var1, double var3) {
- if (this.haveMT) {
- this.cpt.x = this.mpt.x;
- this.cpt.y = this.mpt.y;
- }
-
- if (var1 != this.cpt.x || var3 != this.cpt.y) {
- if (this.haveMT) {
- this.haveMT = false;
-
- for(LayoutPathImpl.SegmentPath.Segment var6 : this.segments) {
- var6.move();
- }
- }
-
- this.field_0.set(this.cpt.x, this.cpt.y, var1, var3);
-
- for(LayoutPathImpl.SegmentPath.Segment var8 : this.segments) {
- var8.line(this.field_0);
- }
-
- this.cpt.x = var1;
- this.cpt.y = var3;
- }
- }
-
- void close() {
- this.lineTo(this.mpt.x, this.mpt.y);
-
- for(LayoutPathImpl.SegmentPath.Segment var2 : this.segments) {
- var2.close();
- }
-
- }
-
- public Shape mapShape(Shape var1) {
- PathIterator var2 = var1.getPathIterator((AffineTransform)null, (double)1.0F);
- this.init();
-
- for(double[] var3 = new double[2]; !var2.isDone(); var2.next()) {
- switch (var2.currentSegment(var3)) {
- case 0:
- this.moveTo(var3[0], var3[1]);
- break;
- case 1:
- this.lineTo(var3[0], var3[1]);
- case 2:
- case 3:
- default:
- break;
- case 4:
- this.close();
- }
- }
-
- GeneralPath var4 = new GeneralPath();
-
- for(LayoutPathImpl.SegmentPath.Segment var6 : this.segments) {
- var4.append(var6.gp, false);
- }
-
- return var4;
- }
- }
-