Compare commits

..

20 Commits

Author SHA1 Message Date
19f25c5cee теперь все картинки static 2025-02-23 14:06:40 +04:00
3620ff93c4 небольшой рефакторинг рисовалки 2025-02-21 22:48:07 +04:00
9b085d63dd добавил commandlineArgs для mvn javafx:run 2025-02-20 20:42:57 +04:00
90f708dc78 css файл теперь задаётся в коде, а не в .fxml 2025-02-20 20:42:29 +04:00
4f332375a5 изменил размер spinnerVlsSelector 2025-02-19 20:56:26 +04:00
0c64c0df9b лаба01 сложная полностью закончена 2025-02-19 19:22:13 +04:00
b28d6d2993 прилепил Spinner 2025-02-19 07:25:13 +04:00
9aac507fce удалил ненужные картинки 2025-02-18 23:58:54 +04:00
56f57afc19 добавил Enum и Класс рисования усложнённой части 2025-02-18 23:57:52 +04:00
ad362f0fab лаба01 простая версия на джаве закончена 2025-02-18 22:22:46 +04:00
9d85732740 сделал сущность и рисовалку 2025-02-18 19:57:16 +04:00
5cae31af03 убрал подгрузку CSS в самом коде 2025-02-18 17:50:55 +04:00
6a421a6fc7 поменял форматирование кода 2025-02-16 15:14:09 +04:00
4ccf6834d6 comment out debug code 2025-02-16 14:51:39 +04:00
ea9980c65a Переход с inline style на css привязанном к Anchorpane 2025-02-16 14:50:52 +04:00
64d698b9ed уже не помню... 2025-02-15 21:28:51 +04:00
fc4e673492 сжал стрелочки... 2025-02-15 21:01:50 +04:00
f217bdcff2 мелкие изменения 2025-02-15 18:45:28 +04:00
c6a896b04c поменял названия классов 2025-02-15 18:42:24 +04:00
0402abec1d Выключил HiDPI 2025-02-15 18:41:09 +04:00
21 changed files with 620 additions and 26 deletions

7
.idea/encodings.xml generated Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding">
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/resources" charset="UTF-8" />
</component>
</project>

View File

@ -0,0 +1,8 @@
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="EnhancedSwitchMigration" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myMaxNumberStatementsForBranch" value="1" />
</inspection_tool>
</profile>
</component>

124
.idea/uiDesigner.xml generated Normal file
View File

@ -0,0 +1,124 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Palette2">
<group name="Swing">
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
</item>
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
</item>
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
</item>
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
<initial-values>
<property name="text" value="Button" />
</initial-values>
</item>
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="RadioButton" />
</initial-values>
</item>
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
<initial-values>
<property name="text" value="CheckBox" />
</initial-values>
</item>
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
<initial-values>
<property name="text" value="Label" />
</initial-values>
</item>
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
<preferred-size width="150" height="-1" />
</default-constraints>
</item>
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
</item>
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
<preferred-size width="150" height="50" />
</default-constraints>
</item>
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
<preferred-size width="200" height="200" />
</default-constraints>
</item>
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
</item>
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
</item>
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
</item>
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
<preferred-size width="-1" height="20" />
</default-constraints>
</item>
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
</item>
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
</item>
</group>
</component>
</project>

View File

@ -75,7 +75,8 @@
<!-- Default configuration for running with: mvn clean javafx:run --> <!-- Default configuration for running with: mvn clean javafx:run -->
<id>default-cli</id> <id>default-cli</id>
<configuration> <configuration>
<mainClass>kvr.missilecruiser_hard/kvr.missilecruiser_hard.ApplicationMissileCruiser</mainClass> <mainClass>kvr.missilecruiser_hard/kvr.missilecruiser_hard.Main</mainClass>
<commandlineArgs>-disable_hidpi</commandlineArgs>
<launcher>app</launcher> <launcher>app</launcher>
<jlinkZipName>app</jlinkZipName> <jlinkZipName>app</jlinkZipName>
<jlinkImageName>app</jlinkImageName> <jlinkImageName>app</jlinkImageName>

View File

@ -6,18 +6,27 @@ import javafx.scene.Scene;
import javafx.stage.Stage; import javafx.stage.Stage;
import java.io.IOException; import java.io.IOException;
import java.util.Objects;
public class ApplicationMissileCruiser extends Application { public class ApplicationMissileCruiser extends Application
{
@Override @Override
public void start(Stage stage) throws IOException { public void start(Stage stage) throws IOException
FXMLLoader fxmlLoader = new FXMLLoader(ApplicationMissileCruiser.class.getResource("ViewMissileCruiser.fxml")); {
Scene scene = new Scene(fxmlLoader.load(), 320, 240); FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("ViewMissileCruiser.fxml"));
stage.setTitle("Hello!"); Scene scene = new Scene(fxmlLoader.load(), 900, 500);
String stylesheet = Objects.requireNonNull(getClass().getResource("StylesMissileCruiser.css")).toExternalForm();
scene.getStylesheets().add(stylesheet);
stage.setResizable(false);
stage.setTitle("Ракетный крейсер");
stage.setScene(scene); stage.setScene(scene);
stage.show(); stage.show();
} }
public static void main(String[] args) { public static void run(String[] args) {
launch(); launch(args);
} }
} }

View File

@ -1,14 +1,74 @@
package kvr.missilecruiser_hard; package kvr.missilecruiser_hard;
import javafx.event.ActionEvent;
import javafx.fxml.FXML; import javafx.fxml.FXML;
import javafx.scene.control.Label; import javafx.scene.control.Button;
import javafx.scene.control.Spinner;
import javafx.scene.control.SpinnerValueFactory.IntegerSpinnerValueFactory;
import javafx.scene.paint.Color;
import javafx.scene.canvas.Canvas;
import javafx.scene.canvas.GraphicsContext;
public class ControllerMissileCruiser { import java.util.Random;
@FXML
private Label welcomeText; public class ControllerMissileCruiser
{
private DrawingMissileCruiser drawingMissileCruiser;
private GraphicsContext graphicsContext;
private Random random;
@FXML @FXML
protected void onHelloButtonClick() { private Canvas mainCanvas;
welcomeText.setText("Welcome to JavaFX Application!");
@FXML
private Spinner<Integer> spinnerVlsSelector;
@FXML
private void initialize() {
drawingMissileCruiser = new DrawingMissileCruiser();
graphicsContext = mainCanvas.getGraphicsContext2D();
graphicsContext.setImageSmoothing(false);
spinnerVlsSelector.setValueFactory(new IntegerSpinnerValueFactory(2, 6, 2, 2));
random = new Random();
}
private void DrawOnCanvas(){
drawingMissileCruiser.DrawTransport(graphicsContext);
}
@FXML
protected void buttonCreate_Click() {
drawingMissileCruiser.Init(
random.nextInt(100, 300), random.nextInt(1000, 3000),
Color.rgb(random.nextInt(0, 256), random.nextInt(0, 256), random.nextInt(0, 256)),
Color.rgb(random.nextInt(0, 256), random.nextInt(0, 256), random.nextInt(0, 256)),
random.nextBoolean(), random.nextBoolean()
);
drawingMissileCruiser.getDrawingVLS().setVlsBlockCount(spinnerVlsSelector.getValue());
drawingMissileCruiser.SetPictureSize((int) mainCanvas.getWidth(), (int) mainCanvas.getHeight());
drawingMissileCruiser.SetPosition(random.nextInt(10, 100), random.nextInt(10, 100));
DrawOnCanvas();
}
@FXML
protected void buttonsMove_Click(ActionEvent event) {
String name = ((Button) event.getSource()).getId();
boolean result = switch (name) {
case "buttonUp" -> drawingMissileCruiser.MoveTransport(DirectionType.Up);
case "buttonDown" -> drawingMissileCruiser.MoveTransport(DirectionType.Down);
case "buttonLeft" -> drawingMissileCruiser.MoveTransport(DirectionType.Left);
case "buttonRight" -> drawingMissileCruiser.MoveTransport(DirectionType.Right);
default -> false;
};
if (result)
{
DrawOnCanvas();
}
} }
} }

View File

@ -0,0 +1,8 @@
package kvr.missilecruiser_hard;
public enum DirectionType {
Up,
Down,
Left,
Right
}

View File

@ -0,0 +1,183 @@
package kvr.missilecruiser_hard;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.image.Image;
import javafx.scene.paint.Color;
import java.util.Objects;
public class DrawingMissileCruiser {
private EntityMissileCruiser entityMissileCruiser;
private DrawingVLS drawingVLS;
public EntityMissileCruiser getEntityMissileCruiser(){
return entityMissileCruiser;
}
public DrawingVLS getDrawingVLS() {
return drawingVLS;
}
private int pictureWidth;
private int pictureHeight;
private int posX;
private int posY;
private final int entityWidth = 150;
private final int entityHeight = 35;
/**
* Инициализирует класс отрисовки и сущности
* @param speed Скорость
* @param weight Вес крейсера
* @param primaryColor Основной цвет
* @param secondaryColor Дополнительный цвет
* @param vls Признак наличия установок вертикального пуска
* @param helipad Признак наличия вертолётной площадки
*/
public void Init(int speed, int weight, Color primaryColor, Color secondaryColor, boolean vls, boolean helipad)
{
entityMissileCruiser = new EntityMissileCruiser();
drawingVLS = new DrawingVLS();
entityMissileCruiser.Init(speed, weight, primaryColor, secondaryColor, vls, helipad);
pictureWidth = 0;
pictureHeight = 0;
posX = 0;
posY = 0;
}
/**
* Установка границ поля где будет находится объект.
* Если объект находится за пределами поля, то он будет отодвинут внутрь нового поля.
* @param width Ширина поля
* @param height Высота поля
* @return true - границы заданы, false - проверка не пройдена, нельзя разместить объект в этих размерах
*/
public boolean SetPictureSize(int width, int height)
{
if (entityMissileCruiser == null || width <= 0 || height <= 0)
{
return false;
}
if (entityWidth < width && entityHeight < height)
{
pictureWidth = width;
pictureHeight = height;
posX = Math.clamp(posX, 0, pictureWidth - entityWidth);
posY = Math.clamp(posY, 0, pictureHeight - entityHeight);
return true;
}
else
{
return false;
}
}
/**
* Установка позиции объекта
* @param x Координата X
* @param y Координата Y
*/
public void SetPosition(int x, int y)
{
if (pictureWidth == 0 || pictureHeight == 0)
{
return;
}
posX = Math.clamp(x, 0, pictureWidth - entityWidth);
posY = Math.clamp(y, 0, pictureHeight - entityHeight);
}
/**
* Перемещение объекта в заданную сторону
* @param direction Направление
* @return true - перемещене выполнено, false - перемещение невозможно
*/
public boolean MoveTransport(DirectionType direction)
{
if (entityMissileCruiser == null || pictureWidth <= 0 || pictureHeight <= 0)
{
return false;
}
int step = entityMissileCruiser.getStep();
switch (direction)
{
case DirectionType.Left:
if (posX - step >= 0)
{
posX -= step;
}
return true;
case DirectionType.Up:
if (posY - step >= 0)
{
posY -= step;
}
return true;
case DirectionType.Right:
if (posX + step < pictureWidth - entityWidth)
{
posX += step;
}
return true;
case DirectionType.Down:
if (posY + step < pictureHeight - entityHeight)
{
posY += step;
}
return true;
default:
return false;
}
}
private static final Image cruiserContourImg = new Image(
Objects.requireNonNull(DrawingMissileCruiser.class.getResource("images/cruiser_contour.png")).toExternalForm()
);
private static final Image helipadImg = new Image(
Objects.requireNonNull(DrawingMissileCruiser.class.getResource("images/cruiser_helipad.png")).toExternalForm()
);
/**
* Прорисовка объекта
* @param gc Объект GDI+
*/
public void DrawTransport(GraphicsContext gc)
{
if (entityMissileCruiser == null)
{
return;
}
// FUCK JavaFX, I had to use SUBPIXEL offsets to not see artifacts of antialiasing, which you can't disable!
double[] contourPolygonX = new double[] {
posX + 10.75, posX + 116.25, posX + 150, posX + 116.25, posX + 10.75, posX + 0.5, posX + 0.5
};
double[] contourPolygonY = new double[] {
posY + 0.5, posY + 0.5, posY + 17.5, posY + 34.5, posY + 34.5, posY + 29.5, posY + 5.5
};
gc.clearRect(0, 0, pictureWidth, pictureHeight);
gc.setFill(entityMissileCruiser.getPrimaryColor());
gc.fillPolygon(contourPolygonX, contourPolygonY, contourPolygonX.length);
if (entityMissileCruiser.getVLS())
{
drawingVLS.drawVLS(gc, posX, posY, entityMissileCruiser.getSecondaryColor());
}
if (entityMissileCruiser.getHelipad())
{
gc.setFill(entityMissileCruiser.getSecondaryColor());
gc.fillOval(posX + 2.5, posY + 9.5, 16, 16);
gc.drawImage(helipadImg, posX, posY, entityWidth, entityHeight);
}
gc.drawImage(cruiserContourImg, posX, posY, entityWidth, entityHeight);
}
}

View File

@ -0,0 +1,55 @@
package kvr.missilecruiser_hard;
import javafx.scene.canvas.GraphicsContext;
import javafx.scene.image.Image;
import javafx.scene.paint.Color;
import java.util.Objects;
public class DrawingVLS {
private VlsBlockCount vlsBlockCount;
public VlsBlockCount getVlsBlockCount() {
return vlsBlockCount;
}
public void setVlsBlockCount(int vlsBlockCount) {
if (vlsBlockCount > 4) {
this.vlsBlockCount = VlsBlockCount.six;
} else if (vlsBlockCount > 2) {
this.vlsBlockCount = VlsBlockCount.four;
} else {
this.vlsBlockCount = VlsBlockCount.two;
}
}
private static final Image doubleVlsImage = new Image(
Objects.requireNonNull(DrawingVLS.class.getResource("images/doubleVLS.png")).toExternalForm()
);
public void drawVLS(GraphicsContext gc, double x, double y, Color secondaryColor) {
gc.setFill(secondaryColor);
switch (vlsBlockCount) {
case VlsBlockCount.six:
gc.fillRect(x + 43, y + 14, 12, 6);
gc.fillRect(x + 57, y + 14, 12, 6);
gc.drawImage(doubleVlsImage, x, y + 9);
// lack of "break;" is intentional
case VlsBlockCount.four:
gc.fillRect(x + 43, y + 5, 12, 6);
gc.fillRect(x + 57, y + 5, 12, 6);
gc.fillRect(x + 43, y + 23, 12, 6);
gc.fillRect(x + 57, y + 23, 12, 6);
gc.drawImage(doubleVlsImage, x, y);
gc.drawImage(doubleVlsImage, x, y + 18);
break;
case VlsBlockCount.two:
gc.fillRect(x + 43, y + 14, 12, 6);
gc.fillRect(x + 57, y + 14, 12, 6);
gc.drawImage(doubleVlsImage, x, y + 9);
break;
}
}
}

View File

@ -0,0 +1,72 @@
package kvr.missilecruiser_hard;
import javafx.scene.paint.Color;
public class EntityMissileCruiser {
/// Скорость
private int speed;
public int getSpeed(){
return speed;
}
/// Вес
private double weight;
public double getWeight(){
return weight;
}
/// Основной цвет
private Color primaryColor;
public Color getPrimaryColor(){
return primaryColor;
}
/// Дополнительный цвет (для опциональных элементов)
private Color secondaryColor;
public Color getSecondaryColor(){
return secondaryColor;
}
/// Установки вертикального пуска
private boolean vls;
public boolean getVLS(){
return vls;
}
/// Вертолётная площадка
private boolean helipad;
public boolean getHelipad(){
return helipad;
}
/// Шаг перемещения
public int getStep() {
return (int)(speed * 100 / weight);
}
/**
* Инициализация полей объекта-класса ракетного крейсера
* @param speed Скорость
* @param weight Вес крейсера
* @param primaryColor Основной цвет
* @param secondaryColor Дополнительный цвет
* @param vls Признак наличия установок вертикального пуска
* @param helipad Признак наличия вертолётной площадки
*/
public void Init(int speed, int weight, Color primaryColor, Color secondaryColor, boolean vls, boolean helipad)
{
this.speed = speed;
this.weight = weight;
this.primaryColor = primaryColor;
this.secondaryColor = secondaryColor;
this.vls = vls;
this.helipad = helipad;
}
}

View File

@ -0,0 +1,13 @@
package kvr.missilecruiser_hard;
public class Main
{
public static void main(String[] args)
{
if (args.length > 0 && args[0].equals("-disable_hidpi")) {
System.setProperty("prism.allowhidpi", "false");
}
ApplicationMissileCruiser.run(args);
}
}

View File

@ -0,0 +1,7 @@
package kvr.missilecruiser_hard;
public enum VlsBlockCount {
two,
four,
six
}

View File

@ -0,0 +1,36 @@
#buttonLeft
{
-fx-background-image: url("images/arrowLeft.png");
-fx-background-size: 85%;
-fx-background-position: center;
-fx-background-repeat: space;
}
#buttonUp
{
-fx-background-image: url("images/arrowUp.png");
-fx-background-size: 85%;
-fx-background-position: center;
-fx-background-repeat: space;
}
#buttonDown
{
-fx-background-image: url("images/arrowDown.png");
-fx-background-size: 85%;
-fx-background-position: center;
-fx-background-repeat: space;
}
#buttonRight
{
-fx-background-image: url("images/arrowRight.png");
-fx-background-size: 85%;
-fx-background-position: center;
-fx-background-repeat: space;
}
#spinnerVlsSelector .text-field {
-fx-font-size: 15px;
-fx-alignment: center;
}

View File

@ -1,16 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<?import javafx.geometry.Insets?> <?import javafx.scene.canvas.Canvas?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.layout.VBox?>
<?import javafx.scene.control.Button?> <?import javafx.scene.control.Button?>
<VBox alignment="CENTER" spacing="20.0" xmlns:fx="http://javafx.com/fxml" <?import javafx.scene.control.Label?>
fx:controller="kvr.missilecruiser_hard.ControllerMissileCruiser"> <?import javafx.scene.control.Spinner?>
<padding> <?import javafx.scene.layout.AnchorPane?>
<Insets bottom="20.0" left="20.0" right="20.0" top="20.0"/> <?import javafx.scene.text.Font?>
</padding>
<Label fx:id="welcomeText"/> <AnchorPane maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="500.0" minWidth="900.0" xmlns="http://javafx.com/javafx/null" xmlns:fx="http://javafx.com/fxml/1" fx:controller="kvr.missilecruiser_hard.ControllerMissileCruiser">
<Button text="Hello!" onAction="#onHelloButtonClick"/> <Canvas fx:id="mainCanvas" height="500.0" width="900.0" />
</VBox> <Button id="buttonCreate" layoutX="14.0" layoutY="455.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="32.0" minWidth="90.0" mnemonicParsing="false" onAction="#buttonCreate_Click" text="Создать" textAlignment="CENTER" AnchorPane.bottomAnchor="14.0" AnchorPane.leftAnchor="14.0">
<font>
<Font size="15.0" />
</font>
</Button>
<Button id="buttonRight" layoutX="846.0" layoutY="446.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="40.0" minWidth="40.0" mnemonicParsing="false" onAction="#buttonsMove_Click" AnchorPane.bottomAnchor="14.0" AnchorPane.rightAnchor="14.0" />
<Button id="buttonDown" layoutX="800.0" layoutY="446.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="40.0" minWidth="40.0" mnemonicParsing="false" onAction="#buttonsMove_Click" AnchorPane.bottomAnchor="14.0" AnchorPane.rightAnchor="60.0" />
<Button id="buttonLeft" layoutX="754.0" layoutY="446.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="40.0" minWidth="40.0" mnemonicParsing="false" onAction="#buttonsMove_Click" AnchorPane.bottomAnchor="14.0" AnchorPane.rightAnchor="106.0" />
<Button id="buttonUp" layoutX="800.0" layoutY="399.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" minHeight="40.0" minWidth="40.0" mnemonicParsing="false" onAction="#buttonsMove_Click" AnchorPane.bottomAnchor="60.0" AnchorPane.rightAnchor="60.0" />
<Spinner fx:id="spinnerVlsSelector" layoutX="112.0" layoutY="454.0" maxHeight="1.7976931348623157E308" maxWidth="1.7976931348623157E308" prefHeight="32.0" prefWidth="56.0" AnchorPane.bottomAnchor="14.0" AnchorPane.leftAnchor="112.0" />
<Label layoutX="175.0" layoutY="459.0" text="VLS Count" AnchorPane.bottomAnchor="19.2" AnchorPane.leftAnchor="175.0">
<font>
<Font size="15.0" />
</font>
</Label>
</AnchorPane>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 647 B