org.gjt.universe.scheme001
Class FleetOrderModel_001

java.lang.Object
  |
  +--org.gjt.universe.OrderModel
        |
        +--org.gjt.universe.scheme001.FleetOrderModel_001
All Implemented Interfaces:
NotificationObserver, TurnProcessedListener

public class FleetOrderModel_001
extends OrderModel
implements NotificationObserver

FleetOrderModel_001.java Created: Feb 23 1999 Updated: Apr 28 2001

Version:
2
Author:
Sean Starkey, Allan Noordvyk

Field Summary
private static java.lang.String COLONIZE_PLANET
           
private  FleetID fleet
           
private  java.util.Vector potentialOrderVector
           
private static java.lang.String TRAVEL_SYSTEM
           
private static java.lang.String TRAVEL_WORMHOLE
           
private  CivID viewer
           
 
Fields inherited from class org.gjt.universe.OrderModel
 
Constructor Summary
FleetOrderModel_001(CivID AID, FleetID FID)
           
 
Method Summary
 void addOrder(int item)
          This concrete implementation of an inherited abstract method is called when the user has selected a potential order that he or she wishes to be made into an actual order.
 void deleteOrder(int item)
          This concrete implementation of an inherited abstract method deletes the currently assigned order at the given position in the queue.
 java.util.Vector getOrderVector()
          This concrete implementation of an inherited abstract method returns the vector of strings representing potential orders that may be given to the assigned fleet.
 java.util.Vector getQueueVector()
          This concrete implementation of an inherited abstract method returns a vector of strings representing the queue of actual orders currently assigned to the fleet.
 void handleNotification(Notification aNotification)
          This method is called automatically whenever our fleet posts a notification (because we registered for this notification in our setFleet method).
 void setFleet(FleetID FID)
          This method sets the fleet whose orders are being represented and manipulated via this object.
 void turnProcessed()
           
private  void updatePotentialOrderVector()
          This internal method is called whenever the assigned fleet or its composition is changed.
 
Methods inherited from class org.gjt.universe.OrderModel
addOrderModelChangeListener, cleanup, fireOrderVectorChanged, fireQueueVectorChanged, popup, removeOrderModelChangeListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRAVEL_SYSTEM

private static java.lang.String TRAVEL_SYSTEM

TRAVEL_WORMHOLE

private static java.lang.String TRAVEL_WORMHOLE

COLONIZE_PLANET

private static java.lang.String COLONIZE_PLANET

fleet

private FleetID fleet

potentialOrderVector

private java.util.Vector potentialOrderVector

viewer

private CivID viewer
Constructor Detail

FleetOrderModel_001

public FleetOrderModel_001(CivID AID,
                           FleetID FID)
Method Detail

updatePotentialOrderVector

private void updatePotentialOrderVector()
This internal method is called whenever the assigned fleet or its composition is changed. It ensures that the orders available for issuing to the fleet make sense given the current fleet's capabilities.


getOrderVector

public java.util.Vector getOrderVector()
This concrete implementation of an inherited abstract method returns the vector of strings representing potential orders that may be given to the assigned fleet.

Specified by:
getOrderVector in class OrderModel

getQueueVector

public java.util.Vector getQueueVector()
This concrete implementation of an inherited abstract method returns a vector of strings representing the queue of actual orders currently assigned to the fleet.

Specified by:
getQueueVector in class OrderModel

addOrder

public void addOrder(int item)
This concrete implementation of an inherited abstract method is called when the user has selected a potential order that he or she wishes to be made into an actual order. This method determined which potential order was selected and creates an actual order to match, collecting any specifics (e.g. planet, star system, etc.) that might be required.

Specified by:
addOrder in class OrderModel
Parameters:
item - The position in the vector of the potential order to be added as an actual order.

deleteOrder

public void deleteOrder(int item)
This concrete implementation of an inherited abstract method deletes the currently assigned order at the given position in the queue.

Specified by:
deleteOrder in class OrderModel
Parameters:
item - The position in the queue of the item to be deleted.

setFleet

public void setFleet(FleetID FID)
This method sets the fleet whose orders are being represented and manipulated via this object. This object will register as an observer of notifications from this fleet. Likewise, it will deregister as an observer of any previously assigned fleet. This object will also ensure that the set of potential orders available to any new fleet is updated.


turnProcessed

public void turnProcessed()
Specified by:
turnProcessed in interface TurnProcessedListener

handleNotification

public void handleNotification(Notification aNotification)
This method is called automatically whenever our fleet posts a notification (because we registered for this notification in our setFleet method).

Specified by:
handleNotification in interface NotificationObserver
Parameters:
aNotification - The notification posted by our fleet.


Copyright © 2001 Universe Dev Team All Rights Reserved.