use of org.talend.designer.runtime.visualization.views.RuntimeGraphcsComposite in project tdi-studio-se by Talend.
the class MemoryRuntimeComposite method initRuntimeGraphs.
private void initRuntimeGraphs(final Composite parent) {
ISelection processContextSelection = viewPart.getSite().getSelectionProvider() == null ? null : viewPart.getSelection();
setExpandHorizontal(true);
setExpandVertical(true);
FormData layouData = new FormData();
layouData.left = new FormAttachment(0, 0);
layouData.right = new FormAttachment(100, 0);
layouData.top = new FormAttachment(0, 0);
layouData.bottom = new FormAttachment(100, 0);
this.setBackground(parent.getBackground());
this.setLayout(new FormLayout());
setLayoutData(layouData);
monitorComposite = new Composite(this, SWT.NULL);
FormData baseData = new FormData();
baseData.left = new FormAttachment(0, 0);
baseData.right = new FormAttachment(100, 0);
baseData.top = new FormAttachment(0, 0);
baseData.bottom = new FormAttachment(100, 0);
monitorComposite.setLayout(new FormLayout());
monitorComposite.setLayoutData(layouData);
setContent(monitorComposite);
Group topGroup = createTopGroup(monitorComposite);
runtimeButton = new Button(topGroup, SWT.PUSH);
if (processContext != null) {
setRuntimeButtonByStatus(!processContext.isMonitoring());
} else {
setRuntimeButtonByStatus(true);
}
runtimeButton.setEnabled(true);
GridData runButtonData = new GridData();
Point execSize = null;
execSize = computeSize(runtimeButton.getText());
runButtonData.widthHint = execSize.x + 70;
runtimeButton.setLayoutData(runButtonData);
gcCheckButton = new Button(topGroup, SWT.CHECK);
GridData gcCheckButtonData = new GridData();
gcCheckButtonData.grabExcessHorizontalSpace = false;
gcCheckButton.setLayoutData(gcCheckButtonData);
gcCheckButton.setEnabled(true);
gcCheckButton.setSelection(isGCSelected);
Label periodLabel = new Label(topGroup, SWT.NULL);
//$NON-NLS-1$
periodLabel.setText(Messages.getString("ProcessView.moniorPeriod"));
periodLabel.setBackground(getBackground());
GridData periodLabelData = new GridData();
execSize = computeSize(periodLabel.getText());
periodLabelData.widthHint = execSize.x;
periodLabelData.grabExcessHorizontalSpace = false;
periodLabelData.horizontalAlignment = GridData.BEGINNING;
periodLabel.setLayoutData(periodLabelData);
periodCombo = new Combo(topGroup, SWT.READ_ONLY);
GridData periodData = new GridData();
execSize = computeSize("Select");
periodData.widthHint = execSize.x;
periodData.grabExcessHorizontalSpace = false;
periodData.horizontalAlignment = GridData.BEGINNING;
periodData.minimumWidth = execSize.x;
periodCombo.setLayoutData(periodData);
periodCombo.setItems(new String[] { "Select", "30 sec", "60 sec", //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
"120 sec" });
periodCombo.setEnabled(isGCSelected);
if (isGCSelected) {
periodCombo.select(periodComboSelectionIndex);
} else {
periodCombo.select(0);
periodComboSelectionIndex = 0;
}
contextCombo = new ComboViewer(topGroup, SWT.BORDER | SWT.READ_ONLY);
contextCombo.getCombo().setLayout(new FormLayout());
GridData contextComboData = new GridData();
contextComboData.grabExcessHorizontalSpace = true;
contextComboData.horizontalAlignment = GridData.END;
//$NON-NLS-N$
execSize = computeSize("Default");
contextComboData.minimumWidth = execSize.x;
contextCombo.getCombo().setLayoutData(contextComboData);
contextCombo.setContentProvider(ArrayContentProvider.getInstance());
contextCombo.setLabelProvider(new ContextNameLabelProvider());
initContextInput();
chartComposite = new RuntimeGraphcsComposite(monitorComposite, processContextSelection, SWT.NULL);
FormLayout rgcLayout = new FormLayout();
FormData charLayData = new FormData();
charLayData.left = new FormAttachment(0, 10);
charLayData.right = new FormAttachment(100, 0);
charLayData.top = new FormAttachment(topGroup, 60, SWT.BOTTOM);
charLayData.bottom = new FormAttachment(100, 0);
chartComposite.setLayout(rgcLayout);
chartComposite.setLayoutData(charLayData);
}
Aggregations