use of org.graalvm.visualvm.core.ui.components.DataViewComponent in project visualvm by oracle.
the class JFRSnapshotBrowserView method createComponent.
@Override
protected DataViewComponent createComponent() {
JFRModel model = getModel();
if (model == null) {
BrowserViewSupport.MasterViewSupport masterView = new BrowserViewSupport.MasterViewSupport(model) {
@Override
void firstShown() {
}
@Override
void eventsFilterChanged(BrowserViewSupport.EventsFilter newFilter) {
}
@Override
void includeExperimentalChanged(boolean newExperimental) {
}
};
return new DataViewComponent(masterView.getMasterView(), new DataViewComponent.MasterViewConfiguration(true));
} else {
final BrowserViewSupport.StackTraceViewSupport stackTracePane = new BrowserViewSupport.StackTraceViewSupport() {
@Override
JFREvent getEvent(long id) {
return model.getEvent(id);
}
};
final BrowserViewSupport.EventsTableViewSupport eventsTable = new BrowserViewSupport.EventsTableViewSupport() {
@Override
void idSelected(long id) {
stackTracePane.idSelected(id);
}
};
eventsTable.setIncludeExperimental(false);
eventsTable.setEventsFilter(BrowserViewSupport.EventsFilter.ALL);
final BrowserViewSupport.EventsTreeViewSupport eventsTree = new BrowserViewSupport.EventsTreeViewSupport(model.getEventsCount()) {
@Override
void eventsSelected(String eventType, long eventsCount, List<JFRDataDescriptor> dataDescriptors) {
initialize(null, eventsTable.getVisitor(eventType, eventsCount, dataDescriptors));
}
};
eventsTree.setIncludeExperimental(false);
BrowserViewSupport.MasterViewSupport masterView = new BrowserViewSupport.MasterViewSupport(model) {
@Override
void firstShown() {
initialize(eventsTree, this, eventsTree.getVisitor());
}
@Override
void eventsFilterChanged(BrowserViewSupport.EventsFilter newFilter) {
eventsTable.setEventsFilter(newFilter);
eventsTree.refreshSelection();
}
@Override
void includeExperimentalChanged(boolean newExperimental) {
eventsTree.setIncludeExperimental(newExperimental);
eventsTable.setIncludeExperimental(newExperimental);
eventsTree.pauseSelection();
initialize(eventsTree, this, eventsTree.getVisitor());
}
};
DataViewComponent dvc = new DataViewComponent(masterView.getMasterView(), new DataViewComponent.MasterViewConfiguration(false));
dvc.configureDetailsView(new DataViewComponent.DetailsViewConfiguration(0.35, 0, -1, -1, 0.65, 1));
dvc.addDetailsView(eventsTree.getDetailsView(), DataViewComponent.TOP_LEFT);
dvc.addDetailsView(eventsTable.getDetailsView(), DataViewComponent.TOP_RIGHT);
dvc.addDetailsView(stackTracePane.getDetailsView(), DataViewComponent.BOTTOM_RIGHT);
dvc.hideDetailsArea(DataViewComponent.BOTTOM_RIGHT);
return dvc;
}
}
use of org.graalvm.visualvm.core.ui.components.DataViewComponent in project visualvm by oracle.
the class JFRSnapshotEnvironmentView method createComponent.
@Override
protected DataViewComponent createComponent() {
JFRModel model = getModel();
boolean hasEvents = model != null && model.containsEvent(JFRSnapshotEnvironmentViewProvider.EventChecker.class);
if (!hasEvents) {
EnvironmentViewSupport.MasterViewSupport masterView = new EnvironmentViewSupport.MasterViewSupport(model) {
@Override
void firstShown() {
}
};
return new DataViewComponent(masterView.getMasterView(), new DataViewComponent.MasterViewConfiguration(true));
} else {
EnvironmentViewSupport.CPUUtilizationSupport cpuUtilizationView = new EnvironmentViewSupport.CPUUtilizationSupport(model);
EnvironmentViewSupport.NetworkUtilizationSupport networkUtilizationView = new EnvironmentViewSupport.NetworkUtilizationSupport(model);
EnvironmentViewSupport.MemoryUsageSupport memoryUsageView = new EnvironmentViewSupport.MemoryUsageSupport(model);
EnvironmentViewSupport.CPUDetailsSupport cpuDetailsView = new EnvironmentViewSupport.CPUDetailsSupport();
EnvironmentViewSupport.OSDetailsSupport osDetailsView = new EnvironmentViewSupport.OSDetailsSupport();
EnvironmentViewSupport.NetworkDetailsSupport networkDetailsView = new EnvironmentViewSupport.NetworkDetailsSupport();
EnvironmentViewSupport.EnvVarSupport envVarView = new EnvironmentViewSupport.EnvVarSupport();
EnvironmentViewSupport.ProcessesSupport processesView = new EnvironmentViewSupport.ProcessesSupport();
EnvironmentViewSupport.MasterViewSupport masterView = new EnvironmentViewSupport.MasterViewSupport(model) {
@Override
void firstShown() {
initialize(this, cpuUtilizationView, networkUtilizationView, memoryUsageView, cpuDetailsView, osDetailsView, networkDetailsView, envVarView, processesView);
}
};
DataViewComponent dvc = new DataViewComponent(masterView.getMasterView(), new DataViewComponent.MasterViewConfiguration(false));
dvc.configureDetailsArea(new DataViewComponent.DetailsAreaConfiguration("CPU & Network", true), DataViewComponent.TOP_LEFT);
dvc.addDetailsView(cpuUtilizationView.getDetailsView(), DataViewComponent.TOP_LEFT);
dvc.addDetailsView(networkUtilizationView.getDetailsView(), DataViewComponent.TOP_LEFT);
dvc.configureDetailsArea(new DataViewComponent.DetailsAreaConfiguration("Memory", true), DataViewComponent.TOP_RIGHT);
dvc.addDetailsView(memoryUsageView.getDetailsView(), DataViewComponent.TOP_RIGHT);
dvc.configureDetailsArea(new DataViewComponent.DetailsAreaConfiguration("Details", true), DataViewComponent.BOTTOM_LEFT);
dvc.addDetailsView(cpuDetailsView.getDetailsView(), DataViewComponent.BOTTOM_LEFT);
dvc.addDetailsView(osDetailsView.getDetailsView(), DataViewComponent.BOTTOM_LEFT);
dvc.addDetailsView(networkDetailsView.getDetailsView(), DataViewComponent.BOTTOM_LEFT);
dvc.addDetailsView(envVarView.getDetailsView(), DataViewComponent.BOTTOM_LEFT);
dvc.addDetailsView(processesView.getDetailsView(), DataViewComponent.BOTTOM_LEFT);
return dvc;
}
}
use of org.graalvm.visualvm.core.ui.components.DataViewComponent in project visualvm by oracle.
the class JFRSnapshotGcView method createComponent.
protected DataViewComponent createComponent() {
JFRModel model = getModel();
boolean hasEvents = model != null && model.containsEvent(JFRSnapshotGcViewProvider.EventChecker.class);
if (!hasEvents) {
masterView = new GcViewSupport.MasterViewSupport(model) {
@Override
void firstShown() {
}
@Override
void changeAggregation(GcViewSupport.Aggregation primary, GcViewSupport.Aggregation secondary) {
}
};
return new DataViewComponent(masterView.getMasterView(), new DataViewComponent.MasterViewConfiguration(true));
} else {
final GcViewSupport.GcConfigurationSupport gcConfigurationView = new GcViewSupport.GcConfigurationSupport();
final GcViewSupport.GcHeapConfigurationSupport gcHeapConfigurationView = new GcViewSupport.GcHeapConfigurationSupport();
final GcViewSupport.GcYoungGenConfigurationSupport gcYoungGenConfigurationView = new GcViewSupport.GcYoungGenConfigurationSupport();
final GcViewSupport.GcSurvivorConfigurationSupport gcSurvivorConfigurationView = new GcViewSupport.GcSurvivorConfigurationSupport();
final GcViewSupport.GcTlabConfigurationSupport gcTlabConfigurationView = new GcViewSupport.GcTlabConfigurationSupport();
masterView = new GcViewSupport.MasterViewSupport(model) {
@Override
void firstShown() {
changeAggregation(GcViewSupport.Aggregation.NONE, GcViewSupport.Aggregation.NONE);
initialize(gcConfigurationView, gcHeapConfigurationView, gcYoungGenConfigurationView, gcSurvivorConfigurationView, gcTlabConfigurationView);
}
@Override
void changeAggregation(GcViewSupport.Aggregation primary, GcViewSupport.Aggregation secondary) {
JFRSnapshotGcView.this.setAggregation(primary, secondary);
}
};
DataViewComponent dvc = new DataViewComponent(masterView.getMasterView(), new DataViewComponent.MasterViewConfiguration(false));
dvc.configureDetailsArea(new DataViewComponent.DetailsAreaConfiguration("Data", false), DataViewComponent.TOP_LEFT);
dataView = new GcViewSupport.DataViewSupport();
dvc.addDetailsView(dataView.getDetailsView(), DataViewComponent.TOP_LEFT);
dvc.configureDetailsArea(new DataViewComponent.DetailsAreaConfiguration("Configuration", true), DataViewComponent.BOTTOM_LEFT);
dvc.addDetailsView(gcConfigurationView.getDetailsView(), DataViewComponent.BOTTOM_LEFT);
dvc.addDetailsView(gcHeapConfigurationView.getDetailsView(), DataViewComponent.BOTTOM_LEFT);
dvc.addDetailsView(gcYoungGenConfigurationView.getDetailsView(), DataViewComponent.BOTTOM_LEFT);
dvc.addDetailsView(gcSurvivorConfigurationView.getDetailsView(), DataViewComponent.BOTTOM_LEFT);
dvc.addDetailsView(gcTlabConfigurationView.getDetailsView(), DataViewComponent.BOTTOM_LEFT);
return dvc;
}
}
use of org.graalvm.visualvm.core.ui.components.DataViewComponent in project visualvm by oracle.
the class ThreadDumpView method createComponent.
protected DataViewComponent createComponent() {
ThreadDump threadDump = (ThreadDump) getDataSource();
DataViewComponent dvc = new DataViewComponent(new MasterViewSupport(threadDump).getMasterView(), new DataViewComponent.MasterViewConfiguration(true));
return dvc;
}
use of org.graalvm.visualvm.core.ui.components.DataViewComponent in project visualgc_java8 by beansoft.
the class VisualGCPane method createComponent.
protected DataViewComponent createComponent(Container contentPane) {
this.contentPane = contentPane;
JList<String> psList = new JList<>(psListModel);
psList.setBorder(BorderFactory.createTitledBorder(Res.getString("double.click.a.jvm.process.to.start")));
psList.addMouseListener(new MouseAdapter() {
@Override
public void mouseClicked(MouseEvent e) {
if (e.getClickCount() >= 2) {
String val = psList.getSelectedValue();
if (val != null) {
if (timer != null)
timer.stop();
pName = val;
String processInput = val.substring(0, val.indexOf(' '));
startMonitor(processInput);
// psListModel.stop();
contentPane.removeAll();
contentPane.add(createComponent(contentPane));
// timer.start();
}
}
}
});
if (!this.modelAvailable) {
DataViewComponent.MasterView masterView = new DataViewComponent.MasterView("Visual GC", null, new JScrollPane(psList));
// new NotSupportedDisplayer(NotSupportedDisplayer.JVM));
DataViewComponent.MasterViewConfiguration masterViewConfiguration = new DataViewComponent.MasterViewConfiguration(true);
return new DataViewComponent(masterView, masterViewConfiguration);
}
this.masterViewSupport = new MasterViewSupport(this.timer);
this.graphGCViewSupport = new GraphGCViewSupport();
this.histogramViewSupport = new HistogramViewSupport();
this.spacesViewSupport = new SpacesViewSupport();
DataViewComponent.MasterView monitoringMasterView = new DataViewComponent.MasterView("Visual GC - " + pName, Res.getString("a.visual.garbage.collection.monitoring.tool"), this.masterViewSupport);
DataViewComponent.MasterViewConfiguration monitoringMasterConfiguration = new DataViewComponent.MasterViewConfiguration(false);
DataViewComponent dvc = new DataViewComponent(monitoringMasterView, monitoringMasterConfiguration);
dvc.configureDetailsView(new DataViewComponent.DetailsViewConfiguration(0.35D, 0.15D, 0.7D, -1.0D, 0.66D, 0.85D));
dvc.configureDetailsArea(new DataViewComponent.DetailsAreaConfiguration(Res.getString("graphs"), true), DataViewComponent.TOP_RIGHT);
dvc.addDetailsView(this.graphGCViewSupport.getDetailsView(), DataViewComponent.TOP_RIGHT);
// dvc.addDetailsView( new DataViewComponent.DetailsView( "GC Policy", null, 10, new JLabel(GCSample.gcPolicyName), null), DataViewComponent.BOTTOM_RIGHT);// Add a Tab
// Add a Tab
dvc.addDetailsView(new DataViewComponent.DetailsView(Res.getString("jvm.browser"), null, 10, new JScrollPane(psList), null), DataViewComponent.BOTTOM_RIGHT);
dvc.addDetailsView(new DataViewComponent.DetailsView(Res.getString("info"), null, 10, new LinkLabel(Res.getString("this.tool.created.by"), null) {
@Override
public void mouseClicked(MouseEvent e) {
try {
Desktop.getDesktop().browse(new URI("https://github.com/beansoft/visualgc_jdk8"));
} catch (IOException ioException) {
ioException.printStackTrace();
} catch (URISyntaxException uriSyntaxException) {
uriSyntaxException.printStackTrace();
}
}
}, null), // Add a Tab
DataViewComponent.BOTTOM_RIGHT);
dvc.configureDetailsArea(new DataViewComponent.DetailsAreaConfiguration(Res.getString("histogram"), true), DataViewComponent.BOTTOM_LEFT);
dvc.addDetailsView(this.histogramViewSupport.getDetailsView(), DataViewComponent.BOTTOM_LEFT);
if (!this.histogramSupported)
dvc.hideDetailsArea(DataViewComponent.BOTTOM_LEFT);
dvc.configureDetailsArea(new DataViewComponent.DetailsAreaConfiguration(Res.getString("spaces"), true), DataViewComponent.TOP_LEFT);
dvc.addDetailsView(this.spacesViewSupport.getDetailsView(), DataViewComponent.TOP_LEFT);
this.timer.start();
refresh();
return dvc;
}
Aggregations