-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDistanceScatterPlotComp.java
103 lines (85 loc) · 2.75 KB
/
DistanceScatterPlotComp.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package dataanalysis;
import distance.DistanceMatrix;
import distance.dissimilarity.DissimilarityFactory.DissimilarityType;
import java.io.IOException;
import java.util.ArrayList;
import projection.model.ProjectionModel;
import tree.model.TreeModel;
import vispipelinebasics.annotations.VisComponent;
import vispipelinebasics.annotations.Param;
import vispipelinebasics.interfaces.AbstractParametersView;
import vispipelinebasics.interfaces.AbstractComponent;
/**
*
* @author Jose Gustavo
*/
@VisComponent(hierarchy = "Data Analysis",
name = "Distance Scatterplot",
description = "calculate the the distance scatterplot of a layout.")
public class DistanceScatterPlotComp implements AbstractComponent {
@Override
public void execute() throws IOException {
if (dmat == null) return;
for (int i=0;i<models.size();i++) {
Serie serie = new Serie(models.get(i));
DistanceScatterPlot.getInstance(null).display(this.dmat,serie,this.useWeight);
}
}
public void attach(@Param(name = "tree model") TreeModel model) {
if (models == null)
models = new ArrayList<ProjectionModel>();
if (model != null)
models.add(model);
}
public void attach(@Param(name = "projection model") ProjectionModel model) {
if (models == null)
models = new ArrayList<ProjectionModel>();
if (model != null)
models.add(model);
}
// public AbstractMatrix output() {
// return input;
// }
@Override
public AbstractParametersView getParametersEditor() {
if (paramview == null) {
paramview = new DistanceScatterPlotParamView(this);
}
return paramview;
}
@Override
public void reset() {
models = null;
}
public boolean isUseWeight() {
return useWeight;
}
public void setUseWeight(boolean useWeight) {
this.useWeight = useWeight;
}
public DissimilarityType getDissimilarityType() {
return disstype;
}
public void setDissimilarityType(DissimilarityType diss) {
this.disstype = diss;
}
public boolean isDistanceMatrixProvided() {
return (getDmat() != null);
}
public DistanceMatrix getDmat() {
return dmat;
}
public void setDmat(DistanceMatrix dmat) {
this.dmat = dmat;
}
public static final long serialVersionUID = 1L;
private ArrayList<ProjectionModel> models;
private transient boolean useWeight;
private transient DistanceScatterPlotParamView paramview;
private DissimilarityType disstype = DissimilarityType.EUCLIDEAN;
private transient DistanceMatrix dmat;
}