Vojtech Szocs has posted comments on this change. Change subject: ui: line chart progress bar ......................................................................
Patch Set 11: (3 comments) http://gerrit.ovirt.org/#/c/29549/11/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabVirtualMachineView.java File frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/section/main/view/tab/MainTabVirtualMachineView.java: Line 399: abstract class ColumnResizeTableLineChartProgressBar extends LineChartProgressBar<VM> { Line 400: Line 401: @Override Line 402: protected String getActualWidth() { Line 403: return ((ColumnResizeCellTable) getTable().table).getColumnWidth(this); AbstractActionTable.table field is public (due to how @WithElementId annotation processing works) but it shouldn't be accessed from outside AbstractActionTable (it's meant to be an implementation detail). Please consider adding following method in AbstractActionTable: public String getColumnWidth(Column<T, ?> column) { return table.getColumnWidth(column); } Line 404: } Line 405: } Line 406: Line 407: private List<Integer> asListOfIntegers(String str) { http://gerrit.ovirt.org/#/c/29549/11/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/column/LineChartProgressBar.java File frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/widget/table/column/LineChartProgressBar.java: Line 26: * - if no points fit into the drawing area, only the number is shown Line 27: * Line 28: * @param <T> The entity type Line 29: */ Line 30: public abstract class LineChartProgressBar<T> extends SafeHtmlColumn<T> { Maybe add "Column" to the name of this class? :-) Line 31: Line 32: private static final ApplicationTemplates applicationTemplates = ClientGinjectorProvider.getApplicationTemplates(); Line 33: Line 34: private static final int stepMax = 15; Line 64: private FallbackProgressColumn fallbackProgressColumn; Line 65: Line 66: @Override Line 67: public SafeHtml getValue(T object) { Line 68: final Canvas canvas = Canvas.createIfSupported(); Code in this class uses HTML5 <canvas> element as a 2D graphics engine, without attaching <canvas> itself to active DOM. Instead, code renders the content of <canvas> through data URL: canvas.toDataUrl(); To improve performance, I strongly suggest to have single, off-screen <canvas> element for all columns of given type (LineChartProgressBar). In getValue method, we can first clear the <canvas> content: canvas.getContext2d().clearRect(0, 0, canvasWidth, canvasHeight); and then proceed with utilizing <canvas> element. Line 69: if (canvas == null) { Line 70: // lazily - normally the browser should support it Line 71: if (fallbackProgressColumn == null) { Line 72: fallbackProgressColumn = new FallbackProgressColumn(); -- To view, visit http://gerrit.ovirt.org/29549 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I66a577d6e3699c7985a4e6dd4aa66dd5969ebf82 Gerrit-PatchSet: 11 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Tomas Jelinek <[email protected]> Gerrit-Reviewer: Tomas Jelinek <[email protected]> Gerrit-Reviewer: Vojtech Szocs <[email protected]> Gerrit-Reviewer: [email protected] Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
