swtグラフィックを使用してテキストのアウトラインを表示する方法を調べようとしています。 は、より正確には、私は次のようにテキストを示し、コード記述する必要があります。私は次のコードを見つけ http://java.sun.com/developer/onlineTraining/Media/2DText/Art/StarryShape.gifswtのテキストの概要
を、私はSWTのAWTから、それを翻訳したいと思います。
FontRenderContext frc = g2.getFontRenderContext();
Font f = new Font("Times",Font.BOLD,w/10);
String s = new String("The Starry Night");
TextLayout tl = new TextLayout(s, f, frc);
float sw = (float) tl.getBounds().getWidth();
AffineTransform transform = new AffineTransform();
transform.setToTranslation(w/2-sw/2, h/4);
Shape shape = tl.getOutline(transform);
Rectangle r = shape.getBounds();
g2.setColor(Color.blue);
g2.draw(shape);
(java.sun.com/developer/onlineTraining/Media/2DText/style.htmlからコード)
しかし、私はSWTでTextLayoutの概要を取得する方法を見つけ出すことはできません。 このような可能性はありますか?
正確な翻訳が必要なのか、swtで枠線付きのテキストを実装するには 'how'ですか?あなたの質問からはっきりと分かりません。 – Favonius