11package com .ss .editor .ui .event ;
22
3+ import static com .ss .rlib .util .ObjectUtils .notNull ;
34import com .ss .editor .config .Config ;
45import com .ss .editor .ui .component .editor .FileEditor ;
56import com .ss .editor .ui .component .editor .area .EditorAreaComponent ;
@@ -172,8 +173,8 @@ private void redirect(@NotNull final InputEvent event) {
172173 return ;
173174 } else if (target instanceof TextInputControl ) {
174175 if (event instanceof KeyEvent && UIUtils .isNotHotKey ((KeyEvent ) event )) {
175- if (Config .DEV_DEBUG_JFX_KEY_INPUT && LOGGER . isEnabledDebug () ) {
176- LOGGER .debug ("Key event was skipped because it was from " + target );
176+ if (Config .DEV_DEBUG_JFX_KEY_INPUT ) {
177+ LOGGER .debug (this , target , ev -> "Key event was skipped because it was from " + ev );
177178 }
178179 return ;
179180 }
@@ -182,17 +183,17 @@ private void redirect(@NotNull final InputEvent event) {
182183 final EventType <? extends InputEvent > eventType = event .getEventType ();
183184 final FileEditor currentEditor = editorAreaComponent .getCurrentEditor ();
184185
185- if (Config .DEV_DEBUG_JFX_KEY_INPUT && LOGGER . isEnabledDebug () ) {
186- LOGGER .debug ("Key event " + event .getEventType () + " is inside " +
187- currentEditor .isInside (getSceneX (), getSceneY (), event .getClass ()));
186+ if (Config .DEV_DEBUG_JFX_KEY_INPUT ) {
187+ LOGGER .debug (this , event , notNull ( currentEditor ), ( red , ev , editor ) -> "Key event " + ev .getEventType () +
188+ " is inside " + editor .isInside (red . getSceneX (), red . getSceneY (), ev .getClass ()));
188189 }
189190
190191 if (currentEditor == null || eventType != KeyEvent .KEY_RELEASED && !currentEditor .isInside (getSceneX (), getSceneY (), event .getClass ())) {
191192 return ;
192193 }
193194
194- if (Config .DEV_DEBUG_JFX_KEY_INPUT && LOGGER . isEnabledDebug () ) {
195- LOGGER .debug ("Redirect event " + event );
195+ if (Config .DEV_DEBUG_JFX_KEY_INPUT ) {
196+ LOGGER .debug (this , event , ev -> "Redirect event " + ev );
196197 }
197198
198199 Event .fireEvent (destination , event .copyFor (event .getSource (), destination ));
@@ -201,7 +202,7 @@ private void redirect(@NotNull final InputEvent event) {
201202 /**
202203 * Update mouse coords.
203204 */
204- private void updateCoords (final MouseEvent event ) {
205+ private void updateCoords (@ NotNull final MouseEvent event ) {
205206 this .sceneX = event .getSceneX ();
206207 this .sceneY = event .getSceneY ();
207208 }
0 commit comments