Search in sources :

Example 1 with TimelineChart

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();
        }
    }
}
Also used : IActiveJvm(org.talend.designer.runtime.visualization.IActiveJvm) TimelineChart(org.talend.designer.runtime.visualization.internal.ui.properties.timeline.TimelineChart)

Example 2 with TimelineChart

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();
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) IMonitoredMXBeanGroup(org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) TimelineChart(org.talend.designer.runtime.visualization.internal.ui.properties.timeline.TimelineChart) FormAttachment(org.eclipse.swt.layout.FormAttachment) JvmCoreException(org.talend.designer.runtime.visualization.JvmCoreException)

Example 3 with TimelineChart

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);
    }
}
Also used : IActiveJvm(org.talend.designer.runtime.visualization.IActiveJvm) TimelineChart(org.talend.designer.runtime.visualization.internal.ui.properties.timeline.TimelineChart)

Example 4 with TimelineChart

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);
    }
}
Also used : FormLayout(org.eclipse.swt.layout.FormLayout) FormData(org.eclipse.swt.layout.FormData) LoadChartAction(org.talend.designer.runtime.visualization.internal.ui.properties.timeline.LoadChartAction) GarbageAction(org.talend.designer.runtime.visualization.internal.ui.properties.memory.GarbageAction) Action(org.eclipse.jface.action.Action) FormToolkit(org.eclipse.ui.forms.widgets.FormToolkit) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) ArrayList(java.util.ArrayList) TimelineChart(org.talend.designer.runtime.visualization.internal.ui.properties.timeline.TimelineChart) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) FormAttachment(org.eclipse.swt.layout.FormAttachment)

Aggregations

TimelineChart (org.talend.designer.runtime.visualization.internal.ui.properties.timeline.TimelineChart)4 ScrolledComposite (org.eclipse.swt.custom.ScrolledComposite)2 FormAttachment (org.eclipse.swt.layout.FormAttachment)2 FormData (org.eclipse.swt.layout.FormData)2 FormLayout (org.eclipse.swt.layout.FormLayout)2 Composite (org.eclipse.swt.widgets.Composite)2 ExpandableComposite (org.eclipse.ui.forms.widgets.ExpandableComposite)2 IActiveJvm (org.talend.designer.runtime.visualization.IActiveJvm)2 ArrayList (java.util.ArrayList)1 Action (org.eclipse.jface.action.Action)1 FormToolkit (org.eclipse.ui.forms.widgets.FormToolkit)1 JvmCoreException (org.talend.designer.runtime.visualization.JvmCoreException)1 IMonitoredMXBeanGroup (org.talend.designer.runtime.visualization.MBean.IMonitoredMXBeanGroup)1 GarbageAction (org.talend.designer.runtime.visualization.internal.ui.properties.memory.GarbageAction)1 LoadChartAction (org.talend.designer.runtime.visualization.internal.ui.properties.timeline.LoadChartAction)1