}
});
components[3] = fontSizeSlider;
//Color
final ColorChooser colorChooser = new ColorChooser(model.getNodeColor());
colorChooser.setToolTipText(NbBundle.getMessage(VizBarController.class, "VizToolbar.Labels.defaultColor"));
colorChooser.setPreferredSize(new Dimension(16, 16));
colorChooser.setMaximumSize(new Dimension(16, 16));
colorChooser.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals(ColorChooser.PROP_COLOR)) {
TextModelImpl model = VizController.getInstance().getVizModel().getTextModel();
model.setNodeColor(colorChooser.getColor());
}
}
});
model.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
TextModelImpl model = VizController.getInstance().getVizModel().getTextModel();
if (!model.getNodeColor().equals(colorChooser.getColor())) {
colorChooser.setColor(model.getNodeColor());
}
}
});
components[4] = colorChooser;