mirror of
https://gitlab.com/2009scape/tools/2009scape-map-viewer.git
synced 2026-08-01 14:39:25 -06:00
haha funny colors brrr
This commit is contained in:
parent
d567863949
commit
4c4af5da0a
1 changed files with 11 additions and 16 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue