matrixPortrayal.setPortrayalForAll(new OvalPortrayal2D() { public void draw(Object object, Graphics2D graphics, DrawInfo2D info) { MutableDouble valueObj = (MutableDouble)object; if ( valueObj.intValue() == 0 ) { paint = new java.awt.Color(1.0F,0.0F,0.0F,0.0F); } else { paint = new java.awt.Color(1.0F,0.0F,0.0F,1.0F); } filled = true; super.draw(object, graphics, info); } });
tuples.put(key, getValue(val.doubleValue())); dtuples.put(key, val.doubleValue()); ituples.put(key, val.intValue()); ftuples.put(key, val.floatValue()); ltuples.put(key, val.longValue());
tuples.put(key, getValue(val.doubleValue())); dtuples.put(key, val.doubleValue()); ituples.put(key, val.intValue()); ftuples.put(key, val.floatValue()); ltuples.put(key, val.longValue());
/** * Emits on all ports that are connected. Data is precomputed during process on input port and endWindow just emits it for each key. Clears the internal data. */ @Override public void endWindow() { for (Map.Entry<K, SumEntry> e: sums.entrySet()) { K key = e.getKey(); SumEntry val = e.getValue(); if (val.changed) { sum.emit(new KeyValPair<K, V>(key, getValue(val.sum.doubleValue()))); sumDouble.emit(new KeyValPair<K, Double>(key, val.sum.doubleValue())); sumInteger.emit(new KeyValPair<K, Integer>(key, val.sum.intValue())); sumFloat.emit(new KeyValPair<K, Float>(key, val.sum.floatValue())); sumShort.emit(new KeyValPair<K, Short>(key, val.sum.shortValue())); sumLong.emit(new KeyValPair<K, Long>(key, val.sum.longValue())); } } clearCache(); }