<dd><code><ahref="AWTEnvironmentPlugin.html"title="class in net.java.games.input">AWTEnvironmentPlugin</a></code>, <code><ahref="DirectAndRawInputEnvironmentPlugin.html"title="class in net.java.games.input">DirectAndRawInputEnvironmentPlugin</a></code>, <code><ahref="DirectInputEnvironmentPlugin.html"title="class in net.java.games.input">DirectInputEnvironmentPlugin</a></code>, <code><ahref="LinuxEnvironmentPlugin.html"title="class in net.java.games.input">LinuxEnvironmentPlugin</a></code>, <code><ahref="OSXEnvironmentPlugin.html"title="class in net.java.games.input">OSXEnvironmentPlugin</a></code>, <code><ahref="RawInputEnvironmentPlugin.html"title="class in net.java.games.input">RawInputEnvironmentPlugin</a></code>, <code><ahref="WinTabEnvironmentPlugin.html"title="class in net.java.games.input">WinTabEnvironmentPlugin</a></code></dd>
</dl>
<hr>
<pre>public abstract class <spanclass="typeNameLabel">ControllerEnvironment</span>
extends java.lang.Object</pre>
<divclass="block">A ControllerEnvironment represents a collection of controllers that are
physically or logically linked. By default, this corresponds to the
environment for the local machine.
<p>
In this reference implementation, this class can also be used to register
controllers with the default environment as "plug-ins". A plug-in is
created by subclassing ControllerEnvironment with a class that has a public
no-argument constructor, implements the net.java.games.util.plugins.Plugin
interface and has a name ending in "Plugin".
(See net.java.games.input.DirectInputEnvironmentPlugin in the DXplugin
part of the source tree for an example.)
When the DefaultControllerEnvrionment is instanced it uses the plugin library
to look for Plugins in both [java.home]/lib/controller and
[user.dir]/controller. This allows controller plugins to be installed either
globally for the entire Java environment or locally for just one particular
Java app.
For more information on the organization of plugins within the controller
root directories, see net.java.games.util.plugins.Plugins (Note the
plural -- "Plugins" not "Plugin" which is just a marker interface.)</div>
<thclass="colFirst"scope="col">Modifier and Type</th>
<thclass="colSecond"scope="col">Method</th>
<thclass="colLast"scope="col">Description</th>
</tr>
<trid="i0"class="altColor">
<tdclass="colFirst"><code>void</code></td>
<thclass="colSecond"scope="row"><code><spanclass="memberNameLink"><ahref="#addControllerListener(net.java.games.input.ControllerListener)">addControllerListener</a></span>​(<ahref="ControllerListener.html"title="interface in net.java.games.input">ControllerListener</a> l)</code></th>
<tdclass="colLast">
<divclass="block">Adds a listener for controller state change events.</div>
<thclass="colSecond"scope="row"><code><spanclass="memberNameLink"><ahref="#fireControllerAdded(net.java.games.input.Controller)">fireControllerAdded</a></span>​(<ahref="Controller.html"title="interface in net.java.games.input">Controller</a> c)</code></th>
<tdclass="colLast">
<divclass="block">Creates and sends an event to the controller listeners that a controller
<thclass="colSecond"scope="row"><code><spanclass="memberNameLink"><ahref="#fireControllerRemoved(net.java.games.input.Controller)">fireControllerRemoved</a></span>​(<ahref="Controller.html"title="interface in net.java.games.input">Controller</a> c)</code></th>
<tdclass="colLast">
<divclass="block">Creates and sends an event to the controller listeners that a controller
has been lost.</div>
</td>
</tr>
<trid="i3"class="rowColor">
<tdclass="colFirst"><code>abstract <ahref="Controller.html"title="interface in net.java.games.input">Controller</a>[]</code></td>
<divclass="block">Returns the isSupported status of this environment.</div>
</td>
</tr>
<trid="i6"class="altColor">
<tdclass="colFirst"><code>void</code></td>
<thclass="colSecond"scope="row"><code><spanclass="memberNameLink"><ahref="#removeControllerListener(net.java.games.input.ControllerListener)">removeControllerListener</a></span>​(<ahref="ControllerListener.html"title="interface in net.java.games.input">ControllerListener</a> l)</code></th>
<tdclass="colLast">
<divclass="block">Removes a listener for controller state change events.</div>
</td>
</tr>
<trid="i7"class="rowColor">
<tdclass="colFirst"><code>abstract <ahref="Controller.html"title="interface in net.java.games.input">Controller</a>[]</code></td>
<divclass="block">List of controller listeners</div>
</li>
</ul>
</li>
</ul>
</section>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<sectionrole="region">
<ulclass="blockList">
<liclass="blockList"><aid="constructor.detail">
<!---->
</a>
<h3>Constructor Detail</h3>
<aid="<init>()">
<!---->
</a>
<ulclass="blockListLast">
<liclass="blockList">
<h4>ControllerEnvironment</h4>
<pre>protected ControllerEnvironment()</pre>
<divclass="block">Protected constructor for subclassing.</div>
</li>
</ul>
</li>
</ul>
</section>
<!-- ============ METHOD DETAIL ========== -->
<sectionrole="region">
<ulclass="blockList">
<liclass="blockList"><aid="method.detail">
<!---->
</a>
<h3>Method Detail</h3>
<aid="getControllers()">
<!---->
</a>
<ulclass="blockList">
<liclass="blockList">
<h4>getControllers</h4>
<preclass="methodSignature">public abstract <ahref="Controller.html"title="interface in net.java.games.input">Controller</a>[] getControllers()</pre>
<divclass="block">Returns a list of all controllers available to this environment,
or an empty array if there are no controllers in this environment.</div>
</li>
</ul>
<aid="rescanControllers()">
<!---->
</a>
<ulclass="blockList">
<liclass="blockList">
<h4>rescanControllers</h4>
<preclass="methodSignature">public abstract <ahref="Controller.html"title="interface in net.java.games.input">Controller</a>[] rescanControllers()</pre>
<divclass="block">Rescans the devices and provides a list of new controllers.</div>
<dl>
<dt><spanclass="returnLabel">Returns:</span></dt>
<dd>a list of all controllers available to this environment.</dd>
<preclass="methodSignature">public void addControllerListener​(<ahref="ControllerListener.html"title="interface in net.java.games.input">ControllerListener</a> l)</pre>
<divclass="block">Adds a listener for controller state change events.</div>
<preclass="methodSignature">public void removeControllerListener​(<ahref="ControllerListener.html"title="interface in net.java.games.input">ControllerListener</a> l)</pre>
<divclass="block">Removes a listener for controller state change events.</div>
<preclass="methodSignature">protected void fireControllerAdded​(<ahref="Controller.html"title="interface in net.java.games.input">Controller</a> c)</pre>
<divclass="block">Creates and sends an event to the controller listeners that a controller
<preclass="methodSignature">protected void fireControllerRemoved​(<ahref="Controller.html"title="interface in net.java.games.input">Controller</a> c)</pre>
<divclass="block">Creates and sends an event to the controller listeners that a controller
has been lost.</div>
</li>
</ul>
<aid="getDefaultEnvironment()">
<!---->
</a>
<ulclass="blockListLast">
<liclass="blockList">
<h4>getDefaultEnvironment</h4>
<preclass="methodSignature">public static <ahref="ControllerEnvironment.html"title="class in net.java.games.input">ControllerEnvironment</a> getDefaultEnvironment()</pre>
<divclass="block">Returns the default environment for input controllers.
This usually corresponds to the environment for the local machine.</div>