From 168474fb5dd1dde22578b58b08d2420482d62b07 Mon Sep 17 00:00:00 2001 From: Tomasz Piechucki Date: Tue, 3 May 2011 20:24:55 +0000 Subject: [PATCH] =?UTF-8?q?Oprogramowany=20przycisk=20usu=C5=84=20-=20usuw?= =?UTF-8?q?anie=20ostatniego=20pasa=C5=BCera?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Winda/src/winda/gui/WindaView.form | 33 +++++++++++++++++-- Winda/src/winda/gui/WindaView.java | 30 +++++++++++++++-- .../winda/gui/resources/WindaView.properties | 1 + Winda/src/winda/logic/Winda.java | 6 ++++ 4 files changed, 66 insertions(+), 4 deletions(-) diff --git a/Winda/src/winda/gui/WindaView.form b/Winda/src/winda/gui/WindaView.form index 91a5c58..845efda 100644 --- a/Winda/src/winda/gui/WindaView.form +++ b/Winda/src/winda/gui/WindaView.form @@ -634,7 +634,6 @@ - @@ -643,6 +642,21 @@ + + + + + + + + + + + + + + + @@ -663,7 +677,11 @@ - + + + + + @@ -710,6 +728,17 @@ + + + + + + + + + + + diff --git a/Winda/src/winda/gui/WindaView.java b/Winda/src/winda/gui/WindaView.java index c00d10b..3c951e0 100644 --- a/Winda/src/winda/gui/WindaView.java +++ b/Winda/src/winda/gui/WindaView.java @@ -208,6 +208,8 @@ public class WindaView extends FrameView{ jLabel13 = new javax.swing.JLabel(); jLabel14 = new javax.swing.JLabel(); jTextField2 = new javax.swing.JTextField(); + jLabel15 = new javax.swing.JLabel(); + jTextField3 = new javax.swing.JTextField(); scrollPane1 = new java.awt.ScrollPane(); menuBar = new javax.swing.JMenuBar(); 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.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); jPanel5.setLayout(jPanel5Layout); jPanel5Layout.setHorizontalGroup( @@ -595,11 +602,22 @@ public class WindaView extends FrameView{ .addGroup(jPanel5Layout.createSequentialGroup() .addContainerGap() .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(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)))) .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.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -618,7 +636,11 @@ public class WindaView extends FrameView{ .addComponent(jLabel14)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) .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 @@ -807,6 +829,7 @@ public class WindaView extends FrameView{ w.Start(); jTextField1.setText(Double.toString(w.GetCzasJazdy())); jTextField2.setText(Double.toString(w.GetCzasSredniObslugi())); + jTextField3.setText(Double.toString(w.GetCzasPietra())); this.setupAnimation(); this.goToPieto(); }//GEN-LAST:event_jButton3ActionPerformed @@ -846,6 +869,7 @@ public class WindaView extends FrameView{ w.SetNowyProjekt(); jTextField1.setText(""); jTextField2.setText(""); + jTextField3.setText(""); w.SetIloscPieter(floor_count); w.SetCzasJazdyPietro(this.czasJazdyPrzezPietro); w.SetCzasWeWyOsoby(czasWeWy); @@ -904,6 +928,7 @@ public class WindaView extends FrameView{ private javax.swing.JLabel jLabel12; private javax.swing.JLabel jLabel13; private javax.swing.JLabel jLabel14; + private javax.swing.JLabel jLabel15; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; @@ -937,6 +962,7 @@ public class WindaView extends FrameView{ private javax.swing.JSpinner jSpinner7; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jTextField2; + private javax.swing.JTextField jTextField3; private javax.swing.JPanel mainPanel; private javax.swing.JMenuBar menuBar; public transient java.awt.ScrollPane scrollPane1; diff --git a/Winda/src/winda/gui/resources/WindaView.properties b/Winda/src/winda/gui/resources/WindaView.properties index a4d21d2..1b9136f 100644 --- a/Winda/src/winda/gui/resources/WindaView.properties +++ b/Winda/src/winda/gui/resources/WindaView.properties @@ -58,3 +58,4 @@ jMenuItem3.text=Zapisz Log jLabel14.text=\u015bredni czas obs\u0142ugi pasa\u017cera (ms): jTextField2.text= jCheckBox2.text=dwie windy +jLabel15.text=czas / pietro (ms): diff --git a/Winda/src/winda/logic/Winda.java b/Winda/src/winda/logic/Winda.java index ef1437a..072a799 100644 --- a/Winda/src/winda/logic/Winda.java +++ b/Winda/src/winda/logic/Winda.java @@ -19,6 +19,7 @@ public class Winda { private double CzasJazdy; private double CzasWeWyOsoby; private double CzasSredniObslugi; + private double CzasPietra; private int IloscPieter; private int IloscPasazerow; private List pasazerowieCollection = new ArrayList(); @@ -75,6 +76,10 @@ public class Winda { return this.CzasSredniObslugi; } + public double GetCzasPietra(){ + return this.CzasPietra; + } + public List GetTrasa(){ return this.Trasa; } @@ -99,6 +104,7 @@ public class Winda { Trasa = AlgorytmWindy.Trasa(pasazerowieCollection); CzasJazdy = Trasa.size()*CzasJazdyPietro+IloscPasazerow*CzasWeWyOsoby*2; CzasSredniObslugi = CzasJazdy / IloscPasazerow; + CzasPietra = CzasJazdy / IloscPieter; log = new Logger(this.Trasa); }