Ejemplo n.º 1
0
        /// <summary>
        /// Initialisiert, sofern nochnicht vorhanden, ein Ausgabegerät mit den angegebenen Ansichten;
        /// Aktualisiert die Darstellung des Knotens "braille123_6"
        /// </summary>
        /// <param name="fromGuiElement">gibt an welche <code>GeneralProperties</code>-Eigenschaft angezeigt werden soll</param>
        public void UiBrailleDis(String fromGuiElement)
        {
            try
            {
                // String path = @"Templates" + System.IO.Path.DirectorySeparatorChar + "TemplateUi.xml";
                String path = @"C:\Users\mkarlapp\Desktop\TemplateUi2.xml";
                //  setDauGui(displayedGuiElementType);

                /* ITreeStrategy<OSMElement.OSMElement> subtreeNav = strategyMgr.getSpecifiedTreeOperations().getSubtreeOfScreen("A1");
                 * if (subtreeNav != null && subtreeNav.Count > 0)
                 * {
                 *   ui.addNavigationbarForScreen(path, subtreeNav);
                 * }
                 * GuiFunctions guiFuctions = new GuiFunctions(strategyMgr, grantTrees);
                 * if (guiFuctions.isTemplateUsableForDevice(path))
                 * {
                 *   ui.createUiElementsAllScreensSymbolView(path);
                 * //  ui.createUiElementsNavigationbarScreensSymbolView(path);
                 *   ui.updateNavigationbarScreens(path);
                 *
                 * }*/
                treeOperation.updateNodes.updateBrailleGroups();
                if (strategyMgr.getSpecifiedBrailleDisplay() == null)
                {
                    Settings settings = new Settings();
                    strategyMgr.setSpecifiedBrailleDisplay(settings.getPossibleBrailleDisplays()[0].className); // muss dynamisch ermittelt werden

                    strategyMgr.getSpecifiedBrailleDisplay().setStrategyMgr(strategyMgr);
                    strategyMgr.getSpecifiedBrailleDisplay().setGeneratedGrantTrees(grantTrees);
                    strategyMgr.getSpecifiedBrailleDisplay().setTreeOperation(treeOperation);
                    // strategyMgr.getSpecifiedBrailleDisplay().initializedSimulator();
                    strategyMgr.getSpecifiedBrailleDisplay().setActiveAdapter();
                    strategyMgr.getSpecifiedBrailleDisplay().generatedBrailleUi();
                }
                else
                {
                    if (!strategyMgr.getSpecifiedBrailleDisplay().isInitialized())
                    {
                        strategyMgr.getSpecifiedBrailleDisplay().setActiveAdapter();
                        strategyMgr.getSpecifiedBrailleDisplay().generatedBrailleUi();
                    }
                }
                strategyMgr.getSpecifiedBrailleDisplay().generatedBrailleUi();
                if (grantTrees.osmTreeConnections == null)
                {
                    List <OsmTreeConnectorTuple> relationship = ExampleTree.setOsmRelationship();
                    grantTrees.osmTreeConnections = relationship;
                }
                else
                {
                    if (grantTrees.filteredTree == null)
                    {
                        Console.WriteLine("Die Anwendung wurde noch nicht gefiltert - bitte 'F5' drücken");
                        return;
                    }
                    GeneralProperties propertiesForSearch = new GeneralProperties();
                    propertiesForSearch.controlTypeFiltered = "TextBox";
                    List <Object> treeElement = treeOperation.searchNodes.getNodesByProperties(grantTrees.brailleTree, propertiesForSearch, OperatorEnum.and);
                    String        brailleId   = "";
                    if (treeElement.Count > 0)
                    {
                        brailleId = strategyMgr.getSpecifiedTree().GetData(treeElement[0]).properties.IdGenerated;
                    }
                    if (brailleId.Equals(""))
                    {
                        return;
                    }
                    OsmTreeConnectorTuple osmRelationships = grantTrees.osmTreeConnections.Find(r => r.BrailleTreeId.Equals(brailleId) || r.FilteredTreeId.Equals(brailleId));
                    if (osmRelationships != null)
                    {
                        //strategyMgr.getSpecifiedFilter().updateNodeOfFilteredTree(osmRelationships.FilteredTree);
                        treeOperation.updateNodes.filteredNodeElementOfApplication(osmRelationships.FilteredTreeId);

                        OSMElements.OSMElement relatedBrailleTreeObject = treeOperation.searchNodes.getBrailleTreeOsmElementById(osmRelationships.BrailleTreeId);
                        if (!relatedBrailleTreeObject.Equals(new OSMElements.OSMElement()))
                        {
                            treeOperation.updateNodes.updateNodeOfBrailleUi(ref relatedBrailleTreeObject);
                            strategyMgr.getSpecifiedBrailleDisplay().updateViewContent(ref relatedBrailleTreeObject);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("An error occurred: '{0}'", ex);
            }
        }
Ejemplo n.º 2
0
        private void InitializeFilterComponent()
        {
            settings      = new Settings();
            strategyMgr   = new StrategyManager();
            grantTree     = new GeneratedGrantTrees();
            searchNodes   = new SearchNodes(strategyMgr, grantTree, treeOperation);
            treeOperation = new TreeOperation(strategyMgr, grantTree);

            // Setzen des Eventmanager
            List <Strategy> possibleEventManager = settings.getPossibleEventManager();

            //abfrage der klassen, debugnamen, des typ für eintragung in strategy.confog - datei für entsprechende erstellung der klasse hier im manager
            //IEvent_PRISMStrategy test = new StrategyEvent_PRISM.Event_PRISM();
            //Type t = test.GetType();

            strategyMgr.setSpecifiedEventStrategy(possibleEventManager[0].className);

            #region setzen der neuen (Juni 2017) Event Interfaces
            strategyMgr.setSpecifiedEventAction(settings.getPossibleEventAction()[0].className);
            strategyMgr.getSpecifiedEventAction().setGrantTrees(grantTree);
            strategyMgr.getSpecifiedEventAction().setTreeOperation(treeOperation);
            strategyMgr.setSpecifiedEventManager(settings.getPossibleEventManager2()[0].className);
            strategyMgr.setSpecifiedEventProcessor(settings.getPossibleEventProcessor()[0].className);

            strategyMgr.getSpecifiedEventProcessor().setGrantTrees(grantTree);
            strategyMgr.getSpecifiedEventProcessor().setTreeOperations(treeOperation);

            //todo: neu, nur in example, noch an application machen
            strategyMgr.getSpecifiedEventManager().setGrantTrees(grantTree);
            strategyMgr.getSpecifiedEventManager().setTreeOperations(treeOperation);
            //test
            strategyMgr.getSpecifiedEventManager().EventExample();
            #endregion


            List <Strategy> possibleOperationSystems = settings.getPossibleOperationSystems();
            String          cUserOperationSystemName = possibleOperationSystems[0].userName; // muss dynamisch ermittelt werden
            strategyMgr.setSpecifiedOperationSystem(Settings.strategyUserNameToClassName(cUserOperationSystemName));

            List <Strategy> possibleTrees = settings.getPossibleTrees();
            strategyMgr.setSpecifiedTree(possibleTrees[0].className);



            List <Strategy> possibleFilter  = Settings.getPossibleFilters();
            String          cUserFilterName = possibleFilter[0].userName; // der Filter muss dynamisch ermittelt werden
            strategyMgr.setSpecifiedFilter(Settings.strategyUserNameToClassName(cUserFilterName));
            //  strategyMgr.getSpecifiedFilter().setStrategyMgr(strategyMgr);

            strategyMgr.setSpecifiedBrailleDisplay(settings.getPossibleBrailleDisplays()[0].className); // muss dynamisch ermittelt werden
            //if (strategyMgr.getSpecifiedBrailleDisplay() == null)
            {
                Settings settings = new Settings();
                strategyMgr.setSpecifiedBrailleDisplay(settings.getPossibleBrailleDisplays()[0].className); // muss dynamisch ermittelt werden

                strategyMgr.getSpecifiedBrailleDisplay().setStrategyMgr(strategyMgr);
                strategyMgr.getSpecifiedBrailleDisplay().setGeneratedGrantTrees(grantTree);
                strategyMgr.getSpecifiedBrailleDisplay().setTreeOperation(treeOperation);
                // strategyMgr.getSpecifiedBrailleDisplay().initializedSimulator();
                //strategyMgr.getSpecifiedBrailleDisplay().setActiveAdapter();
                //strategyMgr.getSpecifiedBrailleDisplay().generatedBrailleUi();
            }
            // brailleDisplayStrategy = strategyMgr.getSpecifiedBrailleDisplay();
            //  brailleDisplayStrategy.setStrategyMgr(strategyMgr);

            strategyMgr.setSpecifiedDisplayStrategy(settings.getPosibleDisplayStrategies()[0].className);

            strategyMgr.setSpecifiedGeneralTemplateUi(settings.getPossibleUiTemplateStrategies()[0].className);
            strategyMgr.getSpecifiedGeneralTemplateUi().setGeneratedGrantTrees(grantTree);
            strategyMgr.getSpecifiedGeneralTemplateUi().setTreeOperation(treeOperation);

            strategyMgr.getSpecifiedFilter().setGeneratedGrantTrees(grantTree);
            strategyMgr.getSpecifiedFilter().setTreeOperation(treeOperation);
            exampleTree       = new ExampleTree(strategyMgr, grantTree, treeOperation);
            exampleInspectGui = new InspectGui(strategyMgr);
            exampleBrailleDis = new ExampleBrailleDis(strategyMgr, grantTree, treeOperation);
            exampleDisplay    = new ExampleDisplayStrategy(strategyMgr);

            guiFunctions = new GuiFunctions(strategyMgr, grantTree, treeOperation);
        }