Фикс названий переменных.

This commit is contained in:
ksenianeva 2022-12-21 19:35:02 +04:00
parent ead0ac0602
commit af8b91a1a4
3 changed files with 11 additions and 13 deletions

View File

@ -20,12 +20,12 @@ public class DrawingShip {
private static final int _shipWidth = 135; private static final int _shipWidth = 135;
private static final int _shipHeight = 40; private static final int _shipHeight = 40;
public void Init(int speed, float weight, Color bodyColor, int numberOfDeks){ public void Init(int speed, float weight, Color bodyColor, int numberOfDecks){
Ship = new EntityShip(); Ship = new EntityShip();
// мметод прорисовки палуб // мметод прорисовки палуб
drawingDecks = new DrawingDecks(); drawingDecks = new DrawingDecks();
Ship.Init(speed, weight, bodyColor); Ship.Init(speed, weight, bodyColor);
drawingDecks.setNumberOfDecks(numberOfDeks);/////// палубы drawingDecks.setNumberOfDecks(numberOfDecks);/////// палубы
} }
public EntityShip getShip() { public EntityShip getShip() {

View File

@ -34,7 +34,7 @@
<Component id="buttonLeft" min="-2" pref="35" max="-2" attributes="0"/> <Component id="buttonLeft" min="-2" pref="35" max="-2" attributes="0"/>
</Group> </Group>
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<Component id="labelAmountOfDeks" min="-2" max="-2" attributes="0"/> <Component id="labelAmountOfDecks" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Component id="comboBoxAmountOfDecks" min="-2" max="-2" attributes="0"/> <Component id="comboBoxAmountOfDecks" min="-2" max="-2" attributes="0"/>
</Group> </Group>
@ -68,7 +68,7 @@
<Group type="103" groupAlignment="0" attributes="0"> <Group type="103" groupAlignment="0" attributes="0">
<Group type="102" alignment="1" attributes="0"> <Group type="102" alignment="1" attributes="0">
<Group type="103" groupAlignment="3" attributes="0"> <Group type="103" groupAlignment="3" attributes="0">
<Component id="labelAmountOfDeks" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="labelAmountOfDecks" alignment="3" min="-2" max="-2" attributes="0"/>
<Component id="comboBoxAmountOfDecks" alignment="3" min="-2" max="-2" attributes="0"/> <Component id="comboBoxAmountOfDecks" alignment="3" min="-2" max="-2" attributes="0"/>
</Group> </Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/>
@ -101,7 +101,7 @@
<Property name="useNullLayout" type="boolean" value="true"/> <Property name="useNullLayout" type="boolean" value="true"/>
</Layout> </Layout>
</Container> </Container>
<Component class="javax.swing.JLabel" name="labelAmountOfDeks"> <Component class="javax.swing.JLabel" name="labelAmountOfDecks">
<Properties> <Properties>
<Property name="text" type="java.lang.String" value="&#x41a;&#x43e;&#x43b;&#x438;&#x447;&#x435;&#x441;&#x442;&#x432;&#x43e; &#x43f;&#x430;&#x43b;&#x443;&#x431;"/> <Property name="text" type="java.lang.String" value="&#x41a;&#x43e;&#x43b;&#x438;&#x447;&#x435;&#x441;&#x442;&#x432;&#x43e; &#x43f;&#x430;&#x43b;&#x443;&#x431;"/>
</Properties> </Properties>
@ -163,7 +163,6 @@
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/containership/Rightarrow.png"/> <Image iconType="3" name="/containership/Rightarrow.png"/>
</Property> </Property>
<Property name="actionCommand" type="java.lang.String" value=""/>
<Property name="name" type="java.lang.String" value="buttonRight" noResource="true"/> <Property name="name" type="java.lang.String" value="buttonRight" noResource="true"/>
</Properties> </Properties>
<Events> <Events>

View File

@ -30,7 +30,7 @@ public class JFrame_Ship extends javax.swing.JFrame {
private void initComponents() { private void initComponents() {
ShipCanvas = new containership.MyCanvas(); ShipCanvas = new containership.MyCanvas();
labelAmountOfDeks = new javax.swing.JLabel(); labelAmountOfDecks = new javax.swing.JLabel();
comboBoxAmountOfDecks = new javax.swing.JComboBox<>(); comboBoxAmountOfDecks = new javax.swing.JComboBox<>();
buttonCreate = new javax.swing.JButton(); buttonCreate = new javax.swing.JButton();
statusLabel = new javax.swing.JLabel(); statusLabel = new javax.swing.JLabel();
@ -47,7 +47,7 @@ public class JFrame_Ship extends javax.swing.JFrame {
} }
}); });
labelAmountOfDeks.setText("Количество палуб"); labelAmountOfDecks.setText("Количество палуб");
comboBoxAmountOfDecks.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Одна", "Две", "Три" })); comboBoxAmountOfDecks.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Одна", "Две", "Три" }));
@ -77,7 +77,6 @@ public class JFrame_Ship extends javax.swing.JFrame {
}); });
buttonRight.setIcon(new javax.swing.ImageIcon(getClass().getResource("/containership/Rightarrow.png"))); // NOI18N buttonRight.setIcon(new javax.swing.ImageIcon(getClass().getResource("/containership/Rightarrow.png"))); // NOI18N
buttonRight.setActionCommand("");
buttonRight.setName("buttonRight"); // NOI18N buttonRight.setName("buttonRight"); // NOI18N
buttonRight.addActionListener(new java.awt.event.ActionListener() { buttonRight.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) { public void actionPerformed(java.awt.event.ActionEvent evt) {
@ -108,7 +107,7 @@ public class JFrame_Ship extends javax.swing.JFrame {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 381, Short.MAX_VALUE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 381, Short.MAX_VALUE)
.addComponent(buttonLeft, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(buttonLeft, javax.swing.GroupLayout.PREFERRED_SIZE, 35, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup() .addGroup(layout.createSequentialGroup()
.addComponent(labelAmountOfDeks) .addComponent(labelAmountOfDecks)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(comboBoxAmountOfDecks, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) .addComponent(comboBoxAmountOfDecks, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
@ -133,7 +132,7 @@ public class JFrame_Ship extends javax.swing.JFrame {
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(labelAmountOfDeks) .addComponent(labelAmountOfDecks)
.addComponent(comboBoxAmountOfDecks, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(comboBoxAmountOfDecks, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(buttonCreate)) .addComponent(buttonCreate))
@ -149,7 +148,7 @@ public class JFrame_Ship extends javax.swing.JFrame {
.addContainerGap()) .addContainerGap())
); );
labelAmountOfDeks.getAccessibleContext().setAccessibleName(""); labelAmountOfDecks.getAccessibleContext().setAccessibleName("");
pack(); pack();
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents
@ -236,7 +235,7 @@ public class JFrame_Ship extends javax.swing.JFrame {
private javax.swing.JButton buttonRight; private javax.swing.JButton buttonRight;
private javax.swing.JButton buttonUp; private javax.swing.JButton buttonUp;
private javax.swing.JComboBox<String> comboBoxAmountOfDecks; private javax.swing.JComboBox<String> comboBoxAmountOfDecks;
private javax.swing.JLabel labelAmountOfDeks; private javax.swing.JLabel labelAmountOfDecks;
private javax.swing.JLabel statusLabel; private javax.swing.JLabel statusLabel;
// End of variables declaration//GEN-END:variables // End of variables declaration//GEN-END:variables
} }