-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Make VirtualFlow's scrollBars optional #9
Comments
Here's a proposal: define interface Virtualized {
Val<Double> totalWidthEstimateProperty();
Val<Double> totalHeightEstimateProperty();
Var<Double> estimatedScrollXProperty();
Var<Double> estimatedScrollYProperty();
} that represents a virtualized component. Make class VirtualizedScrollPane<T extends Virtualized> extends Virtualized {
VirtualizedScrollPane(T content) { /* ... */ }
public T getContent() { /* ... */ }
// ...
}
I guess we can then rename |
If I'm understanding you correctly:
|
The current
|
Shouldn't VirtualizedScrollPane's generic be |
You are right, but then it should be |
Ok. That clarifies things. public interface Virtualized<T, C extends Cell<T, ?>> {
// scrolling API
Val<Double> totalWidthEstimateProperty();
Val<Double> totalHeightEstimateProperty();
Var<Double> estimatedScrollXProperty();
Var<Double> estimatedScrollYProperty();
void setEstimatedScrollX(double value);
void setEstimatedScrollY(double value);
double getEstimatedScrollX();
double getEstimatedScrollY();
void scrollXToPixel(double pixel);
void scrollYToPixel(double pixel);
// and other scrolling-related API....
// and API for other stuff that was in VirtualFlowContent and
// proxied via VirtualFlow (old names respectively)
C getCellFor(int itemIndex);
Optional<C> getCellIfVisible(int itemIndex);
Orientation getContentBias();
VirtualFlowHit<C> hit(double x, double y);
void show(double viewportOffset);
// and so on...
} |
No, the other API should not be there. Virtualized content doesn't have to be a flow of cells, as happens to be the case for |
Ok. Thanks for the clarification. So one would use something like the following code to do stuff: VirtualizedScrollPane vsPane = new VirtualizedScrollPane(VirtualFlow.createHorizontal(args));
vsPane.getContent().setEstimatedScrollX(40);
vsPane.getContent().show(30);
// or more likely...
VirtualFlow content = (VirtualFlow) vsPane.getContent()
content.cellToViewport(cell, bounds)
// etc.... |
Yes. I don't like type casting, though. |
Right. I was thinking in terms of generics, not an instance of a class that uses generics, which would thus know what class its generic value |
Since this was fixed in 842feb6, I'm closing this issue. |
Coming from FXMisc/RichTextFX#205, allow the option of not showing the horizontal and/or the vertical scrollBars.
Tomas already said in the above issue:
The text was updated successfully, but these errors were encountered: