|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.emn.reactiveinput.AbstractDevice fr.emn.examples.icondraw.DTool fr.emn.examples.icondraw.DBrushTool
A DTool with brush attributes
Field Summary | |
In |
a
|
In |
b
|
protected LiteColor |
color
|
protected LiteContext |
context
|
In |
g
|
In |
r
|
protected LiteStroke |
stroke
|
protected int |
w_val
|
In |
width
|
In |
x
|
In |
y
|
Fields inherited from class fr.emn.examples.icondraw.DTool |
activate, use |
Fields inherited from class fr.emn.reactiveinput.AbstractDevice |
currIndex, ins, outs |
Fields inherited from interface fr.emn.reactiveinput.Device |
AUTO_PROPERTIES |
Constructor Summary | |
DBrushTool()
DBrushTool constructor comment. |
|
DBrushTool(java.lang.String name,
DrawView view)
DBrushTool constructor comment. |
Method Summary | |
static double |
check(double d)
paint method comment. |
LiteColor |
getColor()
|
LiteContext |
getContext()
|
LiteStroke |
getStroke()
|
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 |
paint(java.awt.Graphics2D g)
Draw brush feedback |
boolean |
update_begin()
Initiates an interaction. |
void |
update_value(boolean force)
Update interaction values. |
Methods inherited from class fr.emn.examples.icondraw.DTool |
close, copy, getActivated, getScreenCoordinates, hasExternalOutput, isActive, isUsed, setActivated, setScreenCoordinates, toLocal, update_abort, update_end, update |
Methods inherited from class fr.emn.reactiveinput.AbstractDevice |
addIn, addIn, addOut, 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 |
public final In width
public final In r
public final In g
public final In b
public final In a
public final In x
public final In y
protected LiteColor color
protected LiteStroke stroke
protected LiteContext context
protected int w_val
Constructor Detail |
public DBrushTool()
public DBrushTool(java.lang.String name, DrawView view)
Method Detail |
public static double check(double d)
public LiteColor getColor()
public LiteContext getContext()
public LiteStroke getStroke()
public void paint(java.awt.Graphics2D g)
paint
in class DTool
public Processor open(OpenContext context)
AbstractDevice
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.
open
in interface Device
open
in class DTool
public void update_value(boolean force)
DTool
This method is called during an interaction every time a value may have changed.
Additionnaly, it is called with first=true just after interaction has been initiated (provided that update_begin returned true) and just before interaction has been aborted or validated.
update_value
in class DTool
public boolean update_begin()
DTool
You can refuse starting an interaction by returning false (e.g. if you do not have enough data). This method will be re-checked the next tick.
update_begin
in class DTool
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |