use of org.cytoscape.work.util.BoundedDouble in project cytoscape-impl by cytoscape.
the class BoundedDoubleTunableHandler method processArg.
public Object processArg(String arg) throws Exception {
double value = Double.parseDouble(arg);
BoundedDouble bi = (BoundedDouble) getValue();
bi.setValue(value);
return bi;
}
use of org.cytoscape.work.util.BoundedDouble in project cytoscape-impl by cytoscape.
the class BitmapWriterTest method updateZoomTest2.
@Test
public void updateZoomTest2() {
BoundedDouble newZoom = new BoundedDouble(0.0, 100.0, 500.0, true, false);
newZoom.setValue(200.0);
bw.setZoom(newZoom);
assertEquals(newZoom.getValue(), bw.zoom.getValue());
assertTrue(newZoom.getValue() / 100 == (bw.heightInPixels / initHP));
assertTrue(newZoom.getValue() / 100 == (bw.widthInPixels / initWP));
assertTrue(bw.resolution.getSelectedValue() == bw.heightInPixels / bw.heightInInches);
assertTrue(bw.resolution.getSelectedValue() == bw.widthInPixels / bw.widthInInches);
}
use of org.cytoscape.work.util.BoundedDouble in project cytoscape-impl by cytoscape.
the class BitmapWriterTest method updateZoomTest.
@Test
public void updateZoomTest() {
BoundedDouble newZoom = new BoundedDouble(0.0, 100.0, 500.0, true, false);
newZoom.setValue(50.0);
bw.setZoom(newZoom);
assertTrue(50 / 100 == (bw.heightInPixels / initHP));
assertTrue(50 / 100 == (bw.widthInPixels / initWP));
assertTrue(bw.resolution.getSelectedValue() == bw.heightInPixels / bw.heightInInches);
assertTrue(bw.resolution.getSelectedValue() == bw.widthInPixels / bw.widthInInches);
}
use of org.cytoscape.work.util.BoundedDouble in project cytoscape-impl by cytoscape.
the class BitmapWriter method setZoom.
public void setZoom(BoundedDouble zf) {
zoom = zf;
// update height
heightInPixels = (int) ((zoom.getValue() / 100) * initialHPixel);
// update width
widthInPixels = (int) ((zoom.getValue() / 100) * initialWPixel);
// update inch measures
final double dpi = resolution.getSelectedValue().doubleValue();
widthInInches = new Double(widthInPixels / dpi);
heightInInches = new Double(heightInPixels / dpi);
}
use of org.cytoscape.work.util.BoundedDouble in project clusterMaker2 by RBVI.
the class EdgeAttributeHandler method initializeTunables.
public void initializeTunables() {
attribute = ModelUtils.updateEdgeAttributeList(network, attribute);
EdgeWeightConverter[] edgeWeightConverters = converters.toArray(new EdgeWeightConverter[1]);
if (edgeWeightConverters.length > 0) {
edgeWeighter = new ListSingleSelection<EdgeWeightConverter>(edgeWeightConverters);
edgeWeighter.setSelectedValue(edgeWeightConverters[0]);
} else {
edgeWeighter = new ListSingleSelection<EdgeWeightConverter>();
}
edgeCutOff = new BoundedDouble(0.0, 0.0, 100.0, false, false);
}
Aggregations