changeset 7947:397bbdd03f90

[Accessibility] Reduce method/field visibility
author Felipe Heidrich <felipe.heidrich@oracle.com>
date Tue, 02 Sep 2014 13:24:21 -0700
parents f98785bfc2f9
children e118f2891b38
files modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java modules/graphics/src/main/java/com/sun/glass/ui/win/WinTextRangeProvider.java modules/graphics/src/main/java/com/sun/glass/ui/win/WinVariant.java
diffstat 3 files changed, 91 insertions(+), 91 deletions(-) [+]
line wrap: on
line diff
--- a/modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java	Tue Sep 02 11:20:50 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/win/WinAccessible.java	Tue Sep 02 13:24:21 2014 -0700
@@ -206,8 +206,8 @@
     private int id;
 
     /* Text Support */
-    WinTextRangeProvider documentRange;
-    WinTextRangeProvider selectionRange;
+    private WinTextRangeProvider documentRange;
+    private WinTextRangeProvider selectionRange;
 
     /* The lastIndex is used by parents to keep track of the index of the last child
      * returned in Navigate. It is very common for Narrator to traverse the children
@@ -395,7 +395,7 @@
         }
     }
 
-    void notifyToggleState() {
+    private void notifyToggleState() {
         int state = get_ToggleState();
         WinVariant vo = new WinVariant();
         vo.vt = WinVariant.VT_I4;
@@ -545,7 +545,7 @@
     /***********************************************/
     /*        IRawElementProviderSimple            */
     /***********************************************/
-    long GetPatternProvider(int patternId) {
+    private long GetPatternProvider(int patternId) {
         if (isDisposed()) return 0;
         AccessibleRole role = (AccessibleRole)getAttribute(ROLE);
         boolean impl = false;
@@ -660,7 +660,7 @@
         return impl ? getNativeAccessible() : 0L;
     }
 
-    long get_HostRawElementProvider() {
+    private long get_HostRawElementProvider() {
         if (isDisposed()) return 0;
         /* 
          * Returning NULL makes this accessible 'lightweight',
@@ -670,7 +670,7 @@
         return view != null ? view.getNativeView() : 0;
     }
 
-    WinVariant GetPropertyValue(int propertyId) {
+    private WinVariant GetPropertyValue(int propertyId) {
         if (isDisposed()) return null;
         WinVariant variant = null;
         switch (propertyId) {
@@ -862,7 +862,7 @@
     /***********************************************/
     /*       IRawElementProviderFragment           */
     /***********************************************/
-    float[] get_BoundingRectangle() {
+    private float[] get_BoundingRectangle() {
         if (isDisposed()) return null;
         /* No needs to answer for the root */
         if (getView() != null) return null;
@@ -875,7 +875,7 @@
         return null;
     }
 
-    long get_FragmentRoot() {
+    private long get_FragmentRoot() {
         if (isDisposed()) return 0L;
         Scene scene = (Scene)getAttribute(SCENE);
         if (scene == null) return 0L;
@@ -884,12 +884,12 @@
         return acc.getNativeAccessible();
     }
 
-    long[] GetEmbeddedFragmentRoots() {
+    private long[] GetEmbeddedFragmentRoots() {
         if (isDisposed()) return null;
         return null;
     }
 
-    int[] GetRuntimeId() {
+    private int[] GetRuntimeId() {
         if (isDisposed()) return null;
 
         /* MSDN: Implementations should return NULL for a top-level element that is hosted in a window. */
@@ -922,7 +922,7 @@
         return getNativeAccessible(node);
     }
 
-    long Navigate(int direction) {
+    private long Navigate(int direction) {
         if (isDisposed()) return 0;
         AccessibleRole role = (AccessibleRole)getAttribute(ROLE);
         /* special case for the tree item hierarchy, as expected by Windows */
@@ -1053,7 +1053,7 @@
         return getNativeAccessible(node);
     }
 
-    void SetFocus() {
+    private void SetFocus() {
         if (isDisposed()) return;
         executeAction(AccessibleAction.REQUEST_FOCUS);
     }
@@ -1061,13 +1061,13 @@
     /***********************************************/
     /*     IRawElementProviderFragmentRoot         */
     /***********************************************/
-    long ElementProviderFromPoint(double x, double y) {
+    private long ElementProviderFromPoint(double x, double y) {
         if (isDisposed()) return 0;
         Node node = (Node)getAttribute(NODE_AT_POINT, new Point2D(x, y));
         return getNativeAccessible(node);
     }
 
-    long GetFocus() {
+    private long GetFocus() {
         if (isDisposed()) return 0;
         Node node = (Node)getAttribute(FOCUS_NODE);
         if (node == null) return 0L;
@@ -1079,21 +1079,21 @@
     /***********************************************/
     /*     IRawElementProviderAdviseEvents         */
     /***********************************************/
-    void AdviseEventAdded(int eventId, long propertyIDs) {
+    private void AdviseEventAdded(int eventId, long propertyIDs) {
         /* Implementing IRawElementProviderAdviseEvents ensures
          * that the window is announced by Narrator when it first
          * opens. No further action is required.
          */
     }
 
-    void AdviseEventRemoved(int eventId, long propertyIDs) {
+    private void AdviseEventRemoved(int eventId, long propertyIDs) {
         /* See AdviseEventAdded() */
     }
 
     /***********************************************/
     /*             IInvokeProvider                 */
     /***********************************************/
-    void Invoke() {
+    private void Invoke() {
         if (isDisposed()) return;
         executeAction(AccessibleAction.FIRE);
     }
@@ -1101,7 +1101,7 @@
     /***********************************************/
     /*           ISelectionProvider                */
     /***********************************************/
-    long[] GetSelection() {
+    private long[] GetSelection() {
         if (isDisposed()) return null;
 
         /* 
@@ -1159,7 +1159,7 @@
         return null;
     }
 
-    boolean get_CanSelectMultiple() {
+    private boolean get_CanSelectMultiple() {
         if (isDisposed()) return false;
         AccessibleRole role = (AccessibleRole)getAttribute(ROLE);
         if (role != null) {
@@ -1175,7 +1175,7 @@
         return false;
     }
 
-    boolean get_IsSelectionRequired() {
+    private boolean get_IsSelectionRequired() {
         if (isDisposed()) return false;
         //TODO: this may not be true...
         return true;
@@ -1184,7 +1184,7 @@
     /***********************************************/
     /*           IRangeValueProvider               */
     /***********************************************/
-    void SetValue(double val) {
+    private void SetValue(double val) {
         if (isDisposed()) return;
         AccessibleRole role = (AccessibleRole)getAttribute(ROLE);
         if (role != null) {
@@ -1198,7 +1198,7 @@
         }
     }
 
-    double get_Value() {
+    private double get_Value() {
         if (isDisposed()) return 0;
         if (Boolean.TRUE.equals(getAttribute(INDETERMINATE))) return 0;
         Double value = (Double)getAttribute(VALUE);
@@ -1208,7 +1208,7 @@
     /*
      * Note that this method is called by the IValueProvider also.
      */
-    boolean get_IsReadOnly() {
+    private boolean get_IsReadOnly() {
         if (isDisposed()) return false;
         AccessibleRole role = (AccessibleRole)getAttribute(ROLE);
         if (role != null) {
@@ -1224,24 +1224,24 @@
         return true;
     }
 
-    double get_Maximum() {
+    private double get_Maximum() {
         if (isDisposed()) return 0;
         Double value = (Double)getAttribute(MAX_VALUE);
         return value != null ? value : 0;
     }
 
-    double get_Minimum() {
+    private double get_Minimum() {
         if (isDisposed()) return 0;
         Double value = (Double)getAttribute(MIN_VALUE);
         return value != null ? value : 0;
     }
 
-    double get_LargeChange() {
+    private double get_LargeChange() {
         if (isDisposed()) return 0;
         return 10;//TODO
     }
 
-    double get_SmallChange() {
+    private double get_SmallChange() {
         if (isDisposed()) return 0;
         return 3;//TODO
     }
@@ -1249,7 +1249,7 @@
     /***********************************************/
     /*             IValueProvider                  */
     /***********************************************/
-    void SetValueString(String val) {
+    private void SetValueString(String val) {
         if (isDisposed()) return;
         AccessibleRole role = (AccessibleRole)getAttribute(ROLE);
         if (role != null) {
@@ -1263,7 +1263,7 @@
         }
     }
 
-    String get_ValueString() {
+    private String get_ValueString() {
         if (isDisposed()) return null;
         return (String)getAttribute(TEXT);
     }
@@ -1271,7 +1271,7 @@
     /***********************************************/
     /*          ISelectionItemProvider             */
     /***********************************************/
-    void Select() {
+    private void Select() {
         if (isDisposed()) return;
         AccessibleRole role = (AccessibleRole)getAttribute(ROLE);
         if (role != null) {
@@ -1298,22 +1298,22 @@
         }
     }
 
-    void AddToSelection() {
+    private void AddToSelection() {
         if (isDisposed()) return;
         changeSelection(true, false);
     }
 
-    void RemoveFromSelection() {
+    private void RemoveFromSelection() {
         if (isDisposed()) return;
         changeSelection(false, false);
     }
 
-    boolean get_IsSelected() {
+    private boolean get_IsSelected() {
         if (isDisposed()) return false;
         return Boolean.TRUE.equals(getAttribute(SELECTED));
     }
 
-    long get_SelectionContainer() {
+    private long get_SelectionContainer() {
         if (isDisposed()) return 0;
         WinAccessible acc = (WinAccessible)getContainer(); 
         return acc != null ? acc.getNativeAccessible() : 0L;
@@ -1322,17 +1322,17 @@
     /***********************************************/
     /*              ITextProvider                  */
     /***********************************************/
-    long[] GetVisibleRanges() {
+    private long[] GetVisibleRanges() {
         if (isDisposed()) return null;
         return new long[] {get_DocumentRange()};
     }
 
-    long RangeFromChild(long childElement) {
+    private long RangeFromChild(long childElement) {
         if (isDisposed()) return 0;
         return 0;
     }
 
-    long RangeFromPoint(double x, double y) {
+    private long RangeFromPoint(double x, double y) {
         if (isDisposed()) return 0;
         Integer offset = (Integer)getAttribute(OFFSET_AT_POINT, new Point2D(x, y));
         if (offset != null) {
@@ -1343,7 +1343,7 @@
         return 0;
     }
 
-    long get_DocumentRange() {
+    private long get_DocumentRange() {
         if (isDisposed()) return 0;
         if (documentRange == null) {
             documentRange = new WinTextRangeProvider(this);
@@ -1353,7 +1353,7 @@
         return documentRange.getNativeProvider();
     }
 
-    int get_SupportedTextSelection() {
+    private int get_SupportedTextSelection() {
         if (isDisposed()) return 0;
         /* Before this can be done extra API for multiple selection will be required. */
 //        if (Boolean.TRUE.equals(getAttribute(MULTIPLE_SELECTION))) {
@@ -1365,7 +1365,7 @@
     /***********************************************/
     /*             IGridProvider                   */
     /***********************************************/
-    int get_ColumnCount() {
+    private int get_ColumnCount() {
         if (isDisposed()) return 0;
         Integer count = (Integer)getAttribute(COLUMN_COUNT);
 
@@ -1376,13 +1376,13 @@
         return count != null ? count : 1;
     }
 
-    int get_RowCount() {
+    private int get_RowCount() {
         if (isDisposed()) return 0;
         Integer count = (Integer)getAttribute(ROW_COUNT);
         return count != null ? count : 0;
     }
 
-    long GetItem(int row, int column) {
+    private long GetItem(int row, int column) {
         if (isDisposed()) return 0;
         Node node = (Node)getAttribute(CELL_AT_ROW_COLUMN, row, column);
         return getNativeAccessible(node);
@@ -1391,24 +1391,24 @@
     /***********************************************/
     /*             IGridItemProvider               */
     /***********************************************/
-    int get_Column() {
+    private int get_Column() {
         if (isDisposed()) return 0;
         Integer result = (Integer)getAttribute(COLUMN_INDEX);
         return result != null ? result : 0;
     }
 
-    int get_ColumnSpan() {
+    private int get_ColumnSpan() {
         if (isDisposed()) return 0;
         return 1;
     }
 
-    long get_ContainingGrid() {
+    private long get_ContainingGrid() {
         if (isDisposed()) return 0;
         WinAccessible acc = (WinAccessible)getContainer();
         return acc != null ? acc.getNativeAccessible() : 0L;
     }
 
-    int get_Row() {
+    private int get_Row() {
         if (isDisposed()) return 0;
         Integer result = null;
         AccessibleRole role = (AccessibleRole) getAttribute(ROLE);
@@ -1425,7 +1425,7 @@
         return result != null ? result : 0;
     }
 
-    int get_RowSpan() {
+    private int get_RowSpan() {
         if (isDisposed()) return 0;
         return 1;
     }
@@ -1433,19 +1433,19 @@
     /***********************************************/
     /*               ITableProvider                */
     /***********************************************/
-    long[] GetColumnHeaders() {
+    private long[] GetColumnHeaders() {
         if (isDisposed()) return null;
        /* No support in JFX to return all columns with a single call */
        return null;
     }
 
-    long[] GetRowHeaders() {
+    private long[] GetRowHeaders() {
         if (isDisposed()) return null;
        /* No row header support on JFX */
        return null;
     }
 
-    int get_RowOrColumnMajor() {
+    private int get_RowOrColumnMajor() {
         if (isDisposed()) return 0;
         return RowOrColumnMajor_RowMajor;
     }
@@ -1453,7 +1453,7 @@
     /***********************************************/
     /*             ITableItemProvider              */
     /***********************************************/
-    long[] GetColumnHeaderItems() {
+    private long[] GetColumnHeaderItems() {
         if (isDisposed()) return null;
        Integer columnIndex = (Integer)getAttribute(COLUMN_INDEX);
        if (columnIndex == null) return null;
@@ -1464,7 +1464,7 @@
        return new long[] {getNativeAccessible(column)};
     }
 
-    long[] GetRowHeaderItems() {
+    private long[] GetRowHeaderItems() {
         if (isDisposed()) return null;
         /* No row header support on JFX */
        return null;
@@ -1473,12 +1473,12 @@
     /***********************************************/
     /*             IToggleProvider                 */
     /***********************************************/
-    void Toggle() {
+    private void Toggle() {
         if (isDisposed()) return;
         executeAction(AccessibleAction.FIRE);
     }
 
-    int get_ToggleState() {
+    private int get_ToggleState() {
         if (isDisposed()) return 0;
         if (Boolean.TRUE.equals(getAttribute(INDETERMINATE))) {
             return ToggleState_Indeterminate;
@@ -1490,7 +1490,7 @@
     /***********************************************/
     /*             IExpandCollapseProvider         */
     /***********************************************/
-    void Collapse() {
+    private void Collapse() {
         if (isDisposed()) return;
         AccessibleRole role = (AccessibleRole)getAttribute(ROLE);
         if (role == AccessibleRole.TOOL_BAR) {
@@ -1508,7 +1508,7 @@
         executeAction(AccessibleAction.COLLAPSE);
     }
 
-    void Expand() {
+    private void Expand() {
         if (isDisposed()) return;
         AccessibleRole role = (AccessibleRole)getAttribute(ROLE);
         if (role == AccessibleRole.TOOL_BAR) {
@@ -1526,7 +1526,7 @@
         executeAction(AccessibleAction.EXPAND);
     }
 
-    int get_ExpandCollapseState() {
+    private int get_ExpandCollapseState() {
         if (isDisposed()) return 0;
 
         AccessibleRole role = (AccessibleRole)getAttribute(ROLE);
@@ -1566,31 +1566,31 @@
     /***********************************************/
     /*             ITransformProvider              */
     /***********************************************/
-    boolean get_CanMove() {
+    private boolean get_CanMove() {
         return false;
     }
 
-    boolean get_CanResize() {
+    private boolean get_CanResize() {
         return false;
     }
 
-    boolean get_CanRotate() {
+    private boolean get_CanRotate() {
         return false;
     }
 
-    void Move(double x, double y) {
+    private void Move(double x, double y) {
     }
 
-    void Resize(double width, double height) {
+    private void Resize(double width, double height) {
     }
 
-    void Rotate(double degrees) {
+    private void Rotate(double degrees) {
     }
 
     /***********************************************/
     /*             IScrollProvider                 */
     /***********************************************/
-    void Scroll(int horizontalAmount, int verticalAmount) {
+    private void Scroll(int horizontalAmount, int verticalAmount) {
         if (isDisposed()) return;
 
         /* dealing with vertical scroll first */
@@ -1636,7 +1636,7 @@
         }
     }
 
-    void SetScrollPercent(double horizontalPercent, double verticalPercent) {
+    private void SetScrollPercent(double horizontalPercent, double verticalPercent) {
         if (isDisposed()) return;
 
         /* dealing with vertical scroll first */
@@ -1662,7 +1662,7 @@
         }
     }
 
-    boolean get_HorizontallyScrollable() {
+    private boolean get_HorizontallyScrollable() {
         if (isDisposed()) return false;
 
         Node hsb = (Node)getAttribute(HORIZONTAL_SCROLLBAR);
@@ -1672,7 +1672,7 @@
         return Boolean.TRUE.equals(visible);
     }
 
-    double get_HorizontalScrollPercent() {
+    private double get_HorizontalScrollPercent() {
         if (isDisposed()) return 0;
 
         if (!get_HorizontallyScrollable()) {
@@ -1695,7 +1695,7 @@
         return 0;
     }
 
-    double get_HorizontalViewSize() {
+    private double get_HorizontalViewSize() {
         if (isDisposed()) return 0;
         if (!get_HorizontallyScrollable()) return 100; /* MSDN spec */
         Node content = (Node) getAttribute(CONTENTS);
@@ -1707,7 +1707,7 @@
         return scrollPaneBounds.getWidth() / contentBounds.getWidth() * 100;
     }
 
-    boolean get_VerticallyScrollable() {
+    private boolean get_VerticallyScrollable() {
         if (isDisposed()) return false;
 
         Node vsb = (Node) getAttribute(VERTICAL_SCROLLBAR);
@@ -1717,7 +1717,7 @@
         return Boolean.TRUE.equals(visible);
     }
 
-    double get_VerticalScrollPercent() {
+    private double get_VerticalScrollPercent() {
         if (isDisposed()) return 0;
 
         if (!get_VerticallyScrollable()) {
@@ -1740,7 +1740,7 @@
         return 0;
     }
 
-    double get_VerticalViewSize() {
+    private double get_VerticalViewSize() {
         if (isDisposed()) return 0;
         if (!get_VerticallyScrollable()) return 100;
 
@@ -1786,7 +1786,7 @@
     /***********************************************/
     /*             IScrollItemProvider             */
     /***********************************************/
-    void ScrollIntoView() {
+    private void ScrollIntoView() {
         if (isDisposed()) return;
         AccessibleRole role = (AccessibleRole)getAttribute(ROLE);
         if (role == null) return;
--- a/modules/graphics/src/main/java/com/sun/glass/ui/win/WinTextRangeProvider.java	Tue Sep 02 11:20:50 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/win/WinTextRangeProvider.java	Tue Sep 02 13:24:21 2014 -0700
@@ -122,7 +122,7 @@
     /***********************************************/
     /*            ITextRangeProvider               */
     /***********************************************/
-    long Clone() {
+    private long Clone() {
         WinTextRangeProvider clone = new WinTextRangeProvider(accessible);
         clone.setRange(start, end);
 
@@ -133,18 +133,18 @@
         return clone.getNativeProvider();
     }
 
-    boolean Compare(WinTextRangeProvider range) {
+    private boolean Compare(WinTextRangeProvider range) {
         if (range == null) return false;
         return accessible == range.accessible && start == range.start && end == range.end;
     }
 
-    int CompareEndpoints(int endpoint, WinTextRangeProvider targetRange, int targetEndpoint) {
+    private int CompareEndpoints(int endpoint, WinTextRangeProvider targetRange, int targetEndpoint) {
         int offset = endpoint == TextPatternRangeEndpoint_Start ? start : end;
         int targetOffset = targetEndpoint == TextPatternRangeEndpoint_Start ? targetRange.start : targetRange.end;
         return offset - targetOffset;
     }
 
-    void ExpandToEnclosingUnit(int unit) {
+    private void ExpandToEnclosingUnit(int unit) {
         String text = (String)getAttribute(TEXT);
         if (text == null) return;
         int length = text.length();
@@ -224,12 +224,12 @@
         end = Math.max(start, Math.min(end, length));
     }
 
-    long FindAttribute(int attributeId, WinVariant val, boolean backward) {
+    private long FindAttribute(int attributeId, WinVariant val, boolean backward) {
         System.err.println("FindAttribute NOT IMPLEMENTED");
         return 0;
     }
 
-    long FindText(String text, boolean backward, boolean ignoreCase) {
+    private long FindText(String text, boolean backward, boolean ignoreCase) {
         if (text == null) return 0;
         String documentText = (String)getAttribute(TEXT);
         if (documentText == null) return 0;
@@ -250,7 +250,7 @@
         return result.getNativeProvider();
     }
 
-    WinVariant GetAttributeValue(int attributeId) {
+    private WinVariant GetAttributeValue(int attributeId) {
         WinVariant variant = null;
         switch (attributeId) {
             case UIA_FontNameAttributeId: {
@@ -303,7 +303,7 @@
         return variant;
     }
 
-    double[] GetBoundingRectangles() {
+    private double[] GetBoundingRectangles() {
         String text = (String)getAttribute(TEXT);
         if (text == null) return null;
         int length = text.length();
@@ -336,11 +336,11 @@
         return null;
     }
 
-    long GetEnclosingElement() {
+    private long GetEnclosingElement() {
         return accessible.getNativeAccessible();
     }
 
-    String GetText(int maxLength) {
+    private String GetText(int maxLength) {
         String text = (String)getAttribute(TEXT);
         if (text == null) return null;
         int endOffset = maxLength != -1 ? Math.min(end, start + maxLength) : end;
@@ -348,7 +348,7 @@
         return text.substring(start, endOffset);
     }
 
-    int Move(int unit, final int requestedCount) {
+    private int Move(int unit, final int requestedCount) {
         if (requestedCount == 0) return 0;
         String text = (String)getAttribute(TEXT);
         if (text == null) return 0;
@@ -452,7 +452,7 @@
         return actualCount;
     }
 
-    int MoveEndpointByUnit(int endpoint, int unit, final int requestedCount) {
+    private int MoveEndpointByUnit(int endpoint, int unit, final int requestedCount) {
         if (requestedCount == 0) return 0;
         String text = (String)getAttribute(TEXT);
         if (text == null) return 0;
@@ -557,7 +557,7 @@
         return actualCount;
     }
 
-    void MoveEndpointByRange(int endpoint, WinTextRangeProvider targetRange, int targetEndpoint) {
+    private void MoveEndpointByRange(int endpoint, WinTextRangeProvider targetRange, int targetEndpoint) {
         String text = (String)getAttribute(TEXT);
         if (text == null) return;
         int length = text.length();
@@ -577,25 +577,25 @@
         end = Math.max(start, Math.min(end, length));
     }
 
-    void Select() {
+    private void Select() {
         accessible.executeAction(AccessibleAction.SET_TEXT_SELECTION, start, end);
     }
 
-    void AddToSelection() {
+    private void AddToSelection() {
         /* Only possible for multi selection text view */
 //        accessible.executeAction(Action.ADD_TO_SELECTION, start, end);
     }
 
-    void RemoveFromSelection() {
+    private void RemoveFromSelection() {
         /* Only possible for multi selection text view */
 //        accessible.executeAction(Action.REMOVE_FROM_SELECTION, start, end);
     }
 
-    void ScrollIntoView(boolean alignToTop) {
+    private void ScrollIntoView(boolean alignToTop) {
         accessible.executeAction(AccessibleAction.SHOW_TEXT_RANGE, start, end);
     }
 
-    long[] GetChildren() {
+    private long[] GetChildren() {
         /* Not embedded object support currently */
         return new long[0];
     }
--- a/modules/graphics/src/main/java/com/sun/glass/ui/win/WinVariant.java	Tue Sep 02 11:20:50 2014 -0700
+++ b/modules/graphics/src/main/java/com/sun/glass/ui/win/WinVariant.java	Tue Sep 02 13:24:21 2014 -0700
@@ -25,7 +25,7 @@
 
 package com.sun.glass.ui.win;
 
-class WinVariant {
+final class WinVariant {
     static final int VT_EMPTY = 0;
     static final int VT_NULL  = 1;
     static final int VT_I2    = 2;