FFFFFFFFFFFFFUUUUUUUUUUUUUUU
This commit is contained in:
parent
15e333d9bc
commit
2c7c2762c2
4 changed files with 37 additions and 19 deletions
|
@ -33,7 +33,7 @@
|
|||
<EmptySpace type="unrelated" max="-2" attributes="0"/>
|
||||
<Component id="jButton4" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace min="-2" pref="28" max="-2" attributes="0"/>
|
||||
<Component id="jSlider1" pref="420" max="32767" attributes="0"/>
|
||||
<Component id="jSlider1" pref="397" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
|
@ -68,7 +68,7 @@
|
|||
<EmptySpace min="-2" pref="18" max="-2" attributes="0"/>
|
||||
<Component id="jPanel5" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="jSeparator1" alignment="1" pref="558" max="32767" attributes="0"/>
|
||||
<Component id="jSeparator1" alignment="1" pref="541" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace min="-2" pref="19" max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
|
@ -99,7 +99,7 @@
|
|||
<Component id="jSlider1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<Component id="jSeparator2" alignment="0" pref="508" max="32767" attributes="1"/>
|
||||
<Component id="jSeparator2" alignment="0" pref="490" max="32767" attributes="1"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</Group>
|
||||
|
@ -154,8 +154,8 @@
|
|||
</Group>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" attributes="0">
|
||||
<Component id="jSpinner1" pref="52" max="32767" attributes="0"/>
|
||||
<Component id="jSpinner2" pref="52" max="32767" attributes="0"/>
|
||||
<Component id="jSpinner1" pref="69" max="32767" attributes="0"/>
|
||||
<Component id="jSpinner2" pref="69" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace min="28" pref="28" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
|
@ -266,7 +266,7 @@
|
|||
</Group>
|
||||
<Group type="102" alignment="1" attributes="0">
|
||||
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="41" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="42" max="32767" attributes="0"/>
|
||||
<Component id="jSpinner3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
|
@ -275,13 +275,13 @@
|
|||
</Group>
|
||||
<EmptySpace min="-2" pref="56" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="jSeparator3" alignment="1" pref="270" max="32767" attributes="0"/>
|
||||
<Component id="jSeparator3" alignment="1" pref="253" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jButton5" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="jButton6" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="149" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="99" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
|
@ -309,7 +309,7 @@
|
|||
<Component id="jCheckBox1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jSpinner5" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace max="32767" attributes="0"/>
|
||||
<EmptySpace pref="19" max="32767" attributes="0"/>
|
||||
<Group type="103" groupAlignment="3" attributes="0">
|
||||
<Component id="jButton5" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jButton6" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
|
@ -405,18 +405,18 @@
|
|||
<Group type="102" attributes="0">
|
||||
<EmptySpace min="-2" pref="50" max="-2" attributes="0"/>
|
||||
<Component id="jLabel7" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="65" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="74" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="jSeparator5" alignment="1" pref="215" max="32767" attributes="0"/>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jRadioButton1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="124" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="136" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jRadioButton2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="67" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="88" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
|
@ -661,7 +661,7 @@
|
|||
<Component id="jTextField1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="jLabel13" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="231" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="228" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
|
|
|
@ -31,6 +31,7 @@ import winda.logic.Winda;
|
|||
public class WindaView extends FrameView{
|
||||
private ElevatorMovement em;
|
||||
Winda w = new Winda();
|
||||
private int floor_count =12;
|
||||
public WindaView(SingleFrameApplication app) {
|
||||
super(app);
|
||||
|
||||
|
@ -95,6 +96,23 @@ public class WindaView extends FrameView{
|
|||
this.drawAnimation();
|
||||
|
||||
}
|
||||
|
||||
private void setupAnimation(){
|
||||
int []passangers = new int[this.floor_count];
|
||||
for(int i=0;i<this.floor_count;i++)
|
||||
passangers[i] = w.GetTrasa().get(i).pasazerowieWsiadający.size();
|
||||
|
||||
this.em.setPassangersOnFloors(passangers);
|
||||
|
||||
}
|
||||
|
||||
private void goToPieto(){
|
||||
for(int i=0;i<this.w.GetTrasa().size();i++){
|
||||
this.em.setPietro(this.w.GetTrasa().get(i));
|
||||
Thread t = new Thread(em);
|
||||
t.start();
|
||||
}
|
||||
}
|
||||
|
||||
private void drawAnimation(){
|
||||
this.em = new ElevatorMovement(12);
|
||||
|
@ -742,11 +760,14 @@ public class WindaView extends FrameView{
|
|||
int iloscPieter = Integer.parseInt(ip);
|
||||
w.SetIloscPieter(iloscPieter);
|
||||
this.newAnimation(iloscPieter);
|
||||
this.floor_count = iloscPieter;
|
||||
}//GEN-LAST:event_jSpinner1StateChanged
|
||||
|
||||
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
|
||||
w.Start();
|
||||
jTextField1.setText(Double.toString(w.GetCzasJazdy()));
|
||||
this.setupAnimation();
|
||||
this.goToPieto();
|
||||
}//GEN-LAST:event_jButton3ActionPerformed
|
||||
|
||||
private void jSpinner6StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSpinner6StateChanged
|
||||
|
@ -770,10 +791,6 @@ public class WindaView extends FrameView{
|
|||
p.pasazerowieWsiadający.add(new Pasazer(0,2,2));
|
||||
this.em.setPassangersOnFloor(2, 1);
|
||||
em.setTimeForFloor(1000);
|
||||
|
||||
this.em.setPietro(p);
|
||||
Thread t = new Thread(em);
|
||||
t.start();
|
||||
}//GEN-LAST:event_jButton1ActionPerformed
|
||||
|
||||
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
|
||||
|
|
|
@ -48,6 +48,6 @@ public class PasazerSort {
|
|||
*/
|
||||
|
||||
public void sortByStart(){
|
||||
this.mksortByStart( 0, this.array.size() );
|
||||
this.mksortByStart( 0, this.array.size()-1 );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,8 +31,9 @@ public class Winda {
|
|||
CzasWeWyOsoby = 1;
|
||||
IloscPieter = 12;
|
||||
AlgorytmWindy.SetMaxPietro(IloscPieter);
|
||||
pasazerowieCollection = parser.Wczytaj("/crypt/przemo/Dropbox/winda-ee2011/Winda/DemoDane.txt");
|
||||
pasazerowieCollection = parser.Wczytaj("c:\\DemoDane.txt");
|
||||
IloscPasazerow = pasazerowieCollection.size();
|
||||
this.Trasa = new ArrayList();
|
||||
}
|
||||
|
||||
public void SetCzasJazdyPietro(double czas){
|
||||
|
|
Loading…
Reference in a new issue