Browse Source

Start implementing Graphic Objects (Line,Rectangle)

reports
Peter Forstmeier 12 years ago
parent
commit
6a8ef28a89
  1. 4
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj
  2. 8
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/AbstractVisitor.cs
  3. 6
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/DebugVisitor.cs
  4. 4
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/ExpressionVisitor.cs
  5. 1
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/IVisitor.cs
  6. 5
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/WpfVisitor.cs
  7. 24
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/Graphics/BaseGraphics.cs
  8. 30
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/Graphics/BaseLineItem.cs
  9. 43
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/ExportColumns/ExportGraphics.cs
  10. 5
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Pdf/PdfHelper.cs
  11. 10
      src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Pdf/PdfVisitor.cs

4
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/ICSharpCode.Reporting.csproj

@ -149,6 +149,8 @@ @@ -149,6 +149,8 @@
<Compile Include="Src\Globals\GlobalValues.cs" />
<Compile Include="Src\Interfaces\IReportModel.cs" />
<Compile Include="Src\Items\BaseTextItem.cs" />
<Compile Include="Src\Items\Graphics\BaseGraphics.cs" />
<Compile Include="Src\Items\Graphics\BaseLineItem.cs" />
<Compile Include="Src\Items\GroupColumn.cs" />
<Compile Include="Src\Items\PrintableItem.cs" />
<Compile Include="Src\Items\ReportContainer.cs" />
@ -161,6 +163,7 @@ @@ -161,6 +163,7 @@
<Compile Include="Src\PageBuilder\DataPageBuilder.cs" />
<Compile Include="Src\PageBuilder\ExportColumns\ExportColumn.cs" />
<Compile Include="Src\PageBuilder\ExportColumns\ExportContainer.cs" />
<Compile Include="Src\PageBuilder\ExportColumns\ExportGraphics.cs" />
<Compile Include="Src\PageBuilder\ExportColumns\ExportText.cs" />
<Compile Include="Src\PageBuilder\ExportColumns\ExportPage.cs" />
<Compile Include="Src\PageBuilder\FormPageBuilder.cs" />
@ -199,6 +202,7 @@ @@ -199,6 +202,7 @@
<Folder Include="Src\DataManager" />
<Folder Include="Src\DataManager\Listhandling" />
<Folder Include="Src\Expressions" />
<Folder Include="Src\Items\Graphics" />
<Folder Include="Src\Pdf" />
<Folder Include="Src\Wpf" />
<Folder Include="Src\PageBuilder" />

8
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/AbstractVisitor.cs

@ -54,11 +54,19 @@ namespace ICSharpCode.Reporting.Exporter.Visitors @@ -54,11 +54,19 @@ namespace ICSharpCode.Reporting.Exporter.Visitors
}
public virtual void Visit(ExportGraphics exportGraphics)
{
throw new NotImplementedException();
}
protected bool ShouldSetBackcolor (ExportColumn exportColumn) {
return exportColumn.BackColor != Color.White;
}
protected Collection<ExportPage> Pages {get; private set;}
}
}

6
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/DebugVisitor.cs

@ -35,5 +35,11 @@ namespace ICSharpCode.Reporting.Exporter.Visitors @@ -35,5 +35,11 @@ namespace ICSharpCode.Reporting.Exporter.Visitors
public override void Visit(ExportText exportColumn)
{
}
public override void Visit(ExportGraphics exportGraphics)
{
// base.Visit(exportGraphics);
Console.WriteLine("Line from {0} size {1}",exportGraphics.Location,exportGraphics.Size.Width);
}
}
}

4
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/ExpressionVisitor.cs

@ -57,6 +57,10 @@ namespace ICSharpCode.Reporting.Exporter.Visitors @@ -57,6 +57,10 @@ namespace ICSharpCode.Reporting.Exporter.Visitors
}
}
public override void Visit(ExportGraphics exportGraphics)
{
// base.Visit(exportGraphics);
}
object Evaluate(ExportText exportColumn)
{

1
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/IVisitor.cs

@ -16,5 +16,6 @@ namespace ICSharpCode.Reporting.Exporter.Visitors @@ -16,5 +16,6 @@ namespace ICSharpCode.Reporting.Exporter.Visitors
void Visit(ExportPage page);
void Visit(ExportContainer exportColumn);
void Visit(ExportText exportColumn);
void Visit(ExportGraphics exportGraphics);
}
}

5
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Exporter/Visitors/WpfVisitor.cs

@ -81,6 +81,11 @@ namespace ICSharpCode.Reporting.Exporter.Visitors @@ -81,6 +81,11 @@ namespace ICSharpCode.Reporting.Exporter.Visitors
}
public override void Visit(ExportGraphics exportGraphics)
{
// base.Visit(exportGraphics);
}
protected UIElement UIElement {get;private set;}

24
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/Graphics/BaseGraphics.cs

@ -0,0 +1,24 @@ @@ -0,0 +1,24 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Drawing.Drawing2D;
namespace ICSharpCode.Reporting.Items
{
/// <summary>
/// Description of BaseGraphics.
/// </summary>
public class BaseGraphics:PrintableItem
{
public BaseGraphics()
{
this.Thickness = 1;
DashStyle = DashStyle.Solid;
}
public virtual int Thickness {get;set;}
public virtual DashStyle DashStyle {get;set;}
}
}

30
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Items/Graphics/BaseLineItem.cs

@ -0,0 +1,30 @@ @@ -0,0 +1,30 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using ICSharpCode.Reporting.Interfaces.Export;
using ICSharpCode.Reporting.PageBuilder.ExportColumns;
namespace ICSharpCode.Reporting.Items{
/// <summary>
/// Description of BaseLineItem.
/// </summary>
public class BaseLineItem:BaseGraphics
{
public BaseLineItem()
{
}
public override IExportColumn CreateExportColumn()
{
var ex = new ExportGraphics();
ex.Location = Location;
ex.ForeColor = ForeColor;
ex.BackColor = BackColor;
ex.Size = Size;
ex.DesiredSize = Size;
ex.Thickness = Thickness;
ex.DashStyle = DashStyle;
return ex;
}
}
}

43
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/PageBuilder/ExportColumns/ExportGraphics.cs

@ -0,0 +1,43 @@ @@ -0,0 +1,43 @@
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
using System;
using System.Drawing.Drawing2D;
using ICSharpCode.Reporting.Exporter.Visitors;
using ICSharpCode.Reporting.Interfaces.Export;
namespace ICSharpCode.Reporting.PageBuilder.ExportColumns
{
/// <summary>
/// Description of ExportGraphics.
/// </summary>
///
public interface IExportGraphics:IExportColumn {
int Thickness {get;set;}
DashStyle DashStyle {get;set;}
}
public class ExportGraphics:ExportColumn,IExportGraphics,IAcceptor
{
public ExportGraphics()
{
}
public void Accept(IVisitor visitor)
{
visitor.Visit(this);
}
public override ICSharpCode.Reporting.Arrange.IMeasurementStrategy MeasurementStrategy()
{
throw new NotImplementedException();
}
public int Thickness {get;set;}
public DashStyle DashStyle {get;set;}
}
}

5
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Pdf/PdfHelper.cs

@ -54,6 +54,11 @@ namespace ICSharpCode.Reporting.Pdf @@ -54,6 +54,11 @@ namespace ICSharpCode.Reporting.Pdf
}
public static XPen PdfPen(IExportGraphics column) {
return new XPen(ToXColor(column.ForeColor),column.Thickness);
}
public static Point LocationRelToParent (ExportColumn column) {
return new Point(column.Parent.Location.X + column.Location.X,
column.Parent.Location.Y + column.Location.Y);

10
src/AddIns/Misc/Reporting/ICSharpCode.Reporting/Src/Pdf/PdfVisitor.cs

@ -65,6 +65,16 @@ namespace ICSharpCode.Reporting.Pdf @@ -65,6 +65,16 @@ namespace ICSharpCode.Reporting.Pdf
}
public override void Visit(ExportGraphics exportGraphics)
{
var columnLocation = containerLocation;
columnLocation.Offset(exportGraphics.Location);
var p = PdfHelper.PdfPen(exportGraphics);
gfx.DrawLine(p,columnLocation.ToXPoints(),new Point(exportGraphics.Size.Width,columnLocation.Y).ToXPoints());
}
public PdfPage PdfPage {get; private set;}
}
}

Loading…
Cancel
Save