Peter Olcott said:
From the best that I can tell, from the expert advice that I received here, even
this tiny task would tend to be difficult. The specific aspect of this task that
I must analyze is the difficulty of determining the current state and exact
location of any graphical user interface control. Since Java has at least three
different technologies for creating these controls, a first estimate from my
limited point of view would be that even this tiny subtask would require a hodge
podge conglomeration of these three technologies.
Perhaps I can provide a better answer. There are three commonly used
GUI technologies, as you've gathered, but we could be more explicit
about the names. They are:
- Plain AWT
- AWT with Swing
- SWT
Two of these are based on AWT, and the third is based on SWT. Both AWT
and SWT provide the ability to determine the exact location and state of
user interface controls from within that application, if you already
have a reference to the user interface control. From outside of the
application, you'd have to either act like a debugger and ensure the app
is running in debug mode, or obtain a handle to a JVM instance via JNI.
Neither can be done uncooperatively. So to do this with Java APIs, you
need to at least have the cooperation of the application that you wish
to interact with.
It is not reliable, at least in AWT or AWT/Swing, and probably in SWT as
well, to ask the operating system. Lightweight controls in AWT (and
this includes all Swing controls except the top-level containers) are
not exposed to the operating system, so the OS won't be able to give you
their location, nor even know that the control is there. So it is
probably not worthwhile to pursue the route of asking the OS.
You seem to be interested in recognizing controls based on the
equivalent of a screen shot. In this case, you actually need to
consider a larger number of cases: for one case per platform (and
possibly per JVM implementation) for plain AWT and for SWT, and one case
per look and feel for Swing. Since Swing has pluggable look and feels,
a component can literally look like anything in the world, depending on
which look and feel is in use. Of course, custom components may look
different for any of the above.
Finally, you keep mentioning your patent. That really sucks. Please
don't be part of the problem.