Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
lafabregue
MultiCube
Commits
74d5ac3e
Commit
74d5ac3e
authored
Mar 10, 2017
by
lafabregue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed to new JCL version and integrate Data construction with sampling, still need some fixes
parent
c8b78603
Changes
78
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
78 changed files
with
3918 additions
and
3630 deletions
+3918
-3630
geoxygene-datatools.log
geoxygene-datatools.log
+0
-0
geoxygene.log
geoxygene.log
+0
-0
hs_err_pid31285.log
hs_err_pid31285.log
+0
-1775
src/mustic/gui/ClassificationFrame.java
src/mustic/gui/ClassificationFrame.java
+20
-15
src/mustic/gui/ClassificationImage.java
src/mustic/gui/ClassificationImage.java
+4
-22
src/mustic/gui/DataDesktopFrame.java
src/mustic/gui/DataDesktopFrame.java
+71
-0
src/mustic/gui/DataSession.java
src/mustic/gui/DataSession.java
+183
-0
src/mustic/gui/DesktopFrame.java
src/mustic/gui/DesktopFrame.java
+6
-75
src/mustic/gui/ImageDesktopFrame.java
src/mustic/gui/ImageDesktopFrame.java
+123
-0
src/mustic/gui/ImageSession.java
src/mustic/gui/ImageSession.java
+65
-114
src/mustic/gui/MainFrame.java
src/mustic/gui/MainFrame.java
+679
-253
src/mustic/gui/MusticDesktop.java
src/mustic/gui/MusticDesktop.java
+104
-20
src/mustic/gui/PanneauAffichageParam.java
src/mustic/gui/PanneauAffichageParam.java
+5
-0
src/mustic/gui/dialog/ConfigDialog.java
src/mustic/gui/dialog/ConfigDialog.java
+16
-2
src/mustic/gui/dialog/RgbBandChooserInternalFrame.java
src/mustic/gui/dialog/RgbBandChooserInternalFrame.java
+2
-2
src/mustic/gui/dialog/SequenceDialog.java
src/mustic/gui/dialog/SequenceDialog.java
+50
-65
src/mustic/gui/dialog/classifier/AgentDialog.java
src/mustic/gui/dialog/classifier/AgentDialog.java
+19
-11
src/mustic/gui/dialog/classifier/AttributeSelectionDialog.java
...ustic/gui/dialog/classifier/AttributeSelectionDialog.java
+59
-57
src/mustic/gui/dialog/classifier/ClassifierDialog.java
src/mustic/gui/dialog/classifier/ClassifierDialog.java
+1
-1
src/mustic/gui/dialog/classifier/KMeansSeedSelectionDialog.java
...stic/gui/dialog/classifier/KMeansSeedSelectionDialog.java
+1
-1
src/mustic/gui/dialog/messages_en.properties
src/mustic/gui/dialog/messages_en.properties
+2
-1
src/mustic/gui/dialog/messages_fr.properties
src/mustic/gui/dialog/messages_fr.properties
+3
-2
src/mustic/gui/messages_en.properties
src/mustic/gui/messages_en.properties
+6
-3
src/mustic/gui/messages_fr.properties
src/mustic/gui/messages_fr.properties
+5
-2
src/mustic/gui/panels/BirdViewPanel.java
src/mustic/gui/panels/BirdViewPanel.java
+86
-61
src/mustic/gui/panels/HybridParametersHandler.java
src/mustic/gui/panels/HybridParametersHandler.java
+6
-4
src/mustic/gui/panels/ImageInformationPanel.java
src/mustic/gui/panels/ImageInformationPanel.java
+6
-6
src/mustic/gui/panels/ImagePanel.java
src/mustic/gui/panels/ImagePanel.java
+149
-145
src/mustic/gui/panels/ImageResultPanel.java
src/mustic/gui/panels/ImageResultPanel.java
+123
-97
src/mustic/gui/panels/classifier/ClassifierHandler.java
src/mustic/gui/panels/classifier/ClassifierHandler.java
+18
-6
src/mustic/gui/panels/classifier/ClassifierPanel.java
src/mustic/gui/panels/classifier/ClassifierPanel.java
+236
-448
src/mustic/gui/panels/classifier/components/ApproachSelectionPanel.java
.../panels/classifier/components/ApproachSelectionPanel.java
+51
-252
src/mustic/gui/panels/classifier/components/HybridClassificationPanel.java
...nels/classifier/components/HybridClassificationPanel.java
+14
-13
src/mustic/gui/panels/classifier/components/MaclawClassificationParametersPanel.java
...ifier/components/MaclawClassificationParametersPanel.java
+12
-3
src/mustic/gui/panels/classifier/components/NhybridClassificationPanel.java
...els/classifier/components/NhybridClassificationPanel.java
+2
-2
src/mustic/gui/panels/classifier/messages_en.properties
src/mustic/gui/panels/classifier/messages_en.properties
+1
-1
src/mustic/gui/panels/data/DataConstructFrame.java
src/mustic/gui/panels/data/DataConstructFrame.java
+101
-0
src/mustic/gui/panels/data/DataConstructPanel.java
src/mustic/gui/panels/data/DataConstructPanel.java
+208
-0
src/mustic/gui/panels/data/DataPanel.java
src/mustic/gui/panels/data/DataPanel.java
+102
-38
src/mustic/gui/panels/data/Messages.java
src/mustic/gui/panels/data/Messages.java
+22
-0
src/mustic/gui/panels/data/components/SamplingSelectionPanel.java
...ic/gui/panels/data/components/SamplingSelectionPanel.java
+286
-0
src/mustic/gui/panels/data/components/SourceSelectionPanel.java
...stic/gui/panels/data/components/SourceSelectionPanel.java
+286
-0
src/mustic/gui/panels/data/messages_en.properties
src/mustic/gui/panels/data/messages_en.properties
+13
-0
src/mustic/gui/panels/data/messages_fr.properties
src/mustic/gui/panels/data/messages_fr.properties
+13
-0
src/mustic/gui/segmentation/SegmentationDialog.java
src/mustic/gui/segmentation/SegmentationDialog.java
+2
-2
src/mustic/gui/segmentation/SegmentationPanelResultatImage.java
...stic/gui/segmentation/SegmentationPanelResultatImage.java
+4
-4
src/mustic/gui/segmentation/SegmentationResultPanel.java
src/mustic/gui/segmentation/SegmentationResultPanel.java
+1
-1
src/mustic/io/ImageData.java
src/mustic/io/ImageData.java
+245
-32
src/mustic/io/ImageMultiDimSequenceData.java
src/mustic/io/ImageMultiDimSequenceData.java
+15
-14
src/mustic/io/PelicanImageData.java
src/mustic/io/PelicanImageData.java
+5
-4
src/mustic/io/RawImage.java
src/mustic/io/RawImage.java
+143
-16
src/mustic/io/RawImageLight.java
src/mustic/io/RawImageLight.java
+3
-2
src/mustic/io/roi/ClusteringResultROI.java
src/mustic/io/roi/ClusteringResultROI.java
+2
-2
src/mustic/io/roi/ROIImage.java
src/mustic/io/roi/ROIImage.java
+1
-1
src/mustic/models/gui/ClassificationModel.java
src/mustic/models/gui/ClassificationModel.java
+10
-13
src/mustic/models/gui/charts/MultiresolutionChart.java
src/mustic/models/gui/charts/MultiresolutionChart.java
+1
-1
src/mustic/models/gui/charts/ScatterPlotChart.java
src/mustic/models/gui/charts/ScatterPlotChart.java
+15
-7
src/mustic/models/gui/dialogs/AgentDialog.java
src/mustic/models/gui/dialogs/AgentDialog.java
+1
-1
src/mustic/models/gui/dialogs/ClassifierDialog.java
src/mustic/models/gui/dialogs/ClassifierDialog.java
+1
-1
src/mustic/models/gui/dialogs/FilterDataDialog.java
src/mustic/models/gui/dialogs/FilterDataDialog.java
+2
-2
src/mustic/models/gui/panels/AttributeSelectionPanel.java
src/mustic/models/gui/panels/AttributeSelectionPanel.java
+6
-6
src/mustic/models/gui/panels/CentroidsPanel.java
src/mustic/models/gui/panels/CentroidsPanel.java
+4
-4
src/mustic/models/gui/panels/ClassifierPanel.java
src/mustic/models/gui/panels/ClassifierPanel.java
+1
-1
src/mustic/models/gui/panels/ComparisonPanel.java
src/mustic/models/gui/panels/ComparisonPanel.java
+2
-2
src/mustic/models/gui/panels/ConvertValuesPanel.java
src/mustic/models/gui/panels/ConvertValuesPanel.java
+3
-3
src/mustic/models/gui/panels/DataViewPanel.java
src/mustic/models/gui/panels/DataViewPanel.java
+2
-2
src/mustic/models/gui/panels/MaclawClassificationParametersPanel.java
...odels/gui/panels/MaclawClassificationParametersPanel.java
+1
-1
src/mustic/models/gui/panels/RandomDataPanel.java
src/mustic/models/gui/panels/RandomDataPanel.java
+1
-1
src/mustic/models/gui/panels/ScatterPlotPanel.java
src/mustic/models/gui/panels/ScatterPlotPanel.java
+1
-1
src/mustic/models/gui/panels/WeightsPanel.java
src/mustic/models/gui/panels/WeightsPanel.java
+3
-3
src/mustic/models/thread/ClassificationThread.java
src/mustic/models/thread/ClassificationThread.java
+1
-0
src/mustic/models/thread/DataFileReaderThread.java
src/mustic/models/thread/DataFileReaderThread.java
+4
-1
src/mustic/models/thread/FilterThread.java
src/mustic/models/thread/FilterThread.java
+4
-2
src/mustic/utils/documentFilter/DoubleDocumentFilter.java
src/mustic/utils/documentFilter/DoubleDocumentFilter.java
+127
-0
src/mustic/utils/documentFilter/IntDocumentFilter.java
src/mustic/utils/documentFilter/IntDocumentFilter.java
+127
-0
src/mustic/utils/documentFilter/ToUpdateObject.java
src/mustic/utils/documentFilter/ToUpdateObject.java
+13
-0
src/mustic/utils/transform/RegionDataBuilder.java
src/mustic/utils/transform/RegionDataBuilder.java
+6
-2
src/mustic/utils/transform/TransformVeriteTerrainEnRoi.java
src/mustic/utils/transform/TransformVeriteTerrainEnRoi.java
+2
-1
No files found.
geoxygene-datatools.log
deleted
100644 → 0
View file @
c8b78603
geoxygene.log
deleted
100644 → 0
View file @
c8b78603
hs_err_pid31285.log
deleted
100644 → 0
View file @
c8b78603
This diff is collapsed.
Click to expand it.
src/mustic/gui/ClassificationFrame.java
View file @
74d5ac3e
...
...
@@ -37,18 +37,18 @@ public class ClassificationFrame extends JInternalFrame {
private
ClassifierPanel
classifierPanel
;
private
ClassificationFrame
()
{
if
(
MainFrame
.
getInstance
().
getCurrentSession
()
!=
null
)
{
MainFrame
.
getInstance
()
.
getCurrentSession
()
.
setData
(
MainFrame
.
getInstance
().
getCurrentSession
()
.
getImageData
());
classifierPanel
=
new
ClassifierPanel
(
this
,
false
,
false
);
}
else
{
classifierPanel
=
new
ClassifierPanel
(
this
,
false
,
false
);
}
//
if (MainFrame.getInstance().getCurrentSession() != null) {
//
MainFrame
//
.getInstance()
//
.getCurrentSession()
//
.setData(
//
MainFrame.getInstance().getCurrentSession()
//
.getImageData());
//
classifierPanel = new ClassifierPanel(this, false, false);
//
//
} else {
classifierPanel
=
new
ClassifierPanel
(
this
,
false
);
//
}
this
.
add
(
classifierPanel
);
this
.
setTitle
(
Messages
.
getString
(
"ClassificationFrame.0"
));
//$NON-NLS-1$
...
...
@@ -105,15 +105,20 @@ public class ClassificationFrame extends JInternalFrame {
public
void
updateClassifierPanel
()
{
String
[]
items
=
this
.
classifierPanel
.
getNameData
();
// if there is no Data session opened
if
(
items
==
null
)
{
return
;
}
this
.
classifierPanel
.
getApproachPanel
().
get
Single
DataComboBox
()
this
.
classifierPanel
.
getApproachPanel
().
getDataComboBox
()
.
removeAllItems
();
for
(
int
i
=
0
;
i
<
items
.
length
;
i
++)
{
this
.
classifierPanel
.
getApproachPanel
().
get
Single
DataComboBox
()
this
.
classifierPanel
.
getApproachPanel
().
getDataComboBox
()
.
addItem
(
items
[
i
]);
}
this
.
classifierPanel
.
getApproachPanel
().
get
Single
DataComboBox
()
this
.
classifierPanel
.
getApproachPanel
().
getDataComboBox
()
.
setSelectedIndex
(
0
);
}
}
\ No newline at end of file
src/mustic/gui/ClassificationImage.java
View file @
74d5ac3e
...
...
@@ -11,6 +11,7 @@ import jcl.data.Data;
import
jcl.data.attribute.AttributeMultiDimSequence
;
import
jcl.learning.methods.multistrategy.samarah4.comm.ClassificationSAM4
;
import
mustic.gui.panels.ImageResultPanel
;
import
mustic.io.ImageData
;
import
mustic.io.RawImage
;
import
mustic.models.gui.ClassificationModel
;
import
mustic.models.gui.panels.ResultPanel
;
...
...
@@ -21,8 +22,6 @@ public class ClassificationImage extends ClassificationModel {
/** */
private
static
final
long
serialVersionUID
=
1L
;
/** */
public
RawImage
mRawImage
;
/** */
public
ArrayList
<
Classification
>
results
=
new
ArrayList
<
Classification
>();
...
...
@@ -36,16 +35,11 @@ public class ClassificationImage extends ClassificationModel {
public
ClassificationImage
(
Data
data
,
String
title
)
{
super
(
data
,
title
,
false
);
this
.
setDefaultCloseOperation
(
WindowConstants
.
DISPOSE_ON_CLOSE
);
this
.
mRawImage
=
MainFrame
.
getInstance
().
getCurrentSession
()
.
getRawImage
();
}
public
ClassificationImage
(
Data
data
,
String
title
,
boolean
justData
)
{
super
(
data
,
title
,
justData
);
this
.
setDefaultCloseOperation
(
WindowConstants
.
DISPOSE_ON_CLOSE
);
if
(
MainFrame
.
getInstance
().
getCurrentSession
()
!=
null
)
this
.
mRawImage
=
MainFrame
.
getInstance
().
getCurrentSession
()
.
getRawImage
();
}
/**
...
...
@@ -59,19 +53,7 @@ public class ClassificationImage extends ClassificationModel {
@Override
synchronized
public
void
addResult
(
Classification
result
,
String
title
,
TabbedPanel
pane
)
{
ImageSession
imgSession
=
MainFrame
.
getInstance
().
getCurrentSession
();
DesktopFrame
[]
desktopFrames
=
MainFrame
.
getInstance
().
getDesktop
()
.
getAllDesktopFrames
();
for
(
int
i
=
0
;
i
<
desktopFrames
.
length
;
i
++)
{
if
(
result
.
getData
()
.
getDataName
()
.
equals
(
desktopFrames
[
i
].
getImageSession
().
getRawImage
()
.
getPath
()))
imgSession
=
desktopFrames
[
i
].
getImageSession
();
}
ImageResultPanel
rpanel
=
new
ImageResultPanel
(
result
,
this
,
imgSession
.
getRawImage
());
ImageResultPanel
rpanel
=
new
ImageResultPanel
(
result
,
this
,
((
ImageData
)
data
));
Tab
t1
=
ClassificationModel
.
createTab
(
title
,
new
ImageIcon
(
getClass
()
.
getResource
(
"/icons/actions/document-open-result.png"
)),
//$NON-NLS-1$
rpanel
,
true
);
...
...
@@ -91,9 +73,9 @@ public class ClassificationImage extends ClassificationModel {
ImageResultPanel
irp
=
(
ImageResultPanel
)
this
.
tabbedPane
.
getTabAt
(
this
.
tabbedPane
.
getTabCount
()
-
1
).
getContentComponent
();
irp
.
historique
.
addInfosln
(
Messages
.
getString
(
"ClassificationImage.2"
));
//$NON-NLS-1$
if
(
result
.
getData
().
getDataObject
(
0
).
getAttribute
(
0
)
instanceof
AttributeMultiDimSequence
)
{
if
(
result
.
getData
().
get
One
DataObject
().
getAttribute
(
0
)
instanceof
AttributeMultiDimSequence
)
{
irp
.
historique
.
addInfosln
(
Messages
.
getString
(
"ClassificationImage.3"
));
//$NON-NLS-1$
irp
.
historique
.
addInfosln
(
result
.
getData
().
getDataFileName
());
irp
.
historique
.
addInfosln
(
result
.
getData
().
getDataFile
s
Name
()
.
get
(
0
)
);
}
else
irp
.
historique
.
addInfosln
(
Messages
.
getString
(
"ClassificationImage.4"
)
//$NON-NLS-1$
+
result
.
getData
().
getDataName
()
+
"\n"
);
//$NON-NLS-1$
...
...
src/mustic/gui/DataDesktopFrame.java
0 → 100644
View file @
74d5ac3e
package
mustic.gui
;
import
javax.swing.event.InternalFrameEvent
;
public
class
DataDesktopFrame
extends
DesktopFrame
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* Chaque DesktopFrame corresponde a une ImageSession => On utilise le
* MusticDesktop comme manager pour les DesktopFrames et pour les
* ImageSessions dans le meme temps (les methode utilise sont decrit en java
* API, classe JDesktopPane remove JInternalFrame, add JInternalFrame etc.)
*/
private
DataSession
dataSession
=
null
;
public
DataDesktopFrame
(
DataSession
_session
)
{
super
(
_session
.
getTitle
(),
true
,
true
,
true
);
this
.
dataSession
=
_session
;
dataSession
.
associatedFrame
=
this
;
this
.
add
(
dataSession
.
getWorkSpace
());
}
public
DataSession
getDataSession
()
{
return
this
.
dataSession
;
}
@Override
public
void
internalFrameClosed
(
InternalFrameEvent
e
)
{
MainFrame
.
getInstance
().
removeDataNode
(
this
.
dataSession
);
this
.
dataSession
=
null
;
}
@Override
public
void
internalFrameClosing
(
InternalFrameEvent
e
)
{
this
.
dispose
();
}
@Override
public
void
internalFrameDeactivated
(
InternalFrameEvent
e
)
{
}
@Override
public
void
internalFrameDeiconified
(
InternalFrameEvent
e
)
{
}
@Override
public
void
internalFrameIconified
(
InternalFrameEvent
e
)
{
}
@Override
public
void
internalFrameOpened
(
InternalFrameEvent
e
)
{
}
@Override
public
void
internalFrameActivated
(
InternalFrameEvent
e
)
{
}
}
src/mustic/gui/DataSession.java
0 → 100644
View file @
74d5ac3e
package
mustic.gui
;
import
java.awt.event.ActionEvent
;
import
java.awt.event.ActionListener
;
import
java.util.Vector
;
import
javax.swing.ImageIcon
;
import
javax.swing.JButton
;
import
javax.swing.JInternalFrame
;
import
javax.swing.JPanel
;
import
javax.swing.border.EmptyBorder
;
import
jcl.data.Data
;
import
mustic.gui.panels.ImageResultPanel
;
import
mustic.gui.panels.data.DataPanel
;
import
mustic.io.ImageData
;
import
net.infonode.tabbedpanel.TabbedPanel
;
import
net.infonode.tabbedpanel.titledtab.TitledTab
;
/**
* Class that manage the creation and the storage of a Data object
*
* @author Baptiste LAFABREGUE
*
*/
public
class
DataSession
{
/**
* parametre permettant de savoir si l'image ouverte provient de la base de donnees
* ?? repris d'ImageSession
*/
public
JInternalFrame
associatedFrame
=
null
;
/** the data attached to this session */
private
Data
data
;
/** Title of the session */
private
String
mTitle
;
/** Contains image, classifier, results */
protected
TabbedPanel
mWorskSpace
;
/** all ImageResultPanels associated to this session */
private
Vector
<
ImageResultPanel
>
resultPanels
=
new
Vector
<
ImageResultPanel
>();
private
DataPanel
dataPanel
;
/** save the number of clustering already done a the overall sessions */
public
static
int
nbClustering
=
1
;
/**
* Constructor
* @param data
* the data attached to this session
*/
public
DataSession
(
Data
data
)
{
this
.
data
=
data
;
this
.
mTitle
=
"Data - "
+
data
.
getDataName
();
this
.
dataPanel
=
new
DataPanel
(
data
);
this
.
mWorskSpace
=
dataPanel
.
tabbedPane
;
}
/**
* Add a classifier for the data
* @param classificationImage
*/
public
void
addClassifier
(
ClassificationImage
classificationImage
)
{
final
TitledTab
tab
=
new
TitledTab
(
Messages
.
getString
(
"ImageSession.7"
)
+
nbClustering
++,
//$NON-NLS-1$
null
,
classificationImage
.
tabbedPane
,
new
JPanel
());
tab
.
setFocusableComponent
(
null
);
JButton
closeButton
=
new
JButton
(
new
ImageIcon
(
tab
.
getClass
().
getResource
(
"/icons/cluster-invisible.png"
)));
//$NON-NLS-1$
closeButton
.
setOpaque
(
false
);
closeButton
.
setUI
(
new
javax
.
swing
.
plaf
.
metal
.
MetalButtonUI
());
closeButton
.
setMargin
(
null
);
closeButton
.
setBorder
(
new
EmptyBorder
(
1
,
1
,
1
,
1
));
closeButton
.
addActionListener
(
new
ActionListener
()
{
@Override
public
void
actionPerformed
(
ActionEvent
e
)
{
tab
.
getTabbedPanel
().
removeTab
(
tab
);
}
});
tab
.
setHighlightedStateTitleComponent
(
closeButton
);
this
.
mWorskSpace
.
addTab
(
tab
);
this
.
mWorskSpace
.
setSelectedTab
(
tab
);
}
public
void
addResultPanel
(
ImageResultPanel
panel
)
{
if
(
this
.
resultPanels
==
null
)
{
this
.
resultPanels
=
new
Vector
<
ImageResultPanel
>();
}
this
.
resultPanels
.
add
(
panel
);
}
public
void
decreaseBrightness
()
{
if
(
this
.
resultPanels
!=
null
)
{
for
(
ImageResultPanel
panel
:
this
.
resultPanels
)
{
panel
.
decreaseBrightness
();
}
}
}
public
void
decreaseContrast
()
{
if
(
this
.
resultPanels
!=
null
)
{
for
(
ImageResultPanel
panel
:
this
.
resultPanels
)
{
panel
.
decreaseContrast
();
}
}
}
public
void
increaseBrightness
()
{
if
(
this
.
resultPanels
!=
null
)
{
for
(
ImageResultPanel
panel
:
this
.
resultPanels
)
{
panel
.
increaseBrightness
();
}
}
}
public
void
increaseContrast
()
{
if
(
this
.
resultPanels
!=
null
)
{
for
(
ImageResultPanel
panel
:
this
.
resultPanels
)
{
panel
.
increaseContrast
();
}
}
}
public
void
zoomIn
()
{
if
(
this
.
resultPanels
!=
null
)
{
for
(
ImageResultPanel
panel
:
this
.
resultPanels
)
{
panel
.
zoomIn
();
}
}
}
public
void
zoomOut
()
{
if
(
this
.
resultPanels
!=
null
)
{
for
(
ImageResultPanel
panel
:
this
.
resultPanels
)
{
panel
.
zoomOut
();
}
}
}
synchronized
public
Vector
<
ImageResultPanel
>
getResultPanels
()
{
return
this
.
resultPanels
;
}
public
Data
getData
()
{
return
data
;
}
public
void
setTile
(
String
title
)
{
this
.
mTitle
=
title
;
}
public
String
getTitle
()
{
return
mTitle
;
}
public
TabbedPanel
getWorkSpace
()
{
return
this
.
mWorskSpace
;
}
@Override
public
String
toString
()
{
return
this
.
mTitle
;
//$NON-NLS-1$
}
public
Vector
<
ImageSession
>
getAssociatedImageSessions
()
{
if
(
data
instanceof
ImageData
)
{
if
(((
ImageData
)
data
).
getAssociatedImageSessions
()
!=
null
&&
((
ImageData
)
data
).
getAssociatedImageSessions
().
size
()
>
0
)
{
return
((
ImageData
)
data
).
getAssociatedImageSessions
();
}
}
return
null
;
}
}
\ No newline at end of file
src/mustic/gui/DesktopFrame.java
View file @
74d5ac3e
...
...
@@ -8,105 +8,40 @@ import javax.swing.WindowConstants;
import
javax.swing.event.InternalFrameEvent
;
import
javax.swing.event.InternalFrameListener
;
public
class
DesktopFrame
extends
JInternalFrame
implements
abstract
public
class
DesktopFrame
extends
JInternalFrame
implements
InternalFrameListener
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* Chaque DesktopFrame corresponde a une ImageSession => On utilise le
* MusticDesktop comme manager pour les DesktopFrames et pour les
* ImageSessions dans le meme temps (les methode utilise sont decrit en java
* API, classe JDesktopPane remove JInternalFrame, add JInternalFrame etc.)
*/
private
ImageSession
imageSession
=
null
;
public
DesktopFrame
(
ImageSession
_session
)
{
super
(
_session
.
mTitle
,
true
,
true
,
true
);
this
.
imageSession
=
_session
;
public
DesktopFrame
(
String
mTitle
,
boolean
b
,
boolean
c
,
boolean
d
)
{
super
(
mTitle
,
b
,
c
,
d
);
setSize
(
300
,
200
);
setIconifiable
(
true
);
setVisible
(
true
);
imageSession
.
associatedFrame
=
this
;
addInternalFrameListener
(
this
);
this
.
setDefaultCloseOperation
(
WindowConstants
.
DISPOSE_ON_CLOSE
);
this
.
add
(
imageSession
.
getWorkSpace
());
try
{
setSelected
(
true
);
}
catch
(
java
.
beans
.
PropertyVetoException
e
)
{
}
}
public
void
addROITools
()
{
// creation du module
ROIToolsFrame
module
=
imageSession
.
getImagePanel
().
getROIToolsFrame
();
if
(
module
==
null
)
{
module
=
new
ROIToolsFrame
(
imageSession
);
}
this
.
imageSession
.
gardeInstance
(
module
);
MainFrame
.
getInstance
().
getDesktop
().
add
(
module
);
try
{
module
.
setSelected
(
true
);
module
.
setVisible
(
true
);
}
catch
(
PropertyVetoException
e
)
{
}
}
public
void
closeModuleROI
()
{
ROIToolsFrame
roi
=
this
.
imageSession
.
getImagePanel
()
.
getROIToolsFrame
();
if
(
roi
!=
null
&&
!
roi
.
isClosed
())
{
int
answer
=
JOptionPane
.
showConfirmDialog
(
this
,
Messages
.
getString
(
"DesktopFrame.0"
),
Messages
.
getString
(
"DesktopFrame.1"
),
//$NON-NLS-1$ //$NON-NLS-2$
JOptionPane
.
YES_NO_OPTION
,
JOptionPane
.
QUESTION_MESSAGE
);
if
(
answer
==
JOptionPane
.
YES_OPTION
)
{
roi
.
saveRoiAs
();
}
try
{
roi
.
setClosed
(
true
);
}
catch
(
PropertyVetoException
ex
)
{
}
}
}
public
ImageSession
getImageSession
()
{
return
this
.
imageSession
;
}
/**
* quand on selectionne une autre fenetre, on met a jour le birdpanel et
* l'info panel qui correspond a l'image si on visionne l'image. si on
* visionne un result
*/
@Override
public
void
internalFrameActivated
(
InternalFrameEvent
e
)
{
MainFrame
.
getInstance
().
setInfosPanel
(
this
.
imageSession
.
getInfoPanel
());
MainFrame
.
getInstance
().
getInfosPanel
().
repaint
();
MainFrame
.
getInstance
().
setBirdPanel
(
this
.
imageSession
.
getBirdPanel
());
MainFrame
.
getInstance
().
getBirdPanel
().
repaint
();
}
abstract
public
void
internalFrameActivated
(
InternalFrameEvent
e
);
@Override
public
void
internalFrameClosed
(
InternalFrameEvent
e
)
{
MainFrame
.
getInstance
().
removeNode
(
this
.
imageSession
);
this
.
imageSession
=
null
;
}
abstract
public
void
internalFrameClosed
(
InternalFrameEvent
e
);
@Override
public
void
internalFrameClosing
(
InternalFrameEvent
e
)
{
this
.
closeModuleROI
();
this
.
dispose
();
}
...
...
@@ -130,8 +65,4 @@ public class DesktopFrame extends JInternalFrame implements
}
public
void
setImegeSession
(
ImageSession
imgSession
)
{
this
.
imageSession
=
imgSession
;
}
}
src/mustic/gui/ImageDesktopFrame.java
0 → 100644
View file @
74d5ac3e
package
mustic.gui
;
import
java.beans.PropertyVetoException
;
import
javax.swing.JOptionPane
;
import
javax.swing.event.InternalFrameEvent
;
public
class
ImageDesktopFrame
extends
DesktopFrame
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* Chaque DesktopFrame corresponde a une ImageSession => On utilise le
* MusticDesktop comme manager pour les DesktopFrames et pour les
* ImageSessions dans le meme temps (les methode utilise sont decrit en java
* API, classe JDesktopPane remove JInternalFrame, add JInternalFrame etc.)
*/
private
ImageSession
imageSession
=
null
;
public
ImageDesktopFrame
(
ImageSession
_session
)
{
super
(
_session
.
mTitle
,
true
,
true
,
true
);
this
.
imageSession
=
_session
;
imageSession
.
associatedFrame
=
this
;
this
.
add
(
imageSession
.
getWorkSpace
());
}
public
void
addROITools
()
{
// creation du module
ROIToolsFrame
module
=
imageSession
.
getImagePanel
().
getROIToolsFrame
();
if
(
module
==
null
)
{
module
=
new
ROIToolsFrame
(
imageSession
);
}
this
.
imageSession
.
gardeInstance
(
module
);
MainFrame
.
getInstance
().
getDesktop
().
add
(
module
);
try
{
module
.
setSelected
(
true
);
module
.
setVisible
(
true
);
}
catch
(
PropertyVetoException
e
)
{
}
}
public
void
closeModuleROI
()
{
ROIToolsFrame
roi
=
this
.
imageSession
.
getImagePanel
()
.
getROIToolsFrame
();
if
(
roi
!=
null
&&
!
roi
.
isClosed
())
{
int
answer
=
JOptionPane
.
showConfirmDialog
(
this
,
Messages
.
getString
(
"DesktopFrame.0"
),
Messages
.
getString
(
"DesktopFrame.1"
),
//$NON-NLS-1$ //$NON-NLS-2$
JOptionPane
.
YES_NO_OPTION
,
JOptionPane
.
QUESTION_MESSAGE
);
if
(
answer
==
JOptionPane
.
YES_OPTION
)
{
roi
.
saveRoiAs
();
}
try
{
roi
.
setClosed
(
true
);
}
catch
(
PropertyVetoException
ex
)
{
}
}
}
public
ImageSession
getImageSession
()
{
return
this
.
imageSession
;
}
/**
* quand on selectionne une autre fenetre, on met a jour le birdpanel et
* l'info panel qui correspond a l'image si on visionne l'image. si on
* visionne un result
*/
@Override
public
void
internalFrameActivated
(
InternalFrameEvent
e
)
{