-
Notifications
You must be signed in to change notification settings - Fork 305
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove test dependencies from the core agl
Signed-off-by: Lev Nachmanson <[email protected]>
- Loading branch information
Showing
8 changed files
with
614 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion>8.0.30703</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{AF9121C3-E4B7-464F-8EBB-96C9CF627C07}</ProjectGuid> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>FormForGViewer</RootNamespace> | ||
<AssemblyName>FormForGViewer</AssemblyName> | ||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> | ||
<FileAlignment>512</FileAlignment> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<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' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'"> | ||
<DebugSymbols>true</DebugSymbols> | ||
<OutputPath>bin\x86\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<DebugType>full</DebugType> | ||
<PlatformTarget>x86</PlatformTarget> | ||
<ErrorReport>prompt</ErrorReport> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'"> | ||
<OutputPath>bin\x86\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<Optimize>true</Optimize> | ||
<DebugType>pdbonly</DebugType> | ||
<PlatformTarget>x86</PlatformTarget> | ||
<ErrorReport>prompt</ErrorReport> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> | ||
<DebugSymbols>true</DebugSymbols> | ||
<OutputPath>bin\x64\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<DebugType>full</DebugType> | ||
<PlatformTarget>x64</PlatformTarget> | ||
<ErrorReport>prompt</ErrorReport> | ||
</PropertyGroup> | ||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> | ||
<OutputPath>bin\x64\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<Optimize>true</Optimize> | ||
<DebugType>pdbonly</DebugType> | ||
<PlatformTarget>x64</PlatformTarget> | ||
<ErrorReport>prompt</ErrorReport> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Drawing" /> | ||
<Reference Include="System.Windows.Forms" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Data.DataSetExtensions" /> | ||
<Reference Include="Microsoft.CSharp" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="FormStuff.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\..\Drawing\AutomaticGraphLayout.Drawing.csproj"> | ||
<Project>{B76F8F71-4B00-4242-BE36-C9F0732511F7}</Project> | ||
<Name>AutomaticGraphLayout.Drawing</Name> | ||
</ProjectReference> | ||
<ProjectReference Include="..\..\tools\GraphViewerGDI\GraphViewerGDI.csproj"> | ||
<Project>{725CD2CB-CF37-414E-A5A6-F1D87D4D6EDE}</Project> | ||
<Name>GraphViewerGDI</Name> | ||
</ProjectReference> | ||
<ProjectReference Include="..\..\MSAGL\AutomaticGraphLayout.csproj"> | ||
<Project>{415D3E3F-7105-46C1-84D2-7ECB34213D92}</Project> | ||
<Name>AutomaticGraphLayout</Name> | ||
</ProjectReference> | ||
<ProjectReference Include="..\..\tools\Dot2Graph\Dot2Graph.csproj"> | ||
<Project>{ba8fed53-458e-4cb3-8eb3-cbfcadd87e5d}</Project> | ||
<Name>Dot2Graph</Name> | ||
</ProjectReference> | ||
<ProjectReference Include="..\..\tools\QUT.ShiftReduceParser\QUT.ShiftReduceParser.csproj"> | ||
<Project>{ef5cf15e-5645-433b-8a23-af93e3f2682f}</Project> | ||
<Name>QUT.ShiftReduceParser</Name> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
<!-- 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"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
/* | ||
Microsoft Automatic Graph Layout,MSAGL | ||
Copyright (c) Microsoft Corporation | ||
All rights reserved. | ||
MIT License | ||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
""Software""), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
using System; | ||
using System.Diagnostics; | ||
using System.IO; | ||
using System.Windows.Forms; | ||
using Dot2Graph; | ||
using Microsoft.Msagl.Drawing; | ||
using Microsoft.Msagl.GraphViewerGdi; | ||
|
||
namespace FormForGViewer { | ||
public class FormStuff { | ||
public static bool initialLayout; | ||
static string lastFileName; | ||
public static GViewer GViewer; | ||
|
||
public static Form CreateOrAttachForm(GViewer gviewer, Form form) { | ||
GViewer=gviewer; | ||
if (form == null) | ||
form = new Form(); | ||
form.SuspendLayout(); | ||
form.Controls.Add(gviewer); | ||
gviewer.Dock = DockStyle.Fill; | ||
gviewer.SendToBack(); | ||
form.StartPosition = FormStartPosition.CenterScreen; | ||
form.Size = new System.Drawing.Size(Screen.PrimaryScreen.WorkingArea.Width, | ||
Screen.PrimaryScreen.WorkingArea.Height); | ||
form.MainMenuStrip = GetMainMenuStrip(); | ||
form.Controls.Add(form.MainMenuStrip); | ||
form.ResumeLayout(); | ||
form.Load += form_Load; | ||
return form; | ||
} | ||
|
||
static void form_Load(object sender,EventArgs e) { | ||
((Form) sender).Focus(); | ||
} | ||
|
||
|
||
static MenuStrip GetMainMenuStrip() { | ||
var menu=new MenuStrip(); | ||
menu.Items.Add(FileStripItem()); | ||
|
||
return menu; | ||
|
||
} | ||
|
||
static ToolStripItem FileStripItem() { | ||
var item = new ToolStripMenuItem("File"); | ||
item.DropDownItems.Add((ToolStripItem) OpenDotFileItem()); | ||
item.DropDownItems.Add(ReloadDotFileItem()); | ||
return item; | ||
} | ||
|
||
static ToolStripItem ReloadDotFileItem() { | ||
var item = new ToolStripMenuItem("Reload file"); | ||
item.ShortcutKeys = Keys.F5; | ||
item.Click += ReloadFileClick; | ||
return item; | ||
} | ||
|
||
static void ReloadFileClick(object sender, EventArgs e) { | ||
if(lastFileName!=null) | ||
ReadGraphFromFile(lastFileName, GViewer, false); | ||
} | ||
|
||
static ToolStripItem OpenDotFileItem() { | ||
var item = new ToolStripMenuItem("Open file"); | ||
item.ShortcutKeys = Keys.Control | Keys.O; | ||
item.Click += OpenFileClick; | ||
return item; | ||
} | ||
|
||
static void OpenFileClick(object sender, EventArgs e) { | ||
|
||
var openFileDialog = new OpenFileDialog { | ||
RestoreDirectory = true, | ||
Filter = " dot files (*.dot)|*.dot|All files (*.*)|*.*" | ||
}; | ||
|
||
if (openFileDialog.ShowDialog() == DialogResult.OK) | ||
ReadGraphFromFile(openFileDialog.FileName, GViewer, false); | ||
} | ||
|
||
internal static Graph CreateDrawingGraphFromFile(string fileName, out int line, out int column, out bool msaglFile) { | ||
string msg; | ||
var graph = Parser.Parse(fileName, out line, out column, out msg); | ||
if (graph != null) { | ||
msaglFile = false; | ||
return graph; | ||
} | ||
|
||
try { | ||
graph = Graph.Read(fileName); | ||
msaglFile = true; | ||
return graph; | ||
} catch (Exception) { | ||
System.Diagnostics.Debug.WriteLine("cannot read " + fileName); | ||
} | ||
msaglFile = false; | ||
return null; | ||
} | ||
|
||
|
||
public static void ReadGraphFromFile(string fileName, GViewer gViewer, bool verbose) { | ||
int eLine, eColumn; | ||
bool msaglFile; | ||
Graph graph = CreateDrawingGraphFromFile(fileName, out eLine, out eColumn, out msaglFile); | ||
lastFileName = fileName; | ||
if (graph == null) | ||
MessageBox.Show(String.Format("{0}({1},{2}): cannot process the file", fileName, eLine, eColumn)); | ||
|
||
else { | ||
|
||
#if TEST_MSAGL | ||
graph.LayoutAlgorithmSettings.Reporting = Test.verbose; | ||
#endif | ||
gViewer.FileName = fileName; | ||
Stopwatch sw = null; | ||
if (verbose) { | ||
gViewer.AsyncLayout = false; | ||
sw = new Stopwatch(); | ||
sw.Start(); | ||
} | ||
gViewer.Graph = graph; | ||
if (sw != null) { | ||
sw.Stop(); | ||
System.Diagnostics.Debug.WriteLine("layout done for {0} ms", (double)sw.ElapsedMilliseconds / 1000); | ||
} | ||
} | ||
} | ||
} | ||
} |
61 changes: 61 additions & 0 deletions
61
GraphLayout/tools/FormForGViewer/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
Microsoft Automatic Graph Layout,MSAGL | ||
Copyright (c) Microsoft Corporation | ||
All rights reserved. | ||
MIT License | ||
Permission is hereby granted, free of charge, to any person obtaining | ||
a copy of this software and associated documentation files (the | ||
""Software""), to deal in the Software without restriction, including | ||
without limitation the rights to use, copy, modify, merge, publish, | ||
distribute, sublicense, and/or sell copies of the Software, and to | ||
permit persons to whom the Software is furnished to do so, subject to | ||
the following conditions: | ||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("FormForGV")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("Microsoft")] | ||
[assembly: AssemblyCopyright("Copyright © Microsoft 2011")] | ||
[assembly: AssemblyTrademark("")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
// You can specify all the values or you can default the Build and Revision Numbers | ||
// by using the '*' as shown below: | ||
// [assembly: AssemblyVersion("1.0.*")] | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
Oops, something went wrong.