-
-
Notifications
You must be signed in to change notification settings - Fork 195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add new formatting methods to the TableBuilder and fix printing issues #405
Add new formatting methods to the TableBuilder and fix printing issues #405
Conversation
The 4 lists keep track of which column needs which formatting. The setter and getter methods will need to get expanded to reiterate through the list to update the actual formatting for every column.
This solves the issue that the variables are not initialized when createTableColumns() is executed but it does not account for additional columns being added using addColumn(). More work is required here.
No longer uses separate lists to keep track of the formatting choices and insteads allows formatting to be changed by addressing individual column indices.
(the table title makes it clear which column we are adding) Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Fix small docs issues. Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
since they are actually adding the column to the table Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
to avoid confunsion with the addColumn methods and better semantics Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
- Adds new AbstractTableColumn construtor that receives title, subtitle and format to make it easier to create columns. Accordingly add such a constructor to subclasses. - Enables changing format for time, length, ID and PE columns in CloudletsTableBuilder. This way, the dev can define his/her own default formats upfront. - Remove the public addColumn methods from Table interface and make then protected. Add newColumn methods that just create a column, instead of directly adding them to the table. - When new columns are created, they are added to a temporary list before being inserted into the actual table. Columns are added to the table just after calling build. This way, we can add columns any time and define the format for such columns without worring about the order of these method calls (as it's expected for a builder class). Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Hey @StruffelProductions Check my last commit 0998eab. Could you please try it? |
Are you really using these |
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
If column definitions are changed and the build method is called again, the list of colsMappings should be cleared before, to add columns again with new configurations. Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
of clearing to reduce computational complexity and avoid concurrency issues. Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Hi, these |
Great. So I'm removing them and merging the changes. Could you please update the example PR? |
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Yes, I will do that later. |
Signed-off-by: Manoel Campos <manoelcampos@gmail.com>
Thanks for your contributions. I've just merged them. |
I'm glad to provide something to the project. |
Fix #404
This PR introduces new methods for controlling the formatting in tables built using the
TableBuilderAbstract
class, such asCloudletsTableBuilder
. It also changes the default formatting behavior ofCloudletsTableBuilder
to deliver more precision by default and make potential rounding errors rarer and easier to spot.In
CloudletsTableBuilder.java
it removes a rounding method that is no longer needed and refactors the code in thecreateTableColumns()
method.In
TableBuilderAbstract.java
it introduces new methods that allow users to adjust the formatting of one or multiple columns using various selectors with methods that can be chained, following the example ofsetTitle()
.I have already prepared a new example scenario for this feature which will go in this separate PR to the cloudsimplus-example repo: cloudsimplus/cloudsimplus-examples#8