use of net.sf.mzmine.framework.fontspecs.JFontSpecs in project mzmine2 by mzmine.
the class GraphicsExportDialog method updateComponentsFromParameters.
@SuppressWarnings({ "unchecked", "rawtypes" })
protected void updateComponentsFromParameters() {
for (Parameter<?> p : parameters.getParameters()) {
if (!(p instanceof UserParameter))
continue;
UserParameter up = (UserParameter) p;
JComponent component = parametersAndComponents.get(p.getName());
up.setValueToComponent(component, up.getValue());
}
for (Parameter<?> p : chartParam.getParameters()) {
if (!(p instanceof UserParameter))
continue;
UserParameter up = (UserParameter) p;
JComponent component = parametersAndComponents.get(p.getName());
if (component instanceof JFontSpecs) {
// stop listeners from changing all fonts to master
JFontSpecs f = (JFontSpecs) component;
setListenersEnabled(false);
up.setValueToComponent(f, up.getValue());
f.stopListener();
setListenersEnabled(true);
} else
up.setValueToComponent(component, up.getValue());
}
}
use of net.sf.mzmine.framework.fontspecs.JFontSpecs in project mzmine2 by mzmine.
the class GraphicsExportDialog method handleMasterFontChanged.
/**
* changes the components of all fonts to the master font
*
* @param font
*/
private void handleMasterFontChanged(FontSpecs font) {
String master = ChartThemeParameters.masterFont.getName();
for (Parameter<?> p : chartParam.getParameters()) {
if (!(p instanceof FontParameter) || master.equals(p.getName()))
continue;
FontParameter up = (FontParameter) p;
JFontSpecs component = (JFontSpecs) parametersAndComponents.get(p.getName());
up.setValueToComponent(component, font);
}
}
use of net.sf.mzmine.framework.fontspecs.JFontSpecs in project mzmine2 by mzmine.
the class FontParameter method createEditingComponent.
@Override
public JFontSpecs createEditingComponent() {
JFontSpecs f = new JFontSpecs();
f.setBorder(BorderFactory.createCompoundBorder(f.getBorder(), BorderFactory.createEmptyBorder(0, 4, 0, 0)));
return f;
}
Aggregations