[orca/570658-whereami] Remove the whereAmI for the Java Access Bridge.



commit 6fec944512f3393c5d6b654db0a67309c62a29d4
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Mon Jun 8 21:09:34 2009 -0400

    Remove the whereAmI for the Java Access Bridge.
---
 .../toolkits/J2SE-access-bridge/Makefile.am        |    3 +-
 .../toolkits/J2SE-access-bridge/__init__.py        |    1 -
 .../scripts/toolkits/J2SE-access-bridge/script.py  |    6 --
 .../J2SE-access-bridge/speech_generator.py         |   15 +++++
 .../toolkits/J2SE-access-bridge/where_am_I.py      |   55 --------------------
 5 files changed, 16 insertions(+), 64 deletions(-)

diff --git a/src/orca/scripts/toolkits/J2SE-access-bridge/Makefile.am b/src/orca/scripts/toolkits/J2SE-access-bridge/Makefile.am
index a322361..c2025fa 100644
--- a/src/orca/scripts/toolkits/J2SE-access-bridge/Makefile.am
+++ b/src/orca/scripts/toolkits/J2SE-access-bridge/Makefile.am
@@ -5,8 +5,7 @@ orca_python_PYTHON = \
 	braillegenerator.py \
 	formatting.py \
 	script.py \
-	speech_generator.py \
-	where_am_I.py
+	speech_generator.py
 
 orca_pythondir=$(pyexecdir)/orca/scripts/toolkits/J2SE-access-bridge
 
diff --git a/src/orca/scripts/toolkits/J2SE-access-bridge/__init__.py b/src/orca/scripts/toolkits/J2SE-access-bridge/__init__.py
index 325b44a..c9714a9 100644
--- a/src/orca/scripts/toolkits/J2SE-access-bridge/__init__.py
+++ b/src/orca/scripts/toolkits/J2SE-access-bridge/__init__.py
@@ -1,4 +1,3 @@
 from script import Script
 from speech_generator import SpeechGenerator
 from braillegenerator import BrailleGenerator
-from where_am_I import WhereAmI
diff --git a/src/orca/scripts/toolkits/J2SE-access-bridge/script.py b/src/orca/scripts/toolkits/J2SE-access-bridge/script.py
index 5e3a540..e41d374 100644
--- a/src/orca/scripts/toolkits/J2SE-access-bridge/script.py
+++ b/src/orca/scripts/toolkits/J2SE-access-bridge/script.py
@@ -34,7 +34,6 @@ import orca.keybindings as keybindings
 from braillegenerator import BrailleGenerator
 from speech_generator import SpeechGenerator
 from formatting import Formatting
-from where_am_I import WhereAmI
 
 ########################################################################
 #                                                                      #
@@ -52,11 +51,6 @@ class Script(default.Script):
         """
         default.Script.__init__(self, app)
 
-    def getWhereAmI(self):
-        """Returns the "where am I" class for this script.
-        """
-        return WhereAmI(self)
-
     def getBrailleGenerator(self):
         """Returns the braille generator for this script.
         """
diff --git a/src/orca/scripts/toolkits/J2SE-access-bridge/speech_generator.py b/src/orca/scripts/toolkits/J2SE-access-bridge/speech_generator.py
index 19a78a7..ef0c1a8 100644
--- a/src/orca/scripts/toolkits/J2SE-access-bridge/speech_generator.py
+++ b/src/orca/scripts/toolkits/J2SE-access-bridge/speech_generator.py
@@ -23,6 +23,8 @@ __date__      = "$Date$"
 __copyright__ = "Copyright (c) 2005-2009 Sun Microsystems Inc."
 __license__   = "LGPL"
 
+import pyatspi
+
 import orca.speech_generator as speech_generator
 
 ########################################################################
@@ -49,3 +51,16 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
             self, obj, **args)
         del args['requireText']
         return result
+
+    def generateSpeech(self, obj, **args):
+        result = []
+        if args.get('formatType', 'unfocused') == 'basicWhereAmI' \
+           and obj.getRole() == pyatspi.ROLE_TEXT:
+            spinbox = self._script.getAncestor(obj,
+                                               [pyatspi.ROLE_SPIN_BUTTON],
+                                               None)
+            if spinbox:
+                obj = spinbox
+        result.extend(speech_generator.SpeechGenerator.\
+                                       generateSpeech(self, obj, **args))
+        return result
diff --git a/src/orca/scripts/toolkits/J2SE-access-bridge/where_am_I.py b/src/orca/scripts/toolkits/J2SE-access-bridge/where_am_I.py
deleted file mode 100644
index 53bb989..0000000
--- a/src/orca/scripts/toolkits/J2SE-access-bridge/where_am_I.py
+++ /dev/null
@@ -1,55 +0,0 @@
-# Orca
-#
-# Copyright 2006-2008 Sun Microsystems Inc.
-#
-# This library is free software; you can redistribute it and/or
-# modify it under the terms of the GNU Library General Public
-# License as published by the Free Software Foundation; either
-# version 2 of the License, or (at your option) any later version.
-#
-# This library is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-# Library General Public License for more details.
-#
-# You should have received a copy of the GNU Library General Public
-# License along with this library; if not, write to the
-# Free Software Foundation, Inc., Franklin Street, Fifth Floor,
-# Boston MA  02110-1301 USA.
-
-__id__        = "$Id$"
-__version__   = "$Revision$"
-__date__      = "$Date$"
-__copyright__ = "Copyright (c) 2005-2008 Sun Microsystems Inc."
-__license__   = "LGPL"
-
-import pyatspi
-
-import orca.where_am_I as where_am_I
-
-########################################################################
-#                                                                      #
-# Custom WhereAmI                                                      #
-#                                                                      #
-########################################################################
-
-class WhereAmI(where_am_I.WhereAmI):
-    def __init__(self, script):
-        where_am_I.WhereAmI.__init__(self, script)
-
-    def whereAmI(self, obj, basicOnly):
-        """Calls the base class method for basic information and Java
-        specific presentation methods for detailed/custom information.
-        """
-
-        # If we're in the text area of a spin button, then we'll do the
-        # where am I for the spin button.
-        #
-        if obj and obj.getRole() == pyatspi.ROLE_TEXT:
-            spinbox = self._script.getAncestor(obj,
-                                               [pyatspi.ROLE_SPIN_BUTTON],
-                                               None)
-            if spinbox:
-                obj = spinbox
-
-        where_am_I.WhereAmI.whereAmI(self, obj, basicOnly)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]