Example #1
0
        private OSMElements.OSMElement createChildBrailleNode(Object filteredSubtree, TemplateUiObject templateObject, String viewName)
        {
            //TODO: falls eine Beziehung im Baum erstellt werden soll muss diese hier? noch gesetzt werden => geht nicht ID ist noch nicht vorhanden
            OSMElements.OSMElement brailleNode = templateObject.osm;
            GeneralProperties      prop        = templateObject.osm.properties;
            BrailleRepresentation  braille     = templateObject.osm.brailleRepresentation;

            prop.isEnabledFiltered = false;
            braille.isVisible      = true;
            if (templateObject.osm.properties.controlTypeFiltered.Equals("DropDownMenuItem"))
            {
                OSMElements.UiElements.DropDownMenuItem dropDownMenu = new OSMElements.UiElements.DropDownMenuItem();
                if (strategyMgr.getSpecifiedTree().HasChild(filteredSubtree) && strategyMgr.getSpecifiedTree().GetData(strategyMgr.getSpecifiedTree().Child(filteredSubtree)).properties.controlTypeFiltered.Contains("Item"))
                {
                    dropDownMenu.hasChild = true;
                }
                if (strategyMgr.getSpecifiedTree().HasNext(filteredSubtree) && strategyMgr.getSpecifiedTree().GetData(strategyMgr.getSpecifiedTree().Next(filteredSubtree)).properties.controlTypeFiltered.Contains("Item"))
                {
                    dropDownMenu.hasNext = true;
                }
                if (strategyMgr.getSpecifiedTree().HasPrevious(filteredSubtree) && strategyMgr.getSpecifiedTree().GetData(strategyMgr.getSpecifiedTree().Previous(filteredSubtree)).properties.controlTypeFiltered.Contains("Item"))
                {
                    dropDownMenu.hasPrevious = true;
                }
                if (strategyMgr.getSpecifiedTree().HasParent(filteredSubtree) && strategyMgr.getSpecifiedTree().GetData(strategyMgr.getSpecifiedTree().Parent(filteredSubtree)).properties.controlTypeFiltered.Contains("Item"))
                {
                    dropDownMenu.isChild = true;
                }
                dropDownMenu.isOpen             = false;
                dropDownMenu.isVertical         = false;
                braille.uiElementSpecialContent = dropDownMenu;
            }
            if (templateObject.osm.properties.controlTypeFiltered.Equals("TabItem"))
            {
                OSMElements.UiElements.TabItem tabView = new OSMElements.UiElements.TabItem();
                //tabView.orientation = templateObject.orientation;
                //braille.uiElementSpecialContent = tabView;
                braille.uiElementSpecialContent = templateObject.osm.brailleRepresentation.uiElementSpecialContent;
            }
            if (templateObject.Screens == null)
            {
                Debug.WriteLine("Achtung, hier wurde kein Screen angegeben!"); return(new OSMElements.OSMElement());
            }
            braille.screenName                = templateObject.Screens[0]; // hier wird immer nur ein Screen-Name übergeben
            braille.viewName                  = viewName;
            brailleNode.properties            = prop;
            brailleNode.brailleRepresentation = braille;
            prop.IdGenerated                  = treeOperation.generatedIds.generatedIdBrailleNode(brailleNode);
            brailleNode.properties            = prop;

            return(brailleNode);
        }
Example #2
0
        /// <summary>
        /// Calculates the positions of each tab in a navigation bar
        /// </summary>
        /// <param name="screens">specifies a list of screens to show this navigation bar</param>
        /// <param name="templateObject">The template object for the navigation bar</param>
        /// <param name="index">the index where the calculation should be start</param>
        /// <returns></returns>
        private List <OSMElements.OSMElement> calculatePositionOfScreenTab(List <String> screens, TemplateUiObject templateObject, int index = 0)
        {
            List <OSMElements.OSMElement> groupElementsStatic = new List <OSMElements.OSMElement>();

            if (screens == null || templateObject.Equals(new TemplateUiObject()))
            {
                return(null);
            }
            foreach (String s in screens)
            {
                OSMElements.OSMElement childOsm = new OSMElements.OSMElement();
                Rect rect = templateObject.osm.brailleRepresentation.groupelementsOfSameType.childBoundingRectangle;

                if (templateObject.orientation.Equals(OSMElements.UiElements.Orientation.Left) || templateObject.orientation.Equals(OSMElements.UiElements.Orientation.Right))
                {
                    rect.Y = (rect.Height + 1) * index + rect.Y + 1;
                }
                if (templateObject.orientation.Equals(OSMElements.UiElements.Orientation.Top) || templateObject.orientation.Equals(OSMElements.UiElements.Orientation.Bottom))
                {
                    rect.X = (rect.Width + 1) * index + rect.X + 1;
                }

                childOsm.properties.boundingRectangleFiltered = rect;
                childOsm.properties.controlTypeFiltered       = templateObject.osm.brailleRepresentation.groupelementsOfSameType.renderer;
                childOsm.properties.valueFiltered             = s;
                childOsm.brailleRepresentation.isGroupChild   = true;
                childOsm.brailleRepresentation.isVisible      = true;
                childOsm.brailleRepresentation.viewName       = "_" + s;//TODO
                childOsm.brailleRepresentation.typeOfView     = templateObject.osm.brailleRepresentation.typeOfView;
                OSMElements.UiElements.TabItem tabView = new OSMElements.UiElements.TabItem();
                tabView.orientation = templateObject.orientation;
                childOsm.brailleRepresentation.uiElementSpecialContent = tabView;
                groupElementsStatic.Add(childOsm);
                index++;
            }
            return(groupElementsStatic);
        }
Example #3
0
        protected override Object createSpecialUiElement(Object filteredSubtree, TemplateUiObject templateObject, String brailleNodeId = null)
        {
            OSMElements.OSMElement brailleNode = templateObject.osm;
            GeneralProperties      prop        = templateObject.osm.properties;
            BrailleRepresentation  braille     = templateObject.osm.brailleRepresentation;

            prop.isEnabledFiltered = false;
            braille.isVisible      = true;
            #region DropDownMenuItem
            if (templateObject.osm.properties.controlTypeFiltered.Equals("DropDownMenuItem"))
            {
                OSMElements.UiElements.DropDownMenuItem dropDownMenu = new OSMElements.UiElements.DropDownMenuItem();
                if (strategyMgr.getSpecifiedTree().HasChild(filteredSubtree) && strategyMgr.getSpecifiedTree().GetData(strategyMgr.getSpecifiedTree().Child(filteredSubtree)).properties.controlTypeFiltered.Contains("Item"))
                {
                    dropDownMenu.hasChild = true;
                }
                if (strategyMgr.getSpecifiedTree().HasNext(filteredSubtree) && strategyMgr.getSpecifiedTree().GetData(strategyMgr.getSpecifiedTree().Next(filteredSubtree)).properties.controlTypeFiltered.Contains("Item"))
                {
                    dropDownMenu.hasNext = true;
                }
                if (strategyMgr.getSpecifiedTree().HasPrevious(filteredSubtree) && strategyMgr.getSpecifiedTree().GetData(strategyMgr.getSpecifiedTree().Previous(filteredSubtree)).properties.controlTypeFiltered.Contains("Item"))
                {
                    dropDownMenu.hasPrevious = true;
                }
                if (strategyMgr.getSpecifiedTree().HasParent(filteredSubtree) && strategyMgr.getSpecifiedTree().GetData(strategyMgr.getSpecifiedTree().Parent(filteredSubtree)).properties.controlTypeFiltered.Contains("Item"))
                {
                    dropDownMenu.isChild = true;
                }
                dropDownMenu.isOpen             = false;
                dropDownMenu.isVertical         = false;
                braille.uiElementSpecialContent = dropDownMenu;
            }
            #endregion
            #region TabItem
            if (templateObject.osm.properties.controlTypeFiltered.Equals("TabItem"))
            {
                OSMElements.UiElements.TabItem tabView = new OSMElements.UiElements.TabItem();
                tabView.orientation             = templateObject.orientation;
                braille.uiElementSpecialContent = tabView;
                //braille.uiElementSpecialContent = templateObject.osm.brailleRepresentation.uiElementSpecialContent;
            }
            #endregion
            if (templateObject.Screens == null)
            {
                Debug.WriteLine("Achtung, hier wurde kein Screen angegeben!"); return(strategyMgr.getSpecifiedTree().NewTree());
            }
            braille.screenName = templateObject.Screens[0]; // hier wird immer nur ein Screen-Name übergeben
            if (!templateObject.allElementsOfType || !treeOperation.searchNodes.existViewInScreen(braille.screenName, templateObject.viewName, templateObject.osm.brailleRepresentation.typeOfView))
            {
                braille.viewName = templateObject.viewName;
            }
            else
            {
                int    i        = 0;
                String viewName = templateObject.viewName + "_" + i;

                while (treeOperation.searchNodes.existViewInScreen(braille.screenName, viewName, templateObject.osm.brailleRepresentation.typeOfView))
                {
                    i++;
                    viewName += i;
                }
                braille.viewName = viewName;
            }

            brailleNode.properties            = prop;
            brailleNode.brailleRepresentation = braille;
            Object tree = strategyMgr.getSpecifiedTree().NewTree();
            strategyMgr.getSpecifiedTree().AddChild(tree, brailleNode);
            return(tree);
        }