Warning: Can't use blame annotator:
svn blame failed on trunk/src/tmcsim/client/cadscreens/TO_RoutedMessage.java: ("Can't find a temporary directory: Internal error", 20014)

source: tmcsimulator/trunk/src/tmcsim/client/cadscreens/TO_RoutedMessage.java @ 2

Revision 2, 2.0 KB checked in by jdalbey, 10 years ago (diff)

Initial Import of project files

RevLine 
1package tmcsim.client.cadscreens;
2
3
4import javax.swing.text.Document;
5
6import tmcsim.cadmodels.CADRoutedMessage;
7import tmcsim.cadmodels.RoutedMessageModel;
8import tmcsim.client.cadscreens.view.CADMainView;
9import tmcsim.common.CADEnums.TEXT_STYLES;
10
11/**
12 * TO_RoutedMessage is the view component to the RoutedMessageModel
13 * model object.  The screen is shown when the user views a queued message.
14 * When the class is instantiated with reference to the model data and
15 * document, string and style pairs are added to the view document. 
16 * This class extends from the CADMainView object, which
17 * contains the common methods and data needed for display and user
18 * interaction. 
19 *
20 * @see RoutedMessageModel
21 * @author Matthew Cechini
22 * @version $Revision: 1.4 $ $Date: 2009/04/17 16:27:45 $
23 */
24public class TO_RoutedMessage extends CADMainView {
25
26    /** Instance of the model, containing the message data for this view class. */
27    private RoutedMessageModel theModel;
28   
29    /**
30     * Constructor. Initializes the screen with the appropriate formatted text.
31     *
32     * @param newModel The model data object.
33     * @param viewdoc  The Document object used for displaying the model data.
34     */
35    public TO_RoutedMessage(RoutedMessageModel newModel, Document viewDoc) {
36        super(viewDoc);
37       
38        theModel    = newModel;     
39       
40        initialize();
41    }   
42   
43   
44    /**
45     * This method initializes the screen's Document object with
46     * text and style pairs to create the correct screen format.
47     */
48    private void initialize() { 
49       
50        CADRoutedMessage displayMessage = theModel.getCurrentMessage();
51       
52        addDocElement("FROM POS " +  displayMessage.fromPosition
53                + "     MESSAGE      " + "TO POS " 
54                + displayMessage.toPosition + "\n", TEXT_STYLES.CYAN);
55                       
56
57        addDocElement(displayMessage.message + "\n",
58                TEXT_STYLES.CYAN);
59       
60    }
61}
Note: See TracBrowser for help on using the repository browser.