Oprogramowany przycisk usuń - usuwanie ostatniego pasażera

This commit is contained in:
Tomasz Piechucki 2011-05-03 20:24:55 +00:00
parent a07a92d77d
commit 168474fb5d
4 changed files with 66 additions and 4 deletions

View file

@ -634,7 +634,6 @@
<Group type="102" alignment="0" attributes="0"> <Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="1" max="-2" attributes="0"> <Group type="103" groupAlignment="1" max="-2" attributes="0">
<Component id="jTextField2" alignment="0" max="32767" attributes="0"/>
<Component id="jLabel14" alignment="0" max="32767" attributes="0"/> <Component id="jLabel14" alignment="0" max="32767" attributes="0"/>
<Component id="jTextField1" alignment="0" max="32767" attributes="0"/> <Component id="jTextField1" alignment="0" max="32767" attributes="0"/>
<Component id="jLabel12" alignment="0" max="32767" attributes="1"/> <Component id="jLabel12" alignment="0" max="32767" attributes="1"/>
@ -643,6 +642,21 @@
</Group> </Group>
<EmptySpace max="-2" attributes="0"/> <EmptySpace max="-2" attributes="0"/>
</Group> </Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jLabel15" pref="165" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jTextField2" pref="165" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
</Group>
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Component id="jTextField3" pref="165" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="12" max="-2" attributes="0"/>
</Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
<DimensionLayout dim="1"> <DimensionLayout dim="1">
@ -663,7 +677,11 @@
</Group> </Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/> <EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jTextField2" min="-2" max="-2" attributes="0"/> <Component id="jTextField2" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="183" max="32767" attributes="0"/> <EmptySpace min="-2" pref="11" max="-2" attributes="0"/>
<Component id="jLabel15" min="-2" max="-2" attributes="0"/>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Component id="jTextField3" min="-2" max="-2" attributes="0"/>
<EmptySpace pref="127" max="32767" attributes="0"/>
</Group> </Group>
</Group> </Group>
</DimensionLayout> </DimensionLayout>
@ -710,6 +728,17 @@
<Property name="name" type="java.lang.String" value="jTextField2" noResource="true"/> <Property name="name" type="java.lang.String" value="jTextField2" noResource="true"/>
</Properties> </Properties>
</Component> </Component>
<Component class="javax.swing.JLabel" name="jLabel15">
<Properties>
<Property name="text" type="java.lang.String" resourceKey="jLabel15.text"/>
<Property name="name" type="java.lang.String" value="jLabel15" noResource="true"/>
</Properties>
</Component>
<Component class="javax.swing.JTextField" name="jTextField3">
<Properties>
<Property name="name" type="java.lang.String" value="jTextField3" noResource="true"/>
</Properties>
</Component>
</SubComponents> </SubComponents>
</Container> </Container>
<Container class="java.awt.ScrollPane" name="scrollPane1"> <Container class="java.awt.ScrollPane" name="scrollPane1">

View file

@ -208,6 +208,8 @@ public class WindaView extends FrameView{
jLabel13 = new javax.swing.JLabel(); jLabel13 = new javax.swing.JLabel();
jLabel14 = new javax.swing.JLabel(); jLabel14 = new javax.swing.JLabel();
jTextField2 = new javax.swing.JTextField(); jTextField2 = new javax.swing.JTextField();
jLabel15 = new javax.swing.JLabel();
jTextField3 = new javax.swing.JTextField();
scrollPane1 = new java.awt.ScrollPane(); scrollPane1 = new java.awt.ScrollPane();
menuBar = new javax.swing.JMenuBar(); menuBar = new javax.swing.JMenuBar();
javax.swing.JMenu fileMenu = new javax.swing.JMenu(); javax.swing.JMenu fileMenu = new javax.swing.JMenu();
@ -577,6 +579,11 @@ public class WindaView extends FrameView{
jTextField2.setText(resourceMap.getString("jTextField2.text")); // NOI18N jTextField2.setText(resourceMap.getString("jTextField2.text")); // NOI18N
jTextField2.setName("jTextField2"); // NOI18N jTextField2.setName("jTextField2"); // NOI18N
jLabel15.setText(resourceMap.getString("jLabel15.text")); // NOI18N
jLabel15.setName("jLabel15"); // NOI18N
jTextField3.setName("jTextField3"); // NOI18N
javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5); javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
jPanel5.setLayout(jPanel5Layout); jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGroup( jPanel5Layout.setHorizontalGroup(
@ -595,11 +602,22 @@ public class WindaView extends FrameView{
.addGroup(jPanel5Layout.createSequentialGroup() .addGroup(jPanel5Layout.createSequentialGroup()
.addContainerGap() .addContainerGap()
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
.addComponent(jTextField2, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel14, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jLabel14, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTextField1, javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextField1, javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel12, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))) .addComponent(jLabel12, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
.addContainerGap()) .addContainerGap())
.addGroup(jPanel5Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel15, javax.swing.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE)
.addGap(12, 12, 12))
.addGroup(jPanel5Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE)
.addGap(12, 12, 12))
.addGroup(jPanel5Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jTextField3, javax.swing.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE)
.addGap(12, 12, 12))
); );
jPanel5Layout.setVerticalGroup( jPanel5Layout.setVerticalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
@ -618,7 +636,11 @@ public class WindaView extends FrameView{
.addComponent(jLabel14)) .addComponent(jLabel14))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(183, Short.MAX_VALUE)) .addGap(11, 11, 11)
.addComponent(jLabel15)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(127, Short.MAX_VALUE))
); );
scrollPane1.setName("scrollPane1"); // NOI18N scrollPane1.setName("scrollPane1"); // NOI18N
@ -807,6 +829,7 @@ public class WindaView extends FrameView{
w.Start(); w.Start();
jTextField1.setText(Double.toString(w.GetCzasJazdy())); jTextField1.setText(Double.toString(w.GetCzasJazdy()));
jTextField2.setText(Double.toString(w.GetCzasSredniObslugi())); jTextField2.setText(Double.toString(w.GetCzasSredniObslugi()));
jTextField3.setText(Double.toString(w.GetCzasPietra()));
this.setupAnimation(); this.setupAnimation();
this.goToPieto(); this.goToPieto();
}//GEN-LAST:event_jButton3ActionPerformed }//GEN-LAST:event_jButton3ActionPerformed
@ -846,6 +869,7 @@ public class WindaView extends FrameView{
w.SetNowyProjekt(); w.SetNowyProjekt();
jTextField1.setText(""); jTextField1.setText("");
jTextField2.setText(""); jTextField2.setText("");
jTextField3.setText("");
w.SetIloscPieter(floor_count); w.SetIloscPieter(floor_count);
w.SetCzasJazdyPietro(this.czasJazdyPrzezPietro); w.SetCzasJazdyPietro(this.czasJazdyPrzezPietro);
w.SetCzasWeWyOsoby(czasWeWy); w.SetCzasWeWyOsoby(czasWeWy);
@ -904,6 +928,7 @@ public class WindaView extends FrameView{
private javax.swing.JLabel jLabel12; private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13; private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14; private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel5;
@ -937,6 +962,7 @@ public class WindaView extends FrameView{
private javax.swing.JSpinner jSpinner7; private javax.swing.JSpinner jSpinner7;
private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jTextField2; private javax.swing.JTextField jTextField2;
private javax.swing.JTextField jTextField3;
private javax.swing.JPanel mainPanel; private javax.swing.JPanel mainPanel;
private javax.swing.JMenuBar menuBar; private javax.swing.JMenuBar menuBar;
public transient java.awt.ScrollPane scrollPane1; public transient java.awt.ScrollPane scrollPane1;

View file

@ -58,3 +58,4 @@ jMenuItem3.text=Zapisz Log
jLabel14.text=\u015bredni czas obs\u0142ugi pasa\u017cera (ms): jLabel14.text=\u015bredni czas obs\u0142ugi pasa\u017cera (ms):
jTextField2.text= jTextField2.text=
jCheckBox2.text=dwie windy jCheckBox2.text=dwie windy
jLabel15.text=czas / pietro (ms):

View file

@ -19,6 +19,7 @@ public class Winda {
private double CzasJazdy; private double CzasJazdy;
private double CzasWeWyOsoby; private double CzasWeWyOsoby;
private double CzasSredniObslugi; private double CzasSredniObslugi;
private double CzasPietra;
private int IloscPieter; private int IloscPieter;
private int IloscPasazerow; private int IloscPasazerow;
private List<Pasazer> pasazerowieCollection = new ArrayList<Pasazer>(); private List<Pasazer> pasazerowieCollection = new ArrayList<Pasazer>();
@ -75,6 +76,10 @@ public class Winda {
return this.CzasSredniObslugi; return this.CzasSredniObslugi;
} }
public double GetCzasPietra(){
return this.CzasPietra;
}
public List<Pietro> GetTrasa(){ public List<Pietro> GetTrasa(){
return this.Trasa; return this.Trasa;
} }
@ -99,6 +104,7 @@ public class Winda {
Trasa = AlgorytmWindy.Trasa(pasazerowieCollection); Trasa = AlgorytmWindy.Trasa(pasazerowieCollection);
CzasJazdy = Trasa.size()*CzasJazdyPietro+IloscPasazerow*CzasWeWyOsoby*2; CzasJazdy = Trasa.size()*CzasJazdyPietro+IloscPasazerow*CzasWeWyOsoby*2;
CzasSredniObslugi = CzasJazdy / IloscPasazerow; CzasSredniObslugi = CzasJazdy / IloscPasazerow;
CzasPietra = CzasJazdy / IloscPieter;
log = new Logger(this.Trasa); log = new Logger(this.Trasa);
} }