Thread: [java-gnome-hackers] added getInverted and setInverted to Range
Brought to you by:
afcowie
From: Peter M. <Pet...@gm...> - 2009-05-09 10:05:19
|
Hi, I was working on my application and noticed that the getInverted and setInverted methods of the Range object were not yet implemented. I have attached a bundle containing these methods. This is my first patch. So I hope I have done everything right. ==> # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: pm...@xs...-20090509093901-cyme2g226ryy9kpw # target_branch: ../mainline # testament_sha1: e8bb6ba9b6eb85f1c8bf7878dce0e0ab552bfdf5 # timestamp: 2009-05-09 11:39:43 +0200 # source_branch: /tmp/additional_methods_range.patch # base_revision_id: an...@op...-20090504013017-\ # os042rakj9crt9si # # Begin patch === modified file 'src/bindings/org/gnome/gtk/Range.java' --- src/bindings/org/gnome/gtk/Range.java 2008-09-05 14:25:07 +0000 +++ src/bindings/org/gnome/gtk/Range.java 2009-05-09 09:39:01 +0000 @@ -33,7 +33,26 @@ } /** - * Retreive the value currently indicated by this Range instance. + * Retrieve the current value set by setInverted + */ + public boolean getInverted() { + return GtkRange.getInverted(this); + } + + /** + * Inverts the way the value changes when moving the slider + * + * Ranges normally move from lower to higher values as the slider + * moves from top to bottom or left to right. Inverted ranges have + * higher values at the top or on the right rather than on the + * bottom or left. + */ + public void setInverted(boolean setting){ + GtkRange.setInverted(this,setting); + } + + /** + * Retrieve the value currently indicated by this Range instance. * * @since 4.0.6 */ # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWRrMLgIAA0RfgGQQUXf//3Ki UgC//9/6YAZ/HPYAAAAAAAOYBNMAmQwABMEwAAA5gE0wCZDAAEwTAAABqp5pPKYk0AAAAAAA0ABp Uf6kg00ZNDQ0eo0DQMQADQZDmATTAJkMAATBMAAACqJNCaaNAmTRoJiYjICEyManpP1SqD2b+O3b 1tuuj+P+5pnganB1v5rh1zrj66fZ97NSNhKNKVM89fKq2IjdWVHbfNlW3Sgxa6EGZBoaOk+7OlMz Mfz+5+Krlihqyqs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mLXwxNj+3oxjiOembmQsiGnup1LVI5ybG5GFnby73TTc6jz9kLmDAvZj3qOtFTV9oic vCqqvz9y5YxC4zxmDUq00M8dSNhxjBuS2xGx1x5eCMyDQg0o7lx7kcW50rlsQeSay9zBSG7XZgNS Os+qLzh+rk1udDKi4udZjHFB9V8XO49TDVmi3nlQheaiyLhJVRFERg6zrQX25kJmISj/EO01cDYQ syz6VLU7YjHOlKDsdS25+SguiyI4uzKHPVG6P/MsWyOVijGOTk5I9rS4jT5P+sz4k5olSJ199GJL +nejsNEe6gpEfKNy9i2rjzdOCZQ/3pfFewSix6mGHJayGyzgt3CrujMiL5JR+yO+yGGOullV4viq H9ILVCU+p39Ot8JmfzNqpsPnGkKMEXM5oS8cw1WfGm+2bPerahyjvVVKi9uNcSvWzMotaWkzJItn 6LcrypeuMXs0WlqWiIsRglm4IUKSjaqxTU6XHVDaz6MWpGmE44mkKKBQriiwpWfE/po/h6oL0a1W l79M1fVFVGpG0oj5Xyc0aMX41+j/4u5IpwoSA1mFwEA= <== If you have comments please let me know. Peter |
From: Andrew C. <an...@op...> - 2009-05-09 12:55:18
|
On Sat, 2009-05-09 at 12:00 +0200, Peter Mosseveld wrote: > I have attached a bundle containing these methods. Hey, lovely. > This is my first > patch. So I hope I have done everything right. Just some minor details that come under "style" and "consistency" > - * Retreive the value currently indicated by this Range instance. > + * Retrieve the value currently indicated by this Range instance. Thanks for fixing the spelling :) > + * Retrieve the current value set by setInverted When you need to refer to another method, use a @link tag. In this case, ... yada blah yada {@link #setInverted(boolean) setInverted()} yada yada blah blah... As a very high level thing, rather than saying "Get the value" try something more specific, perhaps "Get whether or not the rate scale of this Range is inverted; see {@link ...}." [I have often skipped bothering to write a getter simply because, well, you wrote the code, and you know full well whether you changed it from the default or not. But that's just me; nothing wrong with exposing a getter if you need it and/or are willing to put the work in to offer it] > + /** > + * Inverts the way the value changes when moving the slider > + * > + * Ranges normally move from... You need a <p> tag in there if you are trying to start a new paragraph. Otherwise the whitespace is swallowed (as you'd expect with HTML as the end result). > + * ...higher values at the top or on the right rather than on the > + * bottom or left. > + */ Please add a @since tag. Assume your patch will be accepted and in the next release :) For example, the latest release was 4.0.11; 'mainline' says it is 4.0.12-dev right now; assume you'll be in 4.0.12 and put * @since 4.0.12 This has the wonderful effect of saving the maintainer the trouble of adding it for you, and anything that saves the maintainer trouble is well regarded :). So maybe just touch up those things and then we can merge it! AfC Sydney P.S. I find it a bit easier if you include a bundle as an attachment rather than inline, but that's just me. |
From: Peter M. <Pet...@gm...> - 2009-05-09 15:30:16
Attachments:
additional_methods_range.patch
|
Hi Andrew, Thanks for your comments. I have now reworked my patch to incorporate your comments. I have attached the bundle to my mail. I hope it is now ready to be merged. Regards Peter Andrew Cowie wrote: > On Sat, 2009-05-09 at 12:00 +0200, Peter Mosseveld wrote: >> I have attached a bundle containing these methods. > > Hey, lovely. > >> This is my first >> patch. So I hope I have done everything right. > > Just some minor details that come under "style" and "consistency" > >> - * Retreive the value currently indicated by this Range instance. >> + * Retrieve the value currently indicated by this Range instance. > > Thanks for fixing the spelling :) > >> + * Retrieve the current value set by setInverted > > When you need to refer to another method, use a @link tag. In this case, > > ... yada blah yada {@link #setInverted(boolean) setInverted()} > yada yada blah blah... > > > As a very high level thing, rather than saying "Get the value" try > something more specific, perhaps "Get whether or not the rate scale of > this Range is inverted; see {@link ...}." > > [I have often skipped bothering to write a getter simply because, well, > you wrote the code, and you know full well whether you changed it from > the default or not. But that's just me; nothing wrong with exposing a > getter if you need it and/or are willing to put the work in to offer it] > >> + /** >> + * Inverts the way the value changes when moving the slider >> + * >> + * Ranges normally move from... > > You need a <p> tag in there if you are trying to start a new paragraph. > Otherwise the whitespace is swallowed (as you'd expect with HTML as the > end result). > >> + * ...higher values at the top or on the right rather than on the >> + * bottom or left. >> + */ > > Please add a @since tag. Assume your patch will be accepted and in the > next release :) For example, the latest release was 4.0.11; 'mainline' > says it is 4.0.12-dev right now; assume you'll be in 4.0.12 and put > > * @since 4.0.12 > > This has the wonderful effect of saving the maintainer the trouble of > adding it for you, and anything that saves the maintainer trouble is > well regarded :). > > So maybe just touch up those things and then we can merge it! > > AfC > Sydney > > P.S. I find it a bit easier if you include a bundle as an attachment > rather than inline, but that's just me. > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------------ > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your > production scanning environment may not be a perfect world - but thanks to > Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 > Series Scanner you'll get full speed at 300 dpi even with all image > processing features enabled. http://p.sf.net/sfu/kodak-com > > > ------------------------------------------------------------------------ > > _______________________________________________ > java-gnome-hackers mailing list > jav...@li... > https://lists.sourceforge.net/lists/listinfo/java-gnome-hackers |
From: Andrew C. <an...@op...> - 2009-05-10 00:06:29
|
On Sat, 2009-05-09 at 17:29 +0200, Peter Mosseveld wrote: > I have now reworked my patch to incorporate your comments. I have > attached the bundle to my mail. Merged to 'mainline' AfC Sydney |