Closed wsbrenk closed 2 months ago
@tychobrailleur I really have no idea if a TableModelListener is better than a MouseListener. So I need your advice.
In version 9 we could really think about whether we can bring the confusingly many different tables of the HO to a common (Kotlin) solution.
@tychobrailleur I really have no idea if a TableModelListener is better than a MouseListener. So I need your advice.
For sorting, a MouseListener
would be more appropriate, as it is invoked in reaction to a click. A TableModelListener
would react to any change to the model backing the table, so it could be anything, even things other than a click.
If I remember correctly, sorting in HO is done in a very custom way, which doesn't use the JTable
facilities (i.e. TableRowSorter
), but I think this is because of the very complex things like the split table players' name / rest of attributes.
What problem are you trying to solve here?
In version 9 we could really think about whether we can bring the confusingly many different tables of the HO to a common (Kotlin) solution.
Yes, agreed, we could do with a bit of consistency, and unify into a generic component that would make maintenance a bit easier!
@tychobrailleur In https://github.com/ho-dev/HattrickOrganizer/issues/744#issuecomment-715419003 Jannis recommends using a tableModelListener - so i tried my very best, but i'm not sure if it is a better solution than the previous.
@tychobrailleur In #744 (comment) Jannis recommends using a tableModelListener - so i tried my very best, but i'm not sure if it is a better solution than the previous.
Ah fair enough, if the expert says so! ;-)
Let me have a closer look, then... But I sympathise with your “Widerstreben”!
Sorry for the delay, I'm looking into this tonight.
I have had a closer a look at the thread at #744 , and I think it makes sense to use a TableModelListener
here: I had not fully grasped that the click was not a click to act on the table itself (for sorting), but for a value in the table (the state of that unselectable feature). So the way you have it is good.
One thing I am not sure is the behaviour of the Best Position feature. In the Squad tab, I pick two consecutive players and mark them both as Keeper in the override, but only one appears as manually overridden in the Lineup tab
Probably a separate issue...
Probably a separate issue...
i can not reproduce this - Are you sure you selected the same player?
Now i think i see, what you were doing. The second player you selected is your trainer i think. This player is not displayed in the lineup panel if he can no longer play in the team.
Now i think i see, what you were doing. The second player you selected is your trainer i think. This player is not displayed in the lineup panel if he can no longer play in the team.
Should he appear in the table of players in the Lineup tab, then, if that's the case? Or should we make it “unselectable“ by default, without a way to override?
changes proposed in this pull request:
src/main/resources/release_notes.md
...[Optional] suggested person to review this PR @tychobrailleur