mabe02 / lanterna

Java library for creating text-based GUIs
GNU Lesser General Public License v3.0
2.24k stars 243 forks source link

some base level additions and minor cleanup and window title bar drag ability #498

Closed ginkoblongata closed 4 years ago

ginkoblongata commented 4 years ago

This PR represents commonality sliced out of the PR of the ScrollPanel stuff.

Once this makes it through, I'll put in a PR for the ImageComponent, then another PR for the SplitPanel.

I think then the ScrolPanel PR will be hopefully on topic specifically enough.

Thanks!

mabe02 commented 4 years ago

Looks like we can merge this with a few tweaks. For some of the bigger changes in the other PR, I think we want to target master (3.2). But let's see, one PR at a time.

ginkoblongata commented 4 years ago

Ok, I think this is ready for next round. Once this is through, I think I can slice out the ImageComponent with pretty much cleanly for another PR.

avl42 commented 4 years ago

Since which Java version can keyword "default" be used in that context?

ginkoblongata notifications@github.com schrieb am Sa., 11. Juli 2020, 20:48:

@ginkoblongata commented on this pull request.

In src/main/java/com/googlecode/lanterna/gui2/Window.java https://github.com/mabe02/lanterna/pull/498#discussion_r453223230:

@@ -180,6 +181,13 @@ public String toString() { @Override void invalidate();

+

  • default TerminalRectangle getBounds() {

I've updated with some javadocs.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mabe02/lanterna/pull/498#discussion_r453223230, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABIDBMUXHQV5HCPNUCBOGOTR3CXWDANCNFSM4OKURVAA .

jrb0001 commented 4 years ago

Java 8 introduced the default keyword on interface methods.

ginkoblongata commented 4 years ago

Yes, also, by adding to the interface like that with the 'default' it makes it so that existing implementations of the interface can continue to work as is. I tend to use that feature sparingly but it works out well for that.

I am hoping this PR will make it in. I have a bunch of thoughts of potential rearrangement type breaking changes for Lanterna but I'd like to keep with the non breaking addition type stuff for now before focusing on that discussion. I think I've been leaning towards brevity for these but could go into more full context details.

mabe02 commented 4 years ago

Alright, that is now merged into 3.1