use of javax.swing.event.ChangeEvent in project FBReaderJ by geometer.
the class ZLBooleanOptionView method createItem.
protected void createItem() {
final ZLBooleanOptionEntry booleanEntry = (ZLBooleanOptionEntry) myOption;
myCheckBox = new JCheckBox(myName);
myCheckBox.setSelected(booleanEntry.initialState());
myCheckBox.addChangeListener(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
booleanEntry.onStateChanged(myCheckBox.isSelected());
}
});
myTab.insertWidget(myCheckBox);
}
use of javax.swing.event.ChangeEvent in project gephi by gephi.
the class TextManager method initArchitecture.
@Override
public void initArchitecture() {
model = VizController.getInstance().getVizModel().getTextModel();
vizConfig = VizController.getInstance().getVizConfig();
drawable = VizController.getInstance().getDrawable();
//Settings
antialised = vizConfig.isLabelAntialiased();
mipmap = vizConfig.isLabelMipMap();
fractionalMetrics = vizConfig.isLabelFractionalMetrics();
//Init
initRenderer();
//Init sizemodes
for (SizeMode s : sizeModes) {
s.init();
}
//Model listening
model.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (!nodeRenderer.getFont().equals(model.getNodeFont())) {
nodeRenderer.setFont(model.getNodeFont());
}
if (!edgeRenderer.getFont().equals(model.getEdgeFont())) {
edgeRenderer.setFont(model.getEdgeFont());
}
nodeRefresh = true;
edgeRefresh = true;
}
});
//Model change
VizController.getInstance().getVizModel().addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals("init")) {
TextManager.this.model = VizController.getInstance().getVizModel().getTextModel();
//Initialize columns if needed
if (model.getNodeTextColumns() == null || model.getNodeTextColumns().length == 0) {
model.setTextColumns(new Column[0], new Column[0]);
}
}
}
});
}
use of javax.swing.event.ChangeEvent in project gephi by gephi.
the class ImportCSVUIWizardPanel1 method fireChangeEvent.
protected final void fireChangeEvent() {
Iterator<ChangeListener> it;
synchronized (listeners) {
it = new HashSet<>(listeners).iterator();
}
ChangeEvent ev = new ChangeEvent(this);
while (it.hasNext()) {
it.next().stateChanged(ev);
}
}
use of javax.swing.event.ChangeEvent in project gephi by gephi.
the class ImportCSVUIWizardPanel2 method fireChangeEvent.
protected final void fireChangeEvent() {
Iterator<ChangeListener> it;
synchronized (listeners) {
it = new HashSet<>(listeners).iterator();
}
ChangeEvent ev = new ChangeEvent(this);
while (it.hasNext()) {
it.next().stateChanged(ev);
}
}
use of javax.swing.event.ChangeEvent in project gephi by gephi.
the class EdgeSettingsPanel 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("edgeHasUniColor")) {
refreshSharedConfig();
} else if (evt.getPropertyName().equals("showEdges")) {
refreshSharedConfig();
} else if (evt.getPropertyName().equals("edgeUniColor")) {
refreshSharedConfig();
} else if (evt.getPropertyName().equals("edgeSelectionColor")) {
refreshSharedConfig();
} else if (evt.getPropertyName().equals("edgeInSelectionColor")) {
refreshSharedConfig();
} else if (evt.getPropertyName().equals("edgeOutSelectionColor")) {
refreshSharedConfig();
} else if (evt.getPropertyName().equals("edgeBothSelectionColor")) {
refreshSharedConfig();
} else if (evt.getPropertyName().equals("edgeScale")) {
refreshSharedConfig();
}
}
});
refreshSharedConfig();
showEdgesCheckbox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
VizModel vizModel = VizController.getInstance().getVizModel();
vizModel.setShowEdges(showEdgesCheckbox.isSelected());
setEnable(true);
}
});
((JColorButton) edgeColorButton).addPropertyChangeListener(JColorButton.EVENT_COLOR, new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
VizModel vizModel = VizController.getInstance().getVizModel();
vizModel.setEdgeUniColor(((JColorButton) edgeColorButton).getColorArray());
}
});
sourceNodeColorCheckbox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
VizModel vizModel = VizController.getInstance().getVizModel();
vizModel.setEdgeHasUniColor(!sourceNodeColorCheckbox.isSelected());
}
});
selectionColorCheckbox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
VizModel vizModel = VizController.getInstance().getVizModel();
vizModel.setEdgeSelectionColor(selectionColorCheckbox.isSelected());
}
});
edgeInSelectionColorChooser.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
VizModel vizModel = VizController.getInstance().getVizModel();
vizModel.setEdgeInSelectionColor(edgeInSelectionColorChooser.getColor().getComponents(null));
}
});
edgeBothSelectionColorChooser.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
VizModel vizModel = VizController.getInstance().getVizModel();
vizModel.setEdgeBothSelectionColor(edgeBothSelectionColorChooser.getColor().getComponents(null));
}
});
edgeOutSelectionColorChooser.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent ae) {
VizModel vizModel = VizController.getInstance().getVizModel();
vizModel.setEdgeOutSelectionColor(edgeOutSelectionColorChooser.getColor().getComponents(null));
}
});
scaleSlider.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
VizModel vizModel = VizController.getInstance().getVizModel();
if (vizModel.getEdgeScale() != (scaleSlider.getValue() / 10f + 0.1f)) {
vizModel.setEdgeScale(scaleSlider.getValue() / 10f + 0.1f);
}
}
});
}
Aggregations