📄 statisticstab.java
字号:
label = new Label(sesvers_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.general.label.server_dead_count") + " : "); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); Label server_dead_count = new Label(sesvers_stats,SWT.NONE); server_dead_count.setFont(skin.getLabelFont()); server_dead_count.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); stats_fields.put(JMuleCoreStats.ST_NET_SERVERS_DEAD_COUNT, server_dead_count); label = new Label(sesvers_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.general.label.search_query_count") + " : "); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); Label search_query_count = new Label(sesvers_stats,SWT.NONE); search_query_count.setFont(skin.getLabelFont()); search_query_count.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); stats_fields.put(JMuleCoreStats.SEARCHES_COUNT, search_query_count); layout_data = new GridData(); layout_data.horizontalSpan = 2; new Label(sesvers_stats,SWT.NONE).setLayoutData(layout_data); layout_data = new GridData(); layout_data.horizontalSpan = 2; new Label(sesvers_stats,SWT.NONE).setLayoutData(layout_data); Group sharing_stats = new Group(content,SWT.NONE); sharing_stats.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); sharing_stats.setLayout(new GridLayout(2,false)); sharing_stats.setText(_._("mainwindow.statisticstab.tab.general.group.shared")); label = new Label(sharing_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.general.label.shared_files_count") + " : "); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); Label shared_files_count = new Label(sharing_stats,SWT.NONE); shared_files_count.setFont(skin.getLabelFont()); shared_files_count.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); stats_fields.put(JMuleCoreStats.ST_DISK_SHARED_FILES_COUNT, shared_files_count); label = new Label(sharing_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.general.label.shared_partial_files") + " : "); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); Label shared_partial_files = new Label(sharing_stats,SWT.NONE); shared_partial_files.setFont(skin.getLabelFont()); shared_partial_files.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); stats_fields.put(JMuleCoreStats.ST_DISK_SHARED_FILES_PARTIAL_COUNT, shared_partial_files); label = new Label(sharing_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.general.label.shared_completed_files") + " : "); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); Label shared_completed_files = new Label(sharing_stats,SWT.NONE); shared_completed_files.setFont(skin.getLabelFont()); shared_completed_files.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); stats_fields.put(JMuleCoreStats.ST_DISK_SHARED_FILES_COMPLETE_COUNT, shared_completed_files); label = new Label(sharing_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.general.label.shared_files_bytes") + " : "); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); Label shared_files_bytes = new Label(sharing_stats,SWT.NONE); shared_files_bytes.setFont(skin.getLabelFont()); shared_files_bytes.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); stats_fields.put(JMuleCoreStats.ST_DISK_SHARED_FILES_BYTES, shared_files_bytes); label = new Label(sharing_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.general.label.completed_files_bytes") + " : "); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); Label completed_files_bytes = new Label(sharing_stats,SWT.NONE); completed_files_bytes.setFont(skin.getLabelFont()); completed_files_bytes.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); stats_fields.put(JMuleCoreStats.ST_DISK_SHARED_FILES_COMPLETE_BYTES, completed_files_bytes); label = new Label(sharing_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.general.label.partial_files_bytes") + " : "); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); Label partial_files_bytes = new Label(sharing_stats,SWT.NONE); partial_files_bytes.setFont(skin.getLabelFont()); partial_files_bytes.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); stats_fields.put(JMuleCoreStats.ST_DISK_SHARED_FILES_PARTIAL_BYTES, partial_files_bytes); CTabItem jvm_stats = new CTabItem(stats_tabs,SWT.NONE); jvm_stats.setText(_._("mainwindow.statisticstab.tab.jvm")); content = new Composite(stats_tabs,SWT.NONE); jvm_stats.setControl(content); content.setLayout(new GridLayout(2,true)); Group jvm_general_stats = new Group(content,SWT.NONE); jvm_general_stats.setText(_._("mainwindow.statisticstab.tab.jvm.group.general")); layout_data = new GridData(GridData.FILL_HORIZONTAL); jvm_general_stats.setLayoutData(layout_data); layout = new GridLayout(2,false); jvm_general_stats.setLayout(layout); label = new Label(jvm_general_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.jvm.label.jvm_name") + " : "); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); label = new Label(jvm_general_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(runtime_bean.getVmName()); label = new Label(jvm_general_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.jvm.label.jvm_vendor") + " : "); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); label = new Label(jvm_general_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(runtime_bean.getVmVendor()); label = new Label(jvm_general_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.jvm.label.jvm_version") + " : "); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); label = new Label(jvm_general_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(runtime_bean.getVmVersion()); label = new Label(jvm_general_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.jvm.label.jvm_uptime") + " : "); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); jvm_uptime = new Label(jvm_general_stats,SWT.NONE); jvm_uptime.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); jvm_uptime.setText(TimeFormatter.formatColon(runtime_bean.getUptime()/1000)+""); Group heapmemory_stats = new Group(content,SWT.NONE); heapmemory_stats.setText(_._("mainwindow.statisticstab.tab.jvm.group.heap_memory")); layout_data = new GridData(GridData.FILL_HORIZONTAL); heapmemory_stats.setLayoutData(layout_data); layout = new GridLayout(2,false); heapmemory_stats.setLayout(layout); label = new Label(heapmemory_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.jvm.label.heapmemory_init") + " : "); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); heapmemory_init = new Label(heapmemory_stats,SWT.NONE); heapmemory_init.setFont(skin.getLabelFont()); heapmemory_init.setText(FileFormatter.formatFileSize(heap_memory.getInit())); label = new Label(heapmemory_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.jvm.label.heapmemory_used") + " : "); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); heapmemory_used = new Label(heapmemory_stats,SWT.NONE); heapmemory_used.setFont(skin.getLabelFont()); heapmemory_used.setText(FileFormatter.formatFileSize(heap_memory.getUsed())); label = new Label(heapmemory_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.jvm.label.heapmemory_max") + " : "); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); heapmemory_max = new Label(heapmemory_stats,SWT.NONE); heapmemory_max.setFont(skin.getLabelFont()); heapmemory_max.setText(FileFormatter.formatFileSize(heap_memory.getMax())); new Label(heapmemory_stats,SWT.NONE); Group nonheapmemory_stats = new Group(content,SWT.NONE); nonheapmemory_stats.setText(_._("mainwindow.statisticstab.tab.jvm.group.nonheap_memory")); layout_data = new GridData(GridData.FILL_HORIZONTAL); nonheapmemory_stats.setLayoutData(layout_data); layout = new GridLayout(2,false); nonheapmemory_stats.setLayout(layout); label = new Label(nonheapmemory_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.jvm.label.nonheapmemory_init") + " : "); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); nonheapmemory_init = new Label(nonheapmemory_stats,SWT.NONE); nonheapmemory_init.setFont(skin.getLabelFont()); nonheapmemory_init.setText(FileFormatter.formatFileSize(nonheap_memory.getInit())); label = new Label(nonheapmemory_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.jvm.label.nonheapmemory_used") + " : "); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); nonheapmemory_used = new Label(nonheapmemory_stats,SWT.NONE); nonheapmemory_used.setFont(skin.getLabelFont()); nonheapmemory_used.setText(FileFormatter.formatFileSize(nonheap_memory.getUsed())); label = new Label(nonheapmemory_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.jvm.label.nonheapmemory_max") + " : "); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); nonheapmemory_max = new Label(nonheapmemory_stats,SWT.NONE); nonheapmemory_max.setFont(skin.getLabelFont()); nonheapmemory_max.setText(FileFormatter.formatFileSize(nonheap_memory.getMax())); label = new Label(nonheapmemory_stats,SWT.NONE); Group thread_stats = new Group(content,SWT.NONE); thread_stats.setText(_._("mainwindow.statisticstab.tab.jvm.group.threads")); layout_data = new GridData(GridData.FILL_HORIZONTAL); thread_stats.setLayoutData(layout_data); layout = new GridLayout(2,false); thread_stats.setLayout(layout); label = new Label(thread_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.jvm.label.thread_count") + " : "); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); thread_count = new Label(thread_stats,SWT.NONE); thread_count.setFont(skin.getLabelFont()); thread_count.setText(thread_bean.getThreadCount()+""); label = new Label(thread_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.jvm.label.daemon_thread_count") + " : "); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); daemon_thread_count = new Label(thread_stats,SWT.NONE); daemon_thread_count.setFont(skin.getLabelFont()); daemon_thread_count.setText(thread_bean.getDaemonThreadCount()+""); label = new Label(thread_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.jvm.label.peak_thread_count") + " : "); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); peak_thread_count = new Label(thread_stats,SWT.NONE); peak_thread_count.setFont(skin.getLabelFont()); peak_thread_count.setText(thread_bean.getPeakThreadCount()+""); label = new Label(thread_stats,SWT.NONE); label.setFont(skin.getLabelFont()); label.setText(_._("mainwindow.statisticstab.tab.jvm.label.total_thread_count") + " : "); label.setToolTipText(_._("mainwindow.statisticstab.tab.jvm.label.total_thread_count.tooltip")); label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END)); total_thread_count = new Label(thread_stats,SWT.NONE); total_thread_count.setFont(skin.getLabelFont()); total_thread_count.setText(thread_bean.getTotalStartedThreadCount()+""); total_thread_count.setToolTipText(_._("mainwindow.statisticstab.tab.jvm.label.total_thread_count.tooltip")); stats_tabs.setSelection(network_stats); } public JMULE_TABS getTabType() { return JMULE_TABS.STATISTICS; } public void lostFocus() { GUIUpdater.getInstance().removeRefreshable(refreshable); } public void obtainFocus() { refreshable.refresh(); GUIUpdater.getInstance().addRefreshable(refreshable); } public void disposeTab() { }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -