Commit 1ebd5b90 authored by balanche's avatar balanche
Browse files

Ajout d'une dernière étape de progress bar lors de la classification +...

Ajout d'une dernière étape de progress bar lors de la classification + Suppression des scrollbars sur le panel Dataset
parent 75394fbf
...@@ -51,7 +51,7 @@ public class ClassificationImage extends ClassificationModel { ...@@ -51,7 +51,7 @@ public class ClassificationImage extends ClassificationModel {
TabbedPanel pane) { TabbedPanel pane) {
ResultPanel rpanel = null; ResultPanel rpanel = null;
if (data instanceof ImageData) { if (data instanceof ImageData) {
rpanel = new ImageResultPanel(session, result, this, ((ImageData) data)); rpanel = new ImageResultPanel(session, result, this, ((ImageData) data));//!!
} else { } else {
rpanel = new ResultPanel(result, this); rpanel = new ResultPanel(result, this);
} }
...@@ -68,13 +68,14 @@ public class ClassificationImage extends ClassificationModel { ...@@ -68,13 +68,14 @@ public class ClassificationImage extends ClassificationModel {
@Override @Override
public void doOperationAfterClassification(Classification result) { public void doOperationAfterClassification(Classification result) {
//setprogress final ? /* Monitoring the operation */
result.setStatus("Step "+ (result.getProgressableList().size()+1) + "/" + (result.getProgressableList().size()+1) + " : Displaying result");
if (!result.isHybrid() && !(result instanceof ClassificationSAM4)) { if (!result.isHybrid() && !(result instanceof ClassificationSAM4)) {
if (result.getTimeExec() != 0) if (result.getTimeExec() != 0)
result.setTimeExec(ManagementFactory.getThreadMXBean() result.setTimeExec(ManagementFactory.getThreadMXBean()
.getCurrentThreadCpuTime()); .getCurrentThreadCpuTime());
this.results.add(result); this.results.add(result);
this.addResult(result, Messages.getString("ClassificationImage.1") + ResultPanel.nbResult++); //$NON-NLS-1$ this.addResult(result, Messages.getString("ClassificationImage.1") + ResultPanel.nbResult++); //$NON-NLS-1$ !!!
ResultPanel irp = (ResultPanel) this.tabbedPane.getTabAt( ResultPanel irp = (ResultPanel) this.tabbedPane.getTabAt(
this.tabbedPane.getTabCount() - 1).getContentComponent(); this.tabbedPane.getTabCount() - 1).getContentComponent();
irp.historique.addInfosln(Messages.getString("ClassificationImage.2")); //$NON-NLS-1$ irp.historique.addInfosln(Messages.getString("ClassificationImage.2")); //$NON-NLS-1$
......
...@@ -200,7 +200,7 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen ...@@ -200,7 +200,7 @@ public class ImageResultPanel extends ResultPanel implements TreeSelectionListen
MainFrame.getInstance().getCurrentDataSession().addResultPanel(this); MainFrame.getInstance().getCurrentDataSession().addResultPanel(this);
this.result = classification.getClusteringResult(); this.result = classification.getClusteringResult();
this.clusterMap = new MultiResolutionClusterMap(this, imgData.getWidth(), this.clusterMap = new MultiResolutionClusterMap(this, imgData.getWidth(),
imgData.getHeight(), result.getClusterMap(false), this.result.getClusters()); imgData.getHeight(), result.getClusterMap(false), this.result.getClusters());//!!
this.classPanel.addTreeSelectionListener(this); this.classPanel.addTreeSelectionListener(this);
......
...@@ -137,7 +137,8 @@ public class DataPanel extends JPanel implements ChangeListener { ...@@ -137,7 +137,8 @@ public class DataPanel extends JPanel implements ChangeListener {
this.data = _data; this.data = _data;
JPanel container = buildBody(); JPanel container = buildBody();
JScrollPane sp = new JScrollPane(container); // JScrollPane sp = new JScrollPane(container);
JPanel sp = container;//no scroll bars for better visibility
JPanel dataPane = new JPanel(new BorderLayout()); JPanel dataPane = new JPanel(new BorderLayout());
// dataPane.setSize(700, 500); // dataPane.setSize(700, 500);
dataPane.setPreferredSize(new Dimension(700,500)); dataPane.setPreferredSize(new Dimension(700,500));
......
...@@ -44,7 +44,6 @@ public class ClassificationFrame extends ClassificationModel { ...@@ -44,7 +44,6 @@ public class ClassificationFrame extends ClassificationModel {
ResultPanel rp = new ResultPanel(result, this); ResultPanel rp = new ResultPanel(result, this);
rp.setName(name); rp.setName(name);
resultPanels.add(rp); resultPanels.add(rp);
Tab tabResult = ClassificationModel.createTab( Tab tabResult = ClassificationModel.createTab(
result.getName(), result.getName(),
new ImageIcon(getClass().getResource( new ImageIcon(getClass().getResource(
......
...@@ -41,9 +41,13 @@ public class MultiResolutionClusterMap { ...@@ -41,9 +41,13 @@ public class MultiResolutionClusterMap {
private void generateMaps(int[] map) { private void generateMaps(int[] map) {
int[][] newMap = new int[width][height]; int[][] newMap = new int[width][height];
double pas = 100./(height*width);
double progress = imageResultPanel.getClassification().getProgress()+pas;
for(int j = 0 ; j < height ; j++) { for(int j = 0 ; j < height ; j++) {
for(int i = 0 ; i < width ; i++) { for(int i = 0 ; i < width ; i++) {
newMap[i][j] = map[i + j*width]; newMap[i][j] = map[i + j*width];
progress+=pas;
imageResultPanel.getClassification().setProgress((int)progress);
} }
} }
this.maps.add(newMap); this.maps.add(newMap);
......
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