Ticket #217 (closed defect: fixed)
Exception thrown trying to display properties for an incident
| Reported by: | jdalbey | Owned by: | jdalbey |
|---|---|---|---|
| Priority: | Medium | Milestone: | May 2021 Training |
| Component: | ScriptBuilder GUI | Version: | |
| Severity: | Minor | Keywords: | |
| Cc: |
Description
Suspect cause is related to incident colors.
Steps to reproduce: Load incident 191 from pool. Try to display properties.
Exception in thread "AWT-EventQueue-1" java.lang.IllegalArgumentException: setSelectedIndex: 8 out of bounds at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:620) at scriptbuilder.gui.ScriptBuilderFrame.incidentDetailsScreen(ScriptBuilderFrame.java:1962) at scriptbuilder.gui.panels.IncidentTimelinePanel$IncidentTimelineMouseListener$PopupMenuItemListener.actionPerformed(IncidentTimelinePanel.java:211) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348) at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402) at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259) at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
Change History
comment:2 Changed 6 years ago by jdalbey
- Status changed from new to closed
- Resolution set to fixed
The code failed to handle colors correctly. Now follows these rules:
When loading existing incident:
If it has a color tag in the xml for a valid color, use that color
If it has a color tag in the xml but for an invalid color in xml: use black color.
If no color tag in the xml: assign a random color.
"Valid" colors are specified in SimulationScript.incidentColors
Fixed in r182.
Note: See
TracTickets for help on using
tickets.

Caused when an incident xml specifies a color that is not in the color dropdown box.