Class StatisticsView

java.lang.Object
  |
  +--DisplayPanel
        |
        +--StatisticsView
All Implemented Interfaces:
Observer

public class StatisticsView
extends DisplayPanel
implements Observer

View for simulation statistics.

See Also:
Serialized Form

Field Summary
protected  JLabel added
          View for the number of added orders.
protected  JLabel addedPer
          View for the percentage of added orders.
protected  JLabel failedAdds
          View for the number of failed adds.
protected  JLabel failedAddsPer
          View for the percentage of failed adds.
protected  JLabel failedRemoves
          View for the number of failed removes.
protected  JLabel failedRemovesPer
          View for the percentage of failed removes.
protected  JLabel fragmented
          View for the number of fragmented orders.
protected  JLabel fragmentedPer
          View for the percentage of fragmented orders.
protected  DecimalFormat hundredth
          String format for 2 decimal place precision.
protected  Statistics model
          Statistics data model for this view.
protected  JLabel moves
          View for the number of crane moves.
protected  JLabel movesPer
          View for the number of crane moves per operation.
protected  DecimalFormat percent
          String format for percentage.
protected  JLabel removed
          View for the number of removed orders.
protected  JLabel removedPer
          View for the percentage of removed orders.
protected  JLabel time
          View for the number of milliseconds used.
protected  JLabel timePer
          Vier for the number of milliseconds used per operation.
 
Constructor Summary
StatisticsView(Statistics s)
           
 
Method Summary
protected  void addComponents()
          Adds the components to this GUI.
protected  void print()
          Prints the statistics in the console.
 void update(Observable obj, Object arg)
          Called when the statistics data model changes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

protected Statistics model
Statistics data model for this view.


moves

protected JLabel moves
View for the number of crane moves.


movesPer

protected JLabel movesPer
View for the number of crane moves per operation.


added

protected JLabel added
View for the number of added orders.


addedPer

protected JLabel addedPer
View for the percentage of added orders.


failedAdds

protected JLabel failedAdds
View for the number of failed adds.


failedAddsPer

protected JLabel failedAddsPer
View for the percentage of failed adds.


fragmented

protected JLabel fragmented
View for the number of fragmented orders.


fragmentedPer

protected JLabel fragmentedPer
View for the percentage of fragmented orders.


removed

protected JLabel removed
View for the number of removed orders.


removedPer

protected JLabel removedPer
View for the percentage of removed orders.


failedRemoves

protected JLabel failedRemoves
View for the number of failed removes.


failedRemovesPer

protected JLabel failedRemovesPer
View for the percentage of failed removes.


time

protected JLabel time
View for the number of milliseconds used.


timePer

protected JLabel timePer
Vier for the number of milliseconds used per operation.


hundredth

protected DecimalFormat hundredth
String format for 2 decimal place precision.


percent

protected DecimalFormat percent
String format for percentage.

Constructor Detail

StatisticsView

public StatisticsView(Statistics s)
Method Detail

update

public void update(Observable obj,
                   Object arg)
Called when the statistics data model changes.

Specified by:
update in interface Observer
Parameters:
obj - the statistics object that changed
arg - an arbitrary argument (ignored)

addComponents

protected void addComponents()
Adds the components to this GUI.


print

protected void print()
Prints the statistics in the console.