lab5 preparations for pull request p.2
This commit is contained in:
parent
3e82235fc8
commit
7fb34d7482
@ -25,11 +25,11 @@ public class DrawingShip {
|
|||||||
return startPosY;
|
return startPosY;
|
||||||
}
|
}
|
||||||
private int shipWidth = 150;
|
private int shipWidth = 150;
|
||||||
public int getShipWidth() {
|
public int getWidth() {
|
||||||
return shipWidth;
|
return shipWidth;
|
||||||
}
|
}
|
||||||
private int shipHeight = 50;
|
private int shipHeight = 50;
|
||||||
public int getShipHeight() {
|
public int getHeight() {
|
||||||
return shipHeight;
|
return shipHeight;
|
||||||
}
|
}
|
||||||
public IMoveableObject getMoveableObject() {return new DrawingObjectShip(this);}
|
public IMoveableObject getMoveableObject() {return new DrawingObjectShip(this);}
|
||||||
|
@ -244,8 +244,8 @@ public class FrameShipConfig extends JFrame {
|
|||||||
drawingShip.setBlocksNumber(blocksNumber);
|
drawingShip.setBlocksNumber(blocksNumber);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
drawingShip.setPosition(pictureBoxWidth / 2 - drawingShip.getShipWidth() / 2,
|
drawingShip.setPosition(pictureBoxWidth / 2 - drawingShip.getWidth() / 2,
|
||||||
pictureBoxHeight / 2 - drawingShip.getShipHeight() / 2);
|
pictureBoxHeight / 2 - drawingShip.getHeight() / 2);
|
||||||
pictureBox.repaint();
|
pictureBox.repaint();
|
||||||
return true;
|
return true;
|
||||||
} catch (UnsupportedFlavorException | IOException e) {
|
} catch (UnsupportedFlavorException | IOException e) {
|
||||||
|
@ -37,7 +37,7 @@ public class HardFrame extends JFrame {
|
|||||||
}while(check);
|
}while(check);
|
||||||
buttonMakeObject.addActionListener(e -> {
|
buttonMakeObject.addActionListener(e -> {
|
||||||
DrawingShip drawingShip = generic.makeObject();
|
DrawingShip drawingShip = generic.makeObject();
|
||||||
drawingShip.setPosition(pictureBoxWidth / 2 - drawingShip.getShipWidth()/2, pictureBoxHeight / 2 - drawingShip.getShipHeight()/2);
|
drawingShip.setPosition(pictureBoxWidth / 2 - drawingShip.getWidth()/2, pictureBoxHeight / 2 - drawingShip.getHeight()/2);
|
||||||
drawing = drawingShip;
|
drawing = drawingShip;
|
||||||
draw();
|
draw();
|
||||||
});
|
});
|
||||||
|
@ -13,7 +13,7 @@ public class DrawingObjectShip implements IMoveableObject{
|
|||||||
if(drawingShip == null || drawingShip.getEntityShip() == null)
|
if(drawingShip == null || drawingShip.getEntityShip() == null)
|
||||||
return null;
|
return null;
|
||||||
return new ObjectParameters(drawingShip.getPosX(), drawingShip.getPosY(),
|
return new ObjectParameters(drawingShip.getPosX(), drawingShip.getPosY(),
|
||||||
drawingShip.getShipWidth(), drawingShip.getShipHeight());
|
drawingShip.getWidth(), drawingShip.getHeight());
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public int getStep(){
|
public int getStep(){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user