From 035cb6e7a4fb61f5b76f37f53a944bf930ef4b98 Mon Sep 17 00:00:00 2001 From: Jonathan Feinberg Date: Sun, 4 May 2014 12:38:29 -0400 Subject: [PATCH] Add methods for reading and manipulating horizontal scollbars in text editor. Deprecate old methods to prefer methods with Vertical/Horizontal in their names. --- .../processing/app/syntax/JEditTextArea.java | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/app/src/processing/app/syntax/JEditTextArea.java b/app/src/processing/app/syntax/JEditTextArea.java index 60bfad38a..ff8ef48d1 100644 --- a/app/src/processing/app/syntax/JEditTextArea.java +++ b/app/src/processing/app/syntax/JEditTextArea.java @@ -192,20 +192,50 @@ public class JEditTextArea extends JComponent /** * Get current position of the vertical scroll bar. [fry] + * @deprecated Use {@link #getVerticalScrollPosition()}. */ public int getScrollPosition() { - return vertical.getValue(); + return getVerticalScrollPosition(); } /** * Set position of the vertical scroll bar. [fry] + * @deprecated Use {@link #setVerticalScrollPosition(int)}. */ public void setScrollPosition(int what) { - vertical.setValue(what); + setVerticalScrollPosition(what); + } + + /** + * Get current position of the vertical scroll bar. + */ + public int getVerticalScrollPosition() { + return vertical.getValue(); } + /** + * Set position of the vertical scroll bar. + */ + public void setVerticalScrollPosition(int what) { + vertical.setValue(what); + } + + /** + * Get current position of the horizontal scroll bar. + */ + public int getHorizontalScrollPosition() { + return horizontal.getValue(); + } + + /** + * Set position of the horizontal scroll bar. + */ + public void setHorizontalScrollPosition(int what) { + horizontal.setValue(what); + } + /** * Returns the object responsible for painting this text area. */