Правки. Базовая часть
This commit is contained in:
parent
41281740e9
commit
80d9da1272
@ -87,7 +87,13 @@ public class FormAirFighter extends JFrame implements ComponentListener{
|
|||||||
buttonCreate.addActionListener(new ActionListener() {
|
buttonCreate.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
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();
|
SetData();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -98,8 +104,20 @@ public class FormAirFighter extends JFrame implements ComponentListener{
|
|||||||
buttonModific.addActionListener(new ActionListener() {
|
buttonModific.addActionListener(new ActionListener() {
|
||||||
@Override
|
@Override
|
||||||
public void actionPerformed(ActionEvent e) {
|
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)),
|
Color defaultColor = 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 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();
|
SetData();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -37,7 +37,7 @@ public class MapWithSetAirFightersGeneric <T extends IDrawningObject, U extends
|
|||||||
/// Вывод всего набора объектов
|
/// Вывод всего набора объектов
|
||||||
public BufferedImage ShowSet()
|
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();
|
Graphics gr = bimg.createGraphics();
|
||||||
DrawBackground(gr);
|
DrawBackground(gr);
|
||||||
DrawAirFighters(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 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.setColor(Color.BLACK);
|
||||||
g.drawLine(i * _placeSizeWidth, j * _placeSizeHeight, i *
|
g.drawLine(i * _placeSizeWidth, j * _placeSizeHeight, i *
|
||||||
|
Loading…
x
Reference in New Issue
Block a user