Monday, 22 August 2016

Complete List of Features Implemented

Hi everyone,

Google Summer of Code is ending and its time to let all know what all was done in this amazing 3 months of coding...so here is goes..

1)  Default Column-Header and Row-Header



 This is a example of a standard table which can be formed by running the code

-> columnHeader = [" " "C1" "C2" "C3" ];
-> rowHeader = ["R1" "R2"]';
-> colData_1= ["1" "1"]';
-> colData_2  = ["2" "2"];
-> colData_3 = ["3" "3"];
-> table = [columnHeader; [ rowHeader colData_1 colData_2  colData_3 ]]
-> ut = uicontrol("style","table",..
               "string",table,..
               "position",[5 as(2)-100 300 87])


The row-header and column-header are provided by user.

Now user also has the facility to leave the column/row headers blank and default values will automatically be displayed in place of rows and columns.

                                        

This can be achieved in the following way:

-> columnHeader = ["" "" "" "" ];
-> rowHeader = ["" ""]';
-> colData_1= ["1" "1"]';
-> colData_2  = ["2" "2"];
-> colData_3 = ["3" "3"];
-> table = [columnHeader; [ rowHeader colData_1 colData_2  colData_3 ]]
-> ut = uicontrol("style","table",..
               "string",table,..
               "position",[5 as(2)-100 300 87])

The column-header has default values from " A..Z - AA..ZZ  " while the row-header has values from 1 to n where n is number of rows,

User can now also provide column/ row label for specific column/row respectively.

                                               


-> columnHeader = ["" "" "c2" "" ]; -> rowHeader = ["R1" ""]'; -> colData_1= ["1" "1"]'; -> colData_2 = ["2" "2"];
-> colData_3 = ["3" "3"];
-> table = [columnHeader; [ rowHeader colData_1 colData_2 colData_3 ]]
-> ut = uicontrol("style","table",.. "string",table,.. "position",[5 as(2)-100 300 87])

User can also mention just the column header or just the row header.

Value of data in the cell can be changed via double clicking the particular cell and changing the data, or setting the data value in cell programmatically.

PS: Any change in the table through gui will automatically reflect in table's data string which can be seen programmatically using string property of uitable handle

-> table_handle.string

2) Tool-tips

Initially the Tool-tip property was just displayed on hovering the top-left corner.

Now the user can set tooltip for each and every cell including column headers.

To make the value of each cell as the tooltip one can simply set the tooltip property of Scilab uitable handle equal to "values".



This can be done simply by following code:

-> ut.tooltipstring = "values";

User can also mention specific tooltip for column-header and table cell.



This could be done simply by following code:

-> ut.tooltipstring = ["tooltip1" "tooltip2" "tooltip3" "tooltip4" "tooltip5" "tooltip6"];

Empty strings can be passed in the tooltip matrix to not display tooltip for that particular cell or header.

-> ut.tooltipstring = ["" "" "tooltip3" "tooltip4" "" "tooltip6"];

Note: There are no tooltips for row-headers.

3) Interactive Features

User can now add a new row at the end of table or remove a particular row not only programmatically but through GUI as well.

User can click any cell of row which has to be removed and then right click the selected cell and select remove row from the pop up appeared.

The above image shows how through GUI user can remove a particular row.




PS: Any change in the table will automatically reflect in table's data string which can be seen programmatically using string property of uitable handle

-> table_handle.string

4)  Sorting Table

 Users can now sort the complete table both programmatically and through GUI. The below figure is a example table on which I will be demonstrating sorting.



By default single column sorting is enabled for the uiTable i.e on clicking column headers that particular column is sorted.

For example clicking the first column would sort the column in descending order.



Re-clicking the same column will sort the column in opposite order.

User can sort the complete table with respect to particular column (Including the Row Headers) by first disabling " singlecolumnsortable " property of uitable

-> ut.singlecolumnsortable  = "off";

Once disabled on clicking the column-header of any column will sort the complete table with respect to that column (Including Row Headers).



As shown in the above figure the other columns are sorted with respect to the 1rst column. The row-headers are also rearranged according to 1rst column. The small symbol near the column name displays the sort order.

There might be cases when there would be a need to keep the row-headers fixed while sorting the rest of them table. This can be achieved using "rowheaderfix" property of uitable.

-> ut.rowheaderfix = "on";



And the result is as expected :)

If default values for row header is used then the default values will not be sortable (in built rowheaderfix is on )



To sort a particular column programmatically user can use sort function.

-> sort(ut, "1", "Ascending");
OR
-> ut.sortcolumn = ["1" "Ascending"];

Param: 1) ut is the table handle
            2) "1" is the column number. (C1)
            3) "Ascending"  Sort order.


PS: Any change in the table will automatically reflect in table's data string which can be seen programmatically using string property of uitable handle

-> table_handle.string

5) Horizontal/Vertical Alignment

Users can now set horizontal and vertical alignment to cell data of complete table or cell data of particular column.

Setting alignment to cell data of the complete table will be done via :

//Horizontal Alignment

-> ut.horizontalalignment = "center"

Values that can be given as input are : left | center | right

                                       

Similarly :

//Vertical Alignment

-> ut.verticalalignment = "top"

Values that can be given as input are : top|middle|bottom

Column Alignment:

User can specify horizontal/vertical alignment for cell data in particular column.

It can be achieved through:

-> columnNmuber = "1"
-> ut.horizontalcolumnalignment = [ columNumber "right" ]



User can also  specify class for each column in uitable

-> columnClass = ["integer" "integer" "integer"]
-> ut.columnclass = columnClass

Specifying Column class will change the alignment according to JTable policies of column Alignment.



The above figure is result of the setting class of each column as Integer.

6) Single Cell Selection

Initially user were not allowed to select a single cell instead the complete row was selected. Now the user can select each cell and can make multiple cell selections.

                                          

Single Cell selection can be seen in all the mentioned examples.

7) Font and background/foreground color 

User can now change foreground/background color of the complete table or for each cell individually

For the complete table user can use the backgroundcolor/foregroundcolor property of uitable

-> ut.backgroundcolor = [0.5,1,1]



Similarly for a fore-ground color.

For a particular cell user can use the cellbackgroundcolor/cellforegroundcolor property of uitable

-> row_number = "1"
-> column_number = "1"
-> color = "[0.5,1,1]"
-> ut.cellbackgroundcolor = [color row_number column_number]

                                         

User can also make font changes to data of cell or of complete table.

User can change the font color, font name, font weight and font size.

For example to change font size of complete table, user can:

-> ut.fontsize = 25

                                            

For particular cell user can:

-> row_number = "1"
-> column_number = "1"
-> size = "25"
-> ut.cellbackgroundcolor = [size row_number column_number]

                                              


_______________________________________________________

Following is the link to view all my commits to code-review in Scilab:

Commit Details









Thursday, 30 June 2016

Strings Update

A bit late

These are new update as per guidance.



As shown in the above figure , When the user does not mention any column headers or row headers then a default value is assigned. For column headers its from A-Z continuing from AA-ZZ and for row header its from 1-n where n is number of rows.

As shown in the below figure if the column headers are already provided then the values of the column headers are taken as it is and if the row headers are not provided then the row headers are set to default value from 1-N Where N is number of rows.




RJ

Monday, 13 June 2016

End of 3rd Week: Strings and Tooltips

Hi all,

Posting after almost 2 weeks. 3rd Week of GSoC has passed and everyone are working on full potential.

In the second week I was working on Tool-tips but had few confusions regarding what exactly is needed or would be accepted by user. After a brief discussion with mentors I got a clear Idea and I implemented the required tweaks.

Starting with Strings:



This is the initial state of the table

After moving a column and then checking the string/data of the table:



On changing the the column position, the position of data in the string also changes.

Moving on to Tool-tips:

Simply assigning tooltip to the each cell by passing a matrix of String values.



On changing the column position the tooltip assigned to particular cell remains intact with that cell.




As per discussion on passing the value->"values": the value of data in each cell becomes the value of tooltip for that cell. This also stand for column header and each cell in the main table


Note: For now I have not implemented tooltips for rowheader because I need to provide a functionality where user can decide whether table should have rowheader or not. So I will provide the tooltips for rowheader when I work on that functionality.

To pass tooltip for column header one has to pass a flag at the beginning of the tooltip matrix to assign tooltips to the column header. On changing the position of column the tooltips remain intact with the cell they were assigned to.


On passing the  flag columnheader-values the values of data of each cell becomes the tooltips of that cell.



These are some the tweaks I have been working on lately. Some other functionality that I have already implemented are sorting which I will demonstrate in the next blog

Thanks for reading, stay tuned :)

RJ

Thursday, 2 June 2016

Tooltips

  Hi again,

Welcome to the era of tooltips, this post is in regard to the discussion on the developer mailing list.

As per my understanding of the advice given by mentors I produced the following result.

Case 1: When no string is passed:

                                   

                               

During the Creation of uicontrol object tooltipstring is initialized to default "";

                                 

No tooltip is displayed.

Case 2:  Special character is passed, instead of passing all the data I have used a special character "~"

so if "~" is passed like var.tooltipstring="~" then the tooltip will display the value in that cell as the tooltip.


TooltipString is set to the special charater;

David suggested to pass the complete matrix of data that is passed for the table, but it may lead to some futile computation and as java provides direct method of setting the tooltip to the value of cell I just used this to my advantage and avoided the computation. I can change the speacial character to any other character.Please suggest if it suits the need.











The Value of Cell is displayed in the tooltip.

Case 3:  When a matrix is passed

Since the function TooltipText excepts only Strings so anything passed to the TooltipString is considered as string and hence I use deliminator to separate each value,

ut.tooltipstring="[a,b,c,d]"
or
ut.tooltipstring="[a,,c,d]"

in the second case, the value of cell will only be displayed as a tooltip for that particular cell.


David suggested

ut.tooltipstring=["a" "b" "c" "d"]

So I have added the functionality where one can also input data in this fashion.

                              

I hope this post might make the discussion easier.

RJ


Monday, 30 May 2016

End of 1rst week

Hi, and welcome back!

This week I realized the Time actually Flies, with the blink of an eye the 1rst week is already over,luckily my task for this week were not too challenging so I was able to complete them.

I had three task set for this week.

1) Updating the string of uitable with change in the contents of cell in the table
2) Enabling and Disabling the uicontrol
3)  Restructuring the helper pages

1rst task was very well done by Caio, the rest two I have completed, I have created helper pages for table styles but I wanted to discuss with my mentors before commiting.

The next week is a bit tedious as I need to work on gateways and  make modifications to present implementation of tooltips, so I have started from today itself, I pretty sure I will be able to complete things on time.

Again keeping it short, Hoping for a good coding week ahead.

Stay tuned

RJ

Monday, 23 May 2016

Week 1!!- Hacking Begins


" The Beginning is the most important part of  the work " -Plato

After a long month of exams finally I am back to coding, luckily I am on time with the coding period beginning from today.

I will start this project by first revising all the work I am supposed to do since I have been a bit out of touch. I have aimed at completing few fixes with the UI this week so I will get straight to that.

Well this is my first blog for this GSoC so I am going to keep this short (very short), I will keep blogging in between and make things interesting.


Stay Tuned for the next session of awesomeness :)


RJ