private static WizardStep createKnownDose(
     final JDialog dialog, final TreatmentCategorizationWizardPresentation pm) {
   return DoseRangeWizardStep.createOnKnownDoses(
       dialog,
       pm,
       "Any dose type",
       "For each of the categories, define a range in which the dose must lie. For flexible dose the entire administered dose range must be within the specified range to be in the category.");
 }
 private static WizardStep createFlexibleLowerRanges(
     final JDialog dialog, final TreatmentCategorizationWizardPresentation pm) {
   return DoseRangeWizardStep.createOnMultipleParentRanges(
       dialog,
       pm,
       pm.getFlexibleUpperRanges(),
       "Specify the ranges for lower bound of flexible doses",
       "For each of the categories, define a range in which the lower bound of the administered dose must lie.");
 }
 private static DoseRangeWizardStep createFlexibleUpperDose(
     final JDialog dialog, final TreatmentCategorizationWizardPresentation pm) {
   return DoseRangeWizardStep.createOnBeanProperty(
       dialog,
       pm,
       pm.getFlexibleUpperRangeNode(),
       FlexibleDose.PROPERTY_MIN_DOSE,
       "Specify the ranges for upper bound of flexible doses",
       "For each of the categories, define a range in which the upper bound of the administered dose must lie.");
 }
 private static AbstractTreatmentCategorizationWizardStep createFixedDose(
     final JDialog dialog, final TreatmentCategorizationWizardPresentation pm) {
   return DoseRangeWizardStep.createOnBeanProperty(
       dialog,
       pm,
       pm.getFixedRangeNode(),
       null,
       "Specify ranges for fixed doses",
       "For each of the categories, define a range in which the administered dose must lie.");
 }
  private static void buildFlexiblePath(
      final TreatmentCategorizationWizardPresentation pm,
      final JDialog dialog,
      final BranchingPath flexiblePath,
      final SpecifyDoseTypeWizardStep type,
      final SimplePath lastPath,
      final ValueModel condition) {
    final DoseRangeWizardStep lowerFirst = createFlexibleLowerDose(dialog, pm);
    final DoseRangeWizardStep upperFirst = createFlexibleUpperDose(dialog, pm);
    final BranchingPath lowerFirstPath = new BranchingPath(lowerFirst);
    final BranchingPath upperFirstPath = new BranchingPath(upperFirst);

    addBranch(
        flexiblePath,
        lowerFirstPath,
        new BooleanAndModel(condition, pm.getConsiderFlexibleLowerFirst()));
    addBranch(
        flexiblePath,
        upperFirstPath,
        new BooleanAndModel(condition, pm.getConsiderFlexibleUpperFirst()));

    addBranch(
        lowerFirstPath,
        createSimplePath(lastPath, createFlexibleUpperRanges(dialog, pm)),
        lowerFirst.getConsiderNextProperty());
    addBranch(
        upperFirstPath,
        createSimplePath(lastPath, createFlexibleLowerRanges(dialog, pm)),
        upperFirst.getConsiderNextProperty());
    addBranch(lowerFirstPath, lastPath, new BooleanNotModel(lowerFirst.getConsiderNextProperty()));
    addBranch(upperFirstPath, lastPath, new BooleanNotModel(upperFirst.getConsiderNextProperty()));
  }