Examples of Percent


Examples of barsuift.simLife.Percent

    @Override
    public void stateChanged(ChangeEvent e) {
        JSlider source = (JSlider) e.getSource();
        int luminosity = (int) source.getValue();
        sun.setLuminosity(new Percent(luminosity));
    }
View Full Code Here

Examples of barsuift.simLife.Percent

        sun = new BasicSun(sunState);
        assertEquals(sunState, sun.getState());
    }

    public void testGetLuminosity() {
        sun.setLuminosity(new Percent(30));
        assertEquals(new Percent(30), sun.getLuminosity());
        try {
            sun.setLuminosity(null);
            fail("Should throw an IllegalArgumentException");
        } catch (IllegalArgumentException e) {
            // OK expected exception
View Full Code Here

Examples of barsuift.simLife.Percent

            // OK expected exception
        }
    }

    public void testGetRiseAngle() {
        sun.setRiseAngle(new Percent(30));
        assertEquals(new Percent(30), sun.getRiseAngle());
        try {
            sun.setRiseAngle(null);
            fail("Should throw an IllegalArgumentException");
        } catch (IllegalArgumentException e) {
            // OK expected exception
View Full Code Here

Examples of barsuift.simLife.Percent

            // OK expected exception
        }
    }

    public void testGetZenithAngle() {
        sun.setZenithAngle(new Percent(30));
        assertEquals(new Percent(30), sun.getZenithAngle());
        try {
            sun.setZenithAngle(null);
            fail("Should throw an IllegalArgumentException");
        } catch (IllegalArgumentException e) {
            // OK expected exception
View Full Code Here

Examples of barsuift.simLife.Percent

    }

    public void testObserverLuminosity() {
        observerHelper.addObserver(sun);
        assertEquals(sunState.getLuminosity().toPercent(), sun.getLuminosity());
        sun.setLuminosity(new Percent(90));
        assertEquals(new Percent(90), sun.getLuminosity());
        assertEquals(1, observerHelper.nbUpdated());
        assertEquals(SunUpdateCode.luminosity, observerHelper.getUpdateObjects().get(0));
    }
View Full Code Here

Examples of barsuift.simLife.Percent

    }

    public void testObserverRiseAngle() {
        observerHelper.addObserver(sun);
        assertEquals(sunState.getRiseAngle().toPercent(), sun.getRiseAngle());
        sun.setRiseAngle(new Percent(50));
        assertEquals(new Percent(50), sun.getRiseAngle());
        assertEquals(1, observerHelper.nbUpdated());
        assertEquals(SunUpdateCode.riseAngle, observerHelper.getUpdateObjects().get(0));
    }
View Full Code Here

Examples of barsuift.simLife.Percent

    }

    public void testObserverZenithAngle() {
        observerHelper.addObserver(sun);
        assertEquals(sunState.getZenithAngle().toPercent(), sun.getZenithAngle());
        sun.setZenithAngle(new Percent(75));
        assertEquals(new Percent(75), sun.getZenithAngle());
        assertEquals(1, observerHelper.nbUpdated());
        assertEquals(SunUpdateCode.zenithAngle, observerHelper.getUpdateObjects().get(0));
    }
View Full Code Here

Examples of org.shiftone.jrat.util.Percent

    children = newChildren;
    if (node.getTotalDurationNanos() == 0) {
      parentTotalDurationPercent = null;
    } else {
      parentTotalDurationNanos = node.getTotalDurationNanos() - childrenTotalDurationNanos;
      parentTotalDurationPercent = new Percent(parentTotalDurationNanos * 100.0 / node.getTotalDurationNanos());
    }
    fireTableDataChanged();
  }
View Full Code Here

Examples of org.shiftone.jrat.util.Percent

    case 10:
      return node.getMinDuration(TimeUnit.MS);
    case 11:
      return node.getMaxDuration(TimeUnit.MS);
    case 12:
      return (rowIndex == 0) ? parentTotalDurationPercent : new Percent(node.getPctOfAvgParentDuration());
    }
    return null;
  }
View Full Code Here

Examples of org.shiftone.jrat.util.Percent

    case 10:
      return node.getMinDuration(TimeUnit.MS);
    case 11:
      return node.getMaxDuration(TimeUnit.MS);
    case 12:
      return new Percent(node.getPctOfAvgParentDuration());
    case 13:
      return new Percent(getPctOfAvgRootDuration(node));
    }
    return null;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.