Class WarehouseView

java.lang.Object
  |
  +--DisplayPanel
        |
        +--WarehouseView
All Implemented Interfaces:
EventListener, Observer, PropertyChangeListener

public class WarehouseView
extends DisplayPanel
implements PropertyChangeListener, Observer

View for a warehouse using row and column coordinates to specify locations in the warehouse in tabular format.

See Also:
Serialized Form

Field Summary
protected  SpaceView crane
          Space view currently inhabited by the crane.
protected  SpaceView destination
          Space view currently the crane's destination.
protected  Warehouse model
          Warehouse data model for this view.
protected  SpaceView[][] spaces
          Array of space views used in this view.
 
Constructor Summary
WarehouseView(Warehouse w)
          Constructs a view for the given warehouse.
 
Method Summary
 void propertyChange(PropertyChangeEvent evt)
          Updates this view when the warehouse crane is changed.
 void update(Observable obj, Object arg)
          Updates this.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

model

protected Warehouse model
Warehouse data model for this view.


spaces

protected SpaceView[][] spaces
Array of space views used in this view.


crane

protected SpaceView crane
Space view currently inhabited by the crane.


destination

protected SpaceView destination
Space view currently the crane's destination.

Constructor Detail

WarehouseView

public WarehouseView(Warehouse w)
Constructs a view for the given warehouse.

Method Detail

propertyChange

public void propertyChange(PropertyChangeEvent evt)
Updates this view when the warehouse crane is changed.

Specified by:
propertyChange in interface PropertyChangeListener
Parameters:
evt - event object encapsulating the property change

update

public void update(Observable obj,
                   Object arg)
Updates this.

Specified by:
update in interface Observer