use of org.talend.designer.runtime.visualization.internal.ui.properties.timeline.TimelineChart in project tdi-studio-se by Talend.
the class RuntimeGraphcsComposite method refresh.
@Override
protected void refresh() {
refreshConnectionIndicator();
refreshReportField();
IActiveJvm jvm = getJvm();
if (jvm == null || !jvm.isConnected() || isRefreshSuspended() || chartsPage.isDisposed()) {
return;
}
for (TimelineChart chart : charts) {
if (!chart.isDisposed() && chart.isVisible()) {
chart.refresh();
}
}
}
use of org.talend.designer.runtime.visualization.internal.ui.properties.timeline.TimelineChart in project tdi-studio-se by Talend.
the class RuntimeGraphcsComposite method reconstructCharts.
void reconstructCharts(IActiveJvm activeJvm, boolean connected) {
if (chartsPage.isDisposed()) {
return;
}
if (connected) {
try {
loadOverviewChartSet(activeJvm);
} catch (JvmCoreException e) {
Activator.log(Messages.configureMonitoredAttributesFailedMsg, e);
}
}
List<IMonitoredMXBeanGroup> groups = activeJvm.getMBeanServer().getMonitoredAttributeGroups();
if (groups.size() == 0) {
return;
}
for (TimelineChart chart : charts) {
chart.dispose();
}
charts.clear();
if (chartComposite != null && !chartComposite.isDisposed()) {
chartComposite.dispose();
}
chartComposite = new Composite(chartsPage, SWT.NONE);
FormLayout chartLayout = new FormLayout();
chartLayout.marginHeight = 0;
chartLayout.marginWidth = 0;
chartComposite.setLayout(chartLayout);
FormData chartComData = new FormData();
chartComData.top = new FormAttachment(0, 0);
chartComData.bottom = new FormAttachment(100, 0);
chartComData.left = new FormAttachment(0, 0);
chartComData.right = new FormAttachment(100, 0);
chartComposite.setLayoutData(chartComData);
for (IMonitoredMXBeanGroup group : groups) {
createSection(chartComposite, group);
}
createReportField(chartComposite);
// createInfoField(chartComposite);
chartsPage.layout();
chartsPage.setVisible(true);
refresh();
}
use of org.talend.designer.runtime.visualization.internal.ui.properties.timeline.TimelineChart in project tdi-studio-se by Talend.
the class RuntimeGraphcsComposite method refreshConnectionIndicator.
private void refreshConnectionIndicator() {
IActiveJvm jvm = getJvm();
boolean isConnected = jvm != null && jvm.isConnected();
refreshBackground(chartsPage, isConnected);
for (TimelineChart chart : charts) {
refreshBackground(chart, isConnected);
refreshBackground(chart.getPlotArea(), isConnected);
refreshBackground(chart.getSection(), isConnected);
}
}
use of org.talend.designer.runtime.visualization.internal.ui.properties.timeline.TimelineChart in project tdi-studio-se by Talend.
the class RuntimeGraphcsComposite method createSection.
private void createSection(Composite parent, IMonitoredMXBeanGroup group) {
if (parent.isDisposed()) {
return;
}
FormToolkit tookit = new FormToolkit(Display.getDefault());
ExpandableComposite section = tookit.createSection(parent, ExpandableComposite.NO_TITLE);
section.setText(group.getName());
FormLayout sectionLayout = new FormLayout();
sectionLayout.marginWidth = 0;
sectionLayout.marginHeight = 0;
section.setLayout(sectionLayout);
FormData sectionData = new FormData();
if (group.getName().equals(MonitorAttributeName.HEAP_MEMORY)) {
sectionData.left = new FormAttachment(0, 0);
sectionData.right = new FormAttachment(65, 0);
sectionData.top = new FormAttachment(0, 6);
sectionData.bottom = new FormAttachment(53, -5);
} else if (group.getName().equals(MonitorAttributeName.THREAD_COUNT)) {
sectionData.left = new FormAttachment(50, 5);
sectionData.right = new FormAttachment(100, -5);
sectionData.top = new FormAttachment(50, 2);
sectionData.bottom = new FormAttachment(100, 0);
} else if (group.getName().equals(MonitorAttributeName.CPU_USE)) {
sectionData.left = new FormAttachment(0, 0);
sectionData.right = new FormAttachment(65, 0);
sectionData.top = new FormAttachment(53, 0);
sectionData.bottom = new FormAttachment(100, -6);
}
section.setLayoutData(sectionData);
Composite flatFormComposite = createFlatFormComposite(section, tookit);
FormLayout formLayout = new FormLayout();
formLayout.marginHeight = 0;
formLayout.marginWidth = 0;
flatFormComposite.setLayout(formLayout);
TimelineChart chart = new TimelineChart(flatFormComposite, section, group, SWT.NONE, toString() + getJvm().getPid());
charts.add(chart);
FormData data;
data = new FormData();
data.left = new FormAttachment(0, 0);
data.right = new FormAttachment(100, 0);
data.top = new FormAttachment(0, 0);
data.bottom = new FormAttachment(100, 0);
chart.setLayoutData(data);
section.setClient(flatFormComposite);
ArrayList<Action> list = new ArrayList<Action>();
list.add(garbageCollectorAction);
if (group.getName().equals(MonitorAttributeName.HEAP_MEMORY)) {
addSectionActions(section, list);
}
}
Aggregations