use of org.gephi.visualization.apiimpl.GraphIO in project gephi by gephi.
the class GlobalSettingsPanel method setup.
public void setup() {
VizModel vizModel = VizController.getInstance().getVizModel();
vizModel.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals("init")) {
refreshSharedConfig();
} else if (evt.getPropertyName().equals("backgroundColor")) {
refreshSharedConfig();
} else if (evt.getPropertyName().equals("autoSelectNeighbor")) {
refreshSharedConfig();
} else if (evt.getPropertyName().equals("lightenNonSelectedAuto")) {
refreshSharedConfig();
} else if (evt.getPropertyName().equals("use3d")) {
refreshSharedConfig();
}
}
});
refreshSharedConfig();
hightlightCheckBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
VizModel vizModel = VizController.getInstance().getVizModel();
vizModel.setLightenNonSelectedAuto(hightlightCheckBox.isSelected());
}
});
((JColorButton) backgroundColorButton).addPropertyChangeListener(JColorButton.EVENT_COLOR, new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
VizModel vizModel = VizController.getInstance().getVizModel();
vizModel.setBackgroundColor(((JColorButton) backgroundColorButton).getColor());
}
});
autoSelectNeigborCheckbox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
VizModel vizModel = VizController.getInstance().getVizModel();
vizModel.setAutoSelectNeighbor(autoSelectNeigborCheckbox.isSelected());
}
});
zoomSlider.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
int cam = (int) VizController.getInstance().getVizModel().getCameraDistance();
if (zoomSlider.getValue() != cam && cam < zoomSlider.getMaximum()) {
GraphIO io = VizController.getInstance().getGraphIO();
io.setCameraDistance(zoomSlider.getValue());
}
}
});
}
Aggregations