cz.cuni.jagrlib.reg
Class RegPiece

java.lang.Object
  extended by cz.cuni.jagrlib.reg.RegPiece
All Implemented Interfaces:
Template

public class RegPiece
extends java.lang.Object
implements Template

Registration data for Piece.

Since:
0.23
See Also:
RegPiece.java

Field Summary
 java.lang.String category
          Module category.
 java.lang.String className
          Local class name.
 java.lang.String description
          Longer description of a module.
 java.lang.String name
          Short name of a module.
 java.lang.String packageName
          Fully qualified package name.
protected  InfoParam param
           
 java.util.Map<java.lang.String,InfoParam> params
          Set of module parameters.
 java.util.Map<java.lang.String,InfoPlug> plugs
          Set of module plugs.
 java.lang.String template
          Module template.
static java.lang.Class<?> TYPE
          Static instance of Class object for RegPiece.
 
Fields inherited from interface cz.cuni.jagrlib.Template
ALL_PLUGS, C_1D, C_2D, C_3D, C_ALPHA, C_BINARY, C_BREP, C_CAMERA, C_CIRCLE, C_CLIP, C_COMPRESSION, C_CURVE, C_DATA, C_DRAW, C_EDITOR, C_ELLIPSE, C_FILL, C_FILTER, C_FLOAT, C_FUNCTION, C_IMAGE, C_INTEGER, C_IO, C_LIGHT, C_LINE, C_METRIC, C_POLYGON, C_PROJECTION, C_RADIOSITY, C_RASTER, C_RENDER, C_SAMPLE, C_SCENE, C_SET, C_SOLID, C_TEXT, C_TRANSFORM, C_VECTOR, C_VIEWER, C_WORKER, CAT_EMPTY, EMPTY, IFACE, JAGRLIB, JAGRLIB2, MANIPULATOR_COMBO, MANIPULATOR_CUSTOM, MANIPULATOR_DEFAULT, MANIPULATOR_MULTILINE, PL_ALPHAMASK, PL_BITMASK, PL_CAUSTIC, PL_CODEC, PL_COLORMAP, PL_COMPARE, PL_DATA, PL_DIRECT, PL_EDITOR, PL_FILTER, PL_FUNCTION, PL_IMAGE, PL_IMPORT, PL_INPUT, PL_INTERSECTION, PL_LIGHTSOURCE, PL_ORDER, PL_OUTPUT, PL_PALETTE, PL_PHOTON, PL_PROPERTY, PL_QUANTIZER, PL_RASTER, PL_RENDER, PL_SHADOW, PL_STREAM, PL_TRANSFORM, PL_TRIGGER, PL_VOLUME, PL_WINDOW, TYPE_BOOLEAN, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INTEGER, TYPE_LONG, TYPE_OBJECT, TYPE_STRING
 
Constructor Summary
RegPiece()
           
 
Method Summary
 java.lang.String fullClassName()
          Returns full clas name of the module.
protected  void logError(java.lang.String msg)
           
 void newInputPlug(java.lang.String key, java.lang.String _inputInterface)
          Connects a new input Plug.
 void newOptOutputPlug(java.lang.String key, java.lang.String _outputInterface)
          Connects a new optional output Plug.
 void newOutputPlug(java.lang.String key, java.lang.String _outputInterface)
          Connects a new output Plug.
 void newPlug(java.lang.String key, boolean _mandatory, boolean _multi, boolean _cloneable, java.lang.String _inputInterface, java.lang.String _outputInterface)
          Connects a new Plug.
static java.lang.String normalizeInterfaceName(java.lang.String iface)
          Separates local interface name from fully qualified class name.
 void propBegin(java.lang.String name, java.lang.String type, java.lang.String descr, boolean visual)
          Starts definition of single property.
 void propBounds(java.lang.Object min, java.lang.Object max)
          Minimum and maximum allowed values (for comparable types only, non-mandatory).
 void propDefault(java.lang.Object value)
          Default value (non-mandatory).
 void propEnd()
          Finishes definition of the property.
 void propEnum(java.lang.String label, java.lang.Object value, java.lang.String descr)
          Adds next enum label (for list-box GUI).
 void propManipulator(int manipulatorType)
          Sets visual manipulator for GUI editing of the property.
 void propManipulator(java.lang.String className)
          Sets visual manipulator for GUI editing of the property.
 void setRegStrings(java.lang.String _name, java.lang.String _template, java.lang.String _category, java.lang.String _description)
          Sets registration strings for the module.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

packageName

public java.lang.String packageName
Fully qualified package name. (e.g.: "cz.cuni.jagrlib.piece").


className

public java.lang.String className
Local class name. (e.g.: "LineBresenham").


name

public java.lang.String name
Short name of a module. (e.g.: "Bresenham").


template

public java.lang.String template
Module template. (e.g.: "LineRenderToBitMask").


category

public java.lang.String category
Module category. (e.g.: "2d.draw.line.integer").


description

public java.lang.String description
Longer description of a module.


plugs

public java.util.Map<java.lang.String,InfoPlug> plugs
Set of module plugs.


params

public java.util.Map<java.lang.String,InfoParam> params
Set of module parameters.


param

protected InfoParam param

TYPE

public static final java.lang.Class<?> TYPE
Static instance of Class object for RegPiece.

Constructor Detail

RegPiece

public RegPiece()
Method Detail

normalizeInterfaceName

public static final java.lang.String normalizeInterfaceName(java.lang.String iface)
Separates local interface name from fully qualified class name.


fullClassName

public final java.lang.String fullClassName()
Returns full clas name of the module.


newPlug

public void newPlug(java.lang.String key,
                    boolean _mandatory,
                    boolean _multi,
                    boolean _cloneable,
                    java.lang.String _inputInterface,
                    java.lang.String _outputInterface)
Connects a new Plug. General routine.

Specified by:
newPlug in interface Template
Parameters:
key - New plug's key.
_mandatory - Is that plug mandatory (has to be connected)?
_multi - Can that plug be used in multi-channels?
_cloneable - Is that plug "cloneable" (=generic)? If yes, ordinal numbers (starting from 0) will be appended to its name.
_inputInterface - Fully qualified identifier of input (implemented) interface.
_outputInterface - Fully qualified identifier of output (required) interface.

newInputPlug

public void newInputPlug(java.lang.String key,
                         java.lang.String _inputInterface)
Connects a new input Plug. Common-use routine: creates optional, non-cloneable, multi plug.

Specified by:
newInputPlug in interface Template
Parameters:
key - New plug's key.
_inputInterface - Fully qualified identifier of input (implemented) interface.

newOutputPlug

public void newOutputPlug(java.lang.String key,
                          java.lang.String _outputInterface)
Connects a new output Plug. Common-use routine: creates mandatory, non-cloneable, multi plug.

Specified by:
newOutputPlug in interface Template
Parameters:
key - New plug's key.
_outputInterface - Fully qualified identifier of output (required) interface.

newOptOutputPlug

public void newOptOutputPlug(java.lang.String key,
                             java.lang.String _outputInterface)
Connects a new optional output Plug. Common-use routine: creates optional, non-cloneable, multi plug.

Specified by:
newOptOutputPlug in interface Template
Parameters:
key - New plug's key.
_outputInterface - Fully qualified identifier of output (required) interface.

setRegStrings

public void setRegStrings(java.lang.String _name,
                          java.lang.String _template,
                          java.lang.String _category,
                          java.lang.String _description)
Sets registration strings for the module.

Specified by:
setRegStrings in interface Template

logError

protected void logError(java.lang.String msg)

propBegin

public void propBegin(java.lang.String name,
                      java.lang.String type,
                      java.lang.String descr,
                      boolean visual)
Starts definition of single property.

Specified by:
propBegin in interface Template
Parameters:
name - String identifier (unique inside one module class).
type - Value type - full Java class identifier.
descr - Brief textual description (for human eyes only).
visual - Should be this property represented visually in GUI?
See Also:
propEnd()

propDefault

public void propDefault(java.lang.Object value)
Default value (non-mandatory).

Specified by:
propDefault in interface Template

propBounds

public void propBounds(java.lang.Object min,
                       java.lang.Object max)
Minimum and maximum allowed values (for comparable types only, non-mandatory).

Specified by:
propBounds in interface Template

propManipulator

public void propManipulator(int manipulatorType)
Sets visual manipulator for GUI editing of the property. For predefined manipulators.

Specified by:
propManipulator in interface Template

propManipulator

public void propManipulator(java.lang.String className)
Sets visual manipulator for GUI editing of the property. For user-defined manipulators.

Specified by:
propManipulator in interface Template
Parameters:
className - Class name (either fully-qualified or local in package cz.cuni.jagrlib.gui).

propEnum

public void propEnum(java.lang.String label,
                     java.lang.Object value,
                     java.lang.String descr)
Adds next enum label (for list-box GUI).

Specified by:
propEnum in interface Template
Parameters:
label - Textual label to appear in the listbox.
value - Associated property value (real-value).
descr - Optional item's description (for human eyes only).

propEnd

public void propEnd()
Finishes definition of the property. Every property-definition segment started by propBegin(java.lang.String, java.lang.String, java.lang.String, boolean) must be properly closed by propEnd().

Specified by:
propEnd in interface Template
See Also:
propBegin(java.lang.String, java.lang.String, java.lang.String, boolean)