Revision 13444 trunk/extensions/extExpressionField/src/com/iver/cit/gvsig/project/documents/table/operators/Geometry.java
Geometry.java | ||
---|---|---|
3 | 3 |
import org.apache.bsf.BSFException; |
4 | 4 |
import org.apache.bsf.BSFManager; |
5 | 5 |
|
6 |
import com.iver.cit.gvsig.ExpresionFieldExtension; |
|
6 |
import com.hardcode.gdbms.driver.exceptions.ReadDriverException; |
|
7 |
import com.iver.andami.PluginServices; |
|
8 |
import com.iver.cit.gvsig.ExpressionFieldExtension; |
|
9 |
import com.iver.cit.gvsig.exceptions.expansionfile.ExpansionFileReadException; |
|
7 | 10 |
import com.iver.cit.gvsig.fmap.core.IGeometry; |
8 | 11 |
import com.iver.cit.gvsig.fmap.drivers.DriverIOException; |
9 | 12 |
import com.iver.cit.gvsig.fmap.layers.ReadableVectorial; |
... | ... | |
20 | 23 |
public double process(Index index) throws DriverIOException { |
21 | 24 |
return 0; |
22 | 25 |
} |
23 |
public IGeometry getGeometry(Index index) throws DriverIOException {
|
|
26 |
public IGeometry getGeometry(Index index) throws ExpansionFileReadException, ReadDriverException {
|
|
24 | 27 |
ReadableVectorial adapter = getLayer().getSource(); |
25 | 28 |
IGeometry geom=adapter.getShape(index.get()); |
26 | 29 |
return geom; |
27 | 30 |
} |
28 | 31 |
public void eval(BSFManager interpreter) throws BSFException { |
29 |
interpreter.declareBean("geometry",this,Geometry.class); |
|
30 |
interpreter.eval(ExpresionFieldExtension.BEANSHELL,null,-1,-1,"java.lang.Object geometry(){return geometry.getGeometry(indexRow);};"); |
|
32 |
interpreter.declareBean("jgeometry",this,Geometry.class); |
|
33 |
// interpreter.eval(ExpressionFieldExtension.BEANSHELL,null,-1,-1,"java.lang.Object geometry(){return geometry.getGeometry(indexRow);};"); |
|
34 |
interpreter.exec(ExpressionFieldExtension.JYTHON,null,-1,-1,"def geometry():\n" + |
|
35 |
" return jgeometry.getGeometry(indexRow)"); |
|
31 | 36 |
} |
32 | 37 |
public String toString() { |
33 | 38 |
return "geometry"; |
... | ... | |
35 | 40 |
public boolean isEnable() { |
36 | 41 |
return false; |
37 | 42 |
} |
43 |
public String getTooltip(){ |
|
44 |
return PluginServices.getText(this,"operator")+": "+addText("")+"\n"+getDescription(); |
|
45 |
} |
|
46 |
public String getDescription() { |
|
47 |
return PluginServices.getText(this, "returns") + ": " + |
|
48 |
PluginServices.getText(this, "numeric_value") + "\n" + |
|
49 |
PluginServices.getText(this, "description") + ": " + |
|
50 |
"Returns the geometry of this row."; |
|
51 |
} |
|
38 | 52 |
} |
Also available in: Unified diff