Most of methods should be virtual.

This commit is contained in:
Kolan Sh 2018-01-15 12:05:21 +03:00
parent 1d9912da49
commit a73d81fc89
7 changed files with 12 additions and 13 deletions

View File

@ -77,7 +77,7 @@ namespace CairoChart {
public Line.Style line_style = Line.Style ();
public double font_indent = 5;
public Axis copy () {
public virtual Axis copy () {
var axis = new Axis ();
axis._date_format = this._date_format;
axis._dsec_signs = this._dsec_signs;

View File

@ -8,7 +8,7 @@ namespace CairoChart {
public Line.Style line_style = Line.Style ();
public Grid copy () {
public virtual Grid copy () {
var grid = new Grid ();
grid.color = this.color;
grid.line_style = this.line_style;

View File

@ -21,7 +21,7 @@ namespace CairoChart {
public double text_vspace = 2.0;
public bool show = true;
public Legend copy () {
public virtual Legend copy () {
var legend = new Legend ();
legend.position = this.position;
legend.font_style = this.font_style;

View File

@ -20,7 +20,7 @@ namespace CairoChart {
this.size = size;
}
public Marker copy () {
public virtual Marker copy () {
return new Marker (type, size);
}

View File

@ -29,7 +29,7 @@ namespace CairoChart {
public double zoom_y_min = 0;
public double zoom_y_max = 1;
public Place copy () {
public virtual Place copy () {
var place = new Place ();
place.x_min = this.x_min;
place.x_max = this.x_max;

View File

@ -41,7 +41,7 @@ namespace CairoChart {
public bool zoom_show = true;
public Series copy () {
public virtual Series copy () {
var series = new Series ();
series._color = this._color;
series.axis_x = this.axis_x.copy ();

View File

@ -1,11 +1,10 @@
namespace CairoChart {
[Compact]
public class Text {
public string text = "";
public Font.Style style = Font.Style ();
public Color color = Color();
public Cairo.TextExtents get_extents (Cairo.Context context) {
public virtual Cairo.TextExtents get_extents (Cairo.Context context) {
context.select_font_face (style.family, style.slant, style.weight);
context.set_font_size (style.size);
Cairo.TextExtents extents;
@ -13,7 +12,7 @@ namespace CairoChart {
return extents;
}
public double get_width (Cairo.Context context) {
public virtual double get_width (Cairo.Context context) {
var extents = get_extents (context);
switch (style.orientation) {
case Font.Orientation.HORIZONTAL: return extents.width;
@ -22,7 +21,7 @@ namespace CairoChart {
}
}
public double get_height (Cairo.Context context) {
public virtual double get_height (Cairo.Context context) {
var extents = get_extents (context);
switch (style.orientation) {
case Font.Orientation.HORIZONTAL: return extents.height;
@ -36,7 +35,7 @@ namespace CairoChart {
double height;
}
public Size get_size (Cairo.Context context) {
public virtual Size get_size (Cairo.Context context) {
var sz = Size();
var extents = get_extents (context);
switch (style.orientation) {
@ -52,7 +51,7 @@ namespace CairoChart {
return sz;
}
public void show (Cairo.Context context) {
public virtual void show (Cairo.Context context) {
context.select_font_face(style.family,
style.slant,
style.weight);
@ -74,7 +73,7 @@ namespace CairoChart {
this.color = color;
}
public Text copy () {
public virtual Text copy () {
var text = new Text ();
text.text = this.text;
text.style = this.style;