Kashin M.I. Lab work 2 #2
BIN
Material/KeyDown.jpg
Normal file
BIN
Material/KeyDown.jpg
Normal file
Binary file not shown.
After Width: | Height: | Size: 808 B |
BIN
Material/KeyDown.png
Normal file
BIN
Material/KeyDown.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
BIN
Material/KeyLeft.png
Normal file
BIN
Material/KeyLeft.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
BIN
Material/KeyRight.png
Normal file
BIN
Material/KeyRight.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
BIN
Material/KeyUp.png
Normal file
BIN
Material/KeyUp.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
@ -25,13 +25,13 @@ public class DrawingField extends JPanel{
|
||||
private void SetData() {
|
||||
Random rand=new Random();
|
||||
_gasolineTanker.SetPosition(rand.nextInt(100)+10,rand.nextInt(100)+10,getWidth(),getHeight());
|
||||
Field.SpeedLabel.setText("Скорость: "+_gasolineTanker.getGasolineTanker().getSpeed());
|
||||
Field.WeightLabel.setText("Вес: "+_gasolineTanker.getGasolineTanker().getWeight());
|
||||
Field.BodyColorLabel.setText("Цвет: "+Integer.toHexString(_gasolineTanker.getGasolineTanker().getBodyColor().getRGB()).substring(2));
|
||||
Field.SpeedLabel.setText("Speed: "+_gasolineTanker.getGasolineTanker().getSpeed());
|
||||
Field.WeightLabel.setText("Weight: "+_gasolineTanker.getGasolineTanker().getWeight());
|
||||
Field.BodyColorLabel.setText("Color: "+Integer.toHexString(_gasolineTanker.getGasolineTanker().getBodyColor().getRGB()).substring(2));
|
||||
}
|
||||
public void CreateButtonAction(){
|
||||
Random rand=new Random();
|
||||
Color color1 = JColorChooser.showDialog(Field, "Выберите цвет тела корабля", 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));
|
||||
_gasolineTanker=new DrawingGasolineTanker(rand.nextInt(50)+10,rand.nextInt(3000)+20000,color1,rand.nextInt(3));
|
||||
@ -39,8 +39,8 @@ public class DrawingField extends JPanel{
|
||||
}
|
||||
public void CreateModifButtonAction(){
|
||||
Random rand=new Random();
|
||||
Color color1=JColorChooser.showDialog(Field, "Выберите цвет тела корабля",null);
|
||||
Color color2=JColorChooser.showDialog(Field, "Выборите цвет модификаций корабля",null);
|
||||
Color color1=new Color(rand.nextInt(256), rand.nextInt(256), rand.nextInt(256));
|
||||
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)
|
||||
|
@ -19,7 +19,7 @@ public class FormGasolineTanker extends JFrame{
|
||||
private JPanel PictureBox;
|
||||
|
||||
public FormGasolineTanker(){
|
||||
super("Военный корабль");
|
||||
super("Gasoline Tanker");
|
||||
setContentPane(PictureBox);
|
||||
setSize(1000,700);
|
||||
Width = getWidth();
|
||||
|
@ -30,7 +30,7 @@ public class FormMap extends JFrame {
|
||||
ImageIcon spriteRight =new ImageIcon((new ImageIcon("Material\\KeyRight.png")).
|
||||
getImage().getScaledInstance(10,10,Image.SCALE_SMOOTH));
|
||||
public FormMap(){
|
||||
super("Военный корабль");
|
||||
super("Gasoline tanker");
|
||||
setContentPane(PictureBox);
|
||||
setSize(1000,700);
|
||||
Width = getWidth();
|
||||
|
Loading…
Reference in New Issue
Block a user