Example usage for org.eclipse.jface.resource JFaceResources DEFAULT_FONT

List of usage examples for org.eclipse.jface.resource JFaceResources DEFAULT_FONT

Introduction

In this page you can find the example usage for org.eclipse.jface.resource JFaceResources DEFAULT_FONT.

Prototype

String DEFAULT_FONT

To view the source code for org.eclipse.jface.resource JFaceResources DEFAULT_FONT.

Click Source Link

Document

The symbolic font name for the standard font (value "org.eclipse.jface.defaultfont").

Usage

From source file:ralfstx.mylyn.bugview.internal.BugView.java

License:Open Source License

private int calculateIdWidth() {
    int maxWidth = 0;
    Table table = viewer.getTable();//from   www . ja v a 2s. c  om
    Font boldFont = JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);
    GC gc = new GC(table);
    try {
        gc.setFont(boldFont);
        Collection<ITask> tasks = getTasks();
        for (ITask task : tasks) {
            String id = task.getTaskId();
            int width = gc.stringExtent(id).x;
            maxWidth = Math.max(maxWidth, width);
        }
    } finally {
        gc.dispose();
    }
    return maxWidth;
}

From source file:ralfstx.mylyn.bugview.internal.TaskLabelProvider.java

License:Open Source License

@Override
public Font getFont(Object element) {
    if (element instanceof ITask) {
        ITask task = (ITask) element;//  w  ww  . j a va 2 s . co  m
        if (incomingMatcher.matches(task)) {
            return JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT);
        }
        if (outgoingMatcher.matches(task)) {
            return JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT);
        }
    }
    return null;
}

From source file:uk.ac.stfc.isis.ibex.ui.dae.experimentsetup.DataAcquisitionPanel.java

License:Open Source License

/**
 * The default constructor for the panel.
 * // www.  ja  va 2s  .co m
 * @param parent
 *            The parent composite that this panel belongs to.
 * @param style
 *            The SWT flags giving the style of the panel.
 */
@SuppressWarnings({ "checkstyle:magicnumber", "checkstyle:localvariablename" })
public DataAcquisitionPanel(Composite parent, int style) {
    super(parent, style);
    setLayout(new GridLayout(1, false));

    GridData gdLabels = new GridData(SWT.LEFT, SWT.FILL, false, false, 1, 1);
    gdLabels.widthHint = 80;

    Group grpTables = new Group(this, SWT.NONE);
    grpTables.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    grpTables.setText("Tables");
    grpTables.setBounds(0, 0, 70, 82);
    GridLayout glGrpTables = new GridLayout(2, false);
    glGrpTables.verticalSpacing = 10;
    grpTables.setLayout(glGrpTables);

    // Wiring table selection
    Composite wiringTablePanel = new Composite(grpTables, SWT.NONE);
    wiringTablePanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
    wiringTablePanel.setLayout(new GridLayout(3, false));

    Label lblWiring = new Label(wiringTablePanel, SWT.NONE);
    lblWiring.setLayoutData(gdLabels);
    lblWiring.setText("Wiring Table:");

    Label lblWiringRB = new Label(wiringTablePanel, SWT.NONE);
    lblWiringRB.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblWiringRB.setText("Current:");

    wiringTableRB = new Label(wiringTablePanel, SWT.NONE);
    wiringTableRB.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    wiringTableRB.setFont(JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT));

    new Label(wiringTablePanel, SWT.NONE);

    Label lblWiringChange = new Label(wiringTablePanel, SWT.NONE);
    lblWiringChange.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblWiringChange.setText("Change:");

    wiringTableSelector = new Combo(wiringTablePanel, SWT.DROP_DOWN | SWT.READ_ONLY);
    wiringTableSelector.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));

    // Detector table selection
    Composite detectorTablePanel = new Composite(grpTables, SWT.NONE);
    detectorTablePanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
    detectorTablePanel.setLayout(new GridLayout(3, false));

    Label lblDetector = new Label(detectorTablePanel, SWT.NONE);
    lblDetector.setLayoutData(gdLabels);
    lblDetector.setText("Detector Table:");

    Label lblDetectorRB = new Label(detectorTablePanel, SWT.NONE);
    lblDetectorRB.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblDetectorRB.setText("Current:");

    detectorTableRB = new Label(detectorTablePanel, SWT.NONE);
    detectorTableRB.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    detectorTableRB.setFont(JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT));

    new Label(detectorTablePanel, SWT.NONE);

    Label lblDetectorChange = new Label(detectorTablePanel, SWT.NONE);
    lblDetectorChange.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblDetectorChange.setText("Change:");

    detectorTableSelector = new Combo(detectorTablePanel, SWT.DROP_DOWN | SWT.READ_ONLY);
    detectorTableSelector.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));

    // Spectra table selection
    Composite spectraTablePanel = new Composite(grpTables, SWT.NONE);
    spectraTablePanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
    spectraTablePanel.setLayout(new GridLayout(3, false));

    Label lblSpectra = new Label(spectraTablePanel, SWT.NONE);
    lblSpectra.setLayoutData(gdLabels);
    lblSpectra.setText("Spectra Table:");

    Label lblSpectraRB = new Label(spectraTablePanel, SWT.NONE);
    lblSpectraRB.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblSpectraRB.setText("Current:");

    spectraTableRB = new Label(spectraTablePanel, SWT.NONE);
    spectraTableRB.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    spectraTableRB.setFont(JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT));

    new Label(spectraTablePanel, SWT.NONE);

    Label lblSpectraChange = new Label(spectraTablePanel, SWT.NONE);
    lblSpectraChange.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblSpectraChange.setText("Change:");

    spectraTableSelector = new Combo(spectraTablePanel, SWT.DROP_DOWN | SWT.READ_ONLY);
    spectraTableSelector.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));

    Group grpMonitor = new Group(this, SWT.NONE);
    grpMonitor.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    grpMonitor.setText("Monitor");
    grpMonitor.setLayout(new GridLayout(8, false));

    Label lblSpectrum = new Label(grpMonitor, SWT.NONE);
    lblSpectrum.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblSpectrum.setText("Spectrum:");

    monitorSpectrum = new Spinner(grpMonitor, SWT.BORDER);
    monitorSpectrum.setMaximum(MAXIMUM_MONITOR_SPECTRUM);

    Label lblNewLabel_1 = new Label(grpMonitor, SWT.NONE);
    GridData gd_lblNewLabel_1 = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_lblNewLabel_1.widthHint = 20;
    lblNewLabel_1.setLayoutData(gd_lblNewLabel_1);

    Label lblFrom = new Label(grpMonitor, SWT.NONE);
    lblFrom.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblFrom.setText("From:");

    from = new Text(grpMonitor, SWT.BORDER);
    GridData gd_from = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1);
    gd_from.widthHint = 70;
    from.setLayoutData(gd_from);

    Label lblTo = new Label(grpMonitor, SWT.NONE);
    lblTo.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblTo.setText("To:");

    to = new Text(grpMonitor, SWT.BORDER);
    GridData gd_to = new GridData(SWT.LEFT, SWT.FILL, true, false, 1, 1);
    gd_to.widthHint = 70;
    to.setLayoutData(gd_to);
    new Label(grpMonitor, SWT.NONE);

    Group grpVetos = new Group(this, SWT.NONE);
    GridData gd_grpVetos = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_grpVetos.widthHint = 550;
    grpVetos.setLayoutData(gd_grpVetos);
    grpVetos.setText("Vetos");
    grpVetos.setLayout(new GridLayout(5, true));

    btnFermiChopper = new Button(grpVetos, SWT.CHECK);
    btnFermiChopper.setText("Fermi Chopper");

    Label lblFcDelay = new Label(grpVetos, SWT.NONE);
    lblFcDelay.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblFcDelay.setText("Delay (s):");

    fcDelay = new Label(grpVetos, SWT.NONE);
    fcDelay.setText("UNKNOWN");

    Label lblNewLabel_3 = new Label(grpVetos, SWT.NONE);
    lblNewLabel_3.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblNewLabel_3.setText("Width (s):");

    fcWidth = new Label(grpVetos, SWT.NONE);
    fcWidth.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false, 1, 1));
    fcWidth.setText("UNKNOWN");

    btnSMP = new Button(grpVetos, SWT.CHECK);
    btnSMP.setText("SMP (Chopper)");

    btnTs2Pulse = new Button(grpVetos, SWT.CHECK);
    btnTs2Pulse.setText("TS2 Pulse");

    btnIsisHz = new Button(grpVetos, SWT.CHECK);
    btnIsisHz.setText("ISIS 50 Hz");
    new Label(grpVetos, SWT.NONE);
    new Label(grpVetos, SWT.NONE);

    btnVeto0 = new Button(grpVetos, SWT.CHECK);
    btnVeto0.setText("Veto 0");

    btnVeto1 = new Button(grpVetos, SWT.CHECK);
    btnVeto1.setText("Veto 1");

    btnVeto2 = new Button(grpVetos, SWT.CHECK);
    btnVeto2.setText("Veto 2");

    btnVeto3 = new Button(grpVetos, SWT.CHECK);
    btnVeto3.setText("Veto 3");
    new Label(grpVetos, SWT.NONE);

    Group grpMuons = new Group(this, SWT.NONE);
    grpMuons.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
    grpMuons.setText("Muons");
    grpMuons.setLayout(new GridLayout(2, false));

    Label lblMuonMsMode = new Label(grpMuons, SWT.NONE);
    lblMuonMsMode.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblMuonMsMode.setSize(88, 15);
    lblMuonMsMode.setText("Muon ms mode:");

    btnMuonMsMode = new Button(grpMuons, SWT.CHECK);
    btnMuonMsMode.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false, 1, 1));
    btnMuonMsMode.setSize(63, 16);
    btnMuonMsMode.setText("Enabled");

    Label lblMuonCerenkovPulse = new Label(grpMuons, SWT.NONE);
    lblMuonCerenkovPulse.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblMuonCerenkovPulse.setSize(119, 15);
    lblMuonCerenkovPulse.setText("Muon Cerenkov pulse:");

    Composite muonPulseComposite = new Composite(grpMuons, SWT.BORDER);
    muonPulseComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
    muonPulseComposite.setSize(118, 26);
    muonPulseComposite.setLayout(new GridLayout(2, false));

    btnMuonPulseFirst = new Button(muonPulseComposite, SWT.FLAT | SWT.RADIO);
    btnMuonPulseFirst.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
    btnMuonPulseFirst.setText("First");

    Button btnMuonPulseSecond = new Button(muonPulseComposite, SWT.FLAT | SWT.RADIO);
    btnMuonPulseSecond.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
    btnMuonPulseSecond.setText("Second");

    Group grpTiming = new Group(this, SWT.NONE);
    grpTiming.setText("Timing");
    grpTiming.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    grpTiming.setLayout(new GridLayout(3, false));

    Label lblDaeTimeingSource = new Label(grpTiming, SWT.NONE);
    lblDaeTimeingSource.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblDaeTimeingSource.setText("DAE Timing Source:");

    daeTimingSource = new Combo(grpTiming, SWT.DROP_DOWN | SWT.READ_ONLY);
    daeTimingSource.setItems(DaeTimingSource.allToString().toArray(new String[0]));
    GridData gd_daeTimingSource = new GridData(SWT.LEFT, SWT.FILL, false, false, 1, 1);
    gd_daeTimingSource.widthHint = 100;
    daeTimingSource.setLayoutData(gd_daeTimingSource);
    new Label(grpTiming, SWT.NONE);

    Label lblAutosaveEvery = new Label(grpTiming, SWT.NONE);
    lblAutosaveEvery.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblAutosaveEvery.setText("Autosave every:");

    autosaveFrequency = new Text(grpTiming, SWT.BORDER);
    GridData gd_autosaveFrequency = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1);
    gd_autosaveFrequency.widthHint = 100;
    autosaveFrequency.setLayoutData(gd_autosaveFrequency);

    autosaveUnits = new Combo(grpTiming, SWT.DROP_DOWN | SWT.READ_ONLY);
    autosaveUnits.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, false, 1, 1));
    autosaveUnits.setItems(AutosaveUnit.allToString().toArray(new String[0]));

}

From source file:uk.ac.stfc.isis.ibex.ui.dae.experimentsetup.periods.PeriodsPanel.java

License:Open Source License

/**
 * Standard constructor./*from ww  w  . ja  v a 2 s .  c om*/
 * 
 * @param parent The parent composite.
 * @param style The SWT style.
 */
@SuppressWarnings({ "checkstyle:magicnumber", "checkstyle:localvariablename" })
public PeriodsPanel(Composite parent, int style) {
    super(parent, style);
    GridLayout gl_main = new GridLayout(1, false);
    gl_main.verticalSpacing = 15;
    setLayout(gl_main);

    GridLayout gl_noMargins = new GridLayout();
    gl_noMargins.marginWidth = 0;
    gl_noMargins.marginHeight = 0;

    // Overall Setup
    Composite cmpSetup = new Composite(this, SWT.NONE);
    cmpSetup.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    GridLayout gl_setupPanel = new GridLayout(1, false);
    gl_setupPanel.verticalSpacing = 10;
    cmpSetup.setLayout(gl_setupPanel);

    Composite cmpPeriodType = new Composite(cmpSetup, SWT.NONE);
    GridLayout gl_cmpPeriodType = new GridLayout(2, false);
    gl_cmpPeriodType.marginWidth = 0;
    cmpPeriodType.setLayout(gl_cmpPeriodType);

    Label lblPeriodType = new Label(cmpPeriodType, SWT.NONE);
    lblPeriodType.setText("Period Type:");

    cmbPeriodType = new Combo(cmpPeriodType, SWT.DROP_DOWN | SWT.READ_ONLY);
    cmbPeriodType.setItems(PeriodControlType.allToString().toArray(new String[0]));

    // Group dynamically displaying setup options
    grpSettings = new Group(this, SWT.NONE);
    grpSettings.setText("Period Settings");
    grpSettings.setLayout(stackType);
    grpSettings.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    // Panel to set software periods
    cmpSwitchTypeSoftware = new Composite(grpSettings, SWT.NONE);
    GridLayout gl_cmpSwitchTypeSoftware = new GridLayout(2, false);
    gl_cmpSwitchTypeSoftware.marginWidth = 10;
    gl_cmpSwitchTypeSoftware.marginHeight = 10;
    cmpSwitchTypeSoftware.setLayout(gl_cmpSwitchTypeSoftware);
    cmpSwitchTypeSoftware.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    Label lblNumberOfSoftware = new Label(cmpSwitchTypeSoftware, SWT.NONE);
    lblNumberOfSoftware.setText("Number of software periods:");

    txtSoftwarePeriods = new Text(cmpSwitchTypeSoftware, SWT.BORDER | SWT.RIGHT);
    GridData gd_txtSoftwarePeriods = new GridData(SWT.LEFT, SWT.CENTER, false, false, 1, 1);
    gd_txtSoftwarePeriods.widthHint = 60;
    txtSoftwarePeriods.setLayoutData(gd_txtSoftwarePeriods);

    // Panel to set hardware periods
    cmpSwitchTypeHardware = new Composite(grpSettings, SWT.NONE);
    GridLayout gl_cmpSwitchTypeHardware = new GridLayout(1, false);
    gl_cmpSwitchTypeHardware.marginWidth = 10;
    gl_cmpSwitchTypeHardware.marginHeight = 10;
    cmpSwitchTypeHardware.setLayout(gl_cmpSwitchTypeHardware);
    cmpSwitchTypeHardware.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    Composite cmpHardwareSettings = new Composite(cmpSwitchTypeHardware, SWT.NONE);
    GridLayout gl_cmpHardwareSettings = new GridLayout(4, false);
    gl_cmpHardwareSettings.verticalSpacing = 15;
    gl_cmpHardwareSettings.marginWidth = 0;
    gl_cmpHardwareSettings.marginHeight = 0;
    cmpHardwareSettings.setLayout(gl_cmpHardwareSettings);
    cmpHardwareSettings.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));

    Label lblHardwarePeriodSequences = new Label(cmpHardwareSettings, SWT.NONE);
    lblHardwarePeriodSequences.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblHardwarePeriodSequences.setText("Hardware period sequences:");

    txtHardwarePeriods = new Text(cmpHardwareSettings, SWT.BORDER | SWT.RIGHT);
    GridData gd_txtHardwarePeriods = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1);
    gd_txtHardwarePeriods.widthHint = 80;
    txtHardwarePeriods.setLayoutData(gd_txtHardwarePeriods);

    Label lblOutputDelayus = new Label(cmpHardwareSettings, SWT.NONE);
    lblOutputDelayus.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblOutputDelayus.setText("Output delay (s):");

    txtOutputDelay = new Text(cmpHardwareSettings, SWT.BORDER | SWT.RIGHT);
    GridData gd_txtOutputDelay = new GridData(SWT.LEFT, SWT.FILL, true, false, 1, 1);
    gd_txtOutputDelay.widthHint = 80;
    txtOutputDelay.setLayoutData(gd_txtOutputDelay);

    Composite cmpSourceSelector = new Composite(cmpHardwareSettings, SWT.NONE);
    cmpSourceSelector.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 4, 1));
    GridLayout gl_composite = new GridLayout(5, false);
    gl_composite.verticalSpacing = 10;
    cmpSourceSelector.setLayout(gl_composite);

    Label lblSelectionMethod = new Label(cmpSourceSelector, SWT.NONE);
    lblSelectionMethod.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 5, 1));
    lblSelectionMethod.setText("Select Period Source: ");

    SelectionListener sourceSelectionListener = new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            if (radioUsePeriodFile.getSelection()) {
                model.setSetupSource(PeriodSetupSource.FILE);
            } else {
                model.setSetupSource(PeriodSetupSource.PARAMETERS);
            }
        }
    };

    radioSpecifyParameters = new Button(cmpSourceSelector, SWT.RADIO);
    radioSpecifyParameters.setText(PeriodSetupSource.PARAMETERS.toString());
    radioSpecifyParameters.addSelectionListener(sourceSelectionListener);

    radioUsePeriodFile = new Button(cmpSourceSelector, SWT.RADIO);
    radioUsePeriodFile.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
    radioUsePeriodFile.setText(PeriodSetupSource.FILE.toString());
    radioUsePeriodFile.addSelectionListener(sourceSelectionListener);

    cmpSource = new Composite(cmpSwitchTypeHardware, SWT.NONE);
    cmpSource.setLayout(stackSource);
    cmpSource.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    // Panel with table for manually setting periods
    cmpSwitchSourceParam = new Composite(cmpSource, SWT.NONE);
    cmpSwitchSourceParam.setLayout(gl_noMargins);

    lblNote = new Label(cmpSwitchSourceParam, SWT.NONE);
    lblNote.setText("Frames are not used in external signal control mode");
    lblNote.setFont(JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT));

    tblPeriods = new PeriodsTableView(cmpSwitchSourceParam, SWT.NONE);
    tblPeriods.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    // Panel to load file with period settings
    cmpSwitchSourceFile = new Composite(cmpSource, SWT.NONE);
    GridLayout gl_cmpSwitchSourceFile = new GridLayout(3, false);
    gl_cmpSwitchSourceFile.marginWidth = 0;
    gl_cmpSwitchSourceFile.horizontalSpacing = 20;
    cmpSwitchSourceFile.setLayout(gl_cmpSwitchSourceFile);

    Label lblPeriod = new Label(cmpSwitchSourceFile, SWT.NONE);
    lblPeriod.setText("Period File:");

    Label lblPeriodRB = new Label(cmpSwitchSourceFile, SWT.NONE);
    lblPeriodRB.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblPeriodRB.setText("Current:");

    lblPeriodFileRB = new Label(cmpSwitchSourceFile, SWT.NONE);
    lblPeriodFileRB.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    lblPeriodFileRB.setFont(JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT));

    new Label(cmpSwitchSourceFile, SWT.NONE);

    Label lblPeriodChange = new Label(cmpSwitchSourceFile, SWT.NONE);
    lblPeriodChange.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblPeriodChange.setText("Change:");

    cmbPeriodFile = new Combo(cmpSwitchSourceFile, SWT.DROP_DOWN | SWT.READ_ONLY);
    cmbPeriodFile.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));

    cmbPeriodFile.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            model.setNewPeriodFile(cmbPeriodFile.getText());
        }
    });

    cmbPeriodType.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(SelectionEvent e) {
            model.setPeriodType(cmbPeriodType.getSelectionIndex());
        }
    });
}

From source file:uk.ac.stfc.isis.ibex.ui.dae.experimentsetup.timechannels.TimeChannelsPanel.java

License:Open Source License

@SuppressWarnings({ "checkstyle:magicnumber", })
private void addTimeChannelFilePanel(Composite parent) {

    Composite timeChannelFilePanel = new Composite(parent, SWT.NONE);
    timeChannelFilePanel.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 5, 1));
    GridLayout glTcbFilePanel = new GridLayout(3, false);
    glTcbFilePanel.horizontalSpacing = 20;
    timeChannelFilePanel.setLayout(glTcbFilePanel);

    Label lblTimeChannel = new Label(timeChannelFilePanel, SWT.NONE);
    lblTimeChannel.setText("Time Channel File:");

    Label lblTimeChannelRB = new Label(timeChannelFilePanel, SWT.NONE);
    lblTimeChannelRB.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblTimeChannelRB.setText("Current:");

    timeChannelFileRB = new Label(timeChannelFilePanel, SWT.NONE);
    timeChannelFileRB.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    timeChannelFileRB.setFont(JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT));

    new Label(timeChannelFilePanel, SWT.NONE);

    Label lblTimeChannelChange = new Label(timeChannelFilePanel, SWT.NONE);
    lblTimeChannelChange.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblTimeChannelChange.setText("Change:");

    timeChannelFileSelector = new Combo(timeChannelFilePanel, SWT.DROP_DOWN | SWT.READ_ONLY);
    timeChannelFileSelector.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));

    timeChannelFileSelector.addSelectionListener(new SelectionAdapter() {
        @Override//ww w .j  a  v a 2s .  c  om
        public void widgetSelected(SelectionEvent e) {
            viewModel.setNewTimeChannelFile(timeChannelFileSelector.getText());
        }
    });
}

From source file:uk.ac.stfc.isis.ibex.ui.dae.widgets.LogMessageBox.java

License:Open Source License

/**
 * The constructor for the composite.//  w  w  w  .  j  a v a 2  s .  co  m
 * 
 * @param parent
 *            The parent composite that the panel belongs to.
 * @param style
 *            The SWT style flags for the panel.
 */
public LogMessageBox(Composite parent, int style) {
    super(parent, style);
    setLayout(new GridLayout(1, false));

    title = new Label(this, SWT.NONE);
    title.setText("Log Messages:");
    title.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DEFAULT_FONT));

    logDisplay = new LogDisplay(this, null);
    logDisplay.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    String daeName = "ISISDAE_01";

    LogMessageFilter filter = new LogMessageFilter(LogMessageFields.CLIENT_NAME, daeName, false);

    logDisplay.addMessageFilter(filter);
}

From source file:uk.org.taverna.t3.workbench.ui.presentations.shelf.TavernaRedmondShelfRenderer.java

License:Open Source License

public void initialize(Control control) {
    this.parent = (PShelf) control;

    FontData fd = JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT).getFontData()[0];
    initialFont = new Font(parent.getDisplay(), fd.getName(), fd.getHeight(), SWT.BOLD);

    Color baseColor = parent.getDisplay().getSystemColor(SWT.COLOR_TITLE_BACKGROUND_GRADIENT);
    // Color color1 = createNewBlendedColor(baseColor, parent.getDisplay().getSystemColor(SWT.COLOR_WHITE), 30);
    Color color1 = new Color(parent.getDisplay(), 228, 239, 255);

    baseColor = createNewBlendedColor(parent.getDisplay().getSystemColor(SWT.COLOR_TITLE_BACKGROUND_GRADIENT),
            parent.getDisplay().getSystemColor(SWT.COLOR_WHITE), 80);

    // Color color2 = createNewSaturatedColor(baseColor, .01f);
    Color color2 = new Color(parent.getDisplay(), 194, 218, 254);

    gradient1 = color1;//ww w . j  av a  2s.  co  m
    gradient2 = color2;

    baseColor.dispose();

    baseColor = parent.getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION);

    // lineColor = createNewSaturatedColor(parent.getDisplay().getSystemColor(SWT.COLOR_TITLE_INACTIVE_BACKGROUND), .02f);
    lineColor = new Color(parent.getDisplay(), 154, 185, 254);

    // color1 = createNewBlendedColor(baseColor, parent.getDisplay().getSystemColor(SWT.COLOR_WHITE), 70);
    color1 = new Color(parent.getDisplay(), 199, 222, 252);

    baseColor = createNewBlendedColor(parent.getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION),
            parent.getDisplay().getSystemColor(SWT.COLOR_BLACK), 80);

    // color2 = createNewSaturatedColor(baseColor, .02f);
    color2 = new Color(parent.getDisplay(), 143, 163, 206);

    selectedGradient1 = color1;
    selectedGradient2 = color2;

    baseColor.dispose();

    initialOpenFont = new Font(parent.getDisplay(), initialFont.getFontData());

    font = initialFont;
    selectedFont = initialOpenFont;

    selectedForeground = parent.getDisplay().getSystemColor(SWT.COLOR_LIST_SELECTION_TEXT);

    baseColor = createNewReverseColor(parent.getDisplay().getSystemColor(SWT.COLOR_DARK_BLUE));
    hoverGradient1 = createNewBlendedColor(baseColor, parent.getDisplay().getSystemColor(SWT.COLOR_WHITE), 20);
    Color baseColor2 = createNewBlendedColor(baseColor, parent.getDisplay().getSystemColor(SWT.COLOR_WHITE),
            70);
    hoverGradient2 = createNewSaturatedColor(baseColor2, .00f);

    baseColor2.dispose();
    baseColor.dispose();

    initialColors = new Color[] { gradient1, gradient2, selectedGradient1, selectedGradient2, hoverGradient1,
            hoverGradient2, lineColor };

    // Change the border around the whole container of the shelf

    //      parent.getParent().addPaintListener(new PaintListener() {
    //         
    //         @Override
    //         public void paintControl(PaintEvent e) {
    //            
    //            e.gc.setForeground(lineColor);
    //            e.gc.setLineWidth(4);
    //            
    //            GraphicUtils.drawRoundRectangle(e.gc, e.x, e.y, e.width, e.height,
    //                  e.display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND), lineColor, true, true);
    //            
    ////            e.gc.drawRectangle(e.x, e.y, e.width, e.height);
    //            
    //         }
    //      });
    //      
    //      parent.addPaintListener(new PaintListener() {
    //
    //         @Override
    //         public void paintControl(PaintEvent e) {
    //            
    //            if (e.widget instanceof PShelf) {
    //               e.gc.setForeground(lineColor);
    //               e.gc.setLineWidth(0);
    //               
    //               boolean showBottomCurves = true;
    //               
    //               if (parent.getSelection() == parent.getItems()[parent.getItems().length-1]) {
    //                  showBottomCurves = false;
    //               }
    //               
    //               GraphicUtils.drawRoundRectangle(e.gc, e.x, e.y, e.width, e.height,
    //                     lineColor, lineColor, true, showBottomCurves);
    //            }
    //            
    //         }
    //      });
}

From source file:ummisco.gama.ui.viewers.gis.geotools.styling.simple.StolenColorEditor.java

protected Point computeImageSize(final Control window) {
    final GC gc = new GC(window);
    final Font f = JFaceResources.getFontRegistry().get(JFaceResources.DEFAULT_FONT);
    gc.setFont(f);/*from  w  ww. j ava 2 s. co m*/
    final int height = gc.getFontMetrics().getHeight();
    gc.dispose();
    final Point p = new Point(height * 3 - 6, height);
    return p;
}

From source file:v9t9.gui.client.swt.shells.modules.ModuleDetailsTreeLabelProvider.java

License:Open Source License

@Override
public Font getFont(Object element, int columnIndex) {
    if (columnIndex == 0 && element instanceof InfoTreeNode)
        return JFaceResources.getFontRegistry().getItalic(JFaceResources.DEFAULT_FONT);

    if (columnIndex == 1 && ((TreeNode) element).getValue() instanceof IProperty)
        return JFaceResources.getTextFont();

    return null;//from w w w .ja  v a  2  s.c om
}