LabWork5 PIbd-21 Zacharchenko #5
@ -0,0 +1,187 @@
|
||||
package com.example.doubledeckerbus;
|
||||
|
||||
import javafx.event.ActionEvent;
|
||||
import javafx.fxml.FXML;
|
||||
import javafx.scene.canvas.Canvas;
|
||||
import javafx.scene.canvas.GraphicsContext;
|
||||
import javafx.scene.control.Button;
|
||||
import javafx.scene.control.CheckBox;
|
||||
import javafx.scene.control.Label;
|
||||
import javafx.scene.control.Spinner;
|
||||
import javafx.scene.input.*;
|
||||
import javafx.scene.layout.Background;
|
||||
import javafx.scene.layout.Region;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.scene.paint.Paint;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class ControllerBusConfig {
|
||||
DataFormat colorFormat = DataFormat.lookupMimeType("SerializableColor");
|
||||
DataFormat additionalElementFormat = DataFormat.lookupMimeType("IDrawningAdditionalElement");
|
||||
private Stage _stage;
|
||||
private DrawingBus _bus = null;
|
||||
|
||||
private Event<DrawingBus> addBus;
|
||||
|
||||
public void SetStage(Stage stage)
|
||||
{
|
||||
_stage = stage;
|
||||
}
|
||||
|
||||
public void AddEvent(Consumer<DrawingBus> ev)
|
||||
{
|
||||
addBus.AddListener(ev);
|
||||
}
|
||||
|
||||
private void DrawBus()
|
||||
{
|
||||
GraphicsContext gc = canvasObject.getGraphicsContext2D();
|
||||
gc.clearRect(0, 0, canvasObject.getWidth(), canvasObject.getHeight());
|
||||
if (_bus == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
_bus.SetPosition(5, 5, (int)canvasObject.getWidth(), (int)canvasObject.getHeight());
|
||||
_bus.DrawTransport(gc);
|
||||
}
|
||||
|
||||
@FXML
|
||||
private Canvas canvasObject;
|
||||
|
||||
@FXML
|
||||
private CheckBox checkBoxSecondStage;
|
||||
|
||||
@FXML
|
||||
private CheckBox checkBoxLadder;
|
||||
|
||||
@FXML
|
||||
private Spinner<Integer> spinnerSpeed = new Spinner<>();
|
||||
|
||||
@FXML
|
||||
private Spinner<Integer> spinnerDoors = new Spinner<>();
|
||||
|
||||
@FXML
|
||||
private Spinner<Integer> spinnerWeight = new Spinner<>();
|
||||
|
||||
@FXML
|
||||
public void initialize()
|
||||
{
|
||||
if (colorFormat == null)
|
||||
{
|
||||
colorFormat = new DataFormat("SerializableColor");
|
||||
}
|
||||
if (additionalElementFormat == null)
|
||||
{
|
||||
additionalElementFormat = new DataFormat("IDrawningAdditionalElement");
|
||||
}
|
||||
addBus = new Event<>();
|
||||
}
|
||||
|
||||
@FXML
|
||||
void ButtonOk_Click(ActionEvent event) {
|
||||
if (_bus != null)
|
||||
{
|
||||
addBus.Broadcast(_bus);
|
||||
}
|
||||
if (_stage != null)
|
||||
{
|
||||
_stage.close();
|
||||
}
|
||||
}
|
||||
|
||||
@FXML
|
||||
void CanvasObject_OnDragDropped(DragEvent event) {
|
||||
Dragboard db = event.getDragboard();
|
||||
switch (db.getString())
|
||||
{
|
||||
case "labelSimpleObject" -> _bus = new DrawingBus(spinnerSpeed.getValue(),
|
||||
spinnerWeight.getValue(), Color.WHITE, spinnerDoors.getValue());
|
||||
case "labelModifiedObject" -> _bus = new DrawingDDB(spinnerSpeed.getValue(),
|
||||
spinnerWeight.getValue(), Color.WHITE, spinnerDoors.getValue(), Color.BLACK,
|
||||
checkBoxSecondStage.isSelected(), checkBoxLadder.isSelected());
|
||||
case "labelTriangle" -> _bus.ChangeDoor(new DrawingTriangleDoors());
|
||||
case "labelOval" -> _bus.ChangeDoor(new DrawingEllipsoidDoors());
|
||||
case "labelRect" -> _bus.ChangeDoor(new DrawingDoors());
|
||||
}
|
||||
DrawBus();
|
||||
event.consume();
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
void CanvasObject_OnDragOver(DragEvent event) {
|
||||
if (event.getDragboard().hasString())
|
||||
{
|
||||
event.acceptTransferModes(TransferMode.COPY_OR_MOVE);
|
||||
}
|
||||
event.consume();
|
||||
}
|
||||
|
||||
@FXML
|
||||
void LabelBaseColor_OnDragDropped(DragEvent event) {
|
||||
if (_bus == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Dragboard db = event.getDragboard();
|
||||
|
||||
_bus.Bus.BodyColor = ((SerializableColor)(db.getContent(colorFormat))).getFXColor();
|
||||
event.consume();
|
||||
DrawBus();
|
||||
}
|
||||
|
||||
@FXML
|
||||
void LabelColor_OnDragOver(DragEvent event) {
|
||||
if (event.getDragboard().hasContent(colorFormat))
|
||||
{
|
||||
event.acceptTransferModes(TransferMode.COPY_OR_MOVE);
|
||||
}
|
||||
event.consume();
|
||||
}
|
||||
|
||||
@FXML
|
||||
void LabelDopColor_OnDragDropped(DragEvent event) {
|
||||
if (_bus == null || !(_bus.Bus instanceof EntityDDB ddb))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Dragboard db = event.getDragboard();
|
||||
|
||||
ddb.ExtraColor = ((SerializableColor)(db.getContent(colorFormat))).getFXColor();
|
||||
event.consume();
|
||||
DrawBus();
|
||||
}
|
||||
|
||||
@FXML
|
||||
void LabelObject_OnDragDetected(MouseEvent event) {
|
||||
Label labelObject = (Label)(event.getSource());
|
||||
Dragboard db = labelObject.startDragAndDrop(TransferMode.ANY);
|
||||
|
||||
ClipboardContent content = new ClipboardContent();
|
||||
content.putString(((Label)(event.getSource())).getId());
|
||||
db.setContent(content);
|
||||
|
||||
event.consume();
|
||||
}
|
||||
|
||||
@FXML
|
||||
void RegionColor_OnDragDetected(MouseEvent event) {
|
||||
Region region = (Region)(event.getSource());
|
||||
Dragboard db = region.startDragAndDrop(TransferMode.ANY);
|
||||
|
||||
Background regionBackground = region.getBackground();
|
||||
Paint regionPaint = regionBackground.getFills().get(0).getFill();
|
||||
if (regionPaint instanceof Color)
|
||||
{
|
||||
ClipboardContent content = new ClipboardContent();
|
||||
content.put(colorFormat, new SerializableColor((Color)regionPaint));
|
||||
db.setContent(content);
|
||||
}
|
||||
event.consume();
|
||||
}
|
||||
|
||||
}
|
@ -1,6 +1,4 @@
|
||||
package com.example.doubledeckerbus;
|
||||
import javafx.beans.value.ChangeListener;
|
||||
import javafx.beans.value.ObservableValue;
|
||||
import javafx.collections.FXCollections;
|
||||
import javafx.collections.ObservableList;
|
||||
import javafx.event.ActionEvent;
|
||||
@ -12,6 +10,7 @@ import javafx.scene.canvas.GraphicsContext;
|
||||
import javafx.scene.control.*;
|
||||
import javafx.scene.layout.AnchorPane;
|
||||
import javafx.scene.paint.Color;
|
||||
import javafx.stage.Stage;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
@ -21,7 +20,7 @@ import java.util.Optional;
|
||||
|
||||
public class ControllerMapWithSetBus {
|
||||
static MapWithSetBusesGeneric<DrawingObjectBus, AbstractMap> _mapBusesCollectionGeneric;
|
||||
private HashMap<String, AbstractMap> _mapsDict = new HashMap<>();
|
||||
private final HashMap<String, AbstractMap> _mapsDict = new HashMap<>();
|
||||
{
|
||||
_mapsDict.put("Простая карта", new SimpleMap());
|
||||
_mapsDict.put("Водная карта", new WaterMap());
|
||||
@ -38,30 +37,6 @@ public class ControllerMapWithSetBus {
|
||||
static String map_name = "Простая карта";
|
||||
protected ObservableList<String> countOfMap = FXCollections.observableArrayList("Простая карта", "Водная карта");
|
||||
|
||||
@FXML
|
||||
private Button buttonAddBus;
|
||||
|
||||
@FXML
|
||||
private Button buttonDown;
|
||||
|
||||
@FXML
|
||||
private Button buttonLeft;
|
||||
|
||||
@FXML
|
||||
private Button buttonRemoveCar;
|
||||
|
||||
@FXML
|
||||
private Button buttonRight;
|
||||
|
||||
@FXML
|
||||
private Button buttonShowMap;
|
||||
|
||||
@FXML
|
||||
private Button buttonShowStorage;
|
||||
|
||||
@FXML
|
||||
private Button buttonUp;
|
||||
|
||||
@FXML
|
||||
private Canvas canvasBus;
|
||||
|
||||
@ -84,26 +59,23 @@ public class ControllerMapWithSetBus {
|
||||
private void initialize(){
|
||||
gc = canvasBus.getGraphicsContext2D();
|
||||
if (selected != null) {
|
||||
showStorage();
|
||||
ShowStorage();
|
||||
}
|
||||
if (_mapsCollection == null)
|
||||
_mapsCollection = new MapsCollection((int) canvasBus.getWidth(), (int) canvasBus.getHeight());
|
||||
comboBoxSelectorMap.setItems(countOfMap);
|
||||
comboBoxSelectorMap.setValue(map_name);
|
||||
listViewMaps.getSelectionModel().selectedItemProperty()
|
||||
.addListener(new ChangeListener<String>() {
|
||||
@Override
|
||||
public void changed(ObservableValue<? extends String> observableValue, String s, String t1) {
|
||||
selected = t1;
|
||||
showStorage();
|
||||
}
|
||||
.addListener((observableValue, s, t1) -> {
|
||||
selected = t1;
|
||||
ShowStorage();
|
||||
});
|
||||
listViewMaps.setItems(_mapsCollection.toObserveList());
|
||||
}
|
||||
|
||||
GraphicsContext gc;
|
||||
private void FirstIncome() {
|
||||
if (comboBoxSelectorMap.getValue() != map_name) {
|
||||
if (!Objects.equals(comboBoxSelectorMap.getValue(), map_name)) {
|
||||
map_name = comboBoxSelectorMap.getValue();
|
||||
switch (map_name) {
|
||||
case "Простая карта" -> map = new SimpleMap();
|
||||
@ -118,17 +90,14 @@ public class ControllerMapWithSetBus {
|
||||
|
||||
ObservableList<String> listMaps = FXCollections.observableArrayList();
|
||||
|
||||
for (int i = 0; i < _mapsCollection.Keys().size(); i++)
|
||||
{
|
||||
listMaps.add(_mapsCollection.Keys().get(i));
|
||||
}
|
||||
listMaps.addAll(_mapsCollection.Keys());
|
||||
listViewMaps.setItems(listMaps);
|
||||
|
||||
if (listMaps.size() > 0 && (index == -1 || index >= listMaps.size()))
|
||||
{
|
||||
listViewMaps.getSelectionModel().select(0);
|
||||
}
|
||||
else if (listMaps.size() > 0 && index > -1 && index < listMaps.size())
|
||||
else if (listMaps.size() > 0 && index > -1)
|
||||
{
|
||||
listViewMaps.getSelectionModel().select(index);
|
||||
}
|
||||
@ -136,14 +105,47 @@ public class ControllerMapWithSetBus {
|
||||
|
||||
@FXML
|
||||
private void ButtonAddBus_Click(ActionEvent event) throws IOException {
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(Form.class.getResource("FormBus.fxml"));
|
||||
Scene scene = new Scene(fxmlLoader.load());
|
||||
Form.myStage.setTitle("DoubleDeckerBus");
|
||||
Form.myStage.setScene(scene);
|
||||
Form.myStage.show();
|
||||
if (listViewMaps.getSelectionModel().selectedItemProperty().isNull().get())
|
||||
{
|
||||
return;
|
||||
}
|
||||
Stage stageBus = new Stage();
|
||||
FXMLLoader fxmlLoader = new FXMLLoader(Form.class.getResource("FormBusConfig.fxml"));
|
||||
Scene sceneBus = new Scene(fxmlLoader.load());
|
||||
|
||||
stageBus.setScene(sceneBus);
|
||||
stageBus.show();
|
||||
|
||||
ControllerBusConfig controller = fxmlLoader.getController();
|
||||
controller.AddEvent(this::AddBus);
|
||||
controller.SetStage(stageBus);
|
||||
|
||||
FirstIncome();
|
||||
}
|
||||
|
||||
private void AddBus(DrawingBus bus) {
|
||||
if (listViewMaps.getSelectionModel().selectedItemProperty().isNull().get())
|
||||
{
|
||||
return;
|
||||
}
|
||||
DrawingObjectBus objectBus = new DrawingObjectBus(bus);
|
||||
String selectedMapName = listViewMaps.getSelectionModel().getSelectedItem();
|
||||
|
||||
Alert alert;
|
||||
if (selectedMapName != null && selectedMapName.length() != 0 && _mapsCollection.get(selectedMapName).add(objectBus) != -1)
|
||||
{
|
||||
alert = new Alert(Alert.AlertType.INFORMATION, "Объект добавлен", ButtonType.OK);
|
||||
_mapsCollection.get(selectedMapName).ShowSet(gc);
|
||||
ShowStorage();
|
||||
}
|
||||
else
|
||||
{
|
||||
alert = new Alert(Alert.AlertType.ERROR, "Не удалось добавить объект", ButtonType.OK);
|
||||
}
|
||||
alert.showAndWait();
|
||||
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void ButtonAddMap_Click(ActionEvent event)
|
||||
{
|
||||
@ -165,7 +167,7 @@ public class ControllerMapWithSetBus {
|
||||
}
|
||||
_mapsCollection.AddMap(TextFieldMap.getText(), _mapsDict.get(comboBoxSelectorMap.getValue()));
|
||||
ReloadMaps();
|
||||
showStorage();
|
||||
ShowStorage();
|
||||
}
|
||||
@FXML
|
||||
private void ButtonDeleteMap_Click(ActionEvent event)
|
||||
@ -176,7 +178,7 @@ public class ControllerMapWithSetBus {
|
||||
}
|
||||
_mapsCollection.DelMap(listViewMaps.getSelectionModel().getSelectedItem());
|
||||
ReloadMaps();
|
||||
showStorage();
|
||||
ShowStorage();
|
||||
}
|
||||
|
||||
@FXML
|
||||
@ -236,19 +238,23 @@ public class ControllerMapWithSetBus {
|
||||
alert.setContentText("Не удалось удалить объект");
|
||||
option = alert.showAndWait();
|
||||
}
|
||||
showStorage();
|
||||
ShowStorage();
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void ButtonShowStorage_Click(ActionEvent event)
|
||||
{
|
||||
FirstIncome();
|
||||
showStorage();
|
||||
ShowStorage();
|
||||
}
|
||||
|
||||
@FXML
|
||||
private void ButtonShowOnMap_Click(ActionEvent event) {
|
||||
FirstIncome();
|
||||
ShowMap();
|
||||
}
|
||||
|
||||
private void ShowMap() {
|
||||
if (selected == null) {
|
||||
return;
|
||||
}
|
||||
@ -276,13 +282,13 @@ public class ControllerMapWithSetBus {
|
||||
_mapsCollection.GetId(selected).MoveObject(dir);
|
||||
}
|
||||
|
||||
private void showStorage() {
|
||||
private void ShowStorage() {
|
||||
if (selected == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
gc.setFill(Color.WHITE);
|
||||
gc.fillRect(0, 0, pictureBoxBus.getWidth(), pictureBoxBus.getHeight());
|
||||
gc.clearRect(0, 0, canvasBus.getWidth(), canvasBus.getHeight());
|
||||
_mapsCollection.GetId(selected).ShowSet(gc);
|
||||
}
|
||||
|
||||
|
@ -9,10 +9,10 @@ public class DrawingBus {
|
||||
public EntityBus Bus;
|
||||
|
||||
public IDrawingDoors Doors;
|
||||
|
||||
public EntityBus getBus() {
|
||||
return Bus;
|
||||
}
|
||||
int _speed;
|
||||
float _weight;
|
||||
Color _bodyColor;
|
||||
int _countOfDoors = 3;
|
||||
|
||||
private static final int _null = -1000;
|
||||
protected float _startPosX;
|
||||
@ -23,15 +23,31 @@ public class DrawingBus {
|
||||
private static final int _busHeight = 50;
|
||||
|
||||
public DrawingBus(int speed, float weight, Color bodyColor, int countOfDoors) {
|
||||
Bus = new EntityBus(speed, weight, bodyColor);
|
||||
Bus = CreateBus(speed, weight, bodyColor, countOfDoors);
|
||||
}
|
||||
|
||||
private EntityBus CreateBus(int speed, float weight, Color bodyColor, int countOfDoors) {
|
||||
_speed = speed;
|
||||
_weight = weight;
|
||||
_bodyColor = bodyColor;
|
||||
_countOfDoors = countOfDoors;
|
||||
EntityBus bus = new EntityBus(speed, weight, bodyColor);
|
||||
switch (new Random().nextInt(3)) {
|
||||
case 0 -> Doors = new DrawingTriangleDoors();
|
||||
case 1 -> Doors = new DrawingDoors();
|
||||
case 2 -> Doors = new DrawingEllipsoidDoors();
|
||||
}
|
||||
Doors.setCountOfDoors(countOfDoors);
|
||||
return bus;
|
||||
}
|
||||
|
||||
|
||||
public void ChangeDoor(IDrawingDoors door) {
|
||||
Doors = door;
|
||||
Doors.setCountOfDoors(_countOfDoors);
|
||||
}
|
||||
|
||||
|
||||
public DrawingBus(int speed, float weight, Color bodyColor) {
|
||||
Bus = new EntityBus(speed, weight, bodyColor);
|
||||
}
|
||||
|
@ -4,9 +4,26 @@ import javafx.scene.canvas.GraphicsContext;
|
||||
import javafx.scene.paint.Color;
|
||||
|
||||
public class DrawingDDB extends DrawingBus{
|
||||
public DrawingDDB(int speed, float weight, Color bodyColor, int countOfDoors, Color extraColor, boolean ladder, boolean secondStage) {
|
||||
Color _extraColor;
|
||||
boolean _ladder;
|
||||
boolean _secondStage;
|
||||
|
||||
public DrawingDDB(int speed, float weight, Color bodyColor, int countOfDoors,
|
||||
Color extraColor, boolean ladder, boolean secondStage) {
|
||||
super(speed, weight, bodyColor, countOfDoors);
|
||||
Bus = new EntityDDB(speed, weight, bodyColor, extraColor, ladder, secondStage);
|
||||
Bus = CreateDDB(speed, weight, bodyColor, countOfDoors, extraColor, ladder, secondStage);
|
||||
}
|
||||
|
||||
private EntityDDB CreateDDB(int speed, float weight, Color bodyColor, int countOfDoors,
|
||||
Color extraColor, boolean ladder, boolean secondStage) {
|
||||
_speed = speed;
|
||||
_weight = weight;
|
||||
_bodyColor = bodyColor;
|
||||
_countOfDoors = countOfDoors;
|
||||
_extraColor = extraColor;
|
||||
_ladder = ladder;
|
||||
_secondStage = secondStage;
|
||||
return new EntityDDB(speed, weight, bodyColor, extraColor, ladder, secondStage);
|
||||
}
|
||||
|
||||
public DrawingDDB(int speed, float weight, Color bodyColor, Color extraColor, boolean ladder, boolean secondStage) {
|
||||
|
@ -0,0 +1,17 @@
|
||||
package com.example.doubledeckerbus;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class Event<T> {
|
||||
private final Set<Consumer<T>> listeners = new HashSet<>();
|
||||
|
||||
public void AddListener(Consumer<T> listener) {
|
||||
listeners.add(listener);
|
||||
}
|
||||
|
||||
public void Broadcast(T args) {
|
||||
listeners.forEach(x -> x.accept(args));
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.example.doubledeckerbus;
|
||||
|
||||
import java.io.Serializable;
|
||||
import javafx.scene.paint.Color;
|
||||
|
||||
public class SerializableColor implements Serializable
|
||||
{
|
||||
private final double red;
|
||||
private final double green;
|
||||
private final double blue;
|
||||
private final double alpha;
|
||||
|
||||
public SerializableColor(Color color)
|
||||
{
|
||||
red = color.getRed();
|
||||
green = color.getGreen();
|
||||
blue = color.getBlue();
|
||||
alpha = color.getOpacity();
|
||||
}
|
||||
|
||||
public Color getFXColor()
|
||||
{
|
||||
return new Color(red, green, blue, alpha);
|
||||
}
|
||||
}
|
||||
|
@ -55,6 +55,7 @@ class SetBusesGeneric<T> {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
public int Count() {
|
||||
return _places.size();
|
||||
}
|
||||
|
@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<?import javafx.scene.canvas.Canvas?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<?import javafx.scene.control.CheckBox?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.control.Spinner?>
|
||||
<?import javafx.scene.control.SpinnerValueFactory.IntegerSpinnerValueFactory?>
|
||||
<?import javafx.scene.layout.Pane?>
|
||||
<?import javafx.scene.layout.Region?>
|
||||
<?import javafx.scene.layout.StackPane?>
|
||||
|
||||
<Pane fx:id="root" prefHeight="395.0" prefWidth="642.0" xmlns="http://javafx.com/javafx/18" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.example.doubledeckerbus.ControllerBusConfig">
|
||||
<Pane layoutX="5.0" layoutY="5.0" prefHeight="379.0" prefWidth="307">
|
||||
<Label layoutX="18.0" layoutY="18.0" text="Скорость">
|
||||
Speed:
|
||||
</Label>
|
||||
<Label layoutX="181.0" layoutY="18.0" text="Вес:">
|
||||
Weight:
|
||||
</Label>
|
||||
<Spinner fx:id="spinnerSpeed" layoutX="90.0" layoutY="14.0" prefWidth="70">
|
||||
<valueFactory>
|
||||
<SpinnerValueFactory.IntegerSpinnerValueFactory initialValue="100" max="300" min="100" />
|
||||
</valueFactory>
|
||||
</Spinner>
|
||||
<Spinner fx:id="spinnerWeight" layoutX="222.0" layoutY="14.0" prefWidth="70">
|
||||
<valueFactory>
|
||||
<SpinnerValueFactory.IntegerSpinnerValueFactory initialValue="100" max="2000" min="1000" />
|
||||
</valueFactory>
|
||||
</Spinner>
|
||||
<Pane layoutX="12.0" layoutY="131.0" prefHeight="126.0" prefWidth="280.0">
|
||||
<Region layoutX="25.0" layoutY="9.0" onDragDetected="#RegionColor_OnDragDetected" prefHeight="46.0" prefWidth="46.0" style="-fx-background-color: orangered;" />
|
||||
<Region layoutX="79.0" layoutY="9.0" onDragDetected="#RegionColor_OnDragDetected" prefHeight="46.0" prefWidth="46.0" style="-fx-background-color: yellowgreen;" />
|
||||
<Region layoutX="140.0" layoutY="9.0" onDragDetected="#RegionColor_OnDragDetected" prefHeight="46.0" prefWidth="46.0" style="-fx-background-color: cornflowerblue;" />
|
||||
<Region layoutX="197.0" layoutY="9.0" onDragDetected="#RegionColor_OnDragDetected" prefHeight="46.0" prefWidth="46.0" style="-fx-background-color: yellow;" />
|
||||
<Region layoutX="25.0" layoutY="66.0" onDragDetected="#RegionColor_OnDragDetected" prefHeight="46.0" prefWidth="46.0" style="-fx-background-color: white;" />
|
||||
<Region layoutX="79.0" layoutY="66.0" onDragDetected="#RegionColor_OnDragDetected" prefHeight="46.0" prefWidth="46.0" style="-fx-background-color: gray;" />
|
||||
<Region layoutX="140.0" layoutY="66.0" onDragDetected="#RegionColor_OnDragDetected" prefHeight="46.0" prefWidth="46.0" style="-fx-background-color: black;" />
|
||||
<Region layoutX="197.0" layoutY="66.0" onDragDetected="#RegionColor_OnDragDetected" prefHeight="46.0" prefWidth="46.0" style="-fx-background-color: purple;" />
|
||||
</Pane>
|
||||
<CheckBox fx:id="checkBoxLadder" layoutX="188.0" layoutY="110.0" text="Второй этаж" />
|
||||
<CheckBox fx:id="checkBoxSecondStage" layoutX="8" layoutY="110" prefHeight="18.0" prefWidth="135.0" text="Лестница" />
|
||||
<Label fx:id="labelSimpleObject" alignment="CENTER" layoutX="14.0" layoutY="282.0" onDragDetected="#LabelObject_OnDragDetected" prefHeight="30" prefWidth="127.0" style="-fx-border-color: black;" textOverrun="CLIP">
|
||||
Simple
|
||||
</Label>
|
||||
<Label fx:id="labelModifiedObject" alignment="CENTER" layoutX="165.0" layoutY="282.0" onDragDetected="#LabelObject_OnDragDetected" prefHeight="30" prefWidth="135.0" style="-fx-border-color: black;">
|
||||
Modified
|
||||
</Label>
|
||||
<Label layoutX="101.0" layoutY="56.0" text="Двери">
|
||||
Track rollers
|
||||
</Label>
|
||||
<Spinner fx:id="spinnerDoors" layoutX="150.0" layoutY="52.0" prefWidth="70">
|
||||
<valueFactory>
|
||||
<SpinnerValueFactory.IntegerSpinnerValueFactory initialValue="1" max="5" min="3" />
|
||||
</valueFactory>
|
||||
</Spinner>
|
||||
<Label fx:id="labelTriangle" alignment="CENTER" layoutX="14.0" layoutY="331.0" onDragDetected="#LabelObject_OnDragDetected" prefHeight="30" prefWidth="97.0" style="-fx-border-color: black;" text="Треугольник" textOverrun="CLIP" />
|
||||
<Label fx:id="labelOval" alignment="CENTER" layoutX="128.0" layoutY="331.0" onDragDetected="#LabelObject_OnDragDetected" prefHeight="30" prefWidth="52.0" style="-fx-border-color: black;" text="Овал" textOverrun="CLIP" />
|
||||
<Label fx:id="labelRect" alignment="CENTER" layoutX="199.0" layoutY="331.0" onDragDetected="#LabelObject_OnDragDetected" prefHeight="30" prefWidth="90.0" style="-fx-border-color: black;" text="Квадрат" textOverrun="CLIP" />
|
||||
</Pane>
|
||||
<Label alignment="CENTER" layoutX="356.0" layoutY="52.0" onDragDropped="#LabelBaseColor_OnDragDropped" onDragOver="#LabelColor_OnDragOver" prefHeight="30" prefWidth="127.0" style="-fx-border-color: black;" text="Цвет">
|
||||
Color
|
||||
</Label>
|
||||
<Label alignment="CENTER" layoutX="499.0" layoutY="52.0" onDragDropped="#LabelDopColor_OnDragDropped" onDragOver="#LabelColor_OnDragOver" prefHeight="30" prefWidth="119.0" style="-fx-border-color: black;" text="Доп цвет">
|
||||
Dop Color
|
||||
</Label>
|
||||
<StackPane layoutX="352.0" layoutY="137.0" onDragDropped="#CanvasObject_OnDragDropped" onDragOver="#CanvasObject_OnDragOver" prefHeight="152.0" prefWidth="262.0" style="-fx-border-color: #b8becc; -fx-border-radius: 5; -fx-border-width: 2;">
|
||||
<Canvas fx:id="canvasObject" height="152.0" width="267.0" />
|
||||
</StackPane>
|
||||
<Button fx:id="buttonAdd" layoutX="367.0" layoutY="350.0" onAction="#ButtonOk_Click" prefHeight="26" prefWidth="90" text="Создать">
|
||||
Add
|
||||
</Button>
|
||||
<Button fx:id="buttonCancel" layoutX="522.0" layoutY="350.0" prefHeight="26" prefWidth="90" text="Отмена">
|
||||
Cancel
|
||||
</Button>
|
||||
</Pane>
|
Loading…
Reference in New Issue
Block a user