AlloyTools / org.alloytools.alloy

Alloy is a language for describing structures and a tool for exploring them. It has been used in a wide range of applications from finding holes in security mechanisms to designing telephone switching networks. This repository contains the code for the tool.
Other
694 stars 123 forks source link

Add split panes for text, table and tree view #193

Closed grayswandyr closed 4 months ago

grayswandyr commented 1 year ago

Currently we have a split view for the graphical depiction of consecutive states in the Visualizer, but not for the text, table and tree views. Diff-like colors would even be nice in these views (at least the text one).

nmacedo commented 1 year ago

Very basic implementation for text and table views for 6.2:

Screenshot 2023-04-14 at 19 10 59 Screenshot 2023-04-14 at 19 10 49
grayswandyr commented 1 year ago

@nmacedo thank you so much, you rock! Can you point me to the commit implementing this?

pkriens commented 1 year ago

This great! I can adapt the drawings of the box to use constant vertical space & ordering so the stay on the same place.

nmacedo commented 1 year ago

@nmacedo thank you so much, you rock! Can you point me to the commit implementing this?

It's here. It's nothing fancy, it just tests if the line/table was present in the previous state.

grayswandyr commented 1 year ago
nmacedo commented 1 year ago
  • When a piece of highlighted text is selected, its color doesn't change. After a quick web search, it seems like there's a way to make selection of highlighted text visible...?

I'll look into it.

  • The diff could be finer-grained by only highlighting added and removed atoms (in red and green, à la git diff). I could implement a diffing algorithm returning the list of added and removed atoms per relation; however I think it'd be better to pass valuations rather than strings as parameters (I just need to know what Java type has been defined for valuations in Alloy?).

That would be great, but would require changing the code a bit. Currently the text/table views don't really store any information about the instance, they are just passed a string to be displayed.