Example usage for com.jgoodies.binding PresentationModel getBean

List of usage examples for com.jgoodies.binding PresentationModel getBean

Introduction

In this page you can find the example usage for com.jgoodies.binding PresentationModel getBean.

Prototype

public B getBean() 

Source Link

Document

Returns the bean that holds the adapted properties.

Usage

From source file:org.drugis.addis.presentation.RelativeEffectTableModelBaseTest.java

License:Open Source License

@SuppressWarnings("unchecked")
@Test/*from  w  w  w  .  j  a v a 2s  .c o m*/
public void testGetValueAtLowerLeftPart() {
    assertEquals(3, d_threeArmStudy.getArms().size());
    Arm pg0 = d_threeArmStudy.getArms().get(0);
    Arm pg1 = d_threeArmStudy.getArms().get(1);
    Arm pg2 = d_threeArmStudy.getArms().get(2);

    PresentationModel<BasicRelativeEffect<?>> val20 = (PresentationModel<BasicRelativeEffect<?>>) d_threeArmModel
            .getValueAt(2, 0);
    assertTrue(d_relativeEffectClass.isInstance(val20.getBean()));
    assertEquals(d_threeArmStudy.getMeasurement(d_endpoint, pg2), val20.getBean().getBaseline());
    assertEquals(d_threeArmStudy.getMeasurement(d_endpoint, pg0), val20.getBean().getSubject());

    PresentationModel<BasicRelativeEffect<?>> val21 = (PresentationModel<BasicRelativeEffect<?>>) d_threeArmModel
            .getValueAt(2, 1);
    assertTrue(d_relativeEffectClass.isInstance(val21.getBean()));
    assertEquals(d_threeArmStudy.getMeasurement(d_endpoint, pg2), val21.getBean().getBaseline());
    assertEquals(d_threeArmStudy.getMeasurement(d_endpoint, pg1), val21.getBean().getSubject());
}