commit 5 lab
This commit is contained in:
parent
2e31988a1b
commit
ac846959df
@ -13,7 +13,7 @@
|
|||||||
</properties>
|
</properties>
|
||||||
<border type="none"/>
|
<border type="none"/>
|
||||||
<children>
|
<children>
|
||||||
<grid id="4a7b" binding="groupBoxObjectParameters" layout-manager="GridLayoutManager" row-count="10" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="4a7b" binding="groupBoxObjectParameters" layout-manager="GridLayoutManager" row-count="10" column-count="5" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="0" left="0" bottom="0" right="0"/>
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="1" column="0" row-span="3" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
<grid row="1" column="0" row-span="3" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||||
@ -36,7 +36,7 @@
|
|||||||
<grid id="b49a8" binding="groupBoxColors" layout-manager="GridLayoutManager" row-count="2" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
<grid id="b49a8" binding="groupBoxColors" layout-manager="GridLayoutManager" row-count="2" column-count="4" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||||
<margin top="0" left="0" bottom="0" right="0"/>
|
<margin top="0" left="0" bottom="0" right="0"/>
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="0" column="2" row-span="6" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
<grid row="0" column="3" row-span="6" col-span="2" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false">
|
||||||
<minimum-size width="210" height="200"/>
|
<minimum-size width="210" height="200"/>
|
||||||
<preferred-size width="210" height="200"/>
|
<preferred-size width="210" height="200"/>
|
||||||
<maximum-size width="210" height="200"/>
|
<maximum-size width="210" height="200"/>
|
||||||
@ -201,7 +201,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="4c1bf" class="javax.swing.JLabel" binding="lableSimpleObject">
|
<component id="4c1bf" class="javax.swing.JLabel" binding="lableSimpleObject">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="6" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
<grid row="6" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<text value="Простой"/>
|
<text value="Простой"/>
|
||||||
@ -209,7 +209,7 @@
|
|||||||
</component>
|
</component>
|
||||||
<component id="cc241" class="javax.swing.JLabel" binding="labelModifiedObject">
|
<component id="cc241" class="javax.swing.JLabel" binding="labelModifiedObject">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="6" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
<grid row="6" column="4" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
</constraints>
|
</constraints>
|
||||||
<properties>
|
<properties>
|
||||||
<background color="-2133636"/>
|
<background color="-2133636"/>
|
||||||
@ -224,14 +224,6 @@
|
|||||||
<text value="Признак наличия рогов"/>
|
<text value="Признак наличия рогов"/>
|
||||||
</properties>
|
</properties>
|
||||||
</component>
|
</component>
|
||||||
<component id="bddf7" class="javax.swing.JLabel" binding="labelWheels">
|
|
||||||
<constraints>
|
|
||||||
<grid row="7" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
|
||||||
</constraints>
|
|
||||||
<properties>
|
|
||||||
<text value="Колеса добавить?..."/>
|
|
||||||
</properties>
|
|
||||||
</component>
|
|
||||||
<component id="f2170" class="javax.swing.JLabel" binding="labelCountWheels">
|
<component id="f2170" class="javax.swing.JLabel" binding="labelCountWheels">
|
||||||
<constraints>
|
<constraints>
|
||||||
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
@ -246,6 +238,30 @@
|
|||||||
</constraints>
|
</constraints>
|
||||||
<properties/>
|
<properties/>
|
||||||
</component>
|
</component>
|
||||||
|
<component id="bddf7" class="javax.swing.JLabel" binding="labelBlackWheels">
|
||||||
|
<constraints>
|
||||||
|
<grid row="7" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Черные колеса"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="e6296" class="javax.swing.JLabel" binding="labelEmptyWheels">
|
||||||
|
<constraints>
|
||||||
|
<grid row="7" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Пустые колеса"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
|
<component id="f3cc8" class="javax.swing.JLabel" binding="labelRainbowWheels">
|
||||||
|
<constraints>
|
||||||
|
<grid row="7" column="4" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||||
|
</constraints>
|
||||||
|
<properties>
|
||||||
|
<text value="Радужные колеса"/>
|
||||||
|
</properties>
|
||||||
|
</component>
|
||||||
</children>
|
</children>
|
||||||
</grid>
|
</grid>
|
||||||
<component id="8989b" class="javax.swing.JButton" binding="buttonOk">
|
<component id="8989b" class="javax.swing.JButton" binding="buttonOk">
|
||||||
|
@ -41,9 +41,11 @@ public class FormLocomotiveConfig{
|
|||||||
private JPanel violetPanel;
|
private JPanel violetPanel;
|
||||||
private JPanel panelBodyColor;
|
private JPanel panelBodyColor;
|
||||||
private JPanel panelAdditionalColor;
|
private JPanel panelAdditionalColor;
|
||||||
private JLabel labelWheels;
|
private JLabel labelBlackWheels;
|
||||||
private JLabel labelCountWheels;
|
private JLabel labelCountWheels;
|
||||||
private JSpinner numericUpDownWheels;
|
private JSpinner numericUpDownWheels;
|
||||||
|
private JLabel labelEmptyWheels;
|
||||||
|
private JLabel labelRainbowWheels;
|
||||||
public Canvas canvas;
|
public Canvas canvas;
|
||||||
|
|
||||||
public JPanel getPictureBoxObject(){
|
public JPanel getPictureBoxObject(){
|
||||||
@ -154,9 +156,17 @@ public class FormLocomotiveConfig{
|
|||||||
labelModifiedObject.addMouseListener(new LabelMouseAdapter());
|
labelModifiedObject.addMouseListener(new LabelMouseAdapter());
|
||||||
labelModifiedObject.setBorder(br);
|
labelModifiedObject.setBorder(br);
|
||||||
|
|
||||||
labelWheels.setTransferHandler(new LabelTransferHandler());
|
labelBlackWheels.setTransferHandler(new LabelTransferHandler());
|
||||||
labelWheels.addMouseListener(new LabelMouseAdapter());
|
labelBlackWheels.addMouseListener(new LabelMouseAdapter());
|
||||||
labelWheels.setBorder(br);
|
labelBlackWheels.setBorder(br);
|
||||||
|
|
||||||
|
labelEmptyWheels.setTransferHandler(new LabelTransferHandler());
|
||||||
|
labelEmptyWheels.addMouseListener(new LabelMouseAdapter());
|
||||||
|
labelEmptyWheels.setBorder(br);
|
||||||
|
|
||||||
|
labelRainbowWheels.setTransferHandler((new LabelTransferHandler()));
|
||||||
|
labelRainbowWheels.addMouseListener(new LabelMouseAdapter());
|
||||||
|
labelRainbowWheels.setBorder(br);
|
||||||
|
|
||||||
redPanel.setTransferHandler(new PanelTransferHandler());
|
redPanel.setTransferHandler(new PanelTransferHandler());
|
||||||
redPanel.addMouseListener(new PanelMouseAdapter());
|
redPanel.addMouseListener(new PanelMouseAdapter());
|
||||||
@ -271,24 +281,25 @@ public class FormLocomotiveConfig{
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int wheelsCount = (int)numericUpDownWheels.getValue();
|
||||||
|
IDrawingWheels iDrawingWheels;
|
||||||
String dataWheels = (String) support.getTransferable().getTransferData(DataFlavor.stringFlavor);
|
String dataWheels = (String) support.getTransferable().getTransferData(DataFlavor.stringFlavor);
|
||||||
switch (dataWheels){
|
switch (dataWheels){
|
||||||
case "Колеса добавить?...":
|
case "Черные колеса":
|
||||||
Random rnd;
|
iDrawingWheels = new DrawingWheel();
|
||||||
rnd = new Random();
|
|
||||||
IDrawingWheels iDrawingWheels;
|
|
||||||
int wheelsChoice = rnd.nextInt(0, 3);
|
|
||||||
int wheelsCount = (int)numericUpDownWheels.getValue();
|
|
||||||
if (wheelsChoice == 0) {
|
|
||||||
iDrawingWheels = new DrawingWheel();
|
|
||||||
} else if (wheelsChoice == 1) {
|
|
||||||
iDrawingWheels = new DrawingEmptyWheels();
|
|
||||||
} else {
|
|
||||||
iDrawingWheels = new DrawingWheelsBlueCrom();
|
|
||||||
}
|
|
||||||
|
|
||||||
iDrawingWheels.SetWheelsCount(wheelsCount);
|
iDrawingWheels.SetWheelsCount(wheelsCount);
|
||||||
_loco._drawingWheels = iDrawingWheels;
|
_loco._drawingWheels = iDrawingWheels;
|
||||||
|
break;
|
||||||
|
case "Пустые колеса":
|
||||||
|
iDrawingWheels = new DrawingEmptyWheels();
|
||||||
|
iDrawingWheels.SetWheelsCount(wheelsCount);
|
||||||
|
_loco._drawingWheels = iDrawingWheels;
|
||||||
|
break;
|
||||||
|
case "Радужные колеса":
|
||||||
|
iDrawingWheels = new DrawingWheelsBlueCrom();
|
||||||
|
iDrawingWheels.SetWheelsCount(wheelsCount);
|
||||||
|
_loco._drawingWheels = iDrawingWheels;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
pictureBoxObject.repaint();
|
pictureBoxObject.repaint();
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user