Search in sources :

Example 1 with JFontSpecs

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());
    }
}
Also used : UserParameter(net.sf.mzmine.parameters.UserParameter) JFontSpecs(net.sf.mzmine.framework.fontspecs.JFontSpecs) JComponent(javax.swing.JComponent)

Example 2 with JFontSpecs

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);
    }
}
Also used : JFontSpecs(net.sf.mzmine.framework.fontspecs.JFontSpecs) FontParameter(net.sf.mzmine.parameters.parametertypes.FontParameter)

Example 3 with JFontSpecs

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;
}
Also used : JFontSpecs(net.sf.mzmine.framework.fontspecs.JFontSpecs)

Aggregations

JFontSpecs (net.sf.mzmine.framework.fontspecs.JFontSpecs)3 JComponent (javax.swing.JComponent)1 UserParameter (net.sf.mzmine.parameters.UserParameter)1 FontParameter (net.sf.mzmine.parameters.parametertypes.FontParameter)1