private void AddClientServerMenu_Click(object sender, RoutedEventArgs e) { ClientServerInterface csInterface = clientServerInterfaceController.CreateClientServerInterface(); AutosarTree.UpdateAutosarTreeView(csInterface); AutosarTree.Focus(); }
private void AddSenderReceiverMenu_Click(object sender, RoutedEventArgs e) { SenderReceiverInterface srInterface = senderReceiverInterfaceController.CreateSenderReceiverInterface(); AutosarTree.UpdateAutosarTreeView(srInterface); AutosarTree.Focus(); }
private void AddEnumDataTypeMenu_Click(object sender, RoutedEventArgs e) { string EnumDataTypeTemplateName = "dtEnumDataType"; if (autosarApp.Enums.FindObject(EnumDataTypeTemplateName) != null) { int index = 0; while (autosarApp.Enums.FindObject(EnumDataTypeTemplateName) != null) { index++; EnumDataTypeTemplateName = "dtEnumDataType" + index.ToString(); } } EnumDataType datatype = DataTypeFabric.Instance().CreateEnumDataType(EnumDataTypeTemplateName); autosarApp.Enums.Add(datatype); AutosarTree.UpdateAutosarTreeView(datatype); AutosarTree.Focus(); }
private void AddArrayDataTypeMenu_Click(object sender, RoutedEventArgs e) { string ArrayDataTypeTemplateName = "New_ArrayDataType"; if (autosarApp.ArrayDataTypes.FindObject(ArrayDataTypeTemplateName) != null) { int index = 0; while (autosarApp.ComplexDataTypes.FindObject(ArrayDataTypeTemplateName) != null) { index++; ArrayDataTypeTemplateName = "New_ArrayDataType" + index.ToString(); } } ArrayDataType datatype = DataTypeFabric.Instance().CreateArrayDataType(ArrayDataTypeTemplateName); autosarApp.ArrayDataTypes.Add(datatype); AutosarTree.UpdateAutosarTreeView(datatype); AutosarTree.Focus(); }
/* Create new component defenition */ private void AddComponentDefenitionButton_Click(object sender, RoutedEventArgs e) { string compDefenitionName = "ComponentDefenition"; int index = 0; while (autosarApp.ComponentDefenitionsList.FindObject(compDefenitionName) != null) { index++; compDefenitionName = "ComponentDefenition" + index.ToString(); } ComponentDefenition compDefenition = ComponentFabric.GetInstance().CreateComponentDefenition(compDefenitionName); autosarApp.ComponentDefenitionsList.Add(compDefenition); componentDefenitionViewController.ComponentDefenition = compDefenition; AutosarTree.UpdateAutosarTreeView(compDefenition); AutosarTree.Focus(); }
private void Viewport_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { if (e.ClickCount == 1) { //Scale image with cursor pointer stayed on last plase Point currentPoint = e.GetPosition(ViewPortImage); //get pointed scene coordinates Point sceneCoordinates = scene.MouseToXY(currentPoint); autosarApp.UnselectComponents(); moveObjectsController.Viewport_MouseLeftButtonDown(sceneCoordinates); if (moveObjectsController.SelectedObject != null) { if (!(moveObjectsController.SelectedObject is CompositionInstance)) { AutosarTree.UpdateAutosarTreeView(moveObjectsController.SelectedObject); AutosarTree.Focus(); } } /* Check for creating connection line */ connectionLineController.Viewport_MouseDown(e, sceneCoordinates); } else if (e.ClickCount == 2) { //Scale image with cursor pointer stayed on last plase Point currentPoint = e.GetPosition(ViewPortImage); //get pointed scene coordinates Point sceneCoordinates = scene.MouseToXY(currentPoint); autosarApp.UnselectComponents(); moveObjectsController.Viewport_MouseLeftButtonDown(sceneCoordinates); if (moveObjectsController.SelectedObject != null) { if (moveObjectsController.SelectedObject is CompositionInstance) { autosarApp.ActiveComposition = moveObjectsController.SelectedObject as CompositionInstance; compositionInstanceController.Composition = autosarApp.ActiveComposition; CompositionProperties_TabItem.IsEnabled = true; SelectElement(autosarApp.ActiveComposition); AutosarTree.UpdateAutosarTreeView(moveObjectsController.SelectedObject); AutosarTree.Focus(); moveObjectsController.SelectedObject = null; } else if (moveObjectsController.SelectedObject is ComponentInstance) { ComponentInstance inst = (moveObjectsController.SelectedObject as ComponentInstance); componentDefenitionViewController.ComponentDefenition = inst.ComponentDefenition; ComponentDefenitionTab.IsEnabled = true; tabHideHelper.ProcessTabs(); tabHideHelper.SelectTab(ComponentDefenitionTab); } } } Render(null, null); }