зеркало из https://github.com/stride3d/GraphX.git
Merge with another branch
Many updates and fixes (See change log)
This commit is contained in:
Родитель
1de6424320
Коммит
335eb9c7b0
|
@ -106,3 +106,4 @@ Generated_Code #added for RIA/Silverlight projects
|
|||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
/Nuget/*.nupkg
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<solution>
|
||||
<add key="disableSourceControlIntegration" value="true" />
|
||||
</solution>
|
||||
</configuration>
|
Двоичный файл не отображается.
|
@ -0,0 +1,151 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
|
||||
|
||||
<!-- Enable the restore command to run before builds -->
|
||||
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
|
||||
|
||||
<!-- Property that enables building a package from a project -->
|
||||
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
|
||||
|
||||
<!-- Determines if package restore consent is required to restore packages -->
|
||||
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
|
||||
|
||||
<!-- Download NuGet.exe if it does not already exist -->
|
||||
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(PackageSources)' == '' ">
|
||||
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
|
||||
<!-- The official NuGet package source (https://www.nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
|
||||
<!--
|
||||
<PackageSource Include="https://www.nuget.org/api/v2/" />
|
||||
<PackageSource Include="https://my-nuget-source/nuget/" />
|
||||
-->
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
|
||||
<!-- Windows specific commands -->
|
||||
<NuGetToolsPath>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
|
||||
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
|
||||
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<PackagesProjectConfig>packages.$(MSBuildProjectName.Replace(' ', '_')).config</PackagesProjectConfig>
|
||||
</PropertyGroup>
|
||||
|
||||
<Choose>
|
||||
<When Condition="Exists('$(PackagesProjectConfig)')">
|
||||
<PropertyGroup>
|
||||
<PackagesConfig>$(PackagesProjectConfig)</PackagesConfig>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
<When Condition="Exists('packages.config')">
|
||||
<PropertyGroup>
|
||||
<PackagesConfig>packages.config</PackagesConfig>
|
||||
</PropertyGroup>
|
||||
</When>
|
||||
</Choose>
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- NuGet command -->
|
||||
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
|
||||
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
|
||||
|
||||
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
|
||||
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
|
||||
|
||||
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
|
||||
|
||||
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
|
||||
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
|
||||
|
||||
<PaddedSolutionDir Condition=" '$(OS)' == 'Windows_NT'">"$(SolutionDir) "</PaddedSolutionDir>
|
||||
<PaddedSolutionDir Condition=" '$(OS)' != 'Windows_NT' ">"$(SolutionDir)"</PaddedSolutionDir>
|
||||
|
||||
<!-- Commands -->
|
||||
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)</RestoreCommand>
|
||||
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
|
||||
|
||||
<!-- We need to ensure packages are restored prior to assembly resolve -->
|
||||
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
|
||||
RestorePackages;
|
||||
$(BuildDependsOn);
|
||||
</BuildDependsOn>
|
||||
|
||||
<!-- Make the build depend on restore packages -->
|
||||
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
|
||||
$(BuildDependsOn);
|
||||
BuildPackage;
|
||||
</BuildDependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="CheckPrerequisites">
|
||||
<!-- Raise an error if we're unable to locate nuget.exe -->
|
||||
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
|
||||
<!--
|
||||
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
|
||||
This effectively acts as a lock that makes sure that the download operation will only happen once and all
|
||||
parallel builds will have to wait for it to complete.
|
||||
-->
|
||||
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="_DownloadNuGet">
|
||||
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
|
||||
</Target>
|
||||
|
||||
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
|
||||
<Exec Command="$(RestoreCommand)"
|
||||
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
|
||||
|
||||
<Exec Command="$(RestoreCommand)"
|
||||
LogStandardErrorAsError="true"
|
||||
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
|
||||
<Exec Command="$(BuildCommand)"
|
||||
Condition=" '$(OS)' != 'Windows_NT' " />
|
||||
|
||||
<Exec Command="$(BuildCommand)"
|
||||
LogStandardErrorAsError="true"
|
||||
Condition=" '$(OS)' == 'Windows_NT' " />
|
||||
</Target>
|
||||
|
||||
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
|
||||
<ParameterGroup>
|
||||
<OutputFilename ParameterType="System.String" Required="true" />
|
||||
</ParameterGroup>
|
||||
<Task>
|
||||
<Reference Include="System.Core" />
|
||||
<Using Namespace="System" />
|
||||
<Using Namespace="System.IO" />
|
||||
<Using Namespace="System.Net" />
|
||||
<Using Namespace="Microsoft.Build.Framework" />
|
||||
<Using Namespace="Microsoft.Build.Utilities" />
|
||||
<Code Type="Fragment" Language="cs">
|
||||
<![CDATA[
|
||||
try {
|
||||
OutputFilename = Path.GetFullPath(OutputFilename);
|
||||
|
||||
Log.LogMessage("Downloading latest version of NuGet.exe...");
|
||||
WebClient webClient = new WebClient();
|
||||
webClient.DownloadFile("https://www.nuget.org/nuget.exe", OutputFilename);
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex) {
|
||||
Log.LogErrorFromException(ex);
|
||||
return false;
|
||||
}
|
||||
]]>
|
||||
</Code>
|
||||
</Task>
|
||||
</UsingTask>
|
||||
</Project>
|
Двоичные данные
DLL/QuickGraph.Serialization.dll
Двоичные данные
DLL/QuickGraph.Serialization.dll
Двоичный файл не отображается.
Двоичные данные
DLL/QuickGraph.dll
Двоичные данные
DLL/QuickGraph.dll
Двоичный файл не отображается.
Двоичные данные
DLL/YAXLib.dll
Двоичные данные
DLL/YAXLib.dll
Двоичный файл не отображается.
|
@ -7,12 +7,17 @@
|
|||
+ Added key modifiers to vertex event args
|
||||
+ Added new layout type Custom. When set layout algorithm calculation is skipped completely and manually added data is used for OR and ER algorithms (if any).
|
||||
+ Added (reintroduced) GraphArea::SideExpansionSize property which gets or sets additional space for GraphArea borders. Useful for zoom adjustments when custom text or controls which are not used in size calculations must fit into the zooming.
|
||||
+ Added IGraphControlFactory-Interface and Implementation for Edge and Vertex controls creation (thanks to Paul Mandalka)
|
||||
+ Added simple Nuget-Package specification for GraphX (use createPackage.bat to create the nuget package for GraphX) (thanks to Paul Mandalka)
|
||||
+ Added new ZoomControl::ZoomAnimationCompleted event (thanks to Paul Mandalka)
|
||||
+ Fixed PrintHelper::ExportToImage method to use DPI-Settings for Image Rendering (thanks to Paul Mandalka)
|
||||
+ Fixed labels rendering for parallel edges. Now they are displayed separately for each edge.
|
||||
+ Fixed async calculations being broken due to LogicCore property became dependency
|
||||
+ Fixed ViewFinder not deriving ZoomControl content background
|
||||
+ Fixed edge label update on alignment change
|
||||
+ Fixed self-looped edges handling in GraphArea::GenerateEdgesForVertex() method
|
||||
+ Fixed bugs with edge routing calculation in some cases
|
||||
+ Fixed: Graph-Area LogicCoreProperty was registered using GraphAreaBase which could cause a problem (thanks to Paul Mandalka)
|
||||
+ Implemented some properties as dependencies
|
||||
+ Implemented EdgeControl::IsSelfLooped property as read-only dependency property.
|
||||
+ Reworked EdgeLabelControl inner logic. Should now be more flexible and performance efficient.
|
||||
|
|
|
@ -357,11 +357,11 @@
|
|||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem Header="Test Ground" Name="tgtab">
|
||||
<Grid Name="xxx">
|
||||
<Grid>
|
||||
<Grid.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="Templates/ERGraphXTemplates.xaml"/>
|
||||
<ResourceDictionary Source="Templates/TestTemplates.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Grid.Resources>
|
||||
|
|
|
@ -24,7 +24,9 @@ namespace ShowcaseExample
|
|||
{
|
||||
tst_but_gen.Click += tst_but_gen_Click;
|
||||
//tst_Area.UseNativeObjectArrange = false;
|
||||
|
||||
tst_Area.EnableVisualPropsRecovery = true;
|
||||
tst_Area.SetVerticesMathShape(VertexShape.Rectangle);
|
||||
tst_Area.SetVerticesDrag(true, true);
|
||||
}
|
||||
|
||||
private GraphExample GenerateTestGraph()
|
||||
|
@ -39,11 +41,11 @@ namespace ShowcaseExample
|
|||
var v4 = new DataVertex() { Text = "Test4", ID = 4 };
|
||||
graph.AddVertex(v4);
|
||||
|
||||
graph.AddEdge(new DataEdge(v1, v2, 100) { ToolTipText = "FFFFFF" });
|
||||
graph.AddEdge(new DataEdge(v1, v2, 100) { ToolTipText = "FFFFFF" });
|
||||
graph.AddEdge(new DataEdge(v1, v2, 100) { ToolTipText = "FFFFFF" });
|
||||
graph.AddEdge(new DataEdge(v1, v1, 100) { ToolTipText = "AAA" });
|
||||
graph.AddEdge(new DataEdge(v1, v2, 100));
|
||||
graph.AddEdge(new DataEdge(v2, v3, 100));
|
||||
graph.AddEdge(new DataEdge(v2, v4, 100));
|
||||
|
||||
|
||||
return graph;
|
||||
|
||||
}
|
||||
|
@ -52,16 +54,10 @@ namespace ShowcaseExample
|
|||
{
|
||||
var graph = GenerateTestGraph();
|
||||
var logic = new LogicCoreExample {Graph = graph};
|
||||
logic.EnableParallelEdges = false;
|
||||
logic.ParallelEdgeDistance = 15;
|
||||
|
||||
logic.EnableParallelEdges = true;
|
||||
logic.ParallelEdgeDistance = 25;
|
||||
tst_Area.AlignAllEdgesLabels(true);
|
||||
tst_Area.ShowAllEdgesLabels(true);
|
||||
tst_Area.ShowAllEdgesArrows(true);
|
||||
tst_Area.EnableVisualPropsRecovery = true;
|
||||
tst_Area.SetVerticesMathShape(VertexShape.Rectangle);
|
||||
tst_Area.SetVerticesDrag(true, true);
|
||||
|
||||
tst_Area.ShowAllEdgesArrows(false);
|
||||
|
||||
var layParams = new LinLogLayoutParameters { IterationCount = 100 };
|
||||
logic.DefaultLayoutAlgorithm = LayoutAlgorithmTypeEnum.LinLog;
|
||||
|
@ -72,8 +68,13 @@ namespace ShowcaseExample
|
|||
IExternalEdgeRouting<DataVertex, DataEdge> erParams = null;
|
||||
//logic.ExternalEdgeRoutingAlgorithm =
|
||||
|
||||
TSTLC = logic;
|
||||
tst_Area.GenerateGraph(graph, true);
|
||||
//tst_Area.VertexList[v1].Visibility = System.Windows.Visibility.Collapsed;
|
||||
//tst_Area.VertexList[v2].Visibility = System.Windows.Visibility.Collapsed;
|
||||
//tst_Area.VertexList[v3].Visibility = System.Windows.Visibility.Collapsed;
|
||||
//tst_Area.VertexList[v4].SetPosition(new Point(0, 0));
|
||||
tst_Area.ShowAllEdgesLabels();
|
||||
tst_Area.AlignAllEdgesLabels();
|
||||
tst_zoomctrl.ZoomToFill();
|
||||
|
||||
/* var img = new BitmapImage(new Uri(@"pack://application:,,,/ShowcaseExample;component/Images/birdy.png", UriKind.Absolute)) { CacheOption = BitmapCacheOption.OnLoad };
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
</SccAuxPath>
|
||||
<SccProvider>
|
||||
</SccProvider>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
|
@ -65,10 +67,16 @@
|
|||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="QuickGraph">
|
||||
<HintPath>..\..\DLL\QuickGraph.dll</HintPath>
|
||||
<HintPath>..\..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="QuickGraph.Data">
|
||||
<HintPath>..\..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="QuickGraph.Graphviz">
|
||||
<HintPath>..\..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Graphviz.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="QuickGraph.Serialization">
|
||||
<HintPath>..\..\DLL\QuickGraph.Serialization.dll</HintPath>
|
||||
<HintPath>..\..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
|
@ -85,7 +93,7 @@
|
|||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="YAXLib">
|
||||
<HintPath>..\..\DLL\YAXLib.dll</HintPath>
|
||||
<HintPath>..\..\packages\YAXLib.2.12\lib\YAXLib.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -204,6 +212,7 @@
|
|||
<Resource Include="Images\add.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="readme.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
|
@ -260,6 +269,13 @@
|
|||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Aktivieren Sie die Wiederherstellung von NuGet-Paketen, um die fehlende Datei herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
|
|
@ -6,11 +6,8 @@
|
|||
xmlns:gxl="clr-namespace:GraphX;assembly=GraphX.Controls"
|
||||
xmlns:conv="clr-namespace:GraphX.Converters;assembly=GraphX.Controls">
|
||||
|
||||
<ControlTemplate x:Key="RightTriangleAnnotations">
|
||||
<Polygon Points="0 0, 20 20,0 20" x:Name="poly" Fill="Green" Stroke="Red"></Polygon>
|
||||
</ControlTemplate>
|
||||
|
||||
<!-- VERTEX CONTROL -->
|
||||
|
||||
<!-- VERTEX CONTROL -->
|
||||
<Style TargetType="{x:Type gxl:VertexControl}">
|
||||
<Setter Property="Background" Value="#FFE3E3E3"/>
|
||||
<Setter Property="BorderThickness" Value="5,3,5,3"/>
|
||||
|
|
|
@ -138,7 +138,6 @@
|
|||
|
||||
<conv:VisibilityToBoolConverter Inverted="True" Not="True" x:Key="BooleanToVisibility"/>
|
||||
|
||||
<!-- StrokeDashArray="{Binding Path=Edge, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource dconv}}" -->
|
||||
<!-- EDGE CONTROL -->
|
||||
<Style TargetType="{x:Type gxl:EdgeControl}">
|
||||
<Setter Property="Template">
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="QuickGraph" version="3.6.61119.7" targetFramework="net40-Client" />
|
||||
<package id="YAXLib" version="2.12" targetFramework="net40-Client" />
|
||||
</packages>
|
|
@ -13,6 +13,8 @@
|
|||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
|
@ -55,10 +57,16 @@
|
|||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="QuickGraph">
|
||||
<HintPath>..\..\DLL\QuickGraph.dll</HintPath>
|
||||
<HintPath>..\..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="QuickGraph.Data">
|
||||
<HintPath>..\..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="QuickGraph.Graphviz">
|
||||
<HintPath>..\..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Graphviz.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="QuickGraph.Serialization">
|
||||
<HintPath>..\..\DLL\QuickGraph.Serialization.dll</HintPath>
|
||||
<HintPath>..\..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
|
@ -74,7 +82,7 @@
|
|||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="YAXLib">
|
||||
<HintPath>..\..\DLL\YAXLib.dll</HintPath>
|
||||
<HintPath>..\..\packages\YAXLib.2.12\lib\YAXLib.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -118,6 +126,7 @@
|
|||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
|
@ -151,6 +160,13 @@
|
|||
<Resource Include="readme.txt" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Aktivieren Sie die Wiederherstellung von NuGet-Paketen, um die fehlende Datei herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="QuickGraph" version="3.6.61119.7" targetFramework="net45" />
|
||||
<package id="YAXLib" version="2.12" targetFramework="net45" />
|
||||
</packages>
|
|
@ -48,9 +48,10 @@ namespace WindowsFormsProject
|
|||
zoomctrl.Content = gArea;
|
||||
gArea.RelayoutFinished += gArea_RelayoutFinished;
|
||||
|
||||
|
||||
var myResourceDictionary = new ResourceDictionary {Source = new Uri("Templates\\template.xaml", UriKind.Relative)};
|
||||
zoomctrl.Resources.MergedDictionaries.Add(myResourceDictionary);
|
||||
|
||||
|
||||
return zoomctrl;
|
||||
}
|
||||
|
||||
|
@ -75,6 +76,7 @@ namespace WindowsFormsProject
|
|||
dataEdge = new DataEdge(vlist[2], vlist[3]) { Text = string.Format("{0} -> {1}", vlist[2], vlist[3]) };
|
||||
dataGraph.AddEdge(dataEdge);
|
||||
|
||||
|
||||
dataEdge = new DataEdge(vlist[2], vlist[2]) { Text = string.Format("{0} -> {1}", vlist[2], vlist[2]) };
|
||||
dataGraph.AddEdge(dataEdge);
|
||||
return dataGraph;
|
||||
|
|
|
@ -5,18 +5,18 @@
|
|||
xmlns:gxl="clr-namespace:GraphX;assembly=GraphX.Controls"
|
||||
xmlns:conv="clr-namespace:GraphX.Converters;assembly=GraphX.Controls">
|
||||
|
||||
|
||||
|
||||
<!-- VERTEX CONTROL -->
|
||||
<Style TargetType="{x:Type gxl:VertexControl}">
|
||||
<Setter Property="Background" Value="#FFE3E3E3"/>
|
||||
<Setter Property="BorderThickness" Value="5,3,5,3"/>
|
||||
<Setter Property="Padding" Value="10,5,10,5"/>
|
||||
<Setter Property="BorderBrush" Value="#FF393939"/>
|
||||
|
||||
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type gxl:VertexControl}">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
CornerRadius="10,10,10,10"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
|
@ -30,8 +30,8 @@
|
|||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
<!-- VERTEX DRAGGING CONTROL -->
|
||||
<Setter Property="gxl:DragBehaviour.IsDragEnabled"
|
||||
|
@ -65,7 +65,7 @@
|
|||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
|
||||
<Setter Property="MinWidth"
|
||||
Value="1" />
|
||||
<Setter Property="MinHeight"
|
||||
|
@ -79,7 +79,7 @@
|
|||
|
||||
<Setter Property="gxl:HighlightBehaviour.IsHighlightEnabled" Value="False"/>
|
||||
|
||||
|
||||
|
||||
<Style.Triggers>
|
||||
<Trigger Property="gxl:HighlightBehaviour.Highlighted" Value="True">
|
||||
<Setter Property="Foreground" Value="Gold"/>
|
||||
|
@ -87,12 +87,12 @@
|
|||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
|
||||
<!--EDGE LABLE CONTROL -->
|
||||
<Style TargetType="{x:Type gxl:EdgeLabelControl}">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type gxl:EdgeLabelControl}">
|
||||
<ControlTemplate TargetType="{x:Type gxl:EdgeLabelControl}">
|
||||
<Grid>
|
||||
<Border BorderBrush="Black" BorderThickness="1" Background="LightCoral" CornerRadius="8">
|
||||
<ContentPresenter Margin="3"/>
|
||||
|
@ -101,11 +101,11 @@
|
|||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="RenderTransform">
|
||||
<Setter Property="RenderTransform">
|
||||
<Setter.Value>
|
||||
<RotateTransform CenterX="0.5" CenterY="0.5" Angle="{Binding RelativeSource={RelativeSource AncestorType=gxl:EdgeLabelControl} , Path=Angle}"/>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
|
||||
</Style>
|
||||
</ResourceDictionary>
|
|
@ -12,6 +12,8 @@
|
|||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
|
@ -54,10 +56,16 @@
|
|||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="QuickGraph">
|
||||
<HintPath>..\..\DLL\QuickGraph.dll</HintPath>
|
||||
<HintPath>..\..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="QuickGraph.Data">
|
||||
<HintPath>..\..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="QuickGraph.Graphviz">
|
||||
<HintPath>..\..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Graphviz.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="QuickGraph.Serialization">
|
||||
<HintPath>..\..\DLL\QuickGraph.Serialization.dll</HintPath>
|
||||
<HintPath>..\..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
|
@ -72,7 +80,7 @@
|
|||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="WindowsFormsIntegration" />
|
||||
<Reference Include="YAXLib">
|
||||
<HintPath>..\..\DLL\YAXLib.dll</HintPath>
|
||||
<HintPath>..\..\packages\YAXLib.2.12\lib\YAXLib.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -102,6 +110,7 @@
|
|||
<DesignTime>True</DesignTime>
|
||||
</Compile>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config" />
|
||||
<None Include="Properties\Settings.settings">
|
||||
<Generator>SettingsSingleFileGenerator</Generator>
|
||||
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
|
||||
|
@ -134,12 +143,18 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Include="Templates\template.xaml">
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
<SubType>Designer</SubType>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Aktivieren Sie die Wiederherstellung von NuGet-Paketen, um die fehlende Datei herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="QuickGraph" version="3.6.61119.7" targetFramework="net40-Client" />
|
||||
<package id="YAXLib" version="2.12" targetFramework="net40-Client" />
|
||||
</packages>
|
|
@ -7,13 +7,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GraphX.Common", "GraphX.Com
|
|||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{D9664367-2C2C-46B2-81A6-26CDCD087B29}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "External DLLs", "External DLLs", "{8485AE90-3EEE-4DF3-B80C-29CD2AC8803C}"
|
||||
ProjectSection(SolutionItems) = preProject
|
||||
DLL\QuickGraph.dll = DLL\QuickGraph.dll
|
||||
DLL\QuickGraph.Serialization.dll = DLL\QuickGraph.Serialization.dll
|
||||
DLL\YAXLib.dll = DLL\YAXLib.dll
|
||||
EndProjectSection
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ShowcaseExample", "Examples\ShowcaseExample\ShowcaseExample.csproj", "{A010A068-AC95-4A37-8054-C0B3DB6CD33F}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleGraph", "Examples\SimpleGraph\SimpleGraph.csproj", "{E00C5274-AA34-4CC1-BB24-F59BCF130B85}"
|
||||
|
|
Двоичные данные
GraphX v2.v11.suo
Двоичные данные
GraphX v2.v11.suo
Двоичный файл не отображается.
|
@ -12,6 +12,8 @@
|
|||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
@ -59,7 +61,16 @@
|
|||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="QuickGraph, Version=3.6.61114.0, Culture=neutral, PublicKeyToken=f3fb40175eec2af3, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\DLL\QuickGraph.dll</HintPath>
|
||||
<HintPath>..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="QuickGraph.Data">
|
||||
<HintPath>..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="QuickGraph.Graphviz">
|
||||
<HintPath>..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Graphviz.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="QuickGraph.Serialization">
|
||||
<HintPath>..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
|
@ -72,7 +83,7 @@
|
|||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="YAXLib, Version=2.12.0.0, Culture=neutral, PublicKeyToken=7cc39f8266ad1835, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\DLL\YAXLib.dll</HintPath>
|
||||
<HintPath>..\packages\YAXLib.2.12\lib\YAXLib.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -123,9 +134,17 @@
|
|||
<Compile Include="XmlSerializer\YAXPointSerializer.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="signature.snk" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Aktivieren Sie die Wiederherstellung von NuGet-Paketen, um die fehlende Datei herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
|
|
@ -11,8 +11,8 @@ using System.Windows;
|
|||
namespace GraphX
|
||||
{
|
||||
public interface IGXLogicCore<TVertex, TEdge, TGraph>: IDisposable
|
||||
where TVertex : class,IGraphXVertex
|
||||
where TEdge : class,IGraphXEdge<TVertex>
|
||||
where TVertex : class, IGraphXVertex
|
||||
where TEdge : class, IGraphXEdge<TVertex>
|
||||
where TGraph : class, IMutableBidirectionalGraph<TVertex, TEdge>
|
||||
{
|
||||
IAlgorithmFactory<TVertex, TEdge, TGraph> AlgorithmFactory { get; }
|
||||
|
|
|
@ -1,9 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace GraphX
|
||||
namespace GraphX
|
||||
{
|
||||
public interface IGraphXEdge<TVertex> : IWeightedEdge<TVertex>, IIdentifiableGraphDataObject, IRoutingInfo
|
||||
{
|
||||
|
@ -11,4 +6,4 @@ namespace GraphX
|
|||
new TVertex Target { get; set; }
|
||||
bool IsSelfLoop { get; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,4 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace GraphX
|
||||
{
|
||||
|
|
|
@ -1,8 +1,4 @@
|
|||
using QuickGraph;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace GraphX
|
||||
{
|
||||
|
@ -10,4 +6,4 @@ namespace GraphX
|
|||
{
|
||||
double Weight { get; set; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -15,6 +15,7 @@ namespace GraphX
|
|||
{
|
||||
public EdgeBase(TVertex source, TVertex target, double weight = 1)
|
||||
{
|
||||
|
||||
Source = source;
|
||||
Target = target;
|
||||
Weight = weight;
|
||||
|
@ -30,12 +31,15 @@ namespace GraphX
|
|||
/// Returns true if Source vertex equals Target vertex
|
||||
/// </summary>
|
||||
[YAXDontSerialize]
|
||||
public bool IsSelfLoop { get { return Source.Equals(Target); } }
|
||||
public bool IsSelfLoop
|
||||
{
|
||||
get { return Source.Equals(Target); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Routing points collection used to make Path visual object
|
||||
/// </summary>
|
||||
[YAXCustomSerializer(typeof (YAXPointArraySerializer))]
|
||||
[YAXCustomSerializer(typeof(YAXPointArraySerializer))]
|
||||
public Point[] RoutingPoints { get; set; }
|
||||
|
||||
public TVertex Source { get; set; }
|
||||
|
@ -43,6 +47,5 @@ namespace GraphX
|
|||
public TVertex Target { get; set; }
|
||||
|
||||
public double Weight { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -11,8 +11,8 @@ using System.Windows;
|
|||
namespace GraphX
|
||||
{
|
||||
public interface IAlgorithmFactory<TVertex, TEdge, TGraph>
|
||||
where TVertex : class,IGraphXVertex
|
||||
where TEdge : class,IGraphXEdge<TVertex>
|
||||
where TVertex : class, IGraphXVertex
|
||||
where TEdge : class, IGraphXEdge<TVertex>
|
||||
where TGraph : class, IMutableBidirectionalGraph<TVertex, TEdge>
|
||||
{
|
||||
bool NeedSizes(LayoutAlgorithmTypeEnum algorithmType);
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
namespace GraphX
|
||||
{
|
||||
public abstract class VertexBase : IGraphXVertex
|
||||
public abstract class VertexBase: IGraphXVertex
|
||||
{
|
||||
public VertexBase()
|
||||
{
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="QuickGraph" version="3.6.61119.7" targetFramework="net40-Client" />
|
||||
<package id="YAXLib" version="2.12" targetFramework="net40-Client" />
|
||||
</packages>
|
|
@ -16,28 +16,28 @@ namespace GraphX
|
|||
[Serializable]
|
||||
[TemplatePart(Name = "PART_edgePath", Type = typeof(Path))]
|
||||
[TemplatePart(Name = "PART_edgeArrowPath", Type = typeof(Path))]
|
||||
[TemplatePart(Name = "PART_edgeLabel", Type = typeof(EdgeLabelControl) )]
|
||||
[TemplatePart(Name = "PART_edgeLabel", Type = typeof(EdgeLabelControl))]
|
||||
public class EdgeControl : Control, IGraphControl, IDisposable
|
||||
{
|
||||
#region Dependency Properties
|
||||
{
|
||||
#region Dependency Properties
|
||||
|
||||
public static readonly DependencyProperty SourceProperty = DependencyProperty.Register( "Source",
|
||||
typeof( VertexControl ),
|
||||
typeof( EdgeControl ),
|
||||
new UIPropertyMetadata( null ) );
|
||||
|
||||
|
||||
public static readonly DependencyProperty TargetProperty = DependencyProperty.Register( "Target",
|
||||
public static readonly DependencyProperty SourceProperty = DependencyProperty.Register("Source",
|
||||
typeof(VertexControl),
|
||||
typeof(EdgeControl),
|
||||
new UIPropertyMetadata( null ) );
|
||||
new UIPropertyMetadata(null));
|
||||
|
||||
public static readonly DependencyProperty EdgeProperty = DependencyProperty.Register( "Edge", typeof( object ),
|
||||
|
||||
public static readonly DependencyProperty TargetProperty = DependencyProperty.Register("Target",
|
||||
typeof(VertexControl),
|
||||
typeof(EdgeControl),
|
||||
new UIPropertyMetadata(null));
|
||||
|
||||
public static readonly DependencyProperty EdgeProperty = DependencyProperty.Register("Edge", typeof(object),
|
||||
typeof(EdgeControl),
|
||||
new PropertyMetadata( null ) );
|
||||
new PropertyMetadata(null));
|
||||
|
||||
public static readonly DependencyProperty StrokeThicknessProperty = Shape.StrokeThicknessProperty.AddOwner(typeof(EdgeControl),
|
||||
new UIPropertyMetadata(5.0) );
|
||||
new UIPropertyMetadata(5.0));
|
||||
/// <summary>
|
||||
/// Gets or sets parent GraphArea visual
|
||||
/// </summary>
|
||||
|
@ -60,9 +60,9 @@ namespace GraphX
|
|||
protected set { SetValue(IsSelfLoopedPropertyKey, value); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Properties
|
||||
#region Properties
|
||||
|
||||
private double _labelAngle;
|
||||
/// <summary>
|
||||
|
@ -91,7 +91,7 @@ namespace GraphX
|
|||
private static void dashstyle_changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ec = d as EdgeControl;
|
||||
if(ec == null) return;
|
||||
if (ec == null) return;
|
||||
switch ((EdgeDashStyle)e.NewValue)
|
||||
{
|
||||
case EdgeDashStyle.Solid:
|
||||
|
@ -99,10 +99,10 @@ namespace GraphX
|
|||
break;
|
||||
|
||||
case EdgeDashStyle.Dash:
|
||||
ec.StrokeDashArray = new DoubleCollection(new [] { 4.0, 2.0 });
|
||||
ec.StrokeDashArray = new DoubleCollection(new[] { 4.0, 2.0 });
|
||||
break;
|
||||
case EdgeDashStyle.Dot:
|
||||
ec.StrokeDashArray = new DoubleCollection(new [] { 1.0, 2.0 });
|
||||
ec.StrokeDashArray = new DoubleCollection(new[] { 1.0, 2.0 });
|
||||
break;
|
||||
|
||||
case EdgeDashStyle.DashDot:
|
||||
|
@ -110,7 +110,7 @@ namespace GraphX
|
|||
break;
|
||||
|
||||
case EdgeDashStyle.DashDotDot:
|
||||
ec.StrokeDashArray = new DoubleCollection(new [] { 4.0, 2.0, 1.0, 2.0, 1.0, 2.0 });
|
||||
ec.StrokeDashArray = new DoubleCollection(new[] { 4.0, 2.0, 1.0, 2.0, 1.0, 2.0 });
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -178,7 +178,7 @@ namespace GraphX
|
|||
private static void showlabel_changed(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
var ec = (d as EdgeControl);
|
||||
if(ec == null) return;
|
||||
if (ec == null) return;
|
||||
|
||||
ec.UpdateEdge(false);
|
||||
}
|
||||
|
@ -190,15 +190,19 @@ namespace GraphX
|
|||
/// <summary>
|
||||
/// Gets or sets if lables should be aligned to edges and be displayed under the same angle
|
||||
/// </summary>
|
||||
public bool AlignLabelsToEdges { get { return _alignLabelsToEdges; } set
|
||||
{
|
||||
_alignLabelsToEdges = value;
|
||||
if (_edgeLabelControl != null)
|
||||
public bool AlignLabelsToEdges
|
||||
{
|
||||
get { return _alignLabelsToEdges; }
|
||||
set
|
||||
{
|
||||
if (value == false) _edgeLabelControl.Angle = 0;
|
||||
_edgeLabelControl.UpdatePosition();
|
||||
_alignLabelsToEdges = value;
|
||||
if (_edgeLabelControl != null)
|
||||
{
|
||||
if (value == false) _edgeLabelControl.Angle = 0;
|
||||
_edgeLabelControl.UpdatePosition();
|
||||
}
|
||||
}
|
||||
} }
|
||||
}
|
||||
private bool _alignLabelsToEdges;
|
||||
|
||||
/// <summary>
|
||||
|
@ -240,34 +244,34 @@ namespace GraphX
|
|||
/// <summary>
|
||||
/// Source visual vertex object
|
||||
/// </summary>
|
||||
public VertexControl Source
|
||||
{
|
||||
public VertexControl Source
|
||||
{
|
||||
get { return (VertexControl)GetValue(SourceProperty); }
|
||||
set { SetValue( SourceProperty, value ); }
|
||||
}
|
||||
set { SetValue(SourceProperty, value); }
|
||||
}
|
||||
/// <summary>
|
||||
/// Target visual vertex object
|
||||
/// </summary>
|
||||
public VertexControl Target
|
||||
{
|
||||
{
|
||||
get { return (VertexControl)GetValue(TargetProperty); }
|
||||
set { SetValue( TargetProperty, value ); }
|
||||
}
|
||||
set { SetValue(TargetProperty, value); }
|
||||
}
|
||||
|
||||
/*public Point[] RoutePoints
|
||||
{
|
||||
get { return (Point[])GetValue( RoutePointsProperty ); }
|
||||
set { SetValue( RoutePointsProperty, value ); }
|
||||
}*/
|
||||
/*public Point[] RoutePoints
|
||||
{
|
||||
get { return (Point[])GetValue( RoutePointsProperty ); }
|
||||
set { SetValue( RoutePointsProperty, value ); }
|
||||
}*/
|
||||
|
||||
/// <summary>
|
||||
/// Data edge object
|
||||
/// </summary>
|
||||
public object Edge
|
||||
{
|
||||
get { return GetValue( EdgeProperty ); }
|
||||
set { SetValue( EdgeProperty, value ); }
|
||||
}
|
||||
public object Edge
|
||||
{
|
||||
get { return GetValue(EdgeProperty); }
|
||||
set { SetValue(EdgeProperty, value); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Custom edge thickness
|
||||
|
@ -306,7 +310,7 @@ namespace GraphX
|
|||
|
||||
public EdgeControl(VertexControl source, VertexControl target, object edge, bool showLabels = false, bool showArrows = true)
|
||||
{
|
||||
DataContext = edge;
|
||||
DataContext = edge;
|
||||
Source = source; Target = target;
|
||||
Edge = edge; DataContext = edge;
|
||||
ShowArrows = showArrows;
|
||||
|
@ -452,21 +456,21 @@ namespace GraphX
|
|||
{
|
||||
if (RootArea != null && Visibility == Visibility.Visible)
|
||||
RootArea.OnEdgeMouseLeave(this);
|
||||
// e.Handled = true;
|
||||
// e.Handled = true;
|
||||
}
|
||||
|
||||
void EdgeControl_MouseEnter(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (RootArea != null && Visibility == Visibility.Visible)
|
||||
RootArea.OnEdgeMouseEnter(this);
|
||||
// e.Handled = true;
|
||||
// e.Handled = true;
|
||||
}
|
||||
|
||||
void EdgeControl_MouseMove(object sender, MouseEventArgs e)
|
||||
{
|
||||
if (RootArea != null && Visibility == Visibility.Visible)
|
||||
RootArea.OnEdgeMouseMove(this);
|
||||
e.Handled = true;
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
void EdgeControl_MouseDoubleClick(object sender, MouseButtonEventArgs e)
|
||||
|
@ -509,7 +513,7 @@ namespace GraphX
|
|||
|
||||
internal void InvalidateChildren()
|
||||
{
|
||||
if(_edgeLabelControl != null)
|
||||
if (_edgeLabelControl != null)
|
||||
_edgeLabelControl.UpdateLayout();
|
||||
}
|
||||
|
||||
|
@ -655,7 +659,7 @@ namespace GraphX
|
|||
const double dArrowAngle = Math.PI / 2.0;
|
||||
_arrowgeometry = new PathGeometry();
|
||||
var aPoint = sourcePos1;
|
||||
_arrowgeometry.Figures.Add( GeometryHelper.GenerateArrow(aPoint, new Point(), new Point(), dArrowAngle));
|
||||
_arrowgeometry.Figures.Add(GeometryHelper.GenerateArrow(aPoint, new Point(), new Point(), dArrowAngle));
|
||||
_linegeometry = geo;
|
||||
GeometryHelper.TryFreeze(_arrowgeometry);
|
||||
GeometryHelper.TryFreeze(_linegeometry);
|
||||
|
@ -666,14 +670,14 @@ namespace GraphX
|
|||
var hasRouteInfo = routeInformation != null && routeInformation.Length > 1;
|
||||
|
||||
//calculate source and target edge attach points
|
||||
if (RootArea !=null && !hasRouteInfo && RootArea.EnableParallelEdges)
|
||||
if (RootArea != null && !hasRouteInfo && RootArea.EnableParallelEdges)
|
||||
{
|
||||
if (SourceOffset != 0) sourcePos = GetParallelOffset(Source, Target, SourceOffset);
|
||||
if (TargetOffset != 0) targetPos = GetParallelOffset(Target, Source, TargetOffset);
|
||||
}
|
||||
|
||||
/* Rectangular shapes implementation by bleibold */
|
||||
|
||||
|
||||
|
||||
//Point p1 = GeometryHelper.GetEdgeEndpoint(sourcePos, new Rect(sourceSize), (hasRouteInfo ? routeInformation[1] : (targetPos)), Source.MathShape);
|
||||
//Point p2 = GeometryHelper.GetEdgeEndpoint(targetPos, new Rect(targetSize), hasRouteInfo ? routeInformation[routeInformation.Length - 2] : (sourcePos), Target.MathShape);
|
||||
|
@ -730,8 +734,8 @@ namespace GraphX
|
|||
}
|
||||
GeometryHelper.TryFreeze(_linegeometry);
|
||||
GeometryHelper.TryFreeze(_arrowgeometry);
|
||||
|
||||
if (ShowLabel && _edgeLabelControl != null && _updateLabelPosition && updateLabel )
|
||||
|
||||
if (ShowLabel && _edgeLabelControl != null && _updateLabelPosition && updateLabel)
|
||||
_edgeLabelControl.UpdatePosition();
|
||||
//PathGeometry = (PathGeometry)_linegeometry;
|
||||
}
|
||||
|
@ -739,7 +743,7 @@ namespace GraphX
|
|||
{
|
||||
Debug.WriteLine("PrepareEdgePath() -> Edge template not found! Can't apply path to display edge!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
using System.Drawing;
|
||||
using GraphX.Controls.Models;
|
||||
using GraphX.GraphSharp.Algorithms.EdgeRouting;
|
||||
using GraphX.GraphSharp.Algorithms.Layout;
|
||||
using GraphX.GraphSharp.Algorithms.OverlapRemoval;
|
||||
|
@ -14,19 +16,21 @@ using System.Windows;
|
|||
using System.Windows.Threading;
|
||||
using Microsoft.Win32;
|
||||
using System.Windows.Controls;
|
||||
using Point = System.Windows.Point;
|
||||
using Size = System.Windows.Size;
|
||||
|
||||
namespace GraphX
|
||||
{
|
||||
public class GraphArea<TVertex, TEdge, TGraph> : GraphAreaBase, IDisposable
|
||||
where TVertex :class, IGraphXVertex
|
||||
where TEdge : class,IGraphXEdge<TVertex>
|
||||
where TGraph : class,IMutableBidirectionalGraph<TVertex, TEdge>
|
||||
where TVertex : class, IGraphXVertex
|
||||
where TEdge : class, IGraphXEdge<TVertex>
|
||||
where TGraph : class, IMutableBidirectionalGraph<TVertex, TEdge>
|
||||
{
|
||||
|
||||
#region My properties
|
||||
|
||||
public static readonly DependencyProperty LogicCoreProperty =
|
||||
DependencyProperty.Register("LogicCore", typeof(IGXLogicCore<TVertex, TEdge, TGraph>), typeof(GraphAreaBase), new UIPropertyMetadata(null));
|
||||
DependencyProperty.Register("LogicCore", typeof(IGXLogicCore<TVertex, TEdge, TGraph>), typeof(GraphArea<TVertex, TEdge, TGraph>), new UIPropertyMetadata(null));
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets GraphX logic core object that will drive this visual
|
||||
|
@ -37,6 +41,9 @@ namespace GraphX
|
|||
set { SetValue(LogicCoreProperty, value); }
|
||||
}
|
||||
|
||||
|
||||
public IGraphControlFactory ControlFactory { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets logic core unsafely converted to specified type
|
||||
/// </summary>
|
||||
|
@ -154,6 +161,8 @@ namespace GraphX
|
|||
|
||||
public GraphArea()
|
||||
{
|
||||
ControlFactory = new GraphControlFactory();
|
||||
ControlFactory.FactoryRootArea = this;
|
||||
StateStorage = new StateStorage<TVertex, TEdge, TGraph>(this);
|
||||
EnableVisualPropsRecovery = true;
|
||||
EnableVisualPropsApply = true;
|
||||
|
@ -165,28 +174,29 @@ namespace GraphX
|
|||
Width = DesignSize.Width;
|
||||
Height = DesignSize.Height;
|
||||
var vc = new VertexDataExample(1, "Johnson B.C");
|
||||
var ctrl = new VertexControl(vc) { RootArea = this };
|
||||
var ctrl = ControlFactory.CreateVertexControl(vc);
|
||||
SetX(ctrl, 0); SetY(ctrl, 0, true);
|
||||
|
||||
var vc2 = new VertexDataExample(2, "Manson J.C");
|
||||
var ctrl2 = new VertexControl(vc2) { RootArea = this };
|
||||
var ctrl2 = ControlFactory.CreateVertexControl(vc2);
|
||||
SetX(ctrl2, 200); SetY(ctrl2, 0, true);
|
||||
|
||||
var vc3 = new VertexDataExample(1, "Franklin A.J");
|
||||
var ctrl3 = new VertexControl(vc3) { RootArea = this };
|
||||
var ctrl3 = ControlFactory.CreateVertexControl(vc3);
|
||||
SetX(ctrl3, 100); SetY(ctrl3, 100, true);
|
||||
|
||||
UpdateLayout();
|
||||
var edge = new EdgeDataExample<VertexDataExample>(vc, vc2, 1) { Text = "One" };
|
||||
var edgectrl = new EdgeControl(ctrl, ctrl2, edge) { RootArea = this };
|
||||
var edgectrl = ControlFactory.CreateEdgeControl(ctrl, ctrl2, edge);
|
||||
|
||||
base.Children.Add(edgectrl);
|
||||
|
||||
edge = new EdgeDataExample<VertexDataExample>(vc2, vc3, 1) { Text = "Two" };
|
||||
edgectrl = new EdgeControl(ctrl2, ctrl3, edge) { RootArea = this };
|
||||
edgectrl = ControlFactory.CreateEdgeControl(ctrl2, ctrl3, edge);
|
||||
base.Children.Add(edgectrl);
|
||||
|
||||
edge = new EdgeDataExample<VertexDataExample>(vc3, vc, 1) { Text = "Three" };
|
||||
edgectrl = new EdgeControl(ctrl3, ctrl, edge) { RootArea = this };
|
||||
edgectrl = ControlFactory.CreateEdgeControl(ctrl3, ctrl, edge);
|
||||
base.Children.Add(edgectrl);
|
||||
|
||||
|
||||
|
@ -446,7 +456,9 @@ namespace GraphX
|
|||
//preload vertex controls
|
||||
foreach (var it in graph.Vertices)
|
||||
{
|
||||
var vc = new VertexControl(it) { DataContext = dataContextToDataItem ? it : null, Visibility = Visibility.Hidden }; // make them invisible (there is no layout positions yet calculated)
|
||||
var vc = ControlFactory.CreateVertexControl(it);
|
||||
vc.DataContext = dataContextToDataItem ? it : null;
|
||||
vc.Visibility = Visibility.Hidden; // make them invisible (there is no layout positions yet calculated)
|
||||
InternalAddVertex(it, vc);
|
||||
}
|
||||
if (forceVisPropRecovery)
|
||||
|
@ -956,7 +968,8 @@ namespace GraphX
|
|||
{
|
||||
if (item.Source == null || item.Target == null) continue;
|
||||
if (!_vertexlist.ContainsKey(item.Source) || !_vertexlist.ContainsKey(item.Target)) continue;
|
||||
var edgectrl = new EdgeControl(_vertexlist[item.Source], _vertexlist[item.Target], item) { Visibility = defaultVisibility };
|
||||
var edgectrl = ControlFactory.CreateEdgeControl(_vertexlist[item.Source], _vertexlist[item.Target],
|
||||
item, false, true, defaultVisibility);
|
||||
InternalInsertEdge(item, edgectrl);
|
||||
//setup path
|
||||
if (_svShowEdgeLabels)
|
||||
|
@ -1146,8 +1159,9 @@ namespace GraphX
|
|||
if (inlist != null)
|
||||
foreach (var item in inlist)
|
||||
{
|
||||
if(gotSelfLoop) continue;
|
||||
var ctrl = new EdgeControl(_vertexlist[item.Source], vc, item) { Visibility = defaultVisibility };
|
||||
if(gotSelfLoop) continue;
|
||||
var ctrl = ControlFactory.CreateEdgeControl(_vertexlist[item.Source], vc, item, false, true,
|
||||
defaultVisibility);
|
||||
InsertEdge(item, ctrl);
|
||||
ctrl.PrepareEdgePath();
|
||||
if(item.Source == item.Target) gotSelfLoop = true;
|
||||
|
@ -1155,8 +1169,9 @@ namespace GraphX
|
|||
if (outlist != null)
|
||||
foreach (var item in outlist)
|
||||
{
|
||||
if(gotSelfLoop) continue;
|
||||
var ctrl = new EdgeControl(vc, _vertexlist[item.Target], item) { Visibility = defaultVisibility };
|
||||
if(gotSelfLoop) continue;
|
||||
var ctrl = ControlFactory.CreateEdgeControl(vc, _vertexlist[item.Target], item, false, true,
|
||||
defaultVisibility);
|
||||
InsertEdge(item, ctrl);
|
||||
ctrl.PrepareEdgePath();
|
||||
if(item.Source == item.Target) gotSelfLoop = true;
|
||||
|
@ -1292,7 +1307,8 @@ namespace GraphX
|
|||
foreach (var item in vlist)
|
||||
{
|
||||
var vertexdata = item.Data as TVertex;
|
||||
var ctrl = new VertexControl(vertexdata); ctrl.SetPosition(item.Position);
|
||||
var ctrl = ControlFactory.CreateVertexControl(vertexdata);
|
||||
ctrl.SetPosition(item.Position);
|
||||
AddVertex(vertexdata, ctrl);
|
||||
LogicCore.Graph.AddVertex(vertexdata);
|
||||
}
|
||||
|
@ -1373,6 +1389,11 @@ namespace GraphX
|
|||
}
|
||||
}
|
||||
|
||||
public Bitmap ExportToBitmap(double dpi = PrintHelper.DefaultDPI)
|
||||
{
|
||||
return PrintHelper.RenderTargetBitmapToBitmap(PrintHelper.RenderTargetBitmap(this, true, dpi));
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Print current visual graph layout
|
||||
|
|
|
@ -1231,6 +1231,18 @@ namespace GraphX.Controls
|
|||
#endregion
|
||||
|
||||
#region Animation
|
||||
|
||||
public event EventHandler ZoomAnimationCompleted;
|
||||
|
||||
private void OnZoomAnimationCompleted()
|
||||
{
|
||||
if (ZoomAnimationCompleted != null)
|
||||
ZoomAnimationCompleted(this, EventArgs.Empty);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void DoZoomAnimation(double targetZoom, double transformX, double transformY, bool isZooming = true)
|
||||
{
|
||||
_isZooming = isZooming;
|
||||
|
@ -1270,6 +1282,7 @@ namespace GraphX.Controls
|
|||
SetValue(ZoomProperty, zoom);
|
||||
_isZooming = false;
|
||||
UpdateViewport();
|
||||
OnZoomAnimationCompleted();
|
||||
};
|
||||
}
|
||||
BeginAnimation(dp, animation, HandoffBehavior.Compose);
|
||||
|
|
|
@ -58,14 +58,23 @@
|
|||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="PresentationFramework.Aero" />
|
||||
<Reference Include="QuickGraph">
|
||||
<HintPath>..\DLL\QuickGraph.dll</HintPath>
|
||||
<Reference Include="QuickGraph, Version=3.6.61114.0, Culture=neutral, PublicKeyToken=f3fb40175eec2af3, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="QuickGraph.Serialization">
|
||||
<HintPath>..\DLL\QuickGraph.Serialization.dll</HintPath>
|
||||
<Reference Include="QuickGraph.Data">
|
||||
<HintPath>..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="QuickGraph.Graphviz">
|
||||
<HintPath>..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Graphviz.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="QuickGraph.Serialization, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
|
@ -73,6 +82,10 @@
|
|||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="YAXLib, Version=2.12.0.0, Culture=neutral, PublicKeyToken=7cc39f8266ad1835, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\YAXLib.2.12\lib\YAXLib.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Documents\AIV.cs">
|
||||
|
@ -114,9 +127,11 @@
|
|||
<Compile Include="Models\EdgeEventOptions.cs" />
|
||||
<Compile Include="Models\EdgeSelectedEventArgs.cs" />
|
||||
<Compile Include="Models\EdgeSelectedEventHandler.cs" />
|
||||
<Compile Include="Models\GraphControlFactory.cs" />
|
||||
<Compile Include="Models\IBidirectionalControlAnimation.cs" />
|
||||
<Compile Include="Models\IGraphArea.cs" />
|
||||
<Compile Include="Models\IGraphControl.cs" />
|
||||
<Compile Include="Models\IGraphControlFactory.cs" />
|
||||
<Compile Include="Models\IOneWayControlAnimation.cs" />
|
||||
<Compile Include="Models\RemoveControlEventHandler.cs" />
|
||||
<Compile Include="Models\StateStorage.cs" />
|
||||
|
@ -151,8 +166,13 @@
|
|||
<Project>{eebd4ef2-4649-4f36-8fda-b1ba071a19be}</Project>
|
||||
<Name>GraphX.Common</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\GraphX.Logic\GraphX.Logic.csproj">
|
||||
<Project>{35f09d76-fdbe-4854-9dfc-961185c53b57}</Project>
|
||||
<Name>GraphX.Logic</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="signature.snk" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0"?>
|
||||
<package >
|
||||
<metadata>
|
||||
<id>GraphX</id>
|
||||
<version>2.0.2</version>
|
||||
<title>GraphX</title>
|
||||
<authors>panthernet</authors>
|
||||
<owners></owners>
|
||||
<licenseUrl>https://github.com/panthernet/GraphX/blob/master/LICENSE</licenseUrl>
|
||||
<projectUrl>https://github.com/panthernet/GraphX</projectUrl>
|
||||
<iconUrl>https://noicon.ico</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>GraphX for .NET is an advanced graph visualization library based on Graph# algorithmic blueprints that uses WPF for rendering</description>
|
||||
<releaseNotes></releaseNotes>
|
||||
<copyright>Copyright 2014</copyright>
|
||||
<tags>GraphX WPF Graph# QuickGraph</tags>
|
||||
</metadata>
|
||||
</package>
|
|
@ -0,0 +1,28 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
|
||||
namespace GraphX.Controls.Models
|
||||
{
|
||||
public class GraphControlFactory : IGraphControlFactory
|
||||
{
|
||||
|
||||
public EdgeControl CreateEdgeControl(VertexControl source, VertexControl target, object edge, bool showLabels = false, bool showArrows = true, Visibility visibility = Visibility.Visible)
|
||||
{
|
||||
var edgectrl = new EdgeControl(source, target, edge, showLabels, showArrows) { Visibility = visibility, RootArea = FactoryRootArea};
|
||||
|
||||
return edgectrl;
|
||||
|
||||
}
|
||||
|
||||
public VertexControl CreateVertexControl(object vertexData)
|
||||
{
|
||||
return new VertexControl(vertexData) {RootArea = FactoryRootArea};
|
||||
}
|
||||
|
||||
|
||||
public GraphAreaBase FactoryRootArea { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows;
|
||||
|
||||
namespace GraphX.Controls.Models
|
||||
{
|
||||
public interface IGraphControlFactory
|
||||
{
|
||||
EdgeControl CreateEdgeControl(VertexControl source, VertexControl target, object edge, bool showLabels = false, bool showArrows = true, Visibility visibility = Visibility.Visible);
|
||||
VertexControl CreateVertexControl(object vertexData);
|
||||
GraphAreaBase FactoryRootArea { set; get; }
|
||||
|
||||
}
|
||||
|
||||
}
|
|
@ -9,8 +9,8 @@ namespace GraphX
|
|||
{
|
||||
public class StateStorage<TVertex, TEdge, TGraph>: IDisposable
|
||||
where TEdge : class, IGraphXEdge<TVertex>
|
||||
where TVertex : class, IGraphXVertex
|
||||
where TGraph : class, IMutableBidirectionalGraph<TVertex, TEdge>
|
||||
where TVertex: class, IGraphXVertex
|
||||
where TGraph: class, IMutableBidirectionalGraph<TVertex, TEdge>
|
||||
{
|
||||
private Dictionary<string, GraphState<TVertex, TEdge, TGraph>> _states;
|
||||
private GraphArea<TVertex, TEdge, TGraph> _area;
|
||||
|
@ -82,7 +82,8 @@ namespace GraphX
|
|||
//setup visible edges
|
||||
foreach (var item in _states[id].VisibleEdges)
|
||||
{
|
||||
var edgectrl = new EdgeControl(_area.VertexList[item.Source], _area.VertexList[item.Target], item);
|
||||
var edgectrl = _area.ControlFactory.CreateEdgeControl(_area.VertexList[item.Source], _area.VertexList[item.Target],
|
||||
item);
|
||||
_area.InsertEdge(item, edgectrl);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using GraphX.Controls;
|
||||
using System.Drawing;
|
||||
using GraphX.Controls;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
@ -42,8 +43,8 @@ namespace GraphX
|
|||
new RenderTargetBitmap(
|
||||
//(int)surface.ActualWidth,
|
||||
//(int)surface.ActualHeight,
|
||||
(int)(vis as UIElement).DesiredSize.Width + 100,
|
||||
(int)(vis as UIElement).DesiredSize.Height + 100,
|
||||
(int)((vis as UIElement).DesiredSize.Width * (imgdpi / DefaultDPI) + 100),
|
||||
(int)((vis as UIElement).DesiredSize.Height * (imgdpi / DefaultDPI) + 100),
|
||||
imgdpi,
|
||||
imgdpi,
|
||||
pixelFormat);
|
||||
|
@ -96,6 +97,51 @@ namespace GraphX
|
|||
}
|
||||
}
|
||||
|
||||
public static Bitmap RenderTargetBitmapToBitmap(RenderTargetBitmap source)
|
||||
{
|
||||
using (MemoryStream outStream = new MemoryStream())
|
||||
{
|
||||
//Use png encoder for our data
|
||||
PngBitmapEncoder encoder = new PngBitmapEncoder();
|
||||
|
||||
//Push the rendered bitmap to it
|
||||
encoder.Frames.Add(BitmapFrame.Create(source));
|
||||
|
||||
//Save the data to the stream
|
||||
encoder.Save(outStream);
|
||||
return new Bitmap(outStream);
|
||||
}
|
||||
}
|
||||
|
||||
public static RenderTargetBitmap RenderTargetBitmap(GraphAreaBase surface, bool useZoomControlSurface, double imgdpi)
|
||||
{
|
||||
Visual vis = surface;
|
||||
if (useZoomControlSurface)
|
||||
{
|
||||
if (surface.Parent != null && surface.Parent is IZoomControl)
|
||||
vis = (surface.Parent as IZoomControl).PresenterVisual;
|
||||
else if (surface.Parent != null && surface.Parent is FrameworkElement &&
|
||||
(surface.Parent as FrameworkElement).Parent is IZoomControl)
|
||||
vis = ((surface.Parent as FrameworkElement).Parent as IZoomControl).PresenterVisual;
|
||||
}
|
||||
var renderBitmap =
|
||||
new RenderTargetBitmap(
|
||||
//(int)surface.ActualWidth,
|
||||
//(int)surface.ActualHeight,
|
||||
(int)((vis as UIElement).DesiredSize.Width * (imgdpi / 96) + 100),
|
||||
(int)((vis as UIElement).DesiredSize.Height * (imgdpi / 96) + 100),
|
||||
imgdpi,
|
||||
imgdpi,
|
||||
pixelFormat);
|
||||
|
||||
vis.SetValue(Panel.BackgroundProperty, System.Windows.Media.Brushes.White);
|
||||
//Render the graphlayout onto the bitmap.
|
||||
renderBitmap.Render(vis);
|
||||
|
||||
return renderBitmap;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="QuickGraph" version="3.6.61119.7" targetFramework="net40-Client" />
|
||||
<package id="YAXLib" version="2.12" targetFramework="net40-Client" />
|
||||
</packages>
|
|
@ -12,6 +12,8 @@
|
|||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir>
|
||||
<RestorePackages>true</RestorePackages>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
@ -41,24 +43,32 @@
|
|||
<ItemGroup>
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="QuickGraph">
|
||||
<HintPath>..\DLL\QuickGraph.dll</HintPath>
|
||||
<Reference Include="QuickGraph, Version=3.6.61114.0, Culture=neutral, PublicKeyToken=f3fb40175eec2af3, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="QuickGraph.Serialization">
|
||||
<HintPath>..\DLL\QuickGraph.Serialization.dll</HintPath>
|
||||
<Reference Include="QuickGraph.Data">
|
||||
<HintPath>..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="QuickGraph.Graphviz">
|
||||
<HintPath>..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Graphviz.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="QuickGraph.Serialization, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\QuickGraph.3.6.61119.7\lib\net4\QuickGraph.Serialization.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Windows" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
<Reference Include="YAXLib">
|
||||
<HintPath>..\DLL\YAXLib.dll</HintPath>
|
||||
<Reference Include="YAXLib, Version=2.12.0.0, Culture=neutral, PublicKeyToken=7cc39f8266ad1835, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\YAXLib.2.12\lib\YAXLib.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
@ -182,9 +192,17 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
<None Include="signature.snk" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(SolutionDir)\.nuget\NuGet.targets" Condition="Exists('$(SolutionDir)\.nuget\NuGet.targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>Dieses Projekt verweist auf mindestens ein NuGet-Paket, das auf diesem Computer fehlt. Aktivieren Sie die Wiederherstellung von NuGet-Paketen, um die fehlende Datei herunterzuladen. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkID=322105". Die fehlende Datei ist "{0}".</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(SolutionDir)\.nuget\NuGet.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)\.nuget\NuGet.targets'))" />
|
||||
</Target>
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
|
|
|
@ -9,7 +9,7 @@ namespace GraphX.GraphSharp.Algorithms.EdgeRouting
|
|||
public abstract class EdgeRoutingAlgorithmBase<TVertex, TEdge, TGraph> : IExternalEdgeRouting<TVertex, TEdge>, IDisposable
|
||||
where TVertex : class
|
||||
where TEdge : IEdge<TVertex>
|
||||
where TGraph : class, IMutableBidirectionalGraph<TVertex, TEdge>
|
||||
where TGraph : class, IBidirectionalGraph<TVertex, TEdge>
|
||||
{
|
||||
protected IEdgeRoutingParameters _parameters;
|
||||
protected TGraph _graph;
|
||||
|
|
|
@ -11,7 +11,7 @@ using QuickGraph;
|
|||
namespace GraphX.GraphSharpComponents.EdgeRouting
|
||||
{
|
||||
public class PathFinderEdgeRouting<TVertex, TEdge, TGraph> : EdgeRoutingAlgorithmBase<TVertex, TEdge, TGraph>
|
||||
where TGraph : class, IMutableBidirectionalGraph<TVertex, TEdge>
|
||||
where TGraph : class, IBidirectionalGraph<TVertex, TEdge>
|
||||
where TEdge : IEdge<TVertex>
|
||||
where TVertex : class, IIdentifiableGraphDataObject
|
||||
{
|
||||
|
|
|
@ -8,7 +8,7 @@ using System.Windows;
|
|||
namespace GraphX.GraphSharp.Algorithms.EdgeRouting
|
||||
{
|
||||
public class SimpleEdgeRouting<TVertex, TEdge, TGraph> : EdgeRoutingAlgorithmBase<TVertex, TEdge, TGraph>
|
||||
where TGraph : class, IMutableBidirectionalGraph<TVertex, TEdge>
|
||||
where TGraph : class, IBidirectionalGraph<TVertex, TEdge>
|
||||
where TEdge : IEdge<TVertex>
|
||||
where TVertex : class, IIdentifiableGraphDataObject
|
||||
{
|
||||
|
|
|
@ -19,7 +19,7 @@ using GraphX.GraphSharpComponents.EdgeRouting;
|
|||
namespace GraphX.Logic.Models
|
||||
{
|
||||
public sealed class AlgorithmFactory<TVertex, TEdge, TGraph> : IAlgorithmFactory<TVertex, TEdge, TGraph>
|
||||
where TVertex : class,IGraphXVertex
|
||||
where TVertex : class, IGraphXVertex
|
||||
where TEdge : class, IGraphXEdge<TVertex>
|
||||
where TGraph : class, IMutableBidirectionalGraph<TVertex, TEdge>
|
||||
{
|
||||
|
|
|
@ -14,8 +14,8 @@ using YAXLib;
|
|||
namespace GraphX.Logic
|
||||
{
|
||||
public partial class GXLogicCore<TVertex, TEdge, TGraph>: IGXLogicCore<TVertex, TEdge, TGraph>, IDisposable
|
||||
where TVertex : class,IGraphXVertex
|
||||
where TEdge : class,IGraphXEdge<TVertex>
|
||||
where TVertex : class, IGraphXVertex
|
||||
where TEdge : class, IGraphXEdge<TVertex>
|
||||
where TGraph : class, IMutableBidirectionalGraph<TVertex, TEdge>
|
||||
{
|
||||
#region Properties
|
||||
|
|
|
@ -8,9 +8,9 @@ using System.Windows;
|
|||
namespace GraphX.Logic
|
||||
{
|
||||
public partial class GXLogicCore<TVertex, TEdge, TGraph>
|
||||
where TVertex : class,IGraphXVertex
|
||||
where TEdge : class,IGraphXEdge<TVertex>
|
||||
where TGraph : class,IMutableBidirectionalGraph<TVertex, TEdge>
|
||||
where TVertex : class, IGraphXVertex
|
||||
where TEdge : class, IGraphXEdge<TVertex>
|
||||
where TGraph : class, IMutableBidirectionalGraph<TVertex, TEdge>
|
||||
{
|
||||
public bool AreVertexSizesNeeded()
|
||||
{
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="QuickGraph" version="3.6.61119.7" targetFramework="net40-Client" />
|
||||
<package id="YAXLib" version="2.12" targetFramework="net40-Client" />
|
||||
</packages>
|
|
@ -0,0 +1,18 @@
|
|||
<?xml version="1.0"?>
|
||||
<package >
|
||||
<metadata>
|
||||
<id>GraphX</id>
|
||||
<version>$version$</version>
|
||||
<title>GraphX</title>
|
||||
<authors>$author$</authors>
|
||||
<owners></owners>
|
||||
<licenseUrl>https://github.com/panthernet/GraphX/blob/master/LICENSE</licenseUrl>
|
||||
<projectUrl>https://github.com/panthernet/GraphX</projectUrl>
|
||||
<iconUrl>https://noicon.ico</iconUrl>
|
||||
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||
<description>GraphX for .NET is an advanced graph visualization library based on Graph# algorithmic blueprints that uses WPF for rendering</description>
|
||||
<releaseNotes></releaseNotes>
|
||||
<copyright>Copyright 2014</copyright>
|
||||
<tags>GraphX WPF Graph# QuickGraph</tags>
|
||||
</metadata>
|
||||
</package>
|
Двоичный файл не отображается.
|
@ -0,0 +1,2 @@
|
|||
|
||||
NuGet.exe pack ..\GraphX.Controls\GraphX.Controls.csproj -IncludeReferencedProjects -Prop Configuration=Release
|
Загрузка…
Ссылка в новой задаче