mirror of
https://github.com/klmp200/PQT_Gestionnaire_vente_stock.git
synced 2024-11-22 08:13:20 +00:00
Module Client, écran Stat : correction d'un bug empêchant la mise à jour de l'affichage des statistiques
This commit is contained in:
parent
0c64c49f0f
commit
3f8daabe61
@ -57,6 +57,7 @@ public class StatDao {
|
|||||||
private synchronized void replaceStats(Map<String, String> stats) {
|
private synchronized void replaceStats(Map<String, String> stats) {
|
||||||
this.stats = new HashMap<>(stats);
|
this.stats = new HashMap<>(stats);
|
||||||
this.lastRefreshTimestamp = new Date();
|
this.lastRefreshTimestamp = new Date();
|
||||||
|
eventFirerer.fireStatChangedEvent();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removeListener(IStatListener listener) {
|
public void removeListener(IStatListener listener) {
|
||||||
|
@ -4,13 +4,11 @@ import java.util.Map;
|
|||||||
|
|
||||||
public interface IStatFirerer {
|
public interface IStatFirerer {
|
||||||
|
|
||||||
public abstract void fireGetStatSuccess();
|
void fireGetStatSuccess();
|
||||||
|
void fireGetStatError(Throwable cause);
|
||||||
public abstract void fireGetStatError(Throwable cause);
|
void fireGetStatRefused(Throwable cause);
|
||||||
|
void fireStatChangedEvent();
|
||||||
public abstract void fireGetStatRefused(Throwable cause);
|
|
||||||
|
|
||||||
void removeListener(IStatListener listener);
|
void removeListener(IStatListener listener);
|
||||||
|
|
||||||
void addListener(IStatListener listener);
|
void addListener(IStatListener listener);
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,12 @@ import java.util.Map;
|
|||||||
|
|
||||||
public interface IStatListener extends EventListener {
|
public interface IStatListener extends EventListener {
|
||||||
|
|
||||||
public abstract void onGetStatSuccess();
|
void onGetStatSuccess();
|
||||||
|
|
||||||
public abstract void onGetStatError(Throwable cause);
|
void onGetStatError(Throwable cause);
|
||||||
|
|
||||||
public abstract void onGetStatRefused(Throwable cause);
|
void onGetStatRefused(Throwable cause);
|
||||||
|
|
||||||
|
void onStatChangedEvent();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ public class SimpleStatFirerer implements IStatFirerer {
|
|||||||
/**
|
/**
|
||||||
* @see com.pqt.client.module.stat.listeners.IStatFirerer#fireGetStatSuccess()
|
* @see com.pqt.client.module.stat.listeners.IStatFirerer#fireGetStatSuccess()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void fireGetStatSuccess() {
|
public void fireGetStatSuccess() {
|
||||||
for(IStatListener l : listeners.getListeners(IStatListener.class)){
|
for(IStatListener l : listeners.getListeners(IStatListener.class)){
|
||||||
l.onGetStatSuccess();
|
l.onGetStatSuccess();
|
||||||
@ -24,6 +25,7 @@ public class SimpleStatFirerer implements IStatFirerer {
|
|||||||
/**
|
/**
|
||||||
* @see com.pqt.client.module.stat.listeners.IStatFirerer#fireGetStatError(Throwable)
|
* @see com.pqt.client.module.stat.listeners.IStatFirerer#fireGetStatError(Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void fireGetStatError(Throwable cause) {
|
public void fireGetStatError(Throwable cause) {
|
||||||
for(IStatListener l : listeners.getListeners(IStatListener.class)){
|
for(IStatListener l : listeners.getListeners(IStatListener.class)){
|
||||||
l.onGetStatError(cause);
|
l.onGetStatError(cause);
|
||||||
@ -34,12 +36,20 @@ public class SimpleStatFirerer implements IStatFirerer {
|
|||||||
/**
|
/**
|
||||||
* @see com.pqt.client.module.stat.listeners.IStatFirerer#fireGetStatRefused(Throwable)
|
* @see com.pqt.client.module.stat.listeners.IStatFirerer#fireGetStatRefused(Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void fireGetStatRefused(Throwable cause) {
|
public void fireGetStatRefused(Throwable cause) {
|
||||||
for(IStatListener l : listeners.getListeners(IStatListener.class)){
|
for(IStatListener l : listeners.getListeners(IStatListener.class)){
|
||||||
l.onGetStatRefused(cause);
|
l.onGetStatRefused(cause);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fireStatChangedEvent() {
|
||||||
|
for(IStatListener l : listeners.getListeners(IStatListener.class)){
|
||||||
|
l.onStatChangedEvent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void removeListener(IStatListener listener) {
|
public void removeListener(IStatListener listener) {
|
||||||
listeners.remove(IStatListener.class, listener);
|
listeners.remove(IStatListener.class, listener);
|
||||||
|
@ -6,6 +6,7 @@ public class StatListenerAdapter implements IStatListener {
|
|||||||
/**
|
/**
|
||||||
* @see com.pqt.client.module.stat.listeners.IStatListener#onGetStatSuccess()
|
* @see com.pqt.client.module.stat.listeners.IStatListener#onGetStatSuccess()
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void onGetStatSuccess() {
|
public void onGetStatSuccess() {
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -14,6 +15,7 @@ public class StatListenerAdapter implements IStatListener {
|
|||||||
/**
|
/**
|
||||||
* @see com.pqt.client.module.stat.listeners.IStatListener#onGetStatError(Throwable)
|
* @see com.pqt.client.module.stat.listeners.IStatListener#onGetStatError(Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void onGetStatError(Throwable cause) {
|
public void onGetStatError(Throwable cause) {
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -22,8 +24,14 @@ public class StatListenerAdapter implements IStatListener {
|
|||||||
/**
|
/**
|
||||||
* @see com.pqt.client.module.stat.listeners.IStatListener#onGetStatRefused(Throwable)
|
* @see com.pqt.client.module.stat.listeners.IStatListener#onGetStatRefused(Throwable)
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void onGetStatRefused(Throwable cause) {
|
public void onGetStatRefused(Throwable cause) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onStatChangedEvent() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user