Kargin D.E. Lab Work 4 #4
@ -87,7 +87,13 @@ public class FormAirFighter extends JFrame implements ComponentListener{
|
||||
buttonCreate.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
_airFighter = new DrawningAirFighter((int)(Math.random() * 300 + 200),(int)(Math.random() * 3000 + 2000), new Color((int)(Math.random() * 255), (int)(Math.random() * 255), (int)(Math.random() * 255)), Integer.parseInt(item), itemEngine);
|
||||
Color defaultColor = new Color((int)(Math.random() * 255), (int)(Math.random()) * 255, (int)(Math.random() * 255));
|
||||
Color mainColor = JColorChooser.showDialog(panelForDrawing,
|
||||
"Select a color", defaultColor);
|
||||
if(mainColor == null){
|
||||
mainColor = defaultColor;
|
||||
}
|
||||
_airFighter = new DrawningAirFighter((int)(Math.random() * 300 + 200),(int)(Math.random() * 3000 + 2000), mainColor, Integer.parseInt(item), itemEngine);
|
||||
SetData();
|
||||
}
|
||||
});
|
||||
@ -98,8 +104,20 @@ public class FormAirFighter extends JFrame implements ComponentListener{
|
||||
buttonModific.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
_airFighter = new DrawningUpgradeAirFighter((int)(Math.random() * 300 + 200),(int)(Math.random() * 3000 + 2000), new Color((int)(Math.random() * 255), (int)(Math.random() * 255), (int)(Math.random() * 255)),
|
||||
new Color((int)(Math.random() * 255), (int)(Math.random()) * 255, (int)(Math.random() * 255)), ((int)(Math.random() * 2)) == 1, ((int)(Math.random() * 2)) == 1, Integer.parseInt(item), itemEngine);
|
||||
Color defaultColor = new Color((int)(Math.random() * 255), (int)(Math.random()) * 255, (int)(Math.random() * 255));
|
||||
Color defaultDopColor = new Color((int)(Math.random() * 255), (int)(Math.random()) * 255, (int)(Math.random() * 255));
|
||||
Color mainColor = JColorChooser.showDialog(panelForDrawing,
|
||||
"Select a color", defaultColor);
|
||||
Color dopColor = JColorChooser.showDialog(panelForDrawing,
|
||||
"Select a color", defaultColor);
|
||||
if(mainColor == null){
|
||||
mainColor = defaultColor;
|
||||
}
|
||||
if(dopColor == null){
|
||||
dopColor = defaultDopColor;
|
||||
}
|
||||
_airFighter = new DrawningUpgradeAirFighter((int)(Math.random() * 300 + 200),(int)(Math.random() * 3000 + 2000), mainColor,
|
||||
dopColor, ((int)(Math.random() * 2)) == 1, ((int)(Math.random() * 2)) == 1, Integer.parseInt(item), itemEngine);
|
||||
SetData();
|
||||
}
|
||||
});
|
||||
|
@ -37,7 +37,7 @@ public class MapWithSetAirFightersGeneric <T extends IDrawningObject, U extends
|
||||
/// Вывод всего набора объектов
|
||||
public BufferedImage ShowSet()
|
||||
{
|
||||
BufferedImage bimg = new BufferedImage(_pictureWidth, _pictureHeight, BufferedImage.TYPE_INT_RGB);
|
||||
BufferedImage bimg = new BufferedImage(_pictureWidth, _pictureHeight, BufferedImage.TYPE_INT_ARGB);
|
||||
Graphics gr = bimg.createGraphics();
|
||||
DrawBackground(gr);
|
||||
DrawAirFighters(gr);
|
||||
@ -96,7 +96,7 @@ public class MapWithSetAirFightersGeneric <T extends IDrawningObject, U extends
|
||||
{
|
||||
for (int i = 0; i < _pictureWidth / _placeSizeWidth; i++)
|
||||
{
|
||||
for (int j = 0; j < _pictureHeight / _placeSizeHeight + 1; ++j)
|
||||
for (int j = 0; j < _pictureHeight / _placeSizeHeight; ++j)
|
||||
{//линия рамзетки места
|
||||
g.setColor(Color.BLACK);
|
||||
g.drawLine(i * _placeSizeWidth, j * _placeSizeHeight, i *
|
||||
|
Loading…
x
Reference in New Issue
Block a user