Changeset 76 in tmcsimulator-scriptbuilder


Ignore:
Timestamp:
08/25/2017 12:22:28 PM (9 years ago)
Author:
bmcguffin
Message:

Added javadoc for several files.

Location:
trunk/src
Files:
2 deleted
37 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/event/editor/AudioPanel.java

    r7 r76  
    2626    } 
    2727 
     28    /** 
     29     * Load the script event associated with this editor panel. 
     30     *  
     31     * @param sei The script event in question 
     32     */ 
     33    @Override 
    2834    public void getEventObject(I_ScriptEvent sei) 
    2935    { 
  • trunk/src/event/editor/CADLogPanel.java

    r7 r76  
    2929    } 
    3030 
     31    /** 
     32     * Load the script event associated with this editor panel. 
     33     * 
     34     * @param sei The script event in question 
     35     */ 
     36    @Override 
    3137    public void getEventObject(I_ScriptEvent sei) 
    3238    { 
     
    4248            public void keyPressed(KeyEvent e) 
    4349            { 
    44                 if(e.getKeyCode() == KeyEvent.VK_ENTER) 
     50                if (e.getKeyCode() == KeyEvent.VK_ENTER) 
    4551                { 
    4652                    event.detail = CadTextField.getText(); 
  • trunk/src/event/editor/CCTVPanel.java

    r50 r76  
    5454    } 
    5555 
     56    @Override 
    5657    public void setRemoveListener(ActionListener listener) 
    5758    { 
     
    5960    } 
    6061 
    61     public boolean isOptional() 
    62     { 
    63         return false; 
    64     } 
    65  
     62    @Override 
    6663    public void getEventObject(I_ScriptEvent sei) 
    6764    { 
     
    7370    } 
    7471 
     72    @Override 
    7573    public void update(Observable o, Object arg) 
    7674    { 
  • trunk/src/event/editor/CHPRadioPanel.java

    r7 r76  
    3131    } 
    3232 
     33    @Override 
    3334    public void getEventObject(I_ScriptEvent sei) 
    3435    { 
  • trunk/src/event/editor/CMSEvaluationPanel.java

    r50 r76  
    3636    } 
    3737 
     38    @Override 
    3839    public void getEventObject(I_ScriptEvent sei) 
    3940    { 
  • trunk/src/event/editor/Editor.java

    r7 r76  
    452452    private PropertyModel model = new PropertyModel(); 
    453453 
    454     public PropertyModel getPropertyModel() 
    455     { 
    456         return model; 
    457     } 
     454//    public PropertyModel getPropertyModel() 
     455//    { 
     456//        return model; 
     457//    } 
    458458 
    459459    public void addProperty(Properties property, I_ScriptEvent se) 
     
    489489    }; 
    490490 
     491    /** 
     492     * Blank constructor for a new editor. 
     493     */ 
    491494    public Editor() 
    492495    { 
  • trunk/src/event/editor/RemoveablePanel.java

    r7 r76  
    77{ 
    88 
    9      
    10  
     9    /** 
     10     * Set up the listener for removing this panel. 
     11     * 
     12     * @param listener the remove listener to be added 
     13     */ 
    1114    void setRemoveListener(ActionListener listener); 
    1215} 
  • trunk/src/event/editor/ScriptEventEditorPanel.java

    r7 r76  
    1616{ 
    1717 
     18    /** 
     19     * Load the script event associated with this editor panel. 
     20     * 
     21     * @param sei The script event in question 
     22     */ 
    1823    void getEventObject(I_ScriptEvent sei); 
    1924} 
  • trunk/src/scriptbuilder/gui/IncidentEditorFrame.java

    r73 r76  
    240240     * Constructor. Prep new script model, initialize the GUI, and add listeners 
    241241     * for all buttons. 
     242     *  
     243     * @param theIncident the Script Incident which this window will edit. 
    242244     */ 
    243245    public IncidentEditorFrame(ScriptIncident theIncident) 
  • trunk/src/scriptbuilder/gui/IncidentPaletteFrame.java

    r73 r76  
    3131    private SimulationScript dummyScript; 
    3232 
     33    /** 
     34     * The list of incidents to be displayed in the palette. 
     35     */ 
    3336    public ArrayList<ScriptIncident> incidentList; 
    3437 
     
    3639 
    3740    /** 
    38      * Creates new form IncidentPaletteFrame 
     41     * Create new IncidentPaletteFrame from the form. 
     42     * 
     43     * @param scr The currently running script, to which new incidents will be 
     44     * added. 
    3945     */ 
    40     public IncidentPaletteFrame(SimulationScript s) 
    41     { 
    42         script = s; 
     46    public IncidentPaletteFrame(SimulationScript scr) 
     47    { 
     48        script = scr; 
    4349 
    4450        panelAdd = new JPanel(); 
     
    5460        incidentList = loadIncidentsFromFiles("Incidents"); 
    5561 
    56         recalculateList(); 
     62        refresh(); 
    5763 
    5864    } 
     
    128134    } 
    129135 
    130     private void recalculateList() 
     136    private void refresh() 
    131137    { 
    132138 
     
    136142    } 
    137143 
     144    /** 
     145     * Attempt to add an incident to the script. If successful, refresh the 
     146     * palette. 
     147     * 
     148     * @param incPanel the Add Panel which holds the incident to be added. 
     149     */ 
    138150    public void addIncidentToScript(IncidentPaletteAddPanel incPanel) 
    139151    { 
    140152        if (script.addIncident(incPanel.incident)) 
    141153        { 
    142             recalculateList(); 
     154            refresh(); 
    143155        } 
    144156    } 
  • trunk/src/scriptbuilder/gui/drawers/TimeSliceDrawer.java

    r53 r76  
    103103     * @param g2d the graphics component 
    104104     * @param slice the timeSlice to draw 
    105      * @param collapsed if true, don't draw the event icons 
    106105     */ 
    107106    public static void DrawScriptBuilderTimeSlice(Graphics2D g2d, TimeSlice slice) 
  • trunk/src/scriptbuilder/gui/panels/IncidentPaletteAddPanel.java

    r64 r76  
    2222{ 
    2323 
     24    /** 
     25     * The script incident represented by this panel. 
     26     */ 
    2427    public ScriptIncident incident; 
    2528 
     
    2730 
    2831    /** 
    29      * Creates new form IncidentPaletteAddPanel 
     32     * Create new IncidentPaletteAddPanel from the form. 
     33     * 
     34     * @param inc the incident to be represented in this panel. 
     35     * @param frame the parent palette which holds this panel. 
    3036     */ 
    3137    public IncidentPaletteAddPanel(ScriptIncident inc, IncidentPaletteFrame frame) 
  • trunk/src/scriptbuilder/gui/panels/TimeStampPanel.java

    r54 r76  
    4141 
    4242    /** 
    43      * Update the length interval and the dimensions of the panel. NOTE: This 
    44      * method implementation is an exact duplication of the update method in 
    45      * panels.TimelineTickPanel. I'm not sure if it actually accomplishes 
    46      * anything here. 
     43     * Update the length interval and the dimensions of the panel. This version 
     44     * of the method is used in the main script builder window. 
    4745     * 
    4846     * @param script The simulation script model 
     
    8987 
    9088    /** 
    91      * Update the length interval and the dimensions of the panel. NOTE: This 
    92      * method implementation is an exact duplication of the update method in 
    93      * panels.TimelineTickPanel. I'm not sure if it actually accomplishes 
    94      * anything here. 
     89     * Update the length interval and the dimensions of the panel. This version 
     90     * of the method is used in the individual incident editor window. 
    9591     * 
    96      * @param script The simulation script model 
     92     * @param incident the incident which this window is editing. 
    9793     */ 
    9894    public void update(ScriptIncident incident) 
  • trunk/src/scriptbuilder/gui/panels/TimelineTickPanel.java

    r74 r76  
    3333    private boolean focused = false; 
    3434 
    35     public void setZoom(float zoom) 
    36     { 
    37         repaint(); 
    38     } 
    39  
     35//    public void setZoom(float zoom) 
     36//    { 
     37//        repaint(); 
     38//    } 
    4039    /** 
    4140     * Listener for the mouse. Is notified when the mouse enters, exits, or 
     
    9998    /** 
    10099     * Update the panel's dimensions based on number of events, zoom level, and 
    101      * which events are collapsed. 
     100     * which events are collapsed. The version of the method is used in the main 
     101     * script builder. 
    102102     * 
    103103     * @param script The main script model 
     
    136136    /** 
    137137     * Update the panel's dimensions based on number of events, zoom level, and 
    138      * which events are collapsed. 
    139      * 
    140      * @param script The main script model 
     138     * which events are collapsed. This version of the method is used in the 
     139     * individual incident editor. 
     140     * 
     141     * @param incident the incident being edited 
    141142     */ 
    142143    public void update(ScriptIncident incident) 
  • trunk/src/scriptbuilder/structures/I_XML_Writable.java

    r46 r76  
    1  
    21package scriptbuilder.structures; 
    32 
     
    87public interface I_XML_Writable 
    98{ 
     9 
     10    /** 
     11     * Translate this object's data into an appropriate XML string. 
     12     * 
     13     * @return an XML-compliant string representing this object's data 
     14     */ 
    1015    String toXML(); 
    1116} 
  • trunk/src/scriptbuilder/structures/MyScriptHandler.java

    r45 r76  
    241241    /** 
    242242     * Constructor. Initializes incident map. 
    243      */ 
    244     public MyScriptHandler(SimulationScript s) 
    245     { 
    246         script = s; 
     243     * 
     244     * @param scr the script into which the XML file is being read 
     245     */ 
     246    public MyScriptHandler(SimulationScript scr) 
     247    { 
     248        script = scr; 
    247249        incidentMap = new TreeMap<Integer, ScriptIncident>(); 
    248250        eventMap = new TreeMap<ELEMENT, I_ScriptEvent>(); 
     
    255257     * Get the list of incidents that have been parsed from the script file. 
    256258     * 
    257      * @returns Vector of Incident objects. 
     259     * @return Vector of Incident objects. 
    258260     */ 
    259261    public Vector<ScriptIncident> getIncidents() 
     
    265267     * Get the list of units that have been parsed from the script file. 
    266268     * 
    267      * @returns Vector of Unit objects. 
     269     * @return Vector of Unit objects. 
    268270     */ 
    269271    public ArrayList<Unit> getUnits() 
  • trunk/src/scriptbuilder/structures/ScriptEvent.java

    r72 r76  
    1818     * Compare the Script Events based on their type enum. 
    1919     * 
    20      * @param o the other script event to be compared 
     20     * @param a the other script event to be compared 
    2121     * @return -1, 0, or 1 depending on if this event's type comes before, 
    2222     * simultaneously, or after the other event's type in the enum list 
     
    130130    } 
    131131 
     132    /** 
     133     * Generate a new script event object of the specified type. 
     134     * 
     135     * @param t the type of the script event 
     136     * @return a new I_ScriptEvent object matching the given type 
     137     */ 
    132138    public static I_ScriptEvent factoryByType(ScriptEventType t) 
    133139    { 
     
    172178        } 
    173179    } 
    174      
     180 
     181    /** 
     182     * Determines if the event in question is an evaluation event. 
     183     * 
     184     * @param event the event to be checked 
     185     * @return true if the event implements I_EvaluationEvent 
     186     */ 
    175187    public static boolean isEvaluationEvent(I_ScriptEvent event) 
    176188    { 
  • trunk/src/scriptbuilder/structures/ScriptIncident.java

    r58 r76  
    221221    } 
    222222 
     223    /** 
     224     * Write this incident, in proper XML form, to the file in question. 
     225     * 
     226     * @param f the destination savefile 
     227     */ 
    223228    public void saveIncidentToFile(File f) 
    224229    { 
     
    298303    { 
    299304 
     305        /** 
     306         * The slice which has received focus in this event. 
     307         */ 
    300308        public TimeSlice slice; 
    301309 
     
    325333    { 
    326334 
     335        /** 
     336         * The incident which has received focus in this event. 
     337         */ 
    327338        public ScriptIncident incident; 
    328339 
  • trunk/src/scriptbuilder/structures/SimulationScript.java

    r65 r76  
    5050    }; 
    5151 
     52    /** 
     53     * The file to which this script will be saved. 
     54     */ 
    5255    public File saveFile = null; 
    5356 
     57    /** 
     58     * The name of this script. 
     59     */ 
    5460    public String title = ""; 
    5561 
     
    160166    } 
    161167 
     168    /** 
     169     * Add a new incident to the script. 
     170     * 
     171     * @param sci the incident to be added. 
     172     * @return true if there was enough room to add this incident. 
     173     */ 
    162174    public boolean addIncident(ScriptIncident sci) 
    163175    { 
     
    170182    } 
    171183 
     184    /** 
     185     * Write this script, in proper XML format, to the file in question. 
     186     * 
     187     * @param f the destination savefile to be written. 
     188     */ 
    172189    public void saveScriptToFile(File f) 
    173190    { 
     
    262279    } 
    263280 
     281    /** 
     282     * Counts the number of incidents currently running. 
     283     * 
     284     * @return the number of non-null incidents currently in the script. A 
     285     * number between 0 and INCIDENT_FILL_COUNT, inclusive. 
     286     */ 
    264287    public int incidentCount() 
    265288    { 
  • trunk/src/scriptbuilder/structures/TimeSlice.java

    r67 r76  
    4242     * @param seconds Number of seconds from the beginning of the simulation 
    4343     * that this timeslice occurs 
     44     * @param inc the incident to which this timeslice belongs. 
    4445     */ 
    4546    public TimeSlice(int seconds, ScriptIncident inc) 
  • trunk/src/scriptbuilder/structures/XMLWriter.java

    r46 r76  
    88{ 
    99 
     10    /** 
     11     * XML-style opening tag. Example: if given string "my_tag", returns 
     12     * "<my_tag>". 
     13     * 
     14     * @param s the XML element to be included in the tag. 
     15     * @return the properly formatted tag 
     16     */ 
    1017    public static String openTag(String s) 
    1118    { 
     
    1320    } 
    1421 
     22    /** 
     23     * XML-style closing tag. Example: if given string "my_tag", returns 
     24     * "</my_tag>". 
     25     * 
     26     * @param s the XML element to be included in the tag. 
     27     * @return the properly formatted tag 
     28     */ 
    1529    public static String closeTag(String s) 
    1630    { 
     
    1832    } 
    1933 
     34    /** 
     35     * XML-style empty tag. Example: if given string "my_tag", returns 
     36     * "<my_tag/>". 
     37     * 
     38     * @param s the XML element to be included in the tag. 
     39     * @return the properly formatted tag 
     40     */ 
    2041    public static String emptyTag(String s) 
    2142    { 
     
    2344    } 
    2445 
     46    /** 
     47     * Creates a pair of XML open and close tags to wrap a simple line of data. 
     48     * Useful if only one element need be enclosed in this particular tag. 
     49     * 
     50     * @param s the data to be wrapped 
     51     * @param e the XML element represented by the data 
     52     * @return an XML string of the format <my_tag>some_data_goes_here</my_tag> 
     53     */ 
    2554    public static String simpleTag(String s, ELEMENT e) 
    2655    { 
  • trunk/src/scriptbuilder/structures/events/ATMSEvaluationEvent.java

    r46 r76  
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public ATMSEvaluationEvent() 
    2326    { 
     
    2528    } 
    2629 
     30    /** 
     31     * A list of the expected actions held by this evaluation event. 
     32     */ 
    2733    public ArrayList<String> expectedAction = new ArrayList<String>(); 
    2834 
  • trunk/src/scriptbuilder/structures/events/ActivityLogEvaluationEvent.java

    r46 r76  
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public ActivityLogEvaluationEvent() 
    2326    { 
     
    2528    } 
    2629 
     30    /** 
     31     * A list of the expected actions held by this evaluation event. 
     32     */ 
    2733    public ArrayList<String> expectedAction = new ArrayList<String>(); 
    2834 
  • trunk/src/scriptbuilder/structures/events/AudioEvent.java

    r46 r76  
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public AudioEvent() 
    2326    { 
     
    2528    } 
    2629 
     30    /** 
     31     * Length of the audio to be played, in seconds. 
     32     */ 
    2733    public Integer audioLength = 0; 
    2834 
     35    /** 
     36     * File path for the audio file. 
     37     */ 
    2938    public String audioPath = ""; 
    3039 
  • trunk/src/scriptbuilder/structures/events/CADEvaluationEvent.java

    r46 r76  
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public CADEvaluationEvent() 
    2326    { 
     
    2528    } 
    2629 
     30    /** 
     31     * A list of the expected actions held by this evaluation event. 
     32     */ 
    2733    public ArrayList<String> expectedAction = new ArrayList<String>(); 
    2834 
  • trunk/src/scriptbuilder/structures/events/CADEvent.java

    r47 r76  
    2121{ 
    2222 
     23    /** 
     24     * Constructor. 
     25     */ 
    2326    public CADEvent() 
    2427    { 
     
    2629    } 
    2730 
     31    /** 
     32     * True if this CAD event has sub-events. 
     33     */ 
    2834    public boolean hasSubEvents = false; 
    2935 
     36    /** 
     37     * Description of this event. 
     38     */ 
    3039    public String detail = ""; 
    3140 
  • trunk/src/scriptbuilder/structures/events/CCTVEvent.java

    r46 r76  
    1212 
    1313/** 
    14  * Data model for a CCTV event. (Just a stub; CCTV events aren't currently 
    15  * used.) A CCTV event has, for now, a string message. 
     14 * Data model for a CCTV event(Just a stub; CCTV events aren't currently 
     15 * used). A CCTV event has, for now, a string message. 
    1616 * 
    1717 * @author Bryan McGuffin 
     
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public CCTVEvent() 
    2326    { 
     
    2528    } 
    2629 
     30    /** 
     31     * The message represented by this event. 
     32     */ 
    2733    public String message = ""; 
    2834 
  • trunk/src/scriptbuilder/structures/events/CHPRadioEvent.java

    r46 r76  
    2222{ 
    2323 
     24    /** 
     25     * Constructor. 
     26     */ 
    2427    public CHPRadioEvent() 
    2528    { 
     
    2730    } 
    2831 
     32    /** 
     33     * List of the lines of dialog in this event. 
     34     */ 
    2935    public ArrayList<String> lines = new ArrayList<String>(); 
    3036 
     37    /** 
     38     * List of the corresponding roles for each line of dialog. 
     39     */ 
    3140    public ArrayList<String> roles = new ArrayList<String>(); 
    3241 
     42    /** 
     43     * Path for the audio file to be played during this event. 
     44     */ 
    3345    public String radioFile = ""; 
    3446 
  • trunk/src/scriptbuilder/structures/events/CMSEvaluationEvent.java

    r46 r76  
    2121{ 
    2222 
     23    /** 
     24     * Constructor. 
     25     */ 
    2326    public CMSEvaluationEvent() 
    2427    { 
  • trunk/src/scriptbuilder/structures/events/FacilitatorEvaluationEvent.java

    r46 r76  
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public FacilitatorEvaluationEvent() 
    2326    { 
     
    2528    } 
    2629 
     30    /** 
     31     * A list of the expected actions held by this evaluation event. 
     32     */ 
    2733    public ArrayList<String> expectedAction = new ArrayList<String>(); 
    2834 
  • trunk/src/scriptbuilder/structures/events/MaintenanceRadioEvent.java

    r46 r76  
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public MaintenanceRadioEvent() 
    2326    { 
  • trunk/src/scriptbuilder/structures/events/ParamicsEvent.java

    r47 r76  
    2121{ 
    2222 
     23    /** 
     24     * Constructor. 
     25     */ 
    2326    public ParamicsEvent() 
    2427    { 
  • trunk/src/scriptbuilder/structures/events/RadioEvaluationEvent.java

    r46 r76  
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public RadioEvaluationEvent() 
    2326    { 
     
    2528    } 
    2629 
     30    /** 
     31     * A list of the expected actions held by this evaluation event. 
     32     */ 
    2733    public ArrayList<String> expectedAction = new ArrayList<String>(); 
    2834 
  • trunk/src/scriptbuilder/structures/events/TMTRadioEvent.java

    r46 r76  
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public TMTRadioEvent() 
    2326    { 
  • trunk/src/scriptbuilder/structures/events/TelephoneEvent.java

    r46 r76  
    2222{ 
    2323 
     24    /** 
     25     * Constructor. 
     26     */ 
    2427    public TelephoneEvent() 
    2528    { 
  • trunk/src/scriptbuilder/structures/events/TowEvent.java

    r46 r76  
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public TowEvent() 
    2326    { 
  • trunk/src/scriptbuilder/structures/events/UnitEvent.java

    r46 r76  
    2020{ 
    2121 
     22    /** 
     23     * Constructor. 
     24     */ 
    2225    public UnitEvent() 
    2326    { 
Note: See TracChangeset for help on using the changeset viewer.