SCT Custom Slot/Timestep Cell Colors / RiverWare 6.8
Phil Weinstein, David Neumann, Edie Zagona, CADSWES, 9-28-2015
Document Home: R:\doc\sct\2015\SctCustomColors-2015-Sep.docx
The SCT's series slot table now supports the application of custom text (foreground) and background colors to arbitrary sets of slot/timestep cells. This overrides the cell background colors which indicate the series timestep flag.
Both the definition of a prescribed set of "custom color items" and the association of those definitions to particular slot/timestep cells are stored in the SCT configuration -- not within the RiverWare model.
A custom color item is defined with these three values:
An SCT's set of custom cell color items are part of an SCT's configuration. The editor for these definitions is accessed from the Flags tab within the SCT Configuration dialog box, which itself is shown from the SCT Dialog's "Config" >> "Flags/Colors" menubar operation. Clicking the "Custom Slot/Timestep Cell Colors..." button shows this editor.
![]() ![]() |
Clicking a green plus icon button inserts a row of controls for a new custom color item.
Clicking a red minus icon button removes the row, and the corresponding custom color item.
The name of a custom color item can be directly edited in the item's Custom Color Name line editor. Ultimately, a non-blank name must be provided, and the names must be unique within the defined list of items. If either of these conditions are violated, an error indication is shown (and flashed) when the user clicks the OK button. See the images to the right.
Clicking the Cancel button discards all changes made to the set of custom color items.
Clicking the OK button applies the newly formulated set of custom colors to the SCT configuration being edited.
NOTE: To have these definitions applied to the actual SCT, the user must then click the OK or Apply buttons in the SCT Configuration dialog. See above.
When custom slot/timestep cell colors are defined (as described above), the context (right-click) menu within the SCT's series data table shows an "Apply Custom Colors" submenu containing the names of each of the defined color items and a "Clear" operation. Selecting any of the submenu color items applies the indicated colors to the full set of selected slot/timestep cells. The "Clear" operation clears those cell color assignments, restoring the selected cells' colors to those associated with the slot/timestep's series flag.
Note that, when SCT cells are selected (i.e. in the "selected" state), the foreground and background colors of the numeric portion of those cells are reversed (swapped). (The color reversal is not applied to the optionally shown series flag letter and priority number areas of the cell). When applying custom colors to the current cell selection, those selected cells remain selected -- so they will initially appear with reverse text and cell background colors.
![]() |
When custom colors have been applied to an SCT series data table cell, the tooltip on that cell includes a "Custom Colors:" line with the name of the applied custom colors item.
The name of a color custom item, and its associated "text" and "cell" colors can subsequently be edited (from the SCT Configuration dialog, see above), and, once applied, those changes will be reflected in any slot/timestep cells to which those color items have been applied.
NOTE: As mentioned above, the cell / custom color associations are stored in the SCT -- not in the RiverWare data model. So the SCT must be saved to retain these associations. (It is not sufficient to just save the RiverWare model).
Custom cell colors can be cleared from the entire SCT by selected all cells -- e.g. by clicking in the upper left area of the row header table (in the view shown above -- to the left of the "Timestep" column header) -- right clicking within the data table, and selecting "Apply Custom Colors" >> "Clear". These cell / color associations are also cleared when custom color items are deleted from the custom cell color editor. (This does actually clear all associated internal data, as appropriate).
Two new major data structures are used to support SCT custom cell colors. Internally, these are framed as "user flags," to support the ideas that (a) the non-visual components of these definitions, and importantly, the slot/timestep cell associations could be moved into the RiverWare model, rather than remaining within the SCT configuration, and (b) there could potentially be other associated visual properties -- i.e. not just colors.
In this initial implementation, the SctConfig class supports one instance of each of these classes. These are serialized within the SctConfig flex/bison-parsed SCT file format as distinct XML elements. Below is an excerpt of an SCT file for the SCT configuration illustrated in prior SCT screenshot.
USER_FLAG_SET XML-UFLAG-SET-BEG <UserFlagSet> <UserFlagDef fgColor="#aa0000" bgColor="#00aaff" label="Water Year End"/> <UserFlagDef fgColor="#000000" bgColor="#55ffff" label="Rec Event"/> <UserFlagDef fgColor="#000000" bgColor="#fffaaa" label="Forecast Anomaly"/> </UserFlagSet> XML-UFLAG-SET-END SLOT_USER_FLAG_MAP XML-UFLAG-MAP-BEG <SlotUserFlagMap slotRecCnt="4"> <UserFlagSlotRecord cellCnt="1" slotRecInx="0" slotName="Navajo Reservoir.Inflow" slotCol="-1"> <UFS-Cell flag="Forecast Anomaly" dt="09-19-2016 00:00:00"/> </UserFlagSlotRecord> <UserFlagSlotRecord cellCnt="2" slotRecInx="1" slotName="Navajo Reservoir.Outflow" slotCol="-1"> <UFS-Cell flag="Rec Event" dt="09-25-2016 00:00:00"/> <UFS-Cell flag="Rec Event" dt="09-26-2016 00:00:00"/> </UserFlagSlotRecord> <UserFlagSlotRecord cellCnt="1" slotRecInx="2" slotName="Navajo Reservoir.Pool Elevation" slotCol="-1"> <UFS-Cell flag="Water Year End" dt="10-01-2016 00:00:00"/> </UserFlagSlotRecord> <UserFlagSlotRecord cellCnt="1" slotRecInx="3" slotName="Navajo Reservoir.Storage" slotCol="-1"> <UFS-Cell flag="Water Year End" dt="10-01-2016 00:00:00"/> </UserFlagSlotRecord> </SlotUserFlagMap> XML-UFLAG-MAP-END |
--- (end) ---