Formatting

This commit is contained in:
Robinson 2023-02-03 12:22:39 +01:00
parent f20c4e73a0
commit 43bddeccd3
No known key found for this signature in database
GPG Key ID: 8E7DB78588BD6F5C
6 changed files with 36 additions and 18 deletions

View File

@ -755,9 +755,3 @@
JetBrains s.r.o. and Kotlin Programming Language contributors JetBrains s.r.o. and Kotlin Programming Language contributors
Kotlin Compiler, Test Data+Libraries, and Tools repository contain third-party code, to which different licenses may apply Kotlin Compiler, Test Data+Libraries, and Tools repository contain third-party code, to which different licenses may apply
See: https://github.com/JetBrains/kotlin/blob/master/license/README.md See: https://github.com/JetBrains/kotlin/blob/master/license/README.md
- PropertyLoader - Property annotation and loader for fields
[The Apache Software License, Version 2.0]
https://git.dorkbox.com/dorkbox/PropertyLoader
Copyright 2023
Dorkbox LLC

View File

@ -104,7 +104,7 @@ dependencies {
api("com.dorkbox:TweenEngine:8.3.1") api("com.dorkbox:TweenEngine:8.3.1")
api("com.dorkbox:SwingActiveRender:1.3") api("com.dorkbox:SwingActiveRender:1.3")
api("com.dorkbox:Utilities:1.39") api("com.dorkbox:Utilities:1.39")
api("com.dorkbox:PropertyLoader:1.1") api("com.dorkbox:PropertyLoader:1.2")
} }
publishToSonatype { publishToSonatype {

View File

@ -22,7 +22,8 @@ internal class AppAccessor : TweenAccessor<AppNotify> {
const val X_POS = 0 const val X_POS = 0
const val Y_POS = 1 const val Y_POS = 1
const val X_Y_POS = 2 const val X_Y_POS = 2
const val PROGRESS = 3 const val SHAKE = 3
const val PROGRESS = 4
} }
override fun getValues(target: AppNotify, tweenType: Int, returnValues: FloatArray): Int { override fun getValues(target: AppNotify, tweenType: Int, returnValues: FloatArray): Int {
@ -43,6 +44,12 @@ internal class AppAccessor : TweenAccessor<AppNotify> {
return 2 return 2
} }
SHAKE -> {
returnValues[0] = target.x.toFloat()
returnValues[1] = target.y.toFloat()
return 2
}
PROGRESS -> { PROGRESS -> {
returnValues[0] = target.progress.toFloat() returnValues[0] = target.progress.toFloat()
return 1 return 1
@ -68,6 +75,11 @@ internal class AppAccessor : TweenAccessor<AppNotify> {
return return
} }
SHAKE -> {
target.setLocationInternal(newValues[0].toInt(), newValues[1].toInt())
return
}
PROGRESS -> { PROGRESS -> {
target.progress = newValues[0].toInt() target.progress = newValues[0].toInt()
return return

View File

@ -259,7 +259,7 @@ internal class AppNotify(override val notification: Notify): Canvas(), NotifyTyp
override fun doShake(count: Int, targetX: Float, targetY: Float) { override fun doShake(count: Int, targetX: Float, targetY: Float) {
if (shakeTween != null) { if (shakeTween != null) {
shakeTween!!.valueRelative(targetX, targetY) shakeTween!!.valueRelative(targetX, targetY)
.repeatAutoReverse(count, 0f) .repeatAutoReverse(count, 0f)
} else { } else {
val tween = tweenEngine val tween = tweenEngine
.to(this, AppAccessor.X_Y_POS, tweenAccessor, 0.05f) .to(this, AppAccessor.X_Y_POS, tweenAccessor, 0.05f)

View File

@ -22,7 +22,8 @@ internal class DesktopAccessor : TweenAccessor<DesktopNotify> {
const val X_POS = 0 const val X_POS = 0
const val Y_POS = 1 const val Y_POS = 1
const val X_Y_POS = 2 const val X_Y_POS = 2
const val PROGRESS = 3 const val SHAKE = 3
const val PROGRESS = 4
} }
override fun getValues(target: DesktopNotify, tweenType: Int, returnValues: FloatArray): Int { override fun getValues(target: DesktopNotify, tweenType: Int, returnValues: FloatArray): Int {
@ -43,6 +44,12 @@ internal class DesktopAccessor : TweenAccessor<DesktopNotify> {
return 2 return 2
} }
SHAKE -> {
returnValues[0] = target.x.toFloat()
returnValues[1] = target.y.toFloat()
return 2
}
PROGRESS -> { PROGRESS -> {
returnValues[0] = target.progress.toFloat() returnValues[0] = target.progress.toFloat()
return 1 return 1
@ -68,6 +75,11 @@ internal class DesktopAccessor : TweenAccessor<DesktopNotify> {
return return
} }
SHAKE -> {
target.setLocationInternal(newValues[0].toInt(), newValues[1].toInt())
return
}
PROGRESS -> { PROGRESS -> {
target.progress = newValues[0].toInt() target.progress = newValues[0].toInt()
return return

View File

@ -50,11 +50,11 @@ object NotifyTest {
image!! image!!
bottomRightInFrame(3, frame) // bottomRightInFrame(3, frame)
topLeftInFrame(2, frame) // topLeftInFrame(2, frame)
react() // react()
// topRightMonitor(4) topRightMonitor(4)
// topAndBottomRightMonitor(1) // topAndBottomRightMonitor(1)
// bottomLeftScaled(image) // bottomLeftScaled(image)
// bottomLeftStacking(3, image) // bottomLeftStacking(3, image)
@ -94,12 +94,12 @@ object NotifyTest {
// .setScreen(0) // .setScreen(0)
.theme(Theme.defaultDark) .theme(Theme.defaultDark)
// .shake(1300, 4) // .shake(1300, 4)
.shake(18300, 10) // .shake(18300, 10)
// .hideCloseButton() // .hideCloseButton()
.onClickAction { System.err.println("Notification $i clicked on!") } .onClickAction { System.err.println("Notification $i clicked on!") }
if (i == 0) { // if (i == 0) {
notify.hideAfter(2100) notify.hideAfter(2100)
} // }
notify.show() notify.show()
try { try {
Thread.sleep(1000) Thread.sleep(1000)
@ -229,7 +229,7 @@ object NotifyTest {
// .setScreen(0) // .setScreen(0)
.theme(Theme.defaultDark) .theme(Theme.defaultDark)
// .shake(1300, 4) // .shake(1300, 4)
// .shake(1300, 10) .shake(13200, 10)
.attach(frame) .attach(frame)
// .hideCloseButton() // .hideCloseButton()
.onClickAction { System.err.println("Notification $i clicked on!") } .onClickAction { System.err.println("Notification $i clicked on!") }