Closed VakhoQ closed 3 years ago
Hi @VakhoQ, thanks for your pull request.
I will look at it a bit closer as soon as I find time for it. That could last a bit though, I am pretty busy at the moment.
Best, Stefan
@vandeseer Hi. Let me ask you if you had chance to look into the pull request?
Hey @VakhoQ,
I am really sorry not having had a look earlier!
There are some general remarks I have now after a first look: As you already said there is a lot of casting going on and it feels a bit hacky the way it is implemented right now. Reason being that is implemented within TextCell
. What I mean by "hacky" is:
if(cell instanceof TextCell){
TextCell textCell = (TextCell) cell;
if(textCell.hasSuperScript()){
textCell= textCell.getSuperScript();
textCell.getSettings().fillingMergeBy(row.getSettings());
}
}
This is not very elegant. So I would suggest the following approach: Why not using a cell type of its own? E.g. SuperScriptCell
or maybe (to be a bit more generic and allow for further similar changes): ExtendedTextCell
or something similar.
Then there is no need for such casts on the one hand side and and secondly it's implementation is more independent. There would be some kind of "basic text cell" and another one that is all of that plus some extras.
Closed due to https://github.com/vandeseer/easytable/pull/125
I added functionality for SuperScritp.
Usage:
By default textRise is 0.
Note, right now only TextCell supports this functionality. In the future , I think we need abstract methods in the AbstractTextCell to avoid casting and checking instances:
Under the hood we have the following:
contentStream.setTextRise(styledText.getTextRise());
Additionally, I add logic to move text to the next line if super-text does not fit to the current column.