📄 arcedtextlabel.java
字号:
package wt;// Decompiled by Jad v1.5.8e. Copyright 2001 Pavel Kouznetsov.// Jad home page: http://www.geocities.com/kpdus/jad.html// Decompiler options: packimports(3) // Source File Name: ArcedTextLabel.javaimport java.awt.geom.AffineTransform;class ArcedTextLabel extends TransformedTextLabel{ public ArcedTextLabel() { } public ArcedTextLabel(double spread, double rise) { this(); setSpreadAndRise(spread, rise); } public void setSpreadAndRise(double spread, double rise) { double width = spread / 2D; if(rise > 0.0D) { mRadius = ((width * width) / rise + rise) / 2D; mAngle = 2D * Math.atan2(width, mRadius - rise); } else { mRadius = spread; mAngle = 0.0D; } invalidateTransforms(); } public AffineTransform computeTransform(int i) { int n = length(); double w0 = getCharDist(0); double wn = getTextDist() - getCharDist(length() - 1); double pos = n < 2 ? 0.5D : (getCharDist(i) - w0) / (getTextDist() - w0 - wn); if(mAngle > 0.0D) { double t0 = w0 / mRadius; double tn = wn / mRadius; double angle = ((mAngle - t0 - tn) * pos - mAngle / 2D) + t0; return AffineTransform.getRotateInstance(angle, 0.0D, mRadius); } else { double dist = ((mRadius - w0 - wn) * pos - mRadius / 2D) + w0; return AffineTransform.getTranslateInstance(dist, 0.0D); } } private double mRadius; private double mAngle;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -