haha funny colors brrr

This commit is contained in:
ceikry 2021-10-27 17:12:24 -05:00
parent d567863949
commit 4c4af5da0a

View file

@ -238,18 +238,6 @@ object Rs2MapEditor {
init {
underlayMap.forEach {
val underlay = UnderlaySquarePanel(it.value.getRGB(),30, it.key)
underlay.addMouseListener(object : MouseAdapter(){
val border: Border = MatteBorder(1, 1, 1, 1, Color.GRAY)
val highlight: Border = MatteBorder(1, 1, 1, 1, Color.YELLOW)
override fun mouseEntered(e: MouseEvent?) {
colorPointMap.filter { it.value == underlay.id }.forEach{ componentPointMap[it.key]!!.border = highlight}
}
override fun mouseExited(e: MouseEvent?) {
colorPointMap.filter { it.value == underlay.id }.forEach{ componentPointMap[it.key]!!.border = border}
}
})
add(underlay)
}
val addAnUnderlay = UnderlaySquarePanel(Color.darkGray,30, "+")
@ -269,6 +257,7 @@ object Rs2MapEditor {
}
}
val text = JLabel("$id")
text.foreground = Color((color.rgb).inv()).brighter()
val defaultBackground = color
@ -278,12 +267,18 @@ object Rs2MapEditor {
add(text)
addMouseListener(object : MouseAdapter() {
override fun mouseEntered(e: MouseEvent) {
background = Color.BLUE
val border: Border = MatteBorder(1, 1, 1, 1, Color.GRAY)
val highlight: Border = MatteBorder(1, 1, 1, 1, Color.YELLOW)
val selectionBorder = MatteBorder(1,1,1,1, Color.WHITE)
override fun mouseEntered(e: MouseEvent?) {
this@UnderlaySquarePanel.border = selectionBorder
colorPointMap.filter { it.value == id }.forEach{ componentPointMap[it.key]!!.border = highlight}
}
override fun mouseExited(e: MouseEvent) {
background = defaultBackground
override fun mouseExited(e: MouseEvent?) {
this@UnderlaySquarePanel.border = null
colorPointMap.filter { it.value == id }.forEach{ componentPointMap[it.key]!!.border = border}
}
override fun mouseClicked(e: MouseEvent) {