Compare commits
2 Commits
a180fa3b0a
...
e07a9cae69
Author | SHA1 | Date | |
---|---|---|---|
e07a9cae69 | |||
397c8a2377 |
@ -41,17 +41,17 @@ public class LocomotiveDepotService extends AbstractCompany
|
||||
@Override
|
||||
protected void SetObjectsPosition() {
|
||||
if (locCoord == null || _collection == null) return;
|
||||
int row = 1, col = 1;
|
||||
for (int i = 0; i < _collection.getCount(); i++, col++)
|
||||
{
|
||||
int row = countInRow, col = 1;
|
||||
for (int i = 0; i < _collection.getCount(); i++, col++) {
|
||||
if (_collection.get(i) == null) continue;
|
||||
_collection.get(i).SetPictureSize(_pictureWidth, _pictureHeight);
|
||||
_collection.get(i).SetPosition(locCoord.get(row * countInRow - col).getKey() + 5, locCoord.get(row * countInRow - col).getValue() + 5);
|
||||
if (col == countInRow)
|
||||
{
|
||||
_collection.get(i).SetPosition(locCoord.get((row - 1) * countInRow + (col - 1)).getKey() + 5, locCoord.get((row - 1) * countInRow + (col - 1)).getValue() + 5);
|
||||
if (col == countInRow) {
|
||||
col = 0;
|
||||
row++;
|
||||
row--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ public class SpecialGenerateLocomotive <T extends EntityLocomotive, U extends ID
|
||||
public String getEn(int ind) {
|
||||
if(entityArray.get(ind) instanceof EntityElectricLocomotive) {
|
||||
EntityElectricLocomotive entity = (EntityElectricLocomotive)entityArray.get(ind);
|
||||
return "EntityWarmlyShip{" +
|
||||
return "EntityElectricLocomotive{" +
|
||||
"speed=" + entity.GetSpeed() +
|
||||
", weight=" + entity.GetWeight() +
|
||||
", bodyColor=" + entity.GetBodyColor() +
|
||||
@ -35,7 +35,7 @@ public class SpecialGenerateLocomotive <T extends EntityLocomotive, U extends ID
|
||||
'}';
|
||||
}
|
||||
else{
|
||||
return "EntityShip{" +
|
||||
return "EntityLocomotive{" +
|
||||
"speed=" + entityArray.get(ind).GetSpeed() +
|
||||
", weight=" + entityArray.get(ind).GetWeight() +
|
||||
", bodyColor=" + entityArray.get(ind).GetBodyColor() +
|
||||
|
@ -47,8 +47,8 @@ public class FormGenerateLocomotive extends JFrame
|
||||
sendObject = new JButton("Отправить");
|
||||
|
||||
panelLocomotive.setBorder(BorderFactory.createTitledBorder("Объект"));
|
||||
panelInfoLocomotive.setBorder(BorderFactory.createTitledBorder("Информация о кораблях"));
|
||||
panelInfoWheels.setBorder(BorderFactory.createTitledBorder("Информация о палубах"));
|
||||
panelInfoLocomotive.setBorder(BorderFactory.createTitledBorder("Информация о локомотивах"));
|
||||
panelInfoWheels.setBorder(BorderFactory.createTitledBorder("Информация о колёсах"));
|
||||
panelButtonManage.setLayout(new GridLayout(1, 2));
|
||||
|
||||
labelInfoLocomotive.setVerticalAlignment(SwingConstants.TOP);
|
||||
|
Loading…
Reference in New Issue
Block a user