done hard path
This commit is contained in:
parent
f5b2079766
commit
d7af21d278
@ -38,4 +38,8 @@ private DrawingArmoredVehicle _machine = null;
|
||||
public HashMap<String, Float> GetCurrentPosition() {
|
||||
return _machine.GetCurrentPosition();
|
||||
}
|
||||
public DrawingArmoredVehicle GetMachine()
|
||||
{
|
||||
return _machine;
|
||||
}
|
||||
}
|
||||
|
@ -88,37 +88,38 @@
|
||||
<Component id="MapComboBox" max="32767" attributes="0"/>
|
||||
<Component id="MapNameTextField" alignment="1" max="32767" attributes="0"/>
|
||||
<Component id="jScrollPane2" alignment="1" max="32767" attributes="0"/>
|
||||
<Component id="DeleteMapButton" alignment="1" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="DeletedFormOpen" min="-2" pref="122" max="-2" attributes="0"/>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="25" pref="25" max="-2" attributes="0"/>
|
||||
<Component id="UpButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="103" alignment="0" groupAlignment="0" attributes="0">
|
||||
<Component id="RightButton" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="LeftButton" min="-2" pref="22" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
|
||||
<Component id="DownButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="29" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="39" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="AddMachineButton" max="32767" attributes="0"/>
|
||||
<Component id="TextBoxPosition" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="DeleteButton" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="StoreButton" alignment="0" pref="246" max="32767" attributes="0"/>
|
||||
<Component id="StoreButton" alignment="0" max="32767" attributes="0"/>
|
||||
<Component id="MapButton" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace pref="145" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="25" pref="25" max="-2" attributes="0"/>
|
||||
<Component id="UpButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="27" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="103" alignment="0" groupAlignment="0" attributes="0">
|
||||
<Component id="RightButton" alignment="1" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="LeftButton" min="-2" pref="22" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
|
||||
<Component id="DownButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="29" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="-2" pref="39" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="DeleteMapButton" alignment="1" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
@ -151,8 +152,11 @@
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="MapButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="25" max="-2" attributes="0"/>
|
||||
<Component id="UpButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="1" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="UpButton" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="DeletedFormOpen" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Group type="103" groupAlignment="0" max="-2" attributes="0">
|
||||
@ -187,7 +191,6 @@
|
||||
<Property name="name" type="java.lang.String" value="MapComboBox" noResource="true"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="itemStateChanged" listener="java.awt.event.ItemListener" parameters="java.awt.event.ItemEvent" handler="MapComboBoxItemStateChanged"/>
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="MapComboBoxActionPerformed"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
@ -330,6 +333,14 @@
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
<Component class="javax.swing.JButton" name="DeletedFormOpen">
|
||||
<Properties>
|
||||
<Property name="text" type="java.lang.String" value="Удаленные"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="DeletedFormOpenMouseClicked"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
</SubComponents>
|
||||
|
@ -9,6 +9,7 @@ import java.awt.event.WindowAdapter;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.Queue;
|
||||
import javax.swing.event.ListSelectionEvent;
|
||||
import javax.swing.event.ListSelectionListener;
|
||||
|
||||
@ -21,6 +22,7 @@ private Image img;
|
||||
put("Вертикальная карта", new VerticalMap());
|
||||
put("Горизонтальная карта", new HorizontalMap());
|
||||
}};
|
||||
public Queue<DrawingArmoredVehicle> deleted = new LinkedList<>();
|
||||
public FormMapWithSetMachine() {
|
||||
initComponents();
|
||||
LeftButton.setLabel("<");
|
||||
@ -58,6 +60,7 @@ private Image img;
|
||||
DeleteMapButton = new java.awt.Button();
|
||||
jScrollPane2 = new javax.swing.JScrollPane();
|
||||
MapList = new javax.swing.JList<>();
|
||||
DeletedFormOpen = new javax.swing.JButton();
|
||||
|
||||
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
|
||||
|
||||
@ -68,11 +71,6 @@ private Image img;
|
||||
|
||||
MapComboBox.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Простая карта", "Вертикальная карта", "Горизонтальная карта" }));
|
||||
MapComboBox.setName("MapComboBox"); // NOI18N
|
||||
MapComboBox.addItemListener(new java.awt.event.ItemListener() {
|
||||
public void itemStateChanged(java.awt.event.ItemEvent evt) {
|
||||
MapComboBoxItemStateChanged(evt);
|
||||
}
|
||||
});
|
||||
MapComboBox.addActionListener(new java.awt.event.ActionListener() {
|
||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||
MapComboBoxActionPerformed(evt);
|
||||
@ -172,6 +170,13 @@ private Image img;
|
||||
});
|
||||
jScrollPane2.setViewportView(MapList);
|
||||
|
||||
DeletedFormOpen.setText("Удаленные");
|
||||
DeletedFormOpen.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||
public void mouseClicked(java.awt.event.MouseEvent evt) {
|
||||
DeletedFormOpenMouseClicked(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout InstrumentPanelLayout = new javax.swing.GroupLayout(InstrumentPanel);
|
||||
InstrumentPanel.setLayout(InstrumentPanelLayout);
|
||||
InstrumentPanelLayout.setHorizontalGroup(
|
||||
@ -188,30 +193,31 @@ private Image img;
|
||||
.addComponent(MapComboBox, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(MapNameTextField, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(DeleteMapButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(InstrumentPanelLayout.createSequentialGroup()
|
||||
.addGap(12, 12, 12)
|
||||
.addGroup(InstrumentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(InstrumentPanelLayout.createSequentialGroup()
|
||||
.addComponent(DeletedFormOpen, javax.swing.GroupLayout.PREFERRED_SIZE, 122, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addGroup(InstrumentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(InstrumentPanelLayout.createSequentialGroup()
|
||||
.addGap(25, 25, 25)
|
||||
.addComponent(UpButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(27, 27, 27))
|
||||
.addGroup(InstrumentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(RightButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, InstrumentPanelLayout.createSequentialGroup()
|
||||
.addComponent(LeftButton, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(1, 1, 1)
|
||||
.addComponent(DownButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(29, 29, 29))))
|
||||
.addGap(39, 39, 39))
|
||||
.addComponent(AddMachineButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(TextBoxPosition, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(DeleteButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(StoreButton, javax.swing.GroupLayout.DEFAULT_SIZE, 246, Short.MAX_VALUE)
|
||||
.addComponent(MapButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, InstrumentPanelLayout.createSequentialGroup()
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 145, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(InstrumentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(InstrumentPanelLayout.createSequentialGroup()
|
||||
.addGap(25, 25, 25)
|
||||
.addComponent(UpButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(27, 27, 27))
|
||||
.addGroup(InstrumentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(RightButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, InstrumentPanelLayout.createSequentialGroup()
|
||||
.addComponent(LeftButton, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(1, 1, 1)
|
||||
.addComponent(DownButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(29, 29, 29))))
|
||||
.addGap(39, 39, 39))
|
||||
.addComponent(DeleteMapButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||
.addComponent(StoreButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(MapButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
|
||||
.addContainerGap())))
|
||||
);
|
||||
InstrumentPanelLayout.setVerticalGroup(
|
||||
@ -239,8 +245,10 @@ private Image img;
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addComponent(MapButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(25, 25, 25)
|
||||
.addComponent(UpButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(1, 1, 1)
|
||||
.addGroup(InstrumentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(UpButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(DeletedFormOpen))
|
||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||
.addGroup(InstrumentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, InstrumentPanelLayout.createSequentialGroup()
|
||||
.addGroup(InstrumentPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
|
||||
@ -327,6 +335,7 @@ private Image img;
|
||||
"Удаление", JOptionPane.YES_NO_OPTION);
|
||||
if (res == JOptionPane.YES_OPTION) {
|
||||
int pos = Integer.parseInt(TextBoxPosition.getText());
|
||||
deleted.offer(_mapCollection.Get(MapList.getSelectedValue().toString()).GetMachineInList(pos).GetMachine());
|
||||
if (_mapCollection.Get(MapList.getSelectedValue().toString()).remove(pos) != null)
|
||||
{
|
||||
JOptionPane.showMessageDialog(null, "Объект удален");
|
||||
@ -447,9 +456,24 @@ private void ReloadMaps() {
|
||||
Draw();
|
||||
}//GEN-LAST:event_MapListValueChanged
|
||||
|
||||
private void MapComboBoxItemStateChanged(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_MapComboBoxItemStateChanged
|
||||
// TODO add your handling code here:
|
||||
}//GEN-LAST:event_MapComboBoxItemStateChanged
|
||||
private void DeletedFormOpenMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_DeletedFormOpenMouseClicked
|
||||
var elem = deleted.poll();
|
||||
if(elem != null)
|
||||
{
|
||||
MainForm form = new MainForm(elem);
|
||||
form.setVisible(true);
|
||||
form.addWindowListener(new WindowAdapter() {
|
||||
@Override
|
||||
public void windowDeactivated(WindowEvent e) {
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
JOptionPane.showMessageDialog(null, "Очередь пуста");
|
||||
}
|
||||
|
||||
}//GEN-LAST:event_DeletedFormOpenMouseClicked
|
||||
public void Move(String name)
|
||||
{
|
||||
switch (name)
|
||||
@ -506,6 +530,7 @@ private void ReloadMaps() {
|
||||
private java.awt.Button AddMapButton;
|
||||
private java.awt.Button DeleteButton;
|
||||
private java.awt.Button DeleteMapButton;
|
||||
private javax.swing.JButton DeletedFormOpen;
|
||||
private java.awt.Button DownButton;
|
||||
private javax.swing.JPanel InstrumentPanel;
|
||||
private java.awt.Button LeftButton;
|
||||
|
@ -34,59 +34,86 @@
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="451" max="32767" attributes="0"/>
|
||||
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="DrawPanel" pref="445" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="DrawPanel" max="32767" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<EmptySpace min="0" pref="309" max="32767" attributes="0"/>
|
||||
<Group type="103" rootIndex="1" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<Component id="DrawPanel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<Component id="DrawPanel" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="22" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Container class="javax.swing.JPanel" name="DrawPanel">
|
||||
<Events>
|
||||
<EventHandler event="componentShown" listener="java.awt.event.ComponentListener" parameters="java.awt.event.ComponentEvent" handler="DrawPanelComponentShown"/>
|
||||
</Events>
|
||||
<AuxValues>
|
||||
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new javax.swing.JPanel(){
 Graphics2D g2;}"/>
|
||||
</AuxValues>
|
||||
|
||||
<Layout class="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout"/>
|
||||
<Layout>
|
||||
<DimensionLayout dim="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="367" pref="367" max="-2" attributes="0"/>
|
||||
<Component id="UpButton" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="337" pref="337" max="-2" attributes="0"/>
|
||||
<Component id="LeftButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="30" pref="30" max="-2" attributes="0"/>
|
||||
<Component id="RightButton" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="27" pref="27" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="exitButton" min="-2" pref="78" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="258" max="-2" attributes="0"/>
|
||||
<Component id="DownButton" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="PropertyText" min="-2" pref="330" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace pref="86" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
<DimensionLayout dim="1">
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="160" pref="160" max="-2" attributes="0"/>
|
||||
<Component id="UpButton" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Component id="LeftButton" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="RightButton" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="exitButton" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="DownButton" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="13" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace min="10" pref="10" max="-2" attributes="0"/>
|
||||
<Component id="PropertyText" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
</Layout>
|
||||
<SubComponents>
|
||||
<Component class="java.awt.TextField" name="PropertyText">
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="4" gridWidth="2" gridHeight="1" fill="0" ipadX="322" ipadY="0" insetsTop="10" insetsLeft="0" insetsBottom="10" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="java.awt.Button" name="CreateButton">
|
||||
<Properties>
|
||||
<Property name="actionCommand" type="java.lang.String" value="Create"/>
|
||||
<Property name="label" type="java.lang.String" editor="org.netbeans.modules.form.RADConnectionPropertyEditor">
|
||||
<Connection code=""Создать"" type="code"/>
|
||||
</Property>
|
||||
<Property name="name" type="java.lang.String" value="CreateButton" noResource="true"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="CreateButtonMouseClicked"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="0" gridY="2" gridWidth="1" gridHeight="2" fill="0" ipadX="67" ipadY="0" insetsTop="13" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="java.awt.Button" name="UpButton">
|
||||
<Properties>
|
||||
@ -106,11 +133,6 @@
|
||||
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new java.awt.Button()"/>
|
||||
<AuxValue name="JavaCodeGenerator_CreateCodePre" type="java.lang.String" value="ImageIcon arrowUp = new ImageIcon("C:\\Users\\Alena\\Desktop\\New Folder\\JavaApplication4\\src\\Resources\\arrowUp.jpg");"/>
|
||||
</AuxValues>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="4" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="160" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="java.awt.Button" name="LeftButton">
|
||||
<Properties>
|
||||
@ -123,11 +145,6 @@
|
||||
<Events>
|
||||
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="LeftButtonMouseClicked"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="1" gridY="1" gridWidth="3" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="227" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="java.awt.Button" name="DownButton">
|
||||
<Properties>
|
||||
@ -141,11 +158,6 @@
|
||||
<Events>
|
||||
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="DownButtonMouseClicked"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="4" gridY="2" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="0" anchor="18" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="java.awt.Button" name="RightButton">
|
||||
<Properties>
|
||||
@ -159,11 +171,15 @@
|
||||
<Events>
|
||||
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="RightButtonMouseClicked"/>
|
||||
</Events>
|
||||
<Constraints>
|
||||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
|
||||
<GridBagConstraints gridX="5" gridY="1" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="0" insetsLeft="0" insetsBottom="0" insetsRight="32" anchor="18" weightX="0.0" weightY="0.0"/>
|
||||
</Constraint>
|
||||
</Constraints>
|
||||
</Component>
|
||||
<Component class="java.awt.Button" name="exitButton">
|
||||
<Properties>
|
||||
<Property name="label" type="java.lang.String" value="Выход"/>
|
||||
<Property name="name" type="java.lang.String" value="" noResource="true"/>
|
||||
</Properties>
|
||||
<Events>
|
||||
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="exitButtonMouseClicked"/>
|
||||
</Events>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Container>
|
||||
|
@ -3,31 +3,31 @@ import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Image;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.util.Random;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JColorChooser;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public class MainForm extends javax.swing.JFrame {
|
||||
|
||||
private Image img;
|
||||
private DrawingArmoredVehicle _ArmoredVehicle;
|
||||
private DrawingArmoredVehicle SelectedMachine;
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||
private void initComponents() {
|
||||
java.awt.GridBagConstraints gridBagConstraints;
|
||||
|
||||
jButton1 = new javax.swing.JButton();
|
||||
DrawPanel = new javax.swing.JPanel(){
|
||||
Graphics2D g2;};
|
||||
PropertyText = new java.awt.TextField();
|
||||
CreateButton = new java.awt.Button();
|
||||
ImageIcon arrowUp = new ImageIcon("C:\\Users\\Alena\\Desktop\\New Folder\\JavaApplication4\\src\\Resources\\arrowUp.jpg");
|
||||
UpButton = new java.awt.Button();
|
||||
LeftButton = new java.awt.Button();
|
||||
DownButton = new java.awt.Button();
|
||||
RightButton = new java.awt.Button();
|
||||
exitButton = new java.awt.Button();
|
||||
|
||||
jButton1.setText("jButton1");
|
||||
|
||||
@ -35,32 +35,11 @@ public class MainForm extends javax.swing.JFrame {
|
||||
setMinimumSize(new java.awt.Dimension(444, 303));
|
||||
setName("MainFrame"); // NOI18N
|
||||
|
||||
DrawPanel.setLayout(new java.awt.GridBagLayout());
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 4;
|
||||
gridBagConstraints.gridwidth = 2;
|
||||
gridBagConstraints.ipadx = 322;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
|
||||
gridBagConstraints.insets = new java.awt.Insets(10, 0, 10, 0);
|
||||
DrawPanel.add(PropertyText, gridBagConstraints);
|
||||
|
||||
CreateButton.setActionCommand("Create");
|
||||
CreateButton.setLabel("Создать");
|
||||
CreateButton.setName("CreateButton"); // NOI18N
|
||||
CreateButton.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||
public void mouseClicked(java.awt.event.MouseEvent evt) {
|
||||
CreateButtonMouseClicked(evt);
|
||||
DrawPanel.addComponentListener(new java.awt.event.ComponentAdapter() {
|
||||
public void componentShown(java.awt.event.ComponentEvent evt) {
|
||||
DrawPanelComponentShown(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 0;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.gridheight = 2;
|
||||
gridBagConstraints.ipadx = 67;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
|
||||
gridBagConstraints.insets = new java.awt.Insets(13, 0, 0, 0);
|
||||
DrawPanel.add(CreateButton, gridBagConstraints);
|
||||
|
||||
UpButton.setActionCommand("Up");
|
||||
UpButton.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
|
||||
@ -71,12 +50,6 @@ public class MainForm extends javax.swing.JFrame {
|
||||
UpButtonMouseClicked(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 4;
|
||||
gridBagConstraints.gridy = 0;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
|
||||
gridBagConstraints.insets = new java.awt.Insets(160, 0, 0, 0);
|
||||
DrawPanel.add(UpButton, gridBagConstraints);
|
||||
|
||||
LeftButton.setActionCommand("Left");
|
||||
LeftButton.setMinimumSize(new java.awt.Dimension(30, 30));
|
||||
@ -86,13 +59,6 @@ public class MainForm extends javax.swing.JFrame {
|
||||
LeftButtonMouseClicked(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 1;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.gridwidth = 3;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
|
||||
gridBagConstraints.insets = new java.awt.Insets(0, 227, 0, 0);
|
||||
DrawPanel.add(LeftButton, gridBagConstraints);
|
||||
|
||||
DownButton.setActionCommand("Left");
|
||||
DownButton.setLabel("↓");
|
||||
@ -103,11 +69,6 @@ public class MainForm extends javax.swing.JFrame {
|
||||
DownButtonMouseClicked(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 4;
|
||||
gridBagConstraints.gridy = 2;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
|
||||
DrawPanel.add(DownButton, gridBagConstraints);
|
||||
|
||||
RightButton.setActionCommand("Right");
|
||||
RightButton.setLabel("→");
|
||||
@ -118,57 +79,96 @@ public class MainForm extends javax.swing.JFrame {
|
||||
RightButtonMouseClicked(evt);
|
||||
}
|
||||
});
|
||||
gridBagConstraints = new java.awt.GridBagConstraints();
|
||||
gridBagConstraints.gridx = 5;
|
||||
gridBagConstraints.gridy = 1;
|
||||
gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
|
||||
gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 32);
|
||||
DrawPanel.add(RightButton, gridBagConstraints);
|
||||
|
||||
exitButton.setLabel("Выход");
|
||||
exitButton.setName(""); // NOI18N
|
||||
exitButton.addMouseListener(new java.awt.event.MouseAdapter() {
|
||||
public void mouseClicked(java.awt.event.MouseEvent evt) {
|
||||
exitButtonMouseClicked(evt);
|
||||
}
|
||||
});
|
||||
|
||||
javax.swing.GroupLayout DrawPanelLayout = new javax.swing.GroupLayout(DrawPanel);
|
||||
DrawPanel.setLayout(DrawPanelLayout);
|
||||
DrawPanelLayout.setHorizontalGroup(
|
||||
DrawPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(DrawPanelLayout.createSequentialGroup()
|
||||
.addGroup(DrawPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(DrawPanelLayout.createSequentialGroup()
|
||||
.addGap(367, 367, 367)
|
||||
.addComponent(UpButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(DrawPanelLayout.createSequentialGroup()
|
||||
.addGap(337, 337, 337)
|
||||
.addComponent(LeftButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(30, 30, 30)
|
||||
.addComponent(RightButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(DrawPanelLayout.createSequentialGroup()
|
||||
.addGap(27, 27, 27)
|
||||
.addGroup(DrawPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(DrawPanelLayout.createSequentialGroup()
|
||||
.addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, 78, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(258, 258, 258)
|
||||
.addComponent(DownButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addComponent(PropertyText, javax.swing.GroupLayout.PREFERRED_SIZE, 330, javax.swing.GroupLayout.PREFERRED_SIZE))))
|
||||
.addContainerGap(86, Short.MAX_VALUE))
|
||||
);
|
||||
DrawPanelLayout.setVerticalGroup(
|
||||
DrawPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(DrawPanelLayout.createSequentialGroup()
|
||||
.addGap(160, 160, 160)
|
||||
.addComponent(UpButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(DrawPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addComponent(LeftButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addComponent(RightButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
.addGroup(DrawPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
|
||||
.addComponent(exitButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGroup(DrawPanelLayout.createSequentialGroup()
|
||||
.addComponent(DownButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(13, 13, 13)))
|
||||
.addGap(10, 10, 10)
|
||||
.addComponent(PropertyText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
|
||||
);
|
||||
|
||||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
|
||||
getContentPane().setLayout(layout);
|
||||
layout.setHorizontalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 451, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(DrawPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 445, Short.MAX_VALUE)))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addContainerGap()
|
||||
.addComponent(DrawPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addContainerGap())
|
||||
);
|
||||
layout.setVerticalGroup(
|
||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGap(0, 309, Short.MAX_VALUE)
|
||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
||||
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
|
||||
.addComponent(DrawPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addContainerGap()))
|
||||
.addGroup(layout.createSequentialGroup()
|
||||
.addComponent(DrawPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||
.addGap(0, 22, Short.MAX_VALUE))
|
||||
);
|
||||
|
||||
pack();
|
||||
}// </editor-fold>//GEN-END:initComponents
|
||||
|
||||
public MainForm() {
|
||||
public MainForm(DrawingArmoredVehicle machine) {
|
||||
initComponents();
|
||||
LeftButton.setLabel("<");
|
||||
RightButton.setLabel(">");
|
||||
UpButton.setLabel("/\\");
|
||||
DownButton.setLabel("\\/");
|
||||
}
|
||||
private void CreateButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_CreateButtonMouseClicked
|
||||
DownButton.setLabel("\\/");
|
||||
|
||||
_ArmoredVehicle = machine;
|
||||
Draw();
|
||||
SetData();
|
||||
}
|
||||
public void SetData()
|
||||
{
|
||||
Random rnd = new Random();
|
||||
_ArmoredVehicle = new DrawingArmoredVehicle(rnd.nextInt(100, 300), rnd.nextInt(1000, 2000),
|
||||
new Color(rnd.nextInt(0, 256), rnd.nextInt(0, 256), rnd.nextInt(0, 256)));
|
||||
_ArmoredVehicle.SetPosition(rnd.nextInt(0, 100), rnd.nextInt(25, 200),
|
||||
DrawPanel.getWidth(), DrawPanel.getHeight());
|
||||
PropertyText.setText("Скорость: " + _ArmoredVehicle.ArmoredVehicle.Speed +
|
||||
" Вес: "+_ArmoredVehicle.ArmoredVehicle.Weight +
|
||||
" Цвет: "+_ArmoredVehicle.ArmoredVehicle.BodyColor.getRGB()+
|
||||
" Катков: "+_ArmoredVehicle.Count);
|
||||
Draw();
|
||||
|
||||
}//GEN-LAST:event_CreateButtonMouseClicked
|
||||
|
||||
}
|
||||
public void Move(String name)
|
||||
{
|
||||
switch (name)
|
||||
@ -180,9 +180,6 @@ public class MainForm extends javax.swing.JFrame {
|
||||
}
|
||||
|
||||
Draw();
|
||||
}
|
||||
public DrawingArmoredVehicle getSelectedCar() {
|
||||
return SelectedMachine;
|
||||
}
|
||||
private void UpButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_UpButtonMouseClicked
|
||||
Move("UpButton");
|
||||
@ -200,12 +197,20 @@ public class MainForm extends javax.swing.JFrame {
|
||||
Move("DownButton");
|
||||
}//GEN-LAST:event_DownButtonMouseClicked
|
||||
|
||||
private void exitButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_exitButtonMouseClicked
|
||||
dispose();
|
||||
}//GEN-LAST:event_exitButtonMouseClicked
|
||||
|
||||
private void DrawPanelComponentShown(java.awt.event.ComponentEvent evt) {//GEN-FIRST:event_DrawPanelComponentShown
|
||||
Draw();
|
||||
}//GEN-LAST:event_DrawPanelComponentShown
|
||||
|
||||
|
||||
|
||||
private void Draw()
|
||||
{
|
||||
Graphics g = DrawPanel.getGraphics();
|
||||
g.drawImage(img, 0, 0, this);
|
||||
g.drawImage(Pic(), 0, 0, this);
|
||||
}
|
||||
private void createUIComponents() {
|
||||
DrawPanel = new JPanel() {
|
||||
@ -215,15 +220,24 @@ public class MainForm extends javax.swing.JFrame {
|
||||
}
|
||||
};
|
||||
}
|
||||
Image Pic()
|
||||
{
|
||||
BufferedImage img = new BufferedImage(DrawPanel.getWidth(), DrawPanel.getHeight(), BufferedImage.TYPE_INT_BGR);
|
||||
Graphics2D gr = img.createGraphics();
|
||||
gr.setBackground(Color.yellow);
|
||||
_ArmoredVehicle.DrawTransport(gr);
|
||||
return img;
|
||||
}
|
||||
|
||||
|
||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||
private java.awt.Button CreateButton;
|
||||
private java.awt.Button DownButton;
|
||||
private javax.swing.JPanel DrawPanel;
|
||||
private java.awt.Button LeftButton;
|
||||
private java.awt.TextField PropertyText;
|
||||
private java.awt.Button RightButton;
|
||||
private java.awt.Button UpButton;
|
||||
private java.awt.Button exitButton;
|
||||
private javax.swing.JButton jButton1;
|
||||
// End of variables declaration//GEN-END:variables
|
||||
|
||||
|
@ -34,7 +34,10 @@ public class MapWithSetMachineGeneric<T extends IDrawingObject, U extends Abstra
|
||||
{
|
||||
return _setCars.Remove(position);
|
||||
}
|
||||
|
||||
|
||||
public T GetMachineInList(int ind){
|
||||
return _setCars.Get(ind);
|
||||
}
|
||||
public Image ShowSet()
|
||||
{
|
||||
Image bmp = new BufferedImage(_pictureWidth, _pictureHeight, BufferedImage.TYPE_INT_BGR);
|
||||
|
@ -94,5 +94,12 @@ public class MapsCollection {
|
||||
return null;
|
||||
|
||||
}
|
||||
public DrawingObject Get(String name, int ind) {
|
||||
if (_mapStorages.containsKey(name))
|
||||
{
|
||||
return _mapStorages.get(name).GetMachineInList(ind);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user