Last change
on this file since 1248 was
1240,
checked in by mstoeger, 16 years ago
|
Transformations on shapes are possible outside of the Draw method. (#424)
|
File size:
1.0 KB
|
Rev | Line | |
---|
[1182] | 1 | using System.Drawing;
|
---|
[1194] | 2 | using HeuristicLab.Visualization.LabelProvider;
|
---|
[1182] | 3 |
|
---|
| 4 | namespace HeuristicLab.Visualization {
|
---|
| 5 | public class YAxis : WorldShape {
|
---|
| 6 | public const int PixelsPerInterval = 75;
|
---|
| 7 |
|
---|
[1194] | 8 | private ILabelProvider labelProvider = new ContinuousLabelProvider("e4");
|
---|
[1182] | 9 |
|
---|
| 10 | public ILabelProvider LabelProvider {
|
---|
| 11 | get { return labelProvider; }
|
---|
| 12 | set { labelProvider = value; }
|
---|
| 13 | }
|
---|
| 14 |
|
---|
[1240] | 15 | public override void Draw(Graphics graphics) {
|
---|
| 16 | ClearShapes();
|
---|
[1182] | 17 |
|
---|
[1240] | 18 | foreach (double y in AxisTicks.GetTicks(PixelsPerInterval, Parent.Viewport.Height,
|
---|
[1233] | 19 | ClippingArea.Height,
|
---|
| 20 | ClippingArea.Y1)) {
|
---|
[1182] | 21 | TextShape label = new TextShape(ClippingArea.X2 - 3, y,
|
---|
| 22 | labelProvider.GetLabel(y));
|
---|
| 23 | label.AnchorPositionX = AnchorPositionX.Right;
|
---|
| 24 | label.AnchorPositionY = AnchorPositionY.Middle;
|
---|
[1240] | 25 | AddShape(label);
|
---|
[1182] | 26 | }
|
---|
| 27 |
|
---|
[1240] | 28 | base.Draw(graphics);
|
---|
[1182] | 29 | }
|
---|
| 30 | }
|
---|
| 31 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.