fr.emn.reactiveinput.devices
Class DJComponent

java.lang.Object
  extended byfr.emn.reactiveinput.AbstractDevice
      extended byfr.emn.reactiveinput.devices.DJComponent
All Implemented Interfaces:
Device, Processor

public class DJComponent
extends AbstractDevice

A JComponent controller. PROBLEMS: - Swing management of menus: mouse clicks close current menu, even if mouse events are deactivated through glasspane. - No support for compound entered/exited events in DJComponent - Redisplay problems in internal frames


Field Summary
 In alt
           
 In clicks
           
 In ctrl
           
 In enable
           
 In focus
           
 In id
           
 In press
           
 In press2
           
 In press3
           
 In shift
           
 In show
           
 In x
           
 In y
           
 
Fields inherited from class fr.emn.reactiveinput.AbstractDevice
currIndex, ins, outs
 
Fields inherited from interface fr.emn.reactiveinput.Device
AUTO_PROPERTIES
 
Constructor Summary
DJComponent()
           
 
Method Summary
protected  void generateMouseClicked()
           
protected  void generateMouseDragged()
           
protected  void generateMouseEntered()
           
protected  void generateMouseExited()
           
protected  void generateMouseMoved()
           
protected  void generateMousePressed()
           
protected  void generateMouseReleased()
           
 int getDragThreshold()
           
 boolean getGenerateEnterExit()
           
 boolean getGenerateMoves()
           
 boolean getQueueEvents()
           
 boolean hasExternalOutput()
          Specifies whether this device has external (implicit) output or not.
 Processor open(OpenContext context)
          Subclass this method if you want to specialize data processing, or if you want to perform some initializations before running the device.
 void setDragThreshold(int newDragThreshold)
           
 void setGenerateEnterExit(boolean newGenerate)
           
 void setGenerateMoves(boolean newGenerateMoves)
           
 void setQueueEvents(boolean queueEvents)
           
 void update()
          Updates device's output values.
protected  boolean updateComponent()
           
 
Methods inherited from class fr.emn.reactiveinput.AbstractDevice
addIn, addIn, addOut, close, copy, doDisable, doEnable, finalize, getError, getIndex, getInfo, getIns, getName, getOuts, getProperties, hasExternalInput, init, insertAt, insertAtEnd, insertBefore, isCopiable, isEnabled, isOpenable, setEnabled, setInfo, setInfo, setLastError, setName
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

public final In id

press

public final In press

press2

public final In press2

press3

public final In press3

shift

public final In shift

ctrl

public final In ctrl

alt

public final In alt

clicks

public final In clicks

focus

public final In focus

enable

public final In enable

show

public final In show

x

public final In x

y

public final In y
Constructor Detail

DJComponent

public DJComponent()
Method Detail

hasExternalOutput

public boolean hasExternalOutput()
Description copied from class: AbstractDevice
Specifies whether this device has external (implicit) output or not. Returns false by default.

Return false if the device has no border effects. Most of input and processing devices are in this case.

Return true if the device has border effects, such as graphical feedback, or control of some external value. Examples of devices with external output are application-interfacing devices and all user feedback devices.

This method can be used by the editor for the device's graphical representation. However there is at now no clear definition of what is external output.

Specified by:
hasExternalOutput in interface Device
Overrides:
hasExternalOutput in class AbstractDevice

generateMouseDragged

protected void generateMouseDragged()

generateMouseMoved

protected void generateMouseMoved()

generateMousePressed

protected void generateMousePressed()

generateMouseReleased

protected void generateMouseReleased()

generateMouseClicked

protected void generateMouseClicked()

generateMouseEntered

protected void generateMouseEntered()

generateMouseExited

protected void generateMouseExited()

getDragThreshold

public int getDragThreshold()
Returns:
int

open

public Processor open(OpenContext context)
Description copied from class: AbstractDevice
Subclass this method if you want to specialize data processing, or if you want to perform some initializations before running the device.

By default, open() does nothing and returns the device itself as the Processor (or null if it is not openable): AbstractDevice implements both Device and Processor interfaces, so that you can add processing code directly into the device.

If you want to add specialization features, subclass this method to return a specific processor implementation depending on your device configuration.

Example :

public Processor getProcessor() { if (super.open() == null) return null; // Select the right processor if (in2.isValid()) { return new twoParamProcessor(in1, in2, out); else return new oneParamProcessor(in1, out); }

In this method, you may also perform all necessary pre-running initialization. If initialization fails, return null even if isOpenable() returns true.

In all cases, return null if isOpenable() returns false.

Specified by:
open in interface Device
Overrides:
open in class AbstractDevice
See Also:
Processor, Device.open()

setDragThreshold

public void setDragThreshold(int newDragThreshold)
Parameters:
newDragThreshold - int

getGenerateMoves

public boolean getGenerateMoves()
Returns:
boolean

setGenerateMoves

public void setGenerateMoves(boolean newGenerateMoves)
Parameters:
newGenerateMoves - boolean

getGenerateEnterExit

public boolean getGenerateEnterExit()
Returns:
boolean

setGenerateEnterExit

public void setGenerateEnterExit(boolean newGenerate)

update

public void update()
Description copied from class: AbstractDevice
Updates device's output values.

Subclass init() and update() methods if you want the device to process the data itself. Otherwise, subclass getProcessor() method to use extern processors.

Specified by:
update in interface Processor
Overrides:
update in class AbstractDevice
See Also:
Processor.update()

updateComponent

protected boolean updateComponent()

getQueueEvents

public boolean getQueueEvents()
Returns:
Returns the queueEvents.

setQueueEvents

public void setQueueEvents(boolean queueEvents)
Parameters:
queueEvents - The queueEvents to set.