Search in sources :

Example 1 with BoundedDouble

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;
}
Also used : BoundedDouble(org.cytoscape.work.util.BoundedDouble)

Example 2 with BoundedDouble

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);
}
Also used : BoundedDouble(org.cytoscape.work.util.BoundedDouble) Test(org.junit.Test)

Example 3 with BoundedDouble

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);
}
Also used : BoundedDouble(org.cytoscape.work.util.BoundedDouble) Test(org.junit.Test)

Example 4 with BoundedDouble

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);
}
Also used : BoundedDouble(org.cytoscape.work.util.BoundedDouble)

Example 5 with BoundedDouble

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);
}
Also used : EdgeWeightConverter(edu.ucsf.rbvi.clusterMaker2.internal.algorithms.edgeConverters.EdgeWeightConverter) BoundedDouble(org.cytoscape.work.util.BoundedDouble)

Aggregations

BoundedDouble (org.cytoscape.work.util.BoundedDouble)5 Test (org.junit.Test)2 EdgeWeightConverter (edu.ucsf.rbvi.clusterMaker2.internal.algorithms.edgeConverters.EdgeWeightConverter)1