/** * Create a Zone of Interest belonging to a scenario * * @param scenarioStub */ public void createZoneOfInterest(ScenarioStub scenarioStub) { ZoneOfInterest zoneOfInterest = new ZoneOfInterest(); JLabel lblInputName = new JLabel("Entrer un nom pour la zone d'intérêt"); JTextField textField = new JTextField(); Object[] params = {lblInputName, textField}; int result = JOptionPane.showConfirmDialog( null, params, "Créer Zone d'Intérêt", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE); if (result == JOptionPane.OK_OPTION) { zoneOfInterest.setName(textField.getText()); zoneOfInterest.setZoomLevel(1); zoneOfInterest.setScenarioId(scenarioStub.getEntityId()); // Save ZI ProgressDialog progressBar = new ProgressDialog("Sauvegarde..."); InsertZoneOfInterestWorker worker = new InsertZoneOfInterestWorker(progressBar, zoneOfInterest, scenarioStub); progressBar.setVisible(true); worker.execute(); } }
/** * Rename Zone of Interest * * @param zoneOfInterest * @param dialog */ public void renameZoneOfInterest(ZoneOfInterest zoneOfInterest, ProgressDialog dialog) { RenameZoneOfInterestWorker task = new RenameZoneOfInterestWorker(dialog, zoneOfInterest); dialog.setVisible(true); task.execute(); }
/** * Loads a zone of interest via a worker thread, and showing the status of the operation in a * progress dialog * * @param zoneOfInterestIl Id of the zone of interest to load * @param progressDialog Dialog in which the status / progress of the operation will be shown */ public void loadZoneOfInterest(int zoneOfInterestId, ProgressDialog progressDialog) { LoadZoneOfInterestWorker task = new LoadZoneOfInterestWorker(progressDialog, zoneOfInterestId); progressDialog.setVisible(true); task.execute(); }
/** * Deletes zone of interest from id * * @param id */ public void deleteZoneOfInterest(int id) { ProgressDialog progressBar = new ProgressDialog("Suppression..."); DeleteZoneOfInterestWorker worker = new DeleteZoneOfInterestWorker(progressBar, id); progressBar.setVisible(true); worker.execute(); }
/** * Updates the zone of interest via a worker thread, and showing the status of the operation in a * progress dialog * * @param zoneOfInterest Zone of interest whose changes must be saved * @param progressDialog Dialog in which the status / progress of the operation will be shown */ public void updateZoneOfInterest(ZoneOfInterest zoneOfInterest, ProgressDialog progressDialog) { UpdateZoneOfInterestWorker task = new UpdateZoneOfInterestWorker(progressDialog, zoneOfInterest); progressDialog.setVisible(true); task.execute(); }