なし
--- PaintTool.java Mon Jun 01 05:12:13 2009
+++ PaintTool.java Fri Jun 12 04:21:26 2009
@@ -18,7 +18,7 @@
public Color penColor;
// ペンサイズ
- public float penSize;
+ public int penSize;
// オプションパネル
public JPanel jPanel = null;
--- PtBrush.java Mon Jun 01 05:12:13 2009
+++ PtBrush.java Fri Jun 12 04:32:44 2009
@@ -110,9 +110,9 @@
// ペンサイズと領域の設定
if (brushState == OPTION_00) {
- super.penSize = 7.0F;
+ super.penSize = 7;
} else if (brushState == OPTION_01) {
- super.penSize = 4.0F;
+ super.penSize = 4;
}
Dimension dim = new Dimension((int) super.penSize, (int) super.penSize);
@@ -122,7 +122,7 @@
// 補完
if (!p1.equals(p2)) {
- double range = Math.sqrt(Math.pow((p1.x + p2.x), 2.0F) + Math.pow((p1.y + p2.y), 2.0F)); // 2点間の距離を算出
+ double range = Math.sqrt(Math.pow((p1.x + p2.x), 2.0d) + Math.pow((p1.y + p2.y), 2.0d)); // 2点間の距離を算出
for (int i = 0; i < range; i++) { // 補完処理
ellipse.setFrame(new Point2D.Double(p1.x + ((p2.x - p1.x) / range) * i, p1.y + ((p2.y - p1.y) / range) * i), dim);
g2d.fill(ellipse);
@@ -134,13 +134,13 @@
// ペンサイズと領域の設定
if (brushState == OPTION_10) {
- super.penSize = 8.0F;
+ super.penSize = 8;
} else if (brushState == OPTION_11) {
- super.penSize = 5.0F;
+ super.penSize = 5;
} else if (brushState == OPTION_12) {
- super.penSize = 2.0F;
+ super.penSize = 2;
} else if (brushState == OPTION_02) {
- super.penSize = 1.0F;
+ super.penSize = 1;
}
Dimension dim = new Dimension((int) super.penSize, (int) super.penSize);
@@ -150,7 +150,7 @@
// 補完
if (!p1.equals(p2)) {
- double range = Math.sqrt(Math.pow((p1.x + p2.x), 2.0F) + Math.pow((p1.y + p2.y), 2.0F));
+ double range = Math.sqrt(Math.pow((p1.x + p2.x), 2.0d) + Math.pow((p1.y + p2.y), 2.0d));
for (int i = 0; i < range; i++) {
rect.setFrame(new Point2D.Double(p1.x + ((p2.x - p1.x) / range) * i, p1.y + ((p2.y - p1.y) / range) * i), dim);
g2d.fill(rect);
@@ -162,13 +162,13 @@
// ペンサイズと角度の設定
if (brushState == OPTION_20 || brushState == OPTION_30) {
- super.penSize = 8.0F;
+ super.penSize = 8;
} else if (brushState == OPTION_21 || brushState == OPTION_31) {
- super.penSize = 5.0F;
+ super.penSize = 5;
} else if (brushState == OPTION_22 || brushState == OPTION_32) {
- super.penSize = 2.0F;
+ super.penSize = 2;
}
- int length = (int) super.penSize;
+ int length = super.penSize;
// 逆斜線ブラシならangleを-1にして、角度を90度変える
int angle = 1;
@@ -177,19 +177,19 @@
}
// 押印
- Point2D.Double p2_l = new Point2D.Double(p2.x - length / 2.0F, p2.y + angle * length / 2.0F); // 斜線の端①
- Point2D.Double p2_r = new Point2D.Double(p2.x + length / 2.0F, p2.y - angle * length / 2.0F); // 斜線の端②
+ Point2D.Double p2_l = new Point2D.Double(p2.x - length / 2.0d, p2.y + angle * length / 2.0d); // 斜線の端①
+ Point2D.Double p2_r = new Point2D.Double(p2.x + length / 2.0d, p2.y - angle * length / 2.0d); // 斜線の端②
line.setLine(p2_l, p2_r); // 直線で結ぶ
g2d.draw(line); // 描写
// 補完
if (!p1.equals(p2)) {
- double range = Math.sqrt(Math.pow((p1.x + p2.x), 2.0F) + Math.pow((p1.y + p2.y), 2.0F));
+ double range = Math.sqrt(Math.pow((p1.x + p2.x), 2.0d) + Math.pow((p1.y + p2.y), 2.0d));
for (int i = 0; i < range; i++) {
Point2D.Double pi = new Point2D.Double(p1.x + ((p2.x - p1.x) / range) * i, p1.y + ((p2.y - p1.y) / range) * i);
- p2_l = new Point2D.Double(pi.x - length / 2.0F, pi.y + angle * length / 2.0F); // 斜線の端①
- p2_r = new Point2D.Double(pi.x + length / 2.0F, pi.y - angle * length / 2.0F); // 斜線の端②
+ p2_l = new Point2D.Double(pi.x - length / 2.0d, pi.y + angle * length / 2.0d); // 斜線の端①
+ p2_r = new Point2D.Double(pi.x + length / 2.0d, pi.y - angle * length / 2.0d); // 斜線の端②
line.setLine(p2_l, p2_r);
g2d.draw(line);
--- PtEraser.java Mon Jun 01 05:12:12 2009
+++ PtEraser.java Fri Jun 12 04:32:44 2009
@@ -74,7 +74,7 @@
// 前回の座標と今回の座標が異なれば、それらの区間を補完するための描写を行う
if (!p1.equals(p2)) {
// 2点間の距離を算出
- double range = Math.sqrt(Math.pow((p1.x + p2.x), 2.0F) + Math.pow((p1.y + p2.y), 2.0F));
+ double range = Math.sqrt(Math.pow((p1.x + p2.x), 2.0d) + Math.pow((p1.y + p2.y), 2.0d));
// 補完処理
for (int i = 0; i < range; i++) {
rect.setFrame(new Point2D.Double(p1.x + ((p2.x - p1.x) / range) * i, p1.y + ((p2.y - p1.y) / range) * i), dim);
@@ -98,23 +98,23 @@
// 押されたボタンを選択状態にし、押されたボタンに応じた消しゴムサイズをペンサイズとして設定する
switch (state) {
case OPTION_1:
- super.penSize = 4.0F; // 消しゴムサイズ
+ super.penSize = 4; // 消しゴムサイズ
jButton1.setIcon(new ImageIcon(getClass().getResource("/img/eraser_1_a.png"))); // ボタンを選択状態の画像にする
break;
case OPTION_2:
- super.penSize = 6.0F;
+ super.penSize = 6;
jButton2.setIcon(new ImageIcon(getClass().getResource("/img/eraser_2_a.png")));
break;
case OPTION_3:
- super.penSize = 8.0F;
+ super.penSize = 8;
jButton3.setIcon(new ImageIcon(getClass().getResource("/img/eraser_3_a.png")));
break;
case OPTION_4:
- super.penSize = 10.0F;
+ super.penSize = 10;
jButton4.setIcon(new ImageIcon(getClass().getResource("/img/eraser_4_a.png")));
break;
case OPTION_5:
- super.penSize = 12.0F;
+ super.penSize = 12;
jButton5.setIcon(new ImageIcon(getClass().getResource("/img/eraser_5_a.png")));
break;
}
--- PtPencil.java Mon Jun 01 05:12:13 2009
+++ PtPencil.java Fri Jun 12 04:27:04 2009
@@ -21,7 +21,7 @@
// --------------------------------------------------
PtPencil() {
// ペンサイズの設定
- super.penSize = 1.0F;
+ super.penSize = 1;
}
// --------------------------------------------------