2009-10-30
JFXtras Core 入門 - Shape (4)
シェイプの4回目です。
今回は
- MultiRoundRectangle
- Rays
- RegularPolygon
- ResizableEllipse
を描いてみようと思います。
org.jfxtras.scene.shape.MultiRoundRectangle
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import org.jfxtras.scene.shape.MultiRoundRectangle;
Stage {
title: "JFXtras Shape MultiRoundRectangle"
width: 150
height: 150
scene: Scene {
content: [
MultiRoundRectangle {
x: 10
y: 10
width: 80
height: 80
topLeftWidth: 10
topLeftHeight: 10
bottomLeftWidth: 20
bottomLeftHeight: 20
topRightWidth: 30
topRightHeight: 30
bottomRightWidth: 0
bottomRightHeight: 0
fill: Color.BLUEVIOLET
}
]
}
}
| プロパティ | 説明 |
|---|---|
| topLeftWidth | 左上角の弧の横方向の半径 |
| topLeftHeight | 左上角の弧の縦方向の半径 |
| bottomLeftWidth | 左下角の弧の横方向の半径 |
| bottomLeftHeight | 左下角の弧の縦方向の半径 |
| topRightWidth | 右上角の弧の横方向の半径 |
| topRightHeight | 右上角の弧の縦方向の半径 |
| bottomRightWidth | 右下角の弧の横方向の半径 |
| bottomRightHeight | 右下角の弧の縦方向の半径 |
org.jfxtras.scene.shape.Rays
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import org.jfxtras.scene.shape.Rays;
Stage {
title: "JFXtras Shape Rays"
width: 150
height: 150
scene: Scene {
content: [
Rays {
rounded: false
extent: 0.7
centerX: 60
centerY: 60
radius: 50
rays: 5
fill: Color.DARKGOLDENROD
}
]
}
}
| プロパティ | 説明 |
|---|---|
| extent | Rayの先端の拡がり。0.0 から 1.0 までの範囲で 1.0 が一番拡がりが大きい |
| rays | Rayの数 |
| rounded | Rayの先端を丸めるかどうか。true にすると丸める |
extent: 0.4, rays: 4
Asterisk にも似ていると思います。
org.jfxtras.scene.shape.RegularPolygon
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import org.jfxtras.scene.shape.RegularPolygon;
Stage {
title: "JFXtras Shape RegularPolygon"
width: 150
height: 150
scene: Scene {
content: [
RegularPolygon {
centerX: 50
centerY: 50
radius: 40
sides: 6
fill: Color.HOTPINK
}
]
}
}
| プロパティ | 説明 |
|---|---|
| sides | 辺の数 |
sides: 8
正○角形なわけですね。
org.jfxtras.scene.shape.ResizableEllipse
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import org.jfxtras.scene.shape.ResizableEllipse;
Stage {
title: "JFXtras Shape ResizableEllipse"
width: 150
height: 150
scene: Scene {
content: [
ResizableEllipse {
fill: Color.PALEVIOLETRED
}
]
}
}
特に設定の必要なプロパティはありません。デフォルトではコンテナノードの縦横サイズから自分のサイズを決定します。縦横 200, 200 になります。width, height を好みの大きさに設定することもできます。(使いどころがよくわかりませんけど。。。)
今日はここまで。シェイプは次回が最終回です。
追記
ResizableEllipse のデフォルトのサイズについて修正しました。
トラックバック - http://d.hatena.ne.jp/hide1080/20091030/1256910613
リンク元
- 19 http://d.hatena.ne.jp/
- 9 http://www.google.co.jp/search?sourceid=navclient&hl=ja&ie=UTF-8&rlz=1T4GZHZ_jaJP349JP350&q=ie8のie7互換モード
- 8 http://www.google.co.jp/search?hl=ja&client=firefox-a&rls=org.mozilla:en-US:official&hs=LnM&num=100&newwindow=1&q=java+web+start+deployjava&btnG=検索&lr=lang_ja&aq=f&oq=
- 7 http://www.fukkan.com/fk/VoteDetail?no=46255
- 6 http://www.google.com/search?hl=ja&rls=com.microsoft:ja:IE-SearchBox&rlz=1I7RNTN_ja&q=ie7+互換モード+設定&lr=&aq=4r&oq=ie7+ご
- 4 http://www.google.co.jp/search?hl=ja&lr=&q=RIA+比較&revid=105147425&ei=U0bsSu3WF5DxkAWYnJCcDw&sa=X&oi=revisions_inline&resnum=0&ct=top-revision&cd=2&ved=0CAsQ4QIoAQ
- 4 http://www.google.co.jp/search?hl=ja&q=プログラミング言語+人気&lr=&aq=5&oq=プログラミング言語
- 4 http://www.google.com/search?q=プログラミング言語 最も人気&rls=com.microsoft:*:IE-SearchBox&ie=UTF-8&oe=UTF-8&sourceid=ie7&rlz=1I7ADBR_ja
- 3 http://ocnsearch.goo.ne.jp/ocn.jsp?encode=euc&SM=MC&IE=sjis&MT=javaFXの本
- 3 http://www.google.co.jp/search?hl=ja&lr=lang_ja&client=firefox-a&rls=org.mozilla:ja:official&q=RIA+比較&revid=1033595584&ei=nn7tSpyhM4LVkAWS1vGZDw&sa=X&oi=revisions_inline&resnum=0&ct=broad-revision&cd=2&ved=0CCAQ1QIoATgK







