<?xml version="1.0" encoding="UTF-8" standalone="no"?><umlet_diagram><help_text>// Uncomment the following line to change the fontsize:
// fontsize=14

// Welcome to UMLet!
//
// Double-click on UML elements to add them to the diagram.
// Edit element properties by modifying the text in this panel.
// Edit the files in the 'palettes' directory to create your own element palettes.
// Hold down Ctrl to select multiple elements.
// Press Del to delete elements.
// Press Ctrl-c to copy an element, and to store the whole UML diagram to the system clipboard.
// Select "Custom elements &gt; New..." to create new element types.
//
// This text will be stored with each diagram;  use it for notes.</help_text><element><type>com.umlet.element.base.Class</type><coordinates><x>200</x><y>450</y><w>200</w><h>70</h></coordinates><panel_attributes>CarsTrucksTrainMainPanel
--
Dimension size = (1050, 700)
Color color = Color.gray
bg=orange</panel_attributes><additional_attributes/></element><element><type>com.umlet.element.base.Class</type><coordinates><x>320</x><y>170</y><w>100</w><h>50</h></coordinates><panel_attributes>Main
--
main(String[ ])
bg=magenta</panel_attributes><additional_attributes/></element><element><type>com.umlet.element.base.Class</type><coordinates><x>200</x><y>800</y><w>200</w><h>50</h></coordinates><panel_attributes>MouseListener
--
mouseClicked(MouseEvent)
bg=pink
</panel_attributes><additional_attributes/></element><element><type>com.umlet.element.base.Class</type><coordinates><x>200</x><y>640</y><w>320</w><h>150</h></coordinates><panel_attributes>DrawingPanel
--
static Dimension DEFAULT_SIZE = (830, 700)
static Color DEFAULT_COLOR = Color.cyan
 
--
@Override
paintComponent(Graphics)
    - asks Vehicles to draw themselves
DrawingPanel(List&lt;Vehicle&gt;)
bg=orange
</panel_attributes><additional_attributes/></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1080</x><y>370</y><w>330</w><h>240</h></coordinates><panel_attributes>Truck
--
static int DEFAULT_CONTAINER_HEIGHT = 60
static Dimension DEFAULT_CAB_SIZE = (24, 45)
static int DEFAULT_WHEEL_DIAMETER = 24
 
int containerLength
 
--
Truck(Point upperLeftCorner,
           Vehicle.DIRECTION direction,
           int containerLength)
 
@Override    void draw(Graphics)
@Override    void randomize()
bg=green</panel_attributes><additional_attributes/></element><element><type>com.umlet.element.base.Class</type><coordinates><x>570</x><y>10</y><w>840</w><h>260</h></coordinates><panel_attributes>&lt;&lt;abstract class&gt;&gt;
Vehicle
--
Point upperLeftCorner (upper-left corner of the Vehicle's stick-figure, regardless of which direction it is facing)
Vehicle.DIRECTION direction (facing LEFT or facing RIGHT)
 
--
Vehicle(Point position, Vehicle.DIRECTION direction)
 
public abstract void draw(Graphics) - Draws the vehicle on the given Graphics object
public abstract void randomize() - Sets the settable attributes of the Vehicle
                  (position, location, container length for a truck, number of boxcars for a train) to random values
 
protected:
   drawBoxWithTwoInteriorWheels(Graphics g,  Point upperLeftCorner,  Dimension widthAndHeight)
   drawBoxWithFourWheels(Graphics g,  Point upperLeftCorner,  Dimension widthAndHeight)
bg=green</panel_attributes><additional_attributes/></element><element><type>com.umlet.element.base.Class</type><coordinates><x>220</x><y>130</y><w>100</w><h>30</h></coordinates><panel_attributes>JFrame
bg=pink</panel_attributes><additional_attributes/></element><element><type>com.umlet.element.base.Class</type><coordinates><x>460</x><y>530</y><w>100</w><h>30</h></coordinates><panel_attributes>List&lt;Vehicle&gt;
bg=blue
fg=white
</panel_attributes><additional_attributes/></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>250</x><y>140</y><w>40</w><h>170</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>20;20;20;150</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>320</x><y>550</y><w>100</w><h>50</h></coordinates><panel_attributes>JPanel
--
repaint()
bg=pink</panel_attributes><additional_attributes/></element><element><type>com.umlet.element.base.Class</type><coordinates><x>620</x><y>490</y><w>320</w><h>430</h></coordinates><panel_attributes>ControlsPanel
--
static Dimension DEFAULT_SIZE = (190, 700)
static Color DEFAULT_COLOR = Color.gray
LayoutManager layout
    = new BoxLayout(this, BoxLayout.Y_AXIS)
static int
     DEFAULT_TRUCK_CONTAINER_LENGTH
     = 200
 
JTextField xPositionTextField
JTextField yPositionTextField
 
JTextField truckContainerLengthTextField
JTextField trainNumberOfBoxcarsTextField
 
JRadioButton vehiclePointsLeftRadioButton;
JRadioButton vehiclePointsRightRadioButton
 
JButton constructCarButton
JButton constructTruckButton
JButton constructTrainButton
JButton constructRandomVehicleButton
 
--
ControlsPanel(DrawingPanel, List&lt;Vehicle&gt;)
bg=gray
</panel_attributes><additional_attributes/></element><element><type>com.umlet.element.base.Class</type><coordinates><x>200</x><y>860</y><w>200</w><h>50</h></coordinates><panel_attributes>ActionListener
--
actionPerformed(ActionEvent)
bg=pink
</panel_attributes><additional_attributes/></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>380</x><y>796</y><w>260</w><h>71</h></coordinates><panel_attributes>lt=&lt;&lt;.
set JTextfields
for x-y position</panel_attributes><additional_attributes>20;34;240;34</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>380</x><y>846</y><w>260</w><h>71</h></coordinates><panel_attributes>lt=&lt;&lt;.
construct
Car, Truck, Train, Random</panel_attributes><additional_attributes>20;34;240;34</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>248</x><y>200</y><w>164</w><h>110</h></coordinates><panel_attributes>lt=&lt;-

 
                constructs</panel_attributes><additional_attributes>62;90;102;20</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>580</x><y>249</y><w>141</w><h>261</h></coordinates><panel_attributes>lt=&lt;-
m1=                   constructs</panel_attributes><additional_attributes>70;20;70;241</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>170</x><y>499</y><w>141</w><h>161</h></coordinates><panel_attributes>lt=&lt;-
m2=                   constructs</panel_attributes><additional_attributes>70;141;70;20</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>350</x><y>579</y><w>40</w><h>81</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>20;20;20;61</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>400</x><y>560</y><w>240</w><h>40</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>20;20;220;20</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>499</x><y>610</y><w>141</w><h>100</h></coordinates><panel_attributes>lt=&lt;-</panel_attributes><additional_attributes>20;80;121;20</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>670</x><y>310</y><w>370</w><h>170</h></coordinates><panel_attributes>Car
--
static Dimension DEFAULT_BODY_SIZE = (80, 20)
static Dimension DEFAULT_INTERIOR_SIZE = (32, 16)
static int DEFAULT_WHEEL_DIAMETER = 16
 
--
Car(Point upperLeftCorner) - Cars are uni-directional
 
@Override    void draw(Graphics)
@Override    void randomize()
bg=green</panel_attributes><additional_attributes/></element><element><type>com.umlet.element.base.Class</type><coordinates><x>960</x><y>630</y><w>450</w><h>290</h></coordinates><panel_attributes>Train
--

static Dimension DEFAULT_BOXCAR_SIZE = (150, 60)
static Dimension DEFAULT_ENGINE_BODY_SIZE = (120, 30)
static Dimension DEFAULT_ENGINE_CAB_SIZE = (60, 30)
static Dimension DEFAULT_ENGINE_SMOKESTACK_SIZE = (20, 45)
static int DEFAULT_GAP_BETWEEN_BOXCARS = 10
static int DEFAULT_WHEEL_DIAMETER = 20
 
int numberOfBoxcars
 
--
Train(Point upperLeftCorner,
           Vehicle.DIRECTION direction,
           int numberOfBoxcars)
 
@Override    void draw(Graphics)
@Override    void randomize()
bg=green
</panel_attributes><additional_attributes/></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>830</x><y>249</y><w>40</w><h>81</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>20;20;20;61</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1050</x><y>250</y><w>40</w><h>400</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>20;20;20;380</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1120</x><y>250</y><w>40</w><h>140</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>20;20;20;120</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>380</x><y>450</y><w>260</w><h>80</h></coordinates><panel_attributes>lt=&lt;-
            constructs</panel_attributes><additional_attributes>240;60;20;20</additional_attributes></element><element><type>com.umlet.element.base.Note</type><coordinates><x>950</x><y>490</y><w>100</w><h>130</h></coordinates><panel_attributes>Students:
You MUST
implement
/     draw/
and
/      randomize/
as shown.
bg=yellow</panel_attributes><additional_attributes/></element><element><type>com.umlet.element.base.Class</type><coordinates><x>430</x><y>290</y><w>200</w><h>100</h></coordinates><panel_attributes>CarsTrucksTrainApplet
--
LayoutManager layout
                         = FlowLayout
Dimension size = (1050, 730)
String title
bg=red</panel_attributes><additional_attributes/></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>350</x><y>500</y><w>40</w><h>70</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>20;50;20;20</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>190</x><y>290</y><w>210</w><h>100</h></coordinates><panel_attributes>CarsTrucksTrainFrame
--
LayoutManager layout
                        = FlowLayout
Dimension size = (1050, 730)
String title
bg=red</panel_attributes><additional_attributes/></element><element><type>com.umlet.element.base.Class</type><coordinates><x>460</x><y>130</y><w>100</w><h>30</h></coordinates><panel_attributes>JApplet
bg=pink</panel_attributes><additional_attributes/></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>490</x><y>140</y><w>40</w><h>170</h></coordinates><panel_attributes>lt=&lt;&lt;-</panel_attributes><additional_attributes>20;20;20;150</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>345</x><y>200</y><w>160</w><h>110</h></coordinates><panel_attributes>lt=&lt;-

               constructs</panel_attributes><additional_attributes>105;90;55;20</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>161</x><y>370</y><w>168</w><h>100</h></coordinates><panel_attributes>lt=&lt;-
                 constructs</panel_attributes><additional_attributes>99;80;69;20</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>322</x><y>369</y><w>184</w><h>101</h></coordinates><panel_attributes>lt=&lt;-
                     constructs</panel_attributes><additional_attributes>77;81;108;20</additional_attributes></element><element><type>com.umlet.element.base.Class</type><coordinates><x>1160</x><y>310</y><w>240</w><h>30</h></coordinates><panel_attributes>Enum DIRECTION = {LEFT, RIGHT}
bg=green</panel_attributes><additional_attributes/></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>1240</x><y>250</y><w>40</w><h>80</h></coordinates><panel_attributes>lt=&lt;-</panel_attributes><additional_attributes>20;60;20;20</additional_attributes></element><element><type>com.umlet.element.base.Note</type><coordinates><x>180</x><y>10</y><w>370</w><h>100</h></coordinates><panel_attributes>Students:  You must implement the classes shown here
and the relationships as shown by arrows.  You do NOT
need to implement the classes with exactly the same
fields, constructors and methods as shown here, but
they appear here in hopes that they will be helpful to you.
bg=yellow</panel_attributes><additional_attributes/></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>357</x><y>460</y><w>164</w><h>90</h></coordinates><panel_attributes>lt=&lt;-
r1=                         constructs</panel_attributes><additional_attributes>103;70;42;20</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>540</x><y>520</y><w>100</w><h>40</h></coordinates><panel_attributes>lt=&lt;-</panel_attributes><additional_attributes>20;20;80;20</additional_attributes></element><element><type>com.umlet.element.base.Relation</type><coordinates><x>470</x><y>540</y><w>60</w><h>120</h></coordinates><panel_attributes>lt=&lt;-</panel_attributes><additional_attributes>40;20;20;100</additional_attributes></element></umlet_diagram>