⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 arcedtextlabel.java

📁 一个很好的java2d小程序的源码
💻 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 + -