in code/debugger/src/main/kotlin/org/fbme/debugger/common/ui/DebuggerPanel.kt [339:387]
override fun customizeCellRenderer(
traceItems: JList<out TraceItem>,
traceItem: TraceItem,
index: Int,
isSelected: Boolean,
hasFocus: Boolean,
) {
val (state, path, change) = traceItem
val nLen = statesListModel.size.toString().length
val nPadding = nLen * 10 + 12
val changePadding = nPadding + 100
if (traceItem.synced) {
append("$index", SimpleTextAttributes.REGULAR_BOLD_ATTRIBUTES, nPadding, 2)
} else {
append("$index", SimpleTextAttributes.GRAYED_BOLD_ATTRIBUTES, nPadding, 2)
}
when (change) {
is InitialChange -> {
append("Initial State", SimpleTextAttributes.REGULAR_ATTRIBUTES)
}
is InputEventChange -> {
val name = change.eventName
val value = state.resolveValue(path.plus(change.eventName)) ?: "???"
append("Input Event", SimpleTextAttributes.REGULAR_ATTRIBUTES, changePadding, 2)
append("${path.plus(name).joinToString(".")} → $value", SimpleTextAttributes.REGULAR_ATTRIBUTES)
}
is OutputEventChange -> {
val name = change.eventName
val value = state.resolveValue(path.plus(change.eventName)) ?: "???"
append("Output Event", SimpleTextAttributes.REGULAR_ATTRIBUTES, changePadding, 2)
append("${path.plus(name).joinToString(".")} → $value", SimpleTextAttributes.REGULAR_ATTRIBUTES)
}
is StateChange -> {
append("ECC State", SimpleTextAttributes.REGULAR_ATTRIBUTES, changePadding, 2)
append(
"${path.plus("\$ECC").joinToString(".")} → ${change.state}",
SimpleTextAttributes.REGULAR_ATTRIBUTES
)
}
is ComplexChange -> {
append("Complex change", SimpleTextAttributes.REGULAR_ATTRIBUTES, changePadding, 2)
}
}
}