Commit 45fe2cce authored by Locatelli's avatar Locatelli

Add token stuff in ploty2

parent 33ec9da9
* Add token stuff in ploty2
4.0.46 dd/mm/2020
------
* Licence was missing in some files.
......
......@@ -21,6 +21,8 @@ package fr.ill.ics.client.control.plot;
import java.util.ArrayList;
import java.util.List;
import fr.ill.ics.client.control.remote.RemoteControlManager;
import fr.ill.ics.client.control.token.TokenManager;
import fr.ill.ics.common.ControllerAndPropertyConstants;
import fr.ill.ics.core.property.Property;
import fr.ill.ics.core.property.PropertyManager;
......@@ -46,7 +48,7 @@ public class PlotyManager {
}
public void restorePlots() {
PlotyInstance.getInstance().restorePlots();
PlotyInstance.getInstance().restorePlots(RemoteControlManager.getInstance().getRemoteControlState(), TokenManager.getInstance().tokenIsFree(), TokenManager.getInstance().tokenIsOwnedByMe());
}
public void closePlots() {
......@@ -198,7 +200,7 @@ public class PlotyManager {
optimizationColor, use_grid_prop_name, use_log_prop_name, color_map_prop_name, min_colot_limit_prop_name, max_colot_limit_prop_name, nbRois_prop_name, roiX0_parentId, roiY0_parentId,
roiX1_parentId, roiY1_parentId, roiSum_parentId, roiSelectedPlot_prop_name, roiSelectedRoi_prop_name,
roiSelectedX0_prop_name, roiSelectedY0_prop_name, roiSelectedX1_prop_name, roiSelectedY1_prop_name, roiCommandAdd_prop_name,
roiCommandRaz_prop_name, countActivated_prop_name);
roiCommandRaz_prop_name, countActivated_prop_name, RemoteControlManager.getInstance().getRemoteControlState(), TokenManager.getInstance().tokenIsFree(), TokenManager.getInstance().tokenIsOwnedByMe());
}
}
\ No newline at end of file
......@@ -222,9 +222,6 @@ public class Startup {
}
// construct the main window
MainWindowPeer.getInstance().constructDisplay();
if (ConfigManager.getInstance().getPlotyVersion() == 2) {
PlotyManager.getInstance().restorePlots();
}
informationKey = "initialiseCommandWindowMessage";
break;
case 8:
......
......@@ -24,6 +24,7 @@ import fr.ill.ics.bridge.events.TokenEvent;
import fr.ill.ics.bridge.events.TokenEvent.TokenServerState;
import fr.ill.ics.bridge.listeners.TokenEventListener;
import fr.ill.ics.client.control.MainWindow;
import fr.ill.ics.client.control.plot.PlotyManager;
import fr.ill.ics.client.control.remote.RemoteControlManager;
import fr.ill.ics.client.view.MainWindowPeer;
import fr.ill.ics.nscclient.notification.DataNotificationClient;
......@@ -208,5 +209,9 @@ public class TokenManager implements TokenEventListener {
}).start();
// Request token
SessionManager.getInstance(CommandZoneWrapper.SERVER_ID).requestToken();
// For synchronization restore plots when token info are synchronized in gui
if (ConfigManager.getInstance().getPlotyVersion() == 2) {
PlotyManager.getInstance().restorePlots();
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment