Skip to content

Commit fa4c988

Browse files
committed
WIP
1 parent 6eaf0be commit fa4c988

File tree

9 files changed

+26
-7
lines changed

9 files changed

+26
-7
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# @double value
2+
# @OUTPUT double greeting
3+
4+
greeting = value
5+
6+
print greeting
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
; @Integer(label="My integer",description="Input integer.",value=17) test-int
2+
; @OUTPUT Integer output-int
3+
4+
(def output-int test-int)

org.knime.scijava.commands/src/org/knime/scijava/commands/SciJavaTestCommand.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class SciJavaTestCommand implements Command {
1212
@Parameter
1313
private MultiOutputListener rowOutput;
1414

15-
@Parameter(label = "From Text")
15+
@Parameter(label = "From Text", style = StyleHook.COLUMNSELECTION)
1616
private String fromText;
1717

1818
@Parameter(label = "From Int")
@@ -23,12 +23,11 @@ public class SciJavaTestCommand implements Command {
2323

2424
@Override
2525
public void run() {
26-
2726
for (int i = 0; i < fromInt; i++) {
2827
outInt = i;
2928
rowOutput.notifyListener();
3029
}
31-
3230
}
3331

32+
3433
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
package org.knime.scijava.commands;
22

3-
public interface EnforcerHook {
3+
public interface StyleHook {
44
public final static String COLUMNSELECTION = "colSel";
55
}

org.knime.scijava.commands/src/org/knime/scijava/commands/converter/ConverterCacheService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
import org.knime.core.node.ExecutionContext;
1212
import org.scijava.service.Service;
1313

14+
// FIXME NAMING (KNIPConverterCache?!)
15+
// FIXME CACHING (isn't implemented everywhere, yet)
16+
// FIXME can we always delegate to Jonathans implementations?
1417
public interface ConverterCacheService extends Service {
1518

1619
/**

org.knime.scijava.commands/src/org/knime/scijava/commands/module/DefaultNodeModule.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ public DefaultNodeModule(final Context context, final ModuleInfo info,
5959
}
6060

6161
// FIXME: do we need them all?
62+
// FIXME add our own preprocessors, i.e. to call preprocess?
63+
// FIXME or move this to "preprocess"
6264
final List<PreprocessorPlugin> pre = ps
6365
.createInstancesOfType(PreprocessorPlugin.class);
6466

@@ -77,6 +79,7 @@ public DefaultNodeModule(final Context context, final ModuleInfo info,
7779
}
7880

7981
private void preProcess(final DataRow input) throws Exception {
82+
// input can be null if source node
8083
if (input != null) {
8184
for (final Entry<Integer, ModuleItem<?>> entry : inputMapping
8285
.entrySet()) {
@@ -90,6 +93,7 @@ private void preProcess(final DataRow input) throws Exception {
9093

9194
private void postProcess(final CellOutput output,
9295
final ExecutionContext ctx) throws Exception {
96+
// output can be null if sink node
9397
if (output != null) {
9498
final List<DataCell> cells = new ArrayList<DataCell>();
9599
for (final ModuleItem<?> entry : module.getInfo().outputs()) {
@@ -109,6 +113,8 @@ private void postProcess(final CellOutput output,
109113
@Override
110114
public void run(final DataRow input, final CellOutput output,
111115
final ExecutionContext ctx) throws Exception {
116+
117+
// FIXME: Nicer logic possible here?
112118
preProcess(input);
113119

114120
if (outputListener != null) {

org.knime.scijava.commands/src/org/knime/scijava/commands/nodes/SciJavaCommandNodeModel.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ public OutputPortRole[] getOutputPortRoles() {
224224
}
225225
}
226226

227+
// FIXME must be super performant
227228
@Override
228229
public StreamableOperator createStreamableOperator(
229230
final PartitionInfo partitionInfo, final PortObjectSpec[] inSpecs)

org.knime.scijava.commands/src/org/knime/scijava/commands/nodes/SciJavaNodeSetFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public String getAfterID(final String id) {
106106

107107
@Override
108108
public ConfigRO getAdditionalSettings(final String id) {
109-
// TODO manage versions?
109+
// FIXME manage versions?
110110
final NodeSettings settings = new NodeSettings(
111111
"scijavacommand-factory");
112112
settings.addString(SCIJAVA_COMMAND_KEY, id);

org.knime.scijava.commands/src/org/knime/scijava/commands/settings/DefaultSettingsModelTypeService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
import org.knime.core.data.convert.util.ClassUtil;
77
import org.knime.core.node.defaultnodesettings.SettingsModel;
8-
import org.knime.scijava.commands.EnforcerHook;
8+
import org.knime.scijava.commands.StyleHook;
99
import org.knime.scijava.commands.converter.ConverterCacheService;
1010
import org.knime.scijava.commands.settings.types.SettingsModelColumnSelectionType;
1111
import org.scijava.module.ModuleItem;
@@ -59,7 +59,7 @@ public SettingsModelType getSettingsModelTypeFor(final ModuleItem<?> item) {
5959

6060
// FIXME why do I need this check in case of scripts?
6161
if (item.getWidgetStyle() != null
62-
&& item.getWidgetStyle().equals(EnforcerHook.COLUMNSELECTION)) {
62+
&& item.getWidgetStyle().equals(StyleHook.COLUMNSELECTION)) {
6363
return new SettingsModelColumnSelectionType();
6464
} else {
6565

0 commit comments

Comments
 (0)