示例#1
0
        protected void SetupRulePhases()
        {
            _rulePhases = new ArrayList(5);

            /*
             * Phase 1: Scan the specification for units and also any
             * information that may be helpful for determining structure.
             */
            SpecScanPhase phaseOne = new SpecScanPhase();

            phaseOne.AddRule(new ListFindingRule());
            phaseOne.AddRule(new UnitFindingRule());
            phaseOne.AddRule(new MutualExclusionRule());

            _rulePhases.Add(phaseOne);

            /*
             * Phase 2: Scan the specification again and assign CIOs to
             * each appliance object.  These will used in later phases to
             * populate the lists and make decisions about list structure.
             */

            UnitScanPhase phaseTwo = new UnitScanPhase();

            phaseTwo.AddRule(new ListUnitFinder());
            phaseTwo.AddRule(new ObjectUnitFinder());

            _rulePhases.Add(phaseTwo);

            /*
             * Phase 3: Build an intermediate list structure that can be
             * easily modified by later phases.  This structure is tightly
             * bound to the appliance structure.
             */
            BuildListPhase phaseThree = new BuildListPhase();

            phaseThree.AddRule(new AssignListNodeRule());
            phaseThree.AddRule(new MutualExclusionSubListRule());
            phaseThree.AddRule(new NamedGroupSubListRule());
            phaseThree.AddRule(new ObjectsInListRule());

            _rulePhases.Add(phaseThree);

            /*
             * Phase 4: Build the concrete list structure from the
             * intermediate structure that has been determined so far.
             */
            ListManipulatePhase phaseFour = new ListManipulatePhase();

            phaseFour.AddRule(new CombinePanelNodesRule());
            phaseFour.AddRule(new NoSingleListNodesRule());

            _rulePhases.Add(phaseFour);

            /*
             * Phase 5: Build the concrete list structure from the
             * intermediate structure that has been determined so far.
             */
            BuildConcreteListPhase phaseFive = new BuildConcreteListPhase();

            phaseFive.AddRule(new MakeValueSubListRule());
            phaseFive.AddRule(new MakeSubListRule());
            phaseFive.AddRule(new MakePanelItemRule());
            phaseFive.AddRule(new MakeListItemRule());
            phaseFive.AddRule(new PlacePanelItemsRule());

            _rulePhases.Add(phaseFive);
        }
示例#2
0
        protected void SetupRulePhases()
        {
            _rulePhases = new ArrayList(2);

            /*
             * Phase 1: Scan the specification for units and also any
             * information that may be helpful for determining structure.
             */
            SpecScanPhase phaseOne = new SpecScanPhase();

            phaseOne.AddRule(new ListFindingRule());
            phaseOne.AddRule(new UnitFindingRule());
            phaseOne.AddRule(new MutualExclusionRule());

            _rulePhases.Add(phaseOne);

            /*
             * Phase 2: Modify the specification based upon information
             * found in the previous phase, and inferences made during this
             * phase.
             */

            GroupScanPhase phaseTwo = new GroupScanPhase();

            phaseTwo.AddRule(new NoPanelsRule());
            phaseTwo.AddRule(new PowerPanelRule());
            phaseTwo.AddRule(new TabbedPanelsRule());
            phaseTwo.AddRule(new OverlappingPanelsRule());

            _rulePhases.Add(phaseTwo);

            /*
             * Phase 3: Scan throught the portions of the group tree
             * not yet assigned to widgets.
             */

            UnitScanPhase phaseThree = new UnitScanPhase();

            phaseThree.AddRule(new ListUnitFinder());
            phaseThree.AddRule(new ObjectUnitFinder());

            _rulePhases.Add(phaseThree);

            /*
             * Phase 4: Build the interface tree from the group tree.
             * Assign rows to CIOs during this process.
             */

            TreeBuildingPhase phaseFour = new TreeBuildingPhase();

            phaseFour.AddRule(new OrganizeTreeRule());
            phaseFour.AddRule(new GetPanelRule());
            phaseFour.AddRule(new LabeledTwoCompRowRule());
            phaseFour.AddRule(new FullWidthRowRule());
            phaseFour.AddRule(new OneColumnRowRule());

            _rulePhases.Add(phaseFour);

            /*
             * Phase 5: Build the concrete interface from the interface tree.
             */

            BuildConcretePhase phaseFive = new BuildConcretePhase();

            // TODO: Re-write this phase to use rules...  Currently the
            // phase object does all the work.

            _rulePhases.Add(phaseFive);

            /*
             * Phase 6: Attempt to fix layout problems in the interface tree.
             */

            FixLayoutPhase phaseSix = new FixLayoutPhase();

            phaseSix.AddRule(new FixLayoutWithTabsRule());

            _rulePhases.Add(phaseSix);

            /*
             * Phase 7: Enabling auto-scrolling for panels.
             */

            TreeTraversalPhase phaseSeven = new TreeTraversalPhase();

            phaseSeven.AddRule(new TurnOnScrollingRule());

            _rulePhases.Add(phaseSeven);
        }