23 package com.realtime.crossfire.jxclient.stats;
27 import java.awt.event.ActionListener;
28 import javax.swing.Timer;
29 import org.jetbrains.annotations.NotNull;
60 private static final String
CURE_MESSAGE =
"Your body feels cleansed";
66 private final Object
sync =
new Object();
88 @SuppressWarnings(
"FieldCanBeLocal")
92 public void commandDrawextinfoReceived(
final int color,
final int type,
final int subtype, @NotNull
final String message) {
97 public void setDebugMode(
final boolean printMessageTypes) {
107 @SuppressWarnings(
"FieldCanBeLocal")
111 public void resetBefore() {
115 public void resetAfter() {
116 synchronized (
sync) {
122 public void statChanged(
final int statNo,
final int value) {
124 synchronized (
sync) {
132 public void simpleWeaponSpeedChanged(
final boolean simpleWeaponSpeed) {
136 public void titleChanged(@NotNull
final String title) {
140 public void godNameChanged(@NotNull
final String godName) {
144 public void rangeChanged(@NotNull
final String range) {
148 public void activeSkillChanged(@NotNull
final String activeSkill) {
152 public void experienceChanged(
final long exp) {
156 public void experienceNextLevelChanged(
final long expNextLevel) {
167 synchronized (
sync) {
187 timer.setRepeats(
false);
188 crossfireServerConnection.addCrossfireDrawinfoListener((text, type) ->
check(text));
191 synchronized (
sync) {
200 private void check(@NotNull
final String message) {
201 synchronized (
sync) {
217 if (!Thread.holdsLock(
sync)) {
218 throw new IllegalStateException(
"thread should synchronize on sync");
229 if (this.active ==
active) {