Compare commits
No commits in common. "master" and "346581751dc479a23e8388666fb8bc31c5757214" have entirely different histories.
master
...
346581751d
@ -17,8 +17,7 @@ public class DrawingArtillery {
|
|||||||
public void Init(int speed, float weight, Color bodyColor, int rollersCount) {
|
public void Init(int speed, float weight, Color bodyColor, int rollersCount) {
|
||||||
artillery = new EntityArtillery();
|
artillery = new EntityArtillery();
|
||||||
artillery.Init(speed, weight, bodyColor);
|
artillery.Init(speed, weight, bodyColor);
|
||||||
drawingRollers = new DrawingRollers();
|
drawingRollers = new DrawingRollers(rollersCount, bodyColor);
|
||||||
drawingRollers.Init(rollersCount, bodyColor);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetPosition(int x, int y, int width, int height) {
|
public void SetPosition(int x, int y, int width, int height) {
|
||||||
|
@ -4,9 +4,9 @@ public class DrawingRollers {
|
|||||||
private RollersCount rollersCount;
|
private RollersCount rollersCount;
|
||||||
private Color color;
|
private Color color;
|
||||||
|
|
||||||
public void Init(int rollersCount, Color bodyColor) {
|
public DrawingRollers(int rollersCount, Color rollersColor) {
|
||||||
setRollersCount(rollersCount);
|
setRollersCount(rollersCount);
|
||||||
color = bodyColor;
|
color = rollersColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setRollersCount(int num) {
|
public void setRollersCount(int num) {
|
||||||
|
@ -42,7 +42,7 @@ public class FormArtillery extends JFrame {
|
|||||||
pictureBox.addComponentListener(new ComponentAdapter() {
|
pictureBox.addComponentListener(new ComponentAdapter() {
|
||||||
@Override
|
@Override
|
||||||
public void componentResized(ComponentEvent e) {
|
public void componentResized(ComponentEvent e) {
|
||||||
if (_artillery != null) _artillery.changeBorders(pictureBox.getWidth(), pictureBox.getHeight());
|
if (_artillery != null) _artillery.changeBorders(e.getComponent().getWidth(), e.getComponent().getHeight());
|
||||||
repaint();
|
repaint();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user