use of com.biglybt.ui.swt.components.graphics.Scale in project BiglyBT by BiglySoftware.
the class TransferStatsView method createConnectionPanel.
private void createConnectionPanel() {
connectionPanel = new Composite(mainPanel, SWT.NONE);
GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
Utils.setLayoutData(connectionPanel, gridData);
GridLayout panelLayout = new GridLayout();
panelLayout.numColumns = 2;
panelLayout.makeColumnsEqualWidth = true;
connectionPanel.setLayout(panelLayout);
Composite conn_area = new Composite(connectionPanel, SWT.NULL);
gridData = new GridData(GridData.FILL_HORIZONTAL);
Utils.setLayoutData(conn_area, gridData);
panelLayout = new GridLayout();
panelLayout.numColumns = 2;
conn_area.setLayout(panelLayout);
Label label = new Label(conn_area, SWT.NULL);
Messages.setLanguageText(label, "SpeedView.stats.con");
connection_label = new BufferedLabel(conn_area, SWT.DOUBLE_BUFFERED);
gridData = new GridData(GridData.FILL_HORIZONTAL);
Utils.setLayoutData(connection_label, gridData);
Composite upload_area = new Composite(connectionPanel, SWT.NULL);
gridData = new GridData(GridData.FILL_HORIZONTAL);
Utils.setLayoutData(upload_area, gridData);
panelLayout = new GridLayout();
panelLayout.numColumns = 2;
upload_area.setLayout(panelLayout);
label = new Label(upload_area, SWT.NULL);
Messages.setLanguageText(label, "SpeedView.stats.upload");
upload_label = new BufferedLabel(upload_area, SWT.DOUBLE_BUFFERED);
gridData = new GridData(GridData.FILL_HORIZONTAL);
Utils.setLayoutData(upload_label, gridData);
// connections
con_folder = new TabFolder(connectionPanel, SWT.LEFT);
gridData = new GridData(GridData.FILL_BOTH);
gridData.horizontalSpan = 1;
Utils.setLayoutData(con_folder, gridData);
con_folder.setBackground(Colors.background);
// connection counts
TabItem conn_item = new TabItem(con_folder, SWT.NULL);
conn_item.setText(MessageText.getString("label.connections"));
Canvas connection_canvas = new Canvas(con_folder, SWT.NO_BACKGROUND);
conn_item.setControl(connection_canvas);
gridData = new GridData(GridData.FILL_BOTH);
gridData.heightHint = 200;
Utils.setLayoutData(connection_canvas, gridData);
connection_graphic = SpeedGraphic.getInstance(new Scale(false), new ValueFormater() {
@Override
public String format(int value) {
return (String.valueOf(value));
}
});
connection_graphic.initialize(connection_canvas);
Color[] colors = connection_graphic.colors;
connection_graphic.setLineColors(colors);
// route info
TabItem route_info_tab = new TabItem(con_folder, SWT.NULL);
route_info_tab.setText(MessageText.getString("label.routing"));
Composite route_tab_comp = new Composite(con_folder, SWT.NULL);
Utils.setLayoutData(route_tab_comp, new GridData(SWT.FILL, SWT.FILL, true, true));
GridLayout routeTabLayout = new GridLayout();
routeTabLayout.numColumns = 1;
route_tab_comp.setLayout(routeTabLayout);
route_info_tab.setControl(route_tab_comp);
ScrolledComposite sc = new ScrolledComposite(route_tab_comp, SWT.V_SCROLL);
Utils.setLayoutData(sc, new GridData(SWT.FILL, SWT.FILL, true, true));
route_comp = new Composite(sc, SWT.NULL);
Utils.setLayoutData(route_comp, new GridData(SWT.FILL, SWT.FILL, true, true));
GridLayout routeLayout = new GridLayout();
routeLayout.numColumns = 3;
// routeLayout.makeColumnsEqualWidth = true;
route_comp.setLayout(routeLayout);
sc.setContent(route_comp);
buildRouteComponent(5);
// upload queued
Canvas upload_canvas = new Canvas(connectionPanel, SWT.NO_BACKGROUND);
gridData = new GridData(GridData.FILL_BOTH);
gridData.heightHint = 200;
Utils.setLayoutData(upload_canvas, gridData);
upload_graphic = SpeedGraphic.getInstance(new ValueFormater() {
@Override
public String format(int value) {
return DisplayFormatters.formatByteCountToKiBEtc(value);
}
});
upload_graphic.initialize(upload_canvas);
}
Aggregations