Третий коммит. Убран jcolorchooser
This commit is contained in:
parent
13eaeb49ed
commit
a2e5535386
@ -31,22 +31,13 @@ public class DrawingField extends JPanel{
|
|||||||
}
|
}
|
||||||
public void CreateButtonAction(){
|
public void CreateButtonAction(){
|
||||||
Random rand=new Random();
|
Random rand=new Random();
|
||||||
Color color1 = JColorChooser.showDialog(Field, "Выберите цвет тела корабля", null);
|
_warship=new DrawingWarship(rand.nextInt(50)+10,rand.nextInt(3000)+20000,new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256)),rand.nextInt(3));
|
||||||
if(color1==null)
|
|
||||||
color1=new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
|
|
||||||
_warship=new DrawingWarship(rand.nextInt(50)+10,rand.nextInt(3000)+20000,color1,rand.nextInt(3));
|
|
||||||
SetData();
|
SetData();
|
||||||
}
|
}
|
||||||
public void CreateModifButtonAction(){
|
public void CreateModifButtonAction(){
|
||||||
Random rand=new Random();
|
Random rand=new Random();
|
||||||
Color color1=JColorChooser.showDialog(Field, "Выберите цвет тела корабля",null);
|
_warship = new DrawingAdvancedWarship(rand.nextInt(50) + 10, rand.nextInt(3000) + 20000, new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256)),
|
||||||
Color color2=JColorChooser.showDialog(Field, "Выборите цвет модификаций корабля",null);
|
new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256)), rand.nextBoolean(), rand.nextBoolean(), rand.nextBoolean(),rand.nextInt(3));
|
||||||
if(color1==null)
|
|
||||||
color1=new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
|
|
||||||
if (color2==null)
|
|
||||||
color2=new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
|
|
||||||
_warship = new DrawingAdvancedWarship(rand.nextInt(50) + 10, rand.nextInt(3000) + 20000, color1,
|
|
||||||
color2, rand.nextBoolean(), rand.nextBoolean(), rand.nextBoolean(),rand.nextInt(3));
|
|
||||||
SetData();
|
SetData();
|
||||||
}
|
}
|
||||||
public void ResizeField(){
|
public void ResizeField(){
|
||||||
|
@ -29,20 +29,14 @@ public class DrawingMap extends JPanel {
|
|||||||
}
|
}
|
||||||
public void CreateButtonAction(){
|
public void CreateButtonAction(){
|
||||||
Random rand=new Random();
|
Random rand=new Random();
|
||||||
Color color1 = JColorChooser.showDialog(Map, "Выберите цвет тела корабля", null);
|
Color color1=new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
|
||||||
if(color1==null)
|
|
||||||
color1=new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
|
|
||||||
DrawingWarship warship=new DrawingWarship(rand.nextInt(50)+10,rand.nextInt(3000)+20000,color1,rand.nextInt(3));
|
DrawingWarship warship=new DrawingWarship(rand.nextInt(50)+10,rand.nextInt(3000)+20000,color1,rand.nextInt(3));
|
||||||
SetData(warship);
|
SetData(warship);
|
||||||
}
|
}
|
||||||
public void CreateModifButtonAction(){
|
public void CreateModifButtonAction(){
|
||||||
Random rand=new Random();
|
Random rand=new Random();
|
||||||
Color color1=JColorChooser.showDialog(Map, "Выберите цвет тела корабля",null);
|
Color color1=new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
|
||||||
Color color2=JColorChooser.showDialog(Map, "Выборите цвет модификаций корабля",null);
|
Color color2=new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
|
||||||
if(color1==null)
|
|
||||||
color1=new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
|
|
||||||
if (color2==null)
|
|
||||||
color2=new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
|
|
||||||
DrawingWarship warship = new DrawingAdvancedWarship(rand.nextInt(50) + 10, rand.nextInt(3000) + 20000, color1,
|
DrawingWarship warship = new DrawingAdvancedWarship(rand.nextInt(50) + 10, rand.nextInt(3000) + 20000, color1,
|
||||||
color2, rand.nextBoolean(), rand.nextBoolean(), rand.nextBoolean(),rand.nextInt(3));
|
color2, rand.nextBoolean(), rand.nextBoolean(), rand.nextBoolean(),rand.nextInt(3));
|
||||||
SetData(warship);
|
SetData(warship);
|
||||||
|
Loading…
Reference in New Issue
Block a user