リビジョン 6bf3412b
| AnalogClockSvg/nbproject/project.properties | ||
|---|---|---|
|
annotation.processing.run.all.processors=true
|
||
|
annotation.processing.source.output=${build.generated.sources.dir}/ap-source-output
|
||
|
application.desc=Analog clock on desktop\n
|
||
|
application.title=\u30a2\u30ca\u30ed\u30b0\u6642\u8a08SVG
|
||
|
application.vendor=\u9ad8\u6a4b
|
||
|
application.title=Analog Clock
|
||
|
application.vendor=torutk
|
||
|
auxiliary.org-netbeans-spi-editor-hints-projects.perProjectHintSettingsFile=nbproject/cfg_hints.xml
|
||
|
build.classes.dir=${build.dir}/classes
|
||
|
build.classes.excludes=**/*.java,**/*.form
|
||
| ... | ... | |
|
javadoc.use=true
|
||
|
javadoc.version=false
|
||
|
javadoc.windowtitle=
|
||
|
javafx.application.implementation.version=0.1.0
|
||
|
javafx.application.implementation.version=0.1.1
|
||
|
javafx.binarycss=false
|
||
|
javafx.classpath.extension=\
|
||
|
${java.home}/lib/javaws.jar:\
|
||
| AnalogClockSvg/src/analogclocksvg/AnalogClock.fxml | ||
|---|---|---|
|
</RadialGradient>
|
||
|
</fill>
|
||
|
</SVGPath>
|
||
|
<SVGPath fx:id="dialMinutes" content="M 100.0,12.0 L 100.0,22.0 M 108.9,15.5 L 108.8,16.5 M 117.7,16.9 L 117.5,17.8 M 126.3,19.2 L 126.0,20.1 M 134.6,22.3 L 134.2,23.3 M 144.0,23.8 L 139.0,32.5 M 150.0,31.2 L 149.4,32.0 M 156.9,36.8 L 156.2,37.6 M 163.2,43.1 L 162.4,43.8 M 168.8,50.0 L 168.0,50.6 M 176.2,56.0 L 167.5,61.0 M 177.7,65.4 L 176.7,65.8 M 180.8,73.7 L 179.9,74.0 M 183.1,82.3 L 182.2,82.5 M 184.5,91.1 L 183.5,91.2 M 188.0,100.0 L 178.0,100.0 M 184.5,108.9 L 183.5,108.8 M 183.1,117.7 L 182.2,117.5 M 180.8,126.3 L 179.9,126.0 M 177.7,134.6 L 176.7,134.2 M 176.2,144.0 L 167.5,139.0 M 168.8,150.0 L 168.0,149.4 M 163.2,156.9 L 162.4,156.2 M 156.9,163.2 L 156.2,162.4 M 150.0,168.8 L 149.4,168.0 M 144.0,176.2 L 139.0,167.5 M 134.6,177.7 L 134.2,176.7 M 126.3,180.8 L 126.0,179.9 M 117.7,183.1 L 117.5,182.2 M 108.9,184.5 L 108.8,183.5 M 100.0,188.0 L 100.0,178.0 M 91.1,184.5 L 91.2,183.5 M 82.3,183.1 L 82.5,182.2 M 73.7,180.8 L 74.0,179.9 M 65.4,177.7 L 65.8,176.7 M 56.0,176.2 L 61.0,167.5 M 50.0,168.8 L 50.6,168.0 M 43.1,163.2 L 43.8,162.4 M 36.8,156.9 L 37.6,156.2 M 31.2,150.0 L 32.0,149.4 M 23.8,144.0 L 32.5,139.0 M 22.3,134.6 L 23.3,134.2 M 19.2,126.3 L 20.1,126.0 M 16.9,117.7 L 17.8,117.5 M 15.5,108.9 L 16.5,108.8 M 12.0,100.0 L 22.0,100.0 M 15.5,91.1 L 16.5,91.2 M 16.9,82.3 L 17.8,82.5 M 19.2,73.7 L 20.1,74.0 M 22.3,65.4 L 23.3,65.8 M 23.8,56.0 L 32.5,61.0 M 31.2,50.0 L 32.0,50.6 M 36.8,43.1 L 37.6,43.8 M 43.1,36.8 L 43.8,37.6 M 50.0,31.2 L 50.6,32.0 M 56.0,23.8 L 61.0,32.5 M 65.4,22.3 L 65.8,23.3 M 73.7,19.2 L 74.0,20.1 M 82.3,16.9 L 82.5,17.8 M 91.1,15.5 L 91.2,16.5" stroke="BLACK" strokeWidth="2.0" />
|
||
|
<SVGPath fx:id="dialMinutes" content="M 100.0,12.0 L 100.0,24.0 M 108.8,16.5 L 108.6,18.4 M 117.5,17.8 L 117.0,19.8 M 126.0,20.1 L 125.3,22.0 M 134.2,23.3 L 133.4,25.1 M 144.0,23.8 L 138.0,34.2 M 149.4,32.0 L 148.2,33.7 M 156.2,37.6 L 154.9,39.1 M 162.4,43.8 L 160.9,45.1 M 168.0,50.6 L 166.3,51.8 M 176.2,56.0 L 165.8,62.0 M 176.7,65.8 L 174.9,66.6 M 179.9,74.0 L 178.0,74.7 M 182.2,82.5 L 180.2,83.0 M 183.5,91.2 L 181.6,91.4 M 188.0,100.0 L 176.0,100.0 M 183.5,108.8 L 181.6,108.6 M 182.2,117.5 L 180.2,117.0 M 179.9,126.0 L 178.0,125.3 M 176.7,134.2 L 174.9,133.4 M 176.2,144.0 L 165.8,138.0 M 168.0,149.4 L 166.3,148.2 M 162.4,156.2 L 160.9,154.9 M 156.2,162.4 L 154.9,160.9 M 149.4,168.0 L 148.2,166.3 M 144.0,176.2 L 138.0,165.8 M 134.2,176.7 L 133.4,174.9 M 126.0,179.9 L 125.3,178.0 M 117.5,182.2 L 117.0,180.2 M 108.8,183.5 L 108.6,181.6 M 100.0,188.0 L 100.0,176.0 M 91.2,183.5 L 91.4,181.6 M 82.5,182.2 L 83.0,180.2 M 74.0,179.9 L 74.7,178.0 M 65.8,176.7 L 66.6,174.9 M 56.0,176.2 L 62.0,165.8 M 50.6,168.0 L 51.8,166.3 M 43.8,162.4 L 45.1,160.9 M 37.6,156.2 L 39.1,154.9 M 32.0,149.4 L 33.7,148.2 M 23.8,144.0 L 34.2,138.0 M 23.3,134.2 L 25.1,133.4 M 20.1,126.0 L 22.0,125.3 M 17.8,117.5 L 19.8,117.0 M 16.5,108.8 L 18.4,108.6 M 12.0,100.0 L 24.0,100.0 M 16.5,91.2 L 18.4,91.4 M 17.8,82.5 L 19.8,83.0 M 20.1,74.0 L 22.0,74.7 M 23.3,65.8 L 25.1,66.6 M 23.8,56.0 L 34.2,62.0 M 32.0,50.6 L 33.7,51.8 M 37.6,43.8 L 39.1,45.1 M 43.8,37.6 L 45.1,39.1 M 50.6,32.0 L 51.8,33.7 M 56.0,23.8 L 62.0,34.2 M 65.8,23.3 L 66.6,25.1 M 74.0,20.1 L 74.7,22.0 M 82.5,17.8 L 83.0,19.8 M 91.2,16.5 L 91.4,18.4" stroke="BLACK" strokeWidth="2.0" />
|
||
|
<SVGPath fx:id="hourHand" content="M 100,100 L 92,90 L 100,40 L 108,90 Z" />
|
||
|
<SVGPath fx:id="minuteHand" content="M 100,100 L 92,90 L 100,20 L 108,90 Z" />
|
||
|
<SVGPath fx:id="secondHand" content="M 100,110 L 100,20" stroke="#838080" />
|
||
| AnalogClockSvg/src/analogclocksvg/AnalogClockController.java | ||
|---|---|---|
|
import javafx.util.Duration;
|
||
|
|
||
|
/**
|
||
|
*
|
||
|
*
|
||
|
* @author TAKAHASHI,Toru
|
||
|
*/
|
||
|
public class AnalogClockController implements Initializable {
|
||
| AnalogClockSvg/test/analogclocksvg/AnalogClockControllerTest.java | ||
|---|---|---|
|
System.out.println(pathData);
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* 文字盤の分個別のラインを生成する。
|
||
|
*
|
||
|
* 5分置きに長い線を、それ以外の分は短い線を作成し、分に応じて回転させる。
|
||
|
*
|
||
|
* @param minute 生成する対象の分
|
||
|
* @return 指定した分に対応するライン
|
||
|
*/
|
||
|
private Line createLine(int minute) {
|
||
|
Rotate rot = new Rotate(minute * 6, 100, 100);
|
||
|
Point2D p0 = rot.transform(100, minute % 5 == 0 ? 12 : 15);
|
||
|
Point2D p1 = rot.transform(100, minute % 5 == 0 ? 22 : 16);
|
||
|
Point2D p0 = rot.transform(100, minute % 5 == 0 ? 12 : 16);
|
||
|
Point2D p1 = rot.transform(100, minute % 5 == 0 ? 24 : 18);
|
||
|
Line line = new Line(p0.getX(), p0.getY(), p1.getX(), p1.getY());
|
||
|
return line;
|
||
|
}
|
||
文字盤の分刻みをすこしくっきり表示するようSVGデータを修正