fr.emn.reactiveinput.devices
Class DCursor

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

public class DCursor
extends AbstractMutableDevice


Field Summary
 In activate
           
 Out activatethru
           
 In but1
           
 Out but1thru
           
 In but2
           
 Out but2thru
           
 In but3
           
 Out but3thru
           
 In im_px
           
 In im_py
           
 In image
           
 In x
           
 Out xthru
           
 In y
           
 Out ythru
           
 
Fields inherited from class fr.emn.reactiveinput.AbstractDevice
currIndex, ins, outs
 
Fields inherited from interface fr.emn.reactiveinput.Device
AUTO_PROPERTIES
 
Constructor Summary
DCursor()
          Do not use this constructor
 
Method Summary
 void close()
          Closes the device.
 void doDisable()
          Add device disabling code here (does nothing by default).
 boolean getActivated()
           
 boolean getCenterByDefault()
           
protected  java.awt.Point getDefaultActivePoint(javax.swing.ImageIcon im)
           
 boolean getGraphicalInterpolation()
           
 boolean getHiddenWhenUsed()
           
 ImageEnum getImage()
           
 java.lang.String getImageFile()
           
 Slot[] getMutationTriggers()
          Returns the mutation triggers for this mutable device, i.e. all input or output slots that trigger a mutation when it is connected to another type.
 double getOpacity()
           
 boolean getRoundCoordinates()
           
 boolean getScreenCoordinates()
           
 boolean hasExternalOutput()
          Specifies whether this device has external (implicit) output or not.
 void mutate()
          Perform a mutation on this device.
 Processor open(OpenContext context)
          Ensures that the device will be ready for processing or producing data, and returns the Processor object that will process data, or null if an error occured.
 void setActivated(boolean activated)
           
 void setCenterByDefault(boolean centerByDefault)
           
 void setGraphicalInterpolation(boolean v)
           
 void setHiddenWhenUsed(boolean v)
           
 void setImage(ImageEnum imageref)
           
 void setImageFile(java.lang.String GIFFile)
           
 void setOpacity(double opacity)
           
 void setRoundCoordinates(boolean roundCoordinates)
           
 void setScreenCoordinates(boolean value)
           
 void toLocal(java.awt.Point p)
          Use this method to convert a point into local coordinates.
 void update()
          Updates device's output values.
 
Methods inherited from class fr.emn.reactiveinput.AbstractMutableDevice
addMutableIn, addMutableIn, addMutableIn, addMutableOut, addMutableOut, remove
 
Methods inherited from class fr.emn.reactiveinput.AbstractDevice
addIn, addIn, addOut, copy, 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
 
Methods inherited from interface fr.emn.reactiveinput.Device
copy, getError, getInfo, getIns, getName, getOuts, getProperties, hasExternalInput, isCopiable, isOpenable, setEnabled
 

Field Detail

x

public final In x

y

public final In y

activate

public final In activate

but1

public final In but1

but2

public final In but2

but3

public final In but3

image

public final In image

im_px

public final In im_px

im_py

public final In im_py

xthru

public final Out xthru

ythru

public final Out ythru

activatethru

public final Out activatethru

but1thru

public final Out but1thru

but2thru

public final Out but2thru

but3thru

public final Out but3thru
Constructor Detail

DCursor

public DCursor()
Do not use this constructor

Method Detail

doDisable

public void doDisable()
Description copied from class: AbstractDevice
Add device disabling code here (does nothing by default).

Overrides:
doDisable in class AbstractDevice

close

public void close()
Description copied from interface: Device
Closes the device. Called when the device is not used any more.

Deallocate resources here.

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

getImage

public ImageEnum getImage()

setImage

public void setImage(ImageEnum imageref)

getImageFile

public java.lang.String getImageFile()

setImageFile

public void setImageFile(java.lang.String GIFFile)

getScreenCoordinates

public boolean getScreenCoordinates()

hasExternalOutput

public boolean hasExternalOutput()
Description copied from interface: Device
Specifies whether this device has external (implicit) output or not.

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 this makes no difference for the reactive machine.

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

open

public Processor open(OpenContext context)
Description copied from interface: Device
Ensures that the device will be ready for processing or producing data, and returns the Processor object that will process data, or null if an error occured.

Some devices may need to perform some more or less heavy initialization (such as allocating resources or opening a stream) before being able to process or produce data. This is the case for most input devices, and some I/O and output devices. All these initializations must be done in the open() method.

Because these initializations are subject to fail, open() may return null even if isOpenable() returns true. In all cases, returning a non-null Processor means that the device is now able to process or produce data.

RE-OPENING A DEVICE:

Devices always stay open during reconfiguration, in order to avoid unnecessary deallocation and reallocation of resources. However, some devices will need to be re-open before re-starting the configuration. So open() is always called on all devices before re-starting.

If open() is called on a device that is already open, it may have no effect (and the current Processor is returned), or the device may be re-open if something has changed in its configuration.

Using a Processor as a return value allows the use of different processors, each adapted to a specific device configuration.

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

setScreenCoordinates

public void setScreenCoordinates(boolean value)

getActivated

public boolean getActivated()

setActivated

public void setActivated(boolean activated)

toLocal

public void toLocal(java.awt.Point p)
Use this method to convert a point into local coordinates. If screenCoordinates is false, no changes are made.


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()

getMutationTriggers

public Slot[] getMutationTriggers()
Description copied from class: AbstractMutableDevice
Returns the mutation triggers for this mutable device, i.e. all input or output slots that trigger a mutation when it is connected to another type.

Specified by:
getMutationTriggers in interface MutableDevice
Specified by:
getMutationTriggers in class AbstractMutableDevice

mutate

public void mutate()
Description copied from class: AbstractMutableDevice
Perform a mutation on this device. This method is called when a connection is made (or deleted) on an entry point.

Add mutation code here.

Specified by:
mutate in interface MutableDevice
Specified by:
mutate in class AbstractMutableDevice

getHiddenWhenUsed

public boolean getHiddenWhenUsed()

setHiddenWhenUsed

public void setHiddenWhenUsed(boolean v)

setGraphicalInterpolation

public void setGraphicalInterpolation(boolean v)

getGraphicalInterpolation

public boolean getGraphicalInterpolation()

getOpacity

public double getOpacity()
Returns:
Returns the opacity.

setOpacity

public void setOpacity(double opacity)
Parameters:
opacity - The opacity to set.

getCenterByDefault

public boolean getCenterByDefault()
Returns:
Returns the centerByDefault.

setCenterByDefault

public void setCenterByDefault(boolean centerByDefault)
Parameters:
centerByDefault - The centerByDefault to set.

getDefaultActivePoint

protected java.awt.Point getDefaultActivePoint(javax.swing.ImageIcon im)

getRoundCoordinates

public boolean getRoundCoordinates()
Returns:
Returns the roundCoordinates.

setRoundCoordinates

public void setRoundCoordinates(boolean roundCoordinates)
Parameters:
roundCoordinates - The roundCoordinates to set.