use of com.cubrid.cubridmanager.ui.monitoring.editor.internal.ChartSettingDlg in project cubrid-manager by CUBRID.
the class DbDashboardHistoryViewPart method fireChartSetting.
/**
* This method is responsible for preparing data for ChartSettingDlg and
* dealing with the results of chartSettingDlg
*
*/
private void fireChartSetting() {
ChartSettingDlg chartSettingDlg = new ChartSettingDlg(composite.getShell());
chartSettingDlg.setHasTitlSetting(false);
chartSettingDlg.setHasHistoryPath(true);
chartSettingDlg.setHasAxisSetting(false);
chartSettingDlg.setHasChartSelection(true);
// plot appearance
XYPlot dbStatplot = dbStatChartPart.getChart().getXYPlot();
String plotBgColor = trimPaintColor(dbStatplot.getBackgroundPaint().toString());
String plotDomainGridColor = trimPaintColor(dbStatplot.getDomainGridlinePaint().toString());
String plotRangGridColor = trimPaintColor(dbStatplot.getRangeGridlinePaint().toString());
chartSettingDlg.setPlotBgColor(plotBgColor);
chartSettingDlg.setPlotDomainGridColor(plotDomainGridColor);
chartSettingDlg.setPlotRangGridColor(plotRangGridColor);
// series
chartSettingDlg.setSettingMap(dbStatChartPart.getSettingMap());
// chart selection
chartSettingDlg.setChartSelectionLst(getSelectedCharts());
// history path
chartSettingDlg.setHistoryPath(historyPath);
chartSettingDlg.setHistoryFileName(historyFileName);
if (chartSettingDlg.open() == Dialog.OK) {
// plot appearance
plotBgColor = chartSettingDlg.getPlotBgColor();
plotDomainGridColor = chartSettingDlg.getPlotDomainGridColor();
plotRangGridColor = chartSettingDlg.getPlotRangGridColor();
//SeruesPlot
XYPlot cpuSeriesPlot = (XYPlot) cpuChart.getSeriesChart().getPlot();
XYPlot memorySeriesPlot = (XYPlot) memoryChart.getSeriesChart().getPlot();
XYPlot delaySeriesPlot = (XYPlot) delayChart.getSeriesChart().getPlot();
XYPlot countSeriesPlot = (XYPlot) countChart.getSeriesChart().getPlot();
// history path
String newHistoryPath = chartSettingDlg.getHistoryPath();
isChangedHistoryPath = historyPath.equals(newHistoryPath) ? false : true;
if (isChangedHistoryPath) {
historyPath = newHistoryPath;
historyFileHelp.setHistoryPath(historyPath);
}
int red = 0;
int green = 0;
int blue = 0;
//background
red = getColorElem(plotBgColor, 0);
green = getColorElem(plotBgColor, 1);
blue = getColorElem(plotBgColor, 2);
Color bgColor = new Color(red, green, blue);
dbStatplot.setBackgroundPaint(bgColor);
//cpu chart
cpuSeriesPlot.setBackgroundPaint(bgColor);
//memoryChart
memorySeriesPlot.setBackgroundPaint(bgColor);
//delayChart
delaySeriesPlot.setBackgroundPaint(bgColor);
//countChart;
countSeriesPlot.setBackgroundPaint(bgColor);
//DomainGridColor
//db Chart
red = getColorElem(plotDomainGridColor, 0);
green = getColorElem(plotDomainGridColor, 1);
blue = getColorElem(plotDomainGridColor, 2);
Color domainGridlineColor = new Color(red, green, blue);
dbStatplot.setDomainGridlinePaint(domainGridlineColor);
//cpu chart
cpuSeriesPlot.setDomainGridlinePaint(domainGridlineColor);
//memoryChart
memorySeriesPlot.setDomainGridlinePaint(domainGridlineColor);
//delayChart
delaySeriesPlot.setDomainGridlinePaint(domainGridlineColor);
//countChart;
countSeriesPlot.setDomainGridlinePaint(domainGridlineColor);
//RangeGridColor
red = getColorElem(plotRangGridColor, 0);
green = getColorElem(plotRangGridColor, 1);
blue = getColorElem(plotRangGridColor, 2);
Color rangeGridColor = new Color(red, green, blue);
dbStatplot.setRangeGridlinePaint(rangeGridColor);
//cpu chart
cpuSeriesPlot.setRangeGridlinePaint(rangeGridColor);
//memoryChart
memorySeriesPlot.setRangeGridlinePaint(rangeGridColor);
//delayChart
delaySeriesPlot.setRangeGridlinePaint(rangeGridColor);
//countChart;
countSeriesPlot.setRangeGridlinePaint(rangeGridColor);
dbStatChartPart.setSettingMap(chartSettingDlg.getSettingMap());
dbStatChartPart.updateSettingSeries();
//chart Selection
fireChartSelection(chartSettingDlg.getChartSelectionLst());
}
}
use of com.cubrid.cubridmanager.ui.monitoring.editor.internal.ChartSettingDlg in project cubrid-manager by CUBRID.
the class DatabaseDashboardViewPart method fireChartSetting.
/**
* This method is responsible for preparing data for ChartSettingDlg and
* dealing with the results of chartSettingDlg
*
*/
private void fireChartSetting() {
ChartSettingDlg chartSettingDlg = new ChartSettingDlg(composite.getShell());
chartSettingDlg.setHasTitlSetting(false);
chartSettingDlg.setHasHistoryPath(true);
chartSettingDlg.setHasAxisSetting(false);
chartSettingDlg.setHasChartSelection(true);
// plot appearance
XYPlot dbStatplot = dbStatChartPart.getChart().getXYPlot();
String plotBgColor = trimPaintColor(dbStatplot.getBackgroundPaint().toString());
String plotDomainGridColor = trimPaintColor(dbStatplot.getDomainGridlinePaint().toString());
String plotRangGridColor = trimPaintColor(dbStatplot.getRangeGridlinePaint().toString());
chartSettingDlg.setPlotBgColor(plotBgColor);
chartSettingDlg.setPlotDomainGridColor(plotDomainGridColor);
chartSettingDlg.setPlotRangGridColor(plotRangGridColor);
// series
chartSettingDlg.setSettingMap(dbStatChartPart.getSettingMap());
// history path
chartSettingDlg.setHistoryPath(historyPath);
chartSettingDlg.setHistoryFileName(historyFileName);
// chart selection
chartSettingDlg.setChartSelectionLst(getSelectedCharts());
if (chartSettingDlg.open() == Dialog.OK) {
// plot appearance
plotBgColor = chartSettingDlg.getPlotBgColor();
plotDomainGridColor = chartSettingDlg.getPlotDomainGridColor();
plotRangGridColor = chartSettingDlg.getPlotRangGridColor();
JFreeChart cpuBarChart = cpuChart.getBarChart();
Plot cpuBarPlot = cpuBarChart.getPlot();
XYPlot cpuSeriesPlot = (XYPlot) cpuChart.getSeriesChart().getPlot();
JFreeChart memoryBarChart = memoryChart.getBarChart();
Plot memoryBarPlot = memoryBarChart.getPlot();
XYPlot memorySeriesPlot = (XYPlot) memoryChart.getSeriesChart().getPlot();
JFreeChart delayBarChart = delayChart.getBarChart();
Plot delayBarPlot = delayBarChart.getPlot();
XYPlot delaySeriesPlot = (XYPlot) delayChart.getSeriesChart().getPlot();
JFreeChart countBarChart = countChart.getBarChart();
Plot countBarPlot = countBarChart.getPlot();
XYPlot countSeriesPlot = (XYPlot) countChart.getSeriesChart().getPlot();
// history path
String newHistoryPath = chartSettingDlg.getHistoryPath();
isChangedHistoryPath = historyPath.equals(newHistoryPath) ? false : true;
if (isChangedHistoryPath) {
historyPath = newHistoryPath;
historyFileHelp.setHistoryPath(historyPath);
historyFileHelp.setChangedHistoryPath(true);
}
int red = 0;
int green = 0;
int blue = 0;
//background
red = getColorElem(plotBgColor, 0);
green = getColorElem(plotBgColor, 1);
blue = getColorElem(plotBgColor, 2);
Color bgColor = new Color(red, green, blue);
dbStatplot.setBackgroundPaint(bgColor);
//cpu chart
cpuBarChart.setBackgroundPaint(bgColor);
cpuBarPlot.setBackgroundPaint(bgColor);
cpuSeriesPlot.setBackgroundPaint(bgColor);
//memoryChart
memoryBarPlot.setBackgroundPaint(bgColor);
memoryBarChart.setBackgroundPaint(bgColor);
memorySeriesPlot.setBackgroundPaint(bgColor);
//delayChart
delayBarPlot.setBackgroundPaint(bgColor);
delayBarChart.setBackgroundPaint(bgColor);
delaySeriesPlot.setBackgroundPaint(bgColor);
//countChart;
countBarPlot.setBackgroundPaint(bgColor);
countBarChart.setBackgroundPaint(bgColor);
countSeriesPlot.setBackgroundPaint(bgColor);
//DomainGridColor
//db Chart
red = getColorElem(plotDomainGridColor, 0);
green = getColorElem(plotDomainGridColor, 1);
blue = getColorElem(plotDomainGridColor, 2);
Color domainGridlineColor = new Color(red, green, blue);
dbStatplot.setDomainGridlinePaint(domainGridlineColor);
//cpu chart
cpuSeriesPlot.setDomainGridlinePaint(domainGridlineColor);
//memoryChart
memorySeriesPlot.setDomainGridlinePaint(domainGridlineColor);
//delayChart
delaySeriesPlot.setDomainGridlinePaint(domainGridlineColor);
//countChart;
countSeriesPlot.setDomainGridlinePaint(domainGridlineColor);
//RangeGridColor
red = getColorElem(plotRangGridColor, 0);
green = getColorElem(plotRangGridColor, 1);
blue = getColorElem(plotRangGridColor, 2);
Color rangeGridColor = new Color(red, green, blue);
dbStatplot.setRangeGridlinePaint(rangeGridColor);
//cpu chart
cpuSeriesPlot.setRangeGridlinePaint(rangeGridColor);
//memoryChart
memorySeriesPlot.setRangeGridlinePaint(rangeGridColor);
//delayChart
delaySeriesPlot.setRangeGridlinePaint(rangeGridColor);
//countChart;
countSeriesPlot.setRangeGridlinePaint(rangeGridColor);
dbStatChartPart.setSettingMap(chartSettingDlg.getSettingMap());
dbStatChartPart.updateSettingSeries();
//chart Selection
fireChartSelection(chartSettingDlg.getChartSelectionLst());
}
}
use of com.cubrid.cubridmanager.ui.monitoring.editor.internal.ChartSettingDlg in project cubrid-manager by CUBRID.
the class HostDashboardViewPart method fireChartSetting.
/**
* This method is responsible for preparing data for ChartSettingDlg and
* dealing with the results of chartSettingDlg
*
*/
private void fireChartSetting() {
ChartSettingDlg chartSettingDlg = new ChartSettingDlg(composite.getShell());
chartSettingDlg.setHasTitlSetting(false);
chartSettingDlg.setHasHistoryPath(true);
chartSettingDlg.setHasAxisSetting(false);
chartSettingDlg.setHasChartSelection(true);
// plot appearance
XYPlot cpuSeriesPlot = cpuChart.getSeriesChart().getXYPlot();
String plotBgColor = trimPaintColor(cpuSeriesPlot.getBackgroundPaint().toString());
String plotDomainGridColor = trimPaintColor(cpuSeriesPlot.getDomainGridlinePaint().toString());
String plotRangGridColor = trimPaintColor(cpuSeriesPlot.getRangeGridlinePaint().toString());
chartSettingDlg.setPlotBgColor(plotBgColor);
chartSettingDlg.setPlotDomainGridColor(plotDomainGridColor);
chartSettingDlg.setPlotRangGridColor(plotRangGridColor);
// series
if (brokerChartPart == null) {
chartSettingDlg.setHasSeriesItemSetting(false);
} else {
chartSettingDlg.setHasSeriesItemSetting(true);
chartSettingDlg.setSettingMap(brokerChartPart.getSettingMap());
}
// history path
chartSettingDlg.setHistoryPath(historyPath);
chartSettingDlg.setHistoryFileName(historyFileName);
// chart selection
chartSettingDlg.setChartSelectionLst(getSelectedCharts());
if (chartSettingDlg.open() == Dialog.OK) {
// plot appearance
plotBgColor = chartSettingDlg.getPlotBgColor();
plotDomainGridColor = chartSettingDlg.getPlotDomainGridColor();
plotRangGridColor = chartSettingDlg.getPlotRangGridColor();
JFreeChart cpuBarChart = cpuChart.getBarChart();
Plot cpuBarPlot = cpuBarChart.getPlot();
JFreeChart memoryBarChart = memoryChart.getBarChart();
Plot memoryBarPlot = memoryBarChart.getPlot();
XYPlot memorySeriesPlot = (XYPlot) memoryChart.getSeriesChart().getPlot();
JFreeChart iowaitBarChart = iowaitChart.getBarChart();
Plot iowaitBarPlot = iowaitBarChart.getPlot();
XYPlot iowaitSeriesPlot = (XYPlot) iowaitChart.getSeriesChart().getPlot();
// history path
String newHistoryPath = chartSettingDlg.getHistoryPath();
isChangedHistoryPath = historyPath.equals(newHistoryPath) ? false : true;
if (isChangedHistoryPath) {
historyPath = newHistoryPath;
historyFileHelp.setChangedHistoryPath(true);
historyFileHelp.setHistoryPath(historyPath);
}
int red = 0;
int green = 0;
int blue = 0;
//background
red = getColorElem(plotBgColor, 0);
green = getColorElem(plotBgColor, 1);
blue = getColorElem(plotBgColor, 2);
Color bgColor = new Color(red, green, blue);
//cpu chart
cpuBarChart.setBackgroundPaint(bgColor);
cpuBarPlot.setBackgroundPaint(bgColor);
cpuSeriesPlot.setBackgroundPaint(bgColor);
//memoryChart
memoryBarPlot.setBackgroundPaint(bgColor);
memoryBarChart.setBackgroundPaint(bgColor);
memorySeriesPlot.setBackgroundPaint(bgColor);
//iowaitChart
iowaitBarPlot.setBackgroundPaint(bgColor);
iowaitBarChart.setBackgroundPaint(bgColor);
iowaitSeriesPlot.setBackgroundPaint(bgColor);
//DomainGridColor
//broker Chart
red = getColorElem(plotDomainGridColor, 0);
green = getColorElem(plotDomainGridColor, 1);
blue = getColorElem(plotDomainGridColor, 2);
Color domainGridlineColor = new Color(red, green, blue);
//cpu chart
cpuSeriesPlot.setDomainGridlinePaint(domainGridlineColor);
//memoryChart
memorySeriesPlot.setDomainGridlinePaint(domainGridlineColor);
//delayChart
iowaitSeriesPlot.setDomainGridlinePaint(domainGridlineColor);
//RangeGridColor
red = getColorElem(plotRangGridColor, 0);
green = getColorElem(plotRangGridColor, 1);
blue = getColorElem(plotRangGridColor, 2);
Color rangeGridColor = new Color(red, green, blue);
//cpu chart
cpuSeriesPlot.setRangeGridlinePaint(rangeGridColor);
//memoryChart
memorySeriesPlot.setRangeGridlinePaint(rangeGridColor);
//delayChart
iowaitSeriesPlot.setRangeGridlinePaint(rangeGridColor);
//broker Chart;
if (brokerChartPart != null) {
XYPlot brokerPlot = brokerChartPart.getChart().getXYPlot();
brokerPlot.setBackgroundPaint(bgColor);
brokerPlot.setDomainGridlinePaint(domainGridlineColor);
brokerPlot.setRangeGridlinePaint(rangeGridColor);
brokerChartPart.setSettingMap(chartSettingDlg.getSettingMap());
brokerChartPart.updateSettingSeries();
}
//chart Selection
fireChartSelection(chartSettingDlg.getChartSelectionLst());
}
}
use of com.cubrid.cubridmanager.ui.monitoring.editor.internal.ChartSettingDlg in project cubrid-manager by CUBRID.
the class HostSystemMonitorHistoryViewPart method fireChartSetting.
/**
* This method is responsible for preparing data for ChartSettingDlg and
* dealing with the results of chartSettingDlg
*
*/
private void fireChartSetting() {
ChartSettingDlg chartSettingDlg = new ChartSettingDlg(composite.getShell());
chartSettingDlg.setHasTitlSetting(false);
chartSettingDlg.setHasHistoryPath(true);
chartSettingDlg.setHasAxisSetting(false);
chartSettingDlg.setHasChartSelection(true);
chartSettingDlg.setHasSeriesItemSetting(false);
// plot appearance
XYPlot cpuSeriesPlot = cpuChart.getSeriesChart().getXYPlot();
String plotBgColor = CommonUITool.trimPaintColor(cpuSeriesPlot.getBackgroundPaint().toString());
String plotDomainGridColor = CommonUITool.trimPaintColor(cpuSeriesPlot.getDomainGridlinePaint().toString());
String plotRangGridColor = CommonUITool.trimPaintColor(cpuSeriesPlot.getRangeGridlinePaint().toString());
chartSettingDlg.setPlotBgColor(plotBgColor);
chartSettingDlg.setPlotDomainGridColor(plotDomainGridColor);
chartSettingDlg.setPlotRangGridColor(plotRangGridColor);
// history path
chartSettingDlg.setHistoryPath(historyPath);
chartSettingDlg.setHistoryFileName(historyFileName);
// chart selection
chartSettingDlg.setChartSelectionLst(getSelectedCharts());
if (chartSettingDlg.open() == Dialog.OK) {
// plot appearance
plotBgColor = chartSettingDlg.getPlotBgColor();
plotDomainGridColor = chartSettingDlg.getPlotDomainGridColor();
plotRangGridColor = chartSettingDlg.getPlotRangGridColor();
XYPlot memorySeriesPlot = (XYPlot) memoryChart.getSeriesChart().getPlot();
XYPlot iowaitSeriesPlot = (XYPlot) iowaitChart.getSeriesChart().getPlot();
// history path
String newHistoryPath = chartSettingDlg.getHistoryPath();
isChangedHistoryPath = historyPath.equals(newHistoryPath) ? false : true;
if (isChangedHistoryPath) {
historyPath = newHistoryPath;
historyFileHelp.setHistoryPath(historyPath);
}
int red = 0;
int green = 0;
int blue = 0;
//background
red = getColorElem(plotBgColor, 0);
green = getColorElem(plotBgColor, 1);
blue = getColorElem(plotBgColor, 2);
Color bgColor = new Color(red, green, blue);
//cpu chart
cpuSeriesPlot.setBackgroundPaint(bgColor);
//memoryChart
memorySeriesPlot.setBackgroundPaint(bgColor);
//iowaitChart
iowaitSeriesPlot.setBackgroundPaint(bgColor);
//DomainGridColor
//broker Chart
red = getColorElem(plotDomainGridColor, 0);
green = getColorElem(plotDomainGridColor, 1);
blue = getColorElem(plotDomainGridColor, 2);
Color domainGridlineColor = new Color(red, green, blue);
//cpu chart
cpuSeriesPlot.setDomainGridlinePaint(domainGridlineColor);
//memoryChart
memorySeriesPlot.setDomainGridlinePaint(domainGridlineColor);
//delayChart
iowaitSeriesPlot.setDomainGridlinePaint(domainGridlineColor);
//RangeGridColor
red = getColorElem(plotRangGridColor, 0);
green = getColorElem(plotRangGridColor, 1);
blue = getColorElem(plotRangGridColor, 2);
Color rangeGridColor = new Color(red, green, blue);
//cpu chart
cpuSeriesPlot.setRangeGridlinePaint(rangeGridColor);
//memoryChart
memorySeriesPlot.setRangeGridlinePaint(rangeGridColor);
//delayChart
iowaitSeriesPlot.setRangeGridlinePaint(rangeGridColor);
//chart Selection
fireChartSelection(chartSettingDlg.getChartSelectionLst());
}
}
use of com.cubrid.cubridmanager.ui.monitoring.editor.internal.ChartSettingDlg in project cubrid-manager by CUBRID.
the class HostDashboardHistoryViewPart method fireChartSetting.
/**
* This method is responsible for preparing data for ChartSettingDlg and
* dealing with the results of chartSettingDlg
*
*/
private void fireChartSetting() {
ChartSettingDlg chartSettingDlg = new ChartSettingDlg(composite.getShell());
chartSettingDlg.setHasTitlSetting(false);
chartSettingDlg.setHasHistoryPath(true);
chartSettingDlg.setHasAxisSetting(false);
chartSettingDlg.setHasChartSelection(true);
// plot appearance
XYPlot cpuSeriesPlot = cpuChart.getSeriesChart().getXYPlot();
String plotBgColor = trimPaintColor(cpuSeriesPlot.getBackgroundPaint().toString());
String plotDomainGridColor = trimPaintColor(cpuSeriesPlot.getDomainGridlinePaint().toString());
String plotRangGridColor = trimPaintColor(cpuSeriesPlot.getRangeGridlinePaint().toString());
chartSettingDlg.setPlotBgColor(plotBgColor);
chartSettingDlg.setPlotDomainGridColor(plotDomainGridColor);
chartSettingDlg.setPlotRangGridColor(plotRangGridColor);
// series
if (brokerChartPart == null) {
chartSettingDlg.setHasSeriesItemSetting(false);
} else {
chartSettingDlg.setHasSeriesItemSetting(true);
chartSettingDlg.setSettingMap(brokerChartPart.getSettingMap());
}
// history path
chartSettingDlg.setHistoryPath(historyPath);
chartSettingDlg.setHistoryFileName(historyFileName);
// chart selection
chartSettingDlg.setChartSelectionLst(getSelectedCharts());
if (chartSettingDlg.open() == Dialog.OK) {
// plot appearance
plotBgColor = chartSettingDlg.getPlotBgColor();
plotDomainGridColor = chartSettingDlg.getPlotDomainGridColor();
plotRangGridColor = chartSettingDlg.getPlotRangGridColor();
XYPlot memorySeriesPlot = (XYPlot) memoryChart.getSeriesChart().getPlot();
XYPlot iowaitSeriesPlot = (XYPlot) iowaitChart.getSeriesChart().getPlot();
// history path
String newHistoryPath = chartSettingDlg.getHistoryPath();
isChangedHistoryPath = historyPath.equals(newHistoryPath) ? false : true;
if (isChangedHistoryPath) {
historyPath = newHistoryPath;
historyFileHelp.setHistoryPath(historyPath);
}
int red = 0;
int green = 0;
int blue = 0;
//background
red = getColorElem(plotBgColor, 0);
green = getColorElem(plotBgColor, 1);
blue = getColorElem(plotBgColor, 2);
Color bgColor = new Color(red, green, blue);
//cpu chart
cpuSeriesPlot.setBackgroundPaint(bgColor);
//memoryChart
memorySeriesPlot.setBackgroundPaint(bgColor);
//iowaitChart
iowaitSeriesPlot.setBackgroundPaint(bgColor);
//DomainGridColor
//broker Chart
red = getColorElem(plotDomainGridColor, 0);
green = getColorElem(plotDomainGridColor, 1);
blue = getColorElem(plotDomainGridColor, 2);
Color domainGridlineColor = new Color(red, green, blue);
//cpu chart
cpuSeriesPlot.setDomainGridlinePaint(domainGridlineColor);
//memoryChart
memorySeriesPlot.setDomainGridlinePaint(domainGridlineColor);
//delayChart
iowaitSeriesPlot.setDomainGridlinePaint(domainGridlineColor);
//RangeGridColor
red = getColorElem(plotRangGridColor, 0);
green = getColorElem(plotRangGridColor, 1);
blue = getColorElem(plotRangGridColor, 2);
Color rangeGridColor = new Color(red, green, blue);
//cpu chart
cpuSeriesPlot.setRangeGridlinePaint(rangeGridColor);
//memoryChart
memorySeriesPlot.setRangeGridlinePaint(rangeGridColor);
//delayChart
iowaitSeriesPlot.setRangeGridlinePaint(rangeGridColor);
//broker Chart;
if (brokerChartPart != null) {
XYPlot brokerPlot = brokerChartPart.getChart().getXYPlot();
brokerPlot.setBackgroundPaint(bgColor);
brokerPlot.setDomainGridlinePaint(domainGridlineColor);
brokerPlot.setRangeGridlinePaint(rangeGridColor);
brokerChartPart.setSettingMap(chartSettingDlg.getSettingMap());
brokerChartPart.updateSettingSeries();
}
//chart Selection
fireChartSelection(chartSettingDlg.getChartSelectionLst());
}
}
Aggregations