@Override
public void actionPerformed(ActionEvent e) {
Transformer transformer = model.getCurrentTransformer();
if (transformer != null) {
RankingController rankingController = Lookup.getDefault().lookup(RankingController.class);
if (interpolator != null) {
rankingController.setInterpolator(new org.gephi.ranking.api.Interpolator() {
@Override
public float interpolate(float x) {
return interpolator.interpolate(x);
}
});
}
rankingController.transform(model.getCurrentRanking(), transformer);
}
}
});
splineButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (splineEditor == null) {
splineEditor = new SplineEditor(NbBundle.getMessage(RankingChooser.class, "RankingChooser.splineEditor.title"));
}
splineEditor.setVisible(true);
interpolator = splineEditor.getCurrentInterpolator();
RankingController rankingController = Lookup.getDefault().lookup(RankingController.class);
rankingController.setInterpolator(new org.gephi.ranking.api.Interpolator() {
@Override
public float interpolate(float x) {
return interpolator.interpolate(x);
}
});
}
});
autoApplyButton.setVisible(false);
enableAutoButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
if (enableAutoButton.isSelected()) {
autoApplyButton.setVisible(true);
setAutoApplySelected(false);
autoApplyButton.setSelected(false);
applyButton.setVisible(false);
} else {
autoApplyButton.setVisible(false);
applyButton.setVisible(true);
model.setAutoTransformer(model.getCurrentTransformer(), false);
}
}
});
autoApplyButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
if (interpolator != null) {
RankingController rankingController = Lookup.getDefault().lookup(RankingController.class);
rankingController.setInterpolator(new org.gephi.ranking.api.Interpolator() {
@Override
public float interpolate(float x) {
return interpolator.interpolate(x);
}