Skip to content

Commit

Permalink
[Blueprints] Move GeminiGraphEditor to separate projects
Browse files Browse the repository at this point in the history
Begin works on picking new node
  • Loading branch information
BAndysc committed Oct 20, 2018
1 parent 81d9335 commit 620f6d2
Show file tree
Hide file tree
Showing 66 changed files with 1,373 additions and 334 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
using System.Windows;
using System.Windows.Media.Animation;

namespace WDE.Blueprints.GeminiGraphEditor
namespace GeminiGraphEditor
{
/// <summary>
/// A helper class to simplify animation.
Expand Down
6 changes: 6 additions & 0 deletions GeminiGraphEditor/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2"/>
</startup>
</configuration>
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using System.Windows.Media;
using System.Windows.Shapes;

namespace WDE.Blueprints.GeminiGraphEditor
namespace GeminiGraphEditor
{
public class BezierLine : Shape
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Windows.Data;
using System.Windows.Media;

namespace WDE.Blueprints.GeminiGraphEditor
namespace GeminiGraphEditor
{
public class ColorToBrushConverter : IValueConverter
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Windows;

namespace WDE.Blueprints.GeminiGraphEditor
namespace GeminiGraphEditor
{
public class ConnectionDragCompletedEventArgs : ConnectionDragEventArgs
{
Expand All @@ -11,7 +11,7 @@ public object Connection
get { return _connection; }
}

internal ConnectionDragCompletedEventArgs(RoutedEvent routedEvent, object source,
public ConnectionDragCompletedEventArgs(RoutedEvent routedEvent, object source,
ElementItem elementItem, object connection, ConnectorItem sourceConnectorItem)
: base(routedEvent, source, elementItem, sourceConnectorItem)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Windows;

namespace WDE.Blueprints.GeminiGraphEditor
namespace GeminiGraphEditor
{
public abstract class ConnectionDragEventArgs : RoutedEventArgs
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Windows;

namespace WDE.Blueprints.GeminiGraphEditor
namespace GeminiGraphEditor
{
public class ConnectionDragStartedEventArgs : ConnectionDragEventArgs
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Windows;

namespace WDE.Blueprints.GeminiGraphEditor
namespace GeminiGraphEditor
{
public class ConnectionDraggingEventArgs : ConnectionDragEventArgs
{
Expand All @@ -11,7 +11,7 @@ public object Connection
get { return _connection; }
}

internal ConnectionDraggingEventArgs(RoutedEvent routedEvent, object source,
public ConnectionDraggingEventArgs(RoutedEvent routedEvent, object source,
ElementItem elementItem, object connection, ConnectorItem connectorItem)
: base(routedEvent, source, elementItem, connectorItem)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Windows.Controls;
using System.Windows.Input;

namespace WDE.Blueprints.GeminiGraphEditor
namespace GeminiGraphEditor
{
public class ConnectionItem : ListBoxItem
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Windows.Controls;
using System.Windows.Shapes;

namespace WDE.Blueprints.GeminiGraphEditor
namespace GeminiGraphEditor
{
public class ConnectionItemsControl : ListBox
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Windows.Controls;
using System.Windows.Input;

namespace WDE.Blueprints.GeminiGraphEditor
namespace GeminiGraphEditor
{
public class ConnectorItem : ContentControl
{
Expand Down Expand Up @@ -31,15 +31,15 @@ public Point Position

#region Routed events

internal static readonly RoutedEvent ConnectorDragStartedEvent = EventManager.RegisterRoutedEvent(
public static readonly RoutedEvent ConnectorDragStartedEvent = EventManager.RegisterRoutedEvent(
"ConnectorDragStarted", RoutingStrategy.Bubble, typeof(ConnectorItemDragStartedEventHandler),
typeof(ConnectorItem));

internal static readonly RoutedEvent ConnectorDraggingEvent = EventManager.RegisterRoutedEvent(
public static readonly RoutedEvent ConnectorDraggingEvent = EventManager.RegisterRoutedEvent(
"ConnectorDragging", RoutingStrategy.Bubble, typeof(ConnectorItemDraggingEventHandler),
typeof(ConnectorItem));

internal static readonly RoutedEvent ConnectorDragCompletedEvent = EventManager.RegisterRoutedEvent(
public static readonly RoutedEvent ConnectorDragCompletedEvent = EventManager.RegisterRoutedEvent(
"ConnectorDragCompleted", RoutingStrategy.Bubble, typeof(ConnectorItemDragCompletedEventHandler),
typeof(ConnectorItem));

Expand All @@ -50,7 +50,7 @@ private GraphControl ParentGraphControl
get { return VisualTreeUtility.FindParent<GraphControl>(this); }
}

internal ElementItem ParentElementItem
public ElementItem ParentElementItem
{
get { return VisualTreeUtility.FindParent<ElementItem>(this); }
}
Expand Down
14 changes: 14 additions & 0 deletions GeminiGraphEditor/ConnectorItemDragCompletedEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Windows;

namespace GeminiGraphEditor
{
public class ConnectorItemDragCompletedEventArgs : RoutedEventArgs
{
public ConnectorItemDragCompletedEventArgs(RoutedEvent routedEvent, object source) :
base(routedEvent, source)
{
}
}

public delegate void ConnectorItemDragCompletedEventHandler(object sender, ConnectorItemDragCompletedEventArgs e);
}
16 changes: 16 additions & 0 deletions GeminiGraphEditor/ConnectorItemDragStartedEventArgs.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System.Windows;

namespace GeminiGraphEditor
{
public class ConnectorItemDragStartedEventArgs : RoutedEventArgs
{
public bool Cancel { get; set; }

public ConnectorItemDragStartedEventArgs(RoutedEvent routedEvent, object source)
: base(routedEvent, source)
{
}
}

public delegate void ConnectorItemDragStartedEventHandler(object sender, ConnectorItemDragStartedEventArgs e);
}
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using System.Windows;

namespace WDE.Blueprints.GeminiGraphEditor
namespace GeminiGraphEditor
{
internal class ConnectorItemDraggingEventArgs : RoutedEventArgs
public class ConnectorItemDraggingEventArgs : RoutedEventArgs
{
private readonly double _horizontalChange;

Expand All @@ -26,5 +26,5 @@ public double VerticalChange
}
}

internal delegate void ConnectorItemDraggingEventHandler(object sender, ConnectorItemDraggingEventArgs e);
public delegate void ConnectorItemDraggingEventHandler(object sender, ConnectorItemDraggingEventArgs e);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Windows.Controls;
using System.Windows.Input;

namespace WDE.Blueprints.GeminiGraphEditor
namespace GeminiGraphEditor
{
public class ElementItem : ListBoxItem
{
Expand Down Expand Up @@ -140,7 +140,7 @@ protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e)

#endregion

internal void BringToFront()
public void BringToFront()
{
var parentGraphControl = ParentGraphControl;
if (parentGraphControl == null)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System.Windows;
using System.Windows.Controls;

namespace WDE.Blueprints.GeminiGraphEditor
namespace GeminiGraphEditor
{
public class ElementItemsControl : ListBox
{
Expand Down
106 changes: 106 additions & 0 deletions GeminiGraphEditor/GeminiGraphEditor.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{99F6C079-A4C1-4167-992C-B02EBAA70219}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>GeminiGraphEditor</RootNamespace>
<AssemblyName>GeminiGraphEditor</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup>
<StartupObject />
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Compile Include="VisualTreeUtility.cs" />
<Compile Include="ZoomAndPanControl.cs" />
<Compile Include="ZoomAndPanControl_IScrollInfo.cs" />
<Compile Include="AnimationHelper.cs" />
<Compile Include="BezierLine.cs" />
<Compile Include="ColorToBrushConverter.cs" />
<Compile Include="ConnectionDragCompletedEventArgs.cs" />
<Compile Include="ConnectionDragEventArgs.cs" />
<Compile Include="ConnectionDraggingEventArgs.cs" />
<Compile Include="ConnectionDragStartedEventArgs.cs" />
<Compile Include="ConnectionItem.cs" />
<Compile Include="ConnectionItemsControl.cs" />
<Compile Include="ConnectorItem.cs" />
<Compile Include="ConnectorItemDragCompletedEventArgs.cs" />
<Compile Include="ConnectorItemDraggingEventArgs.cs" />
<Compile Include="ConnectorItemDragStartedEventArgs.cs" />
<Compile Include="ElementItem.cs" />
<Compile Include="ElementItemsControl.cs" />
<Compile Include="GraphControl.cs" />
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<None Include="App.config">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Windows.Controls.Primitives;
using System.Windows.Input;

namespace WDE.Blueprints.GeminiGraphEditor
namespace GeminiGraphEditor
{
// Inspired by studying http://www.codeproject.com/Articles/182683/NetworkView-A-WPF-custom-control-for-visualizing-a
// Thank you Ashley Davis!
Expand Down Expand Up @@ -179,7 +179,7 @@ protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
base.OnMouseLeftButtonDown(e);
}

internal int GetMaxZIndex()
public int GetMaxZIndex()
{
return _elementItemsControl.Items.Cast<object>()
.Select(item => (ElementItem) _elementItemsControl.ItemContainerGenerator.ContainerFromItem(item))
Expand Down
Loading

0 comments on commit 620f6d2

Please sign in to comment.