本文整理汇总了C#中IDrawingView类的典型用法代码示例。如果您正苦于以下问题:C# IDrawingView类的具体用法?C# IDrawingView怎么用?C# IDrawingView使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
IDrawingView类属于命名空间,在下文中一共展示了IDrawingView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ResizeHandleUndoActivity
public ResizeHandleUndoActivity(IDrawingView view, IFigure owner): base (view) {
Undoable = true;
Redoable = true;
Owner = owner;
OldDisplayBox = Owner.DisplayBox;
NewDisplayBox = Owner.DisplayBox;
}
示例2: DrawInRegionVisitor
public DrawInRegionVisitor(Gdk.Region region, Cairo.Context context, IDrawingView view)
{
this.context = context;
this.region = region;
this.view = view;
this.figures = new List<Figure> ();
}
示例3: InvokeStep
public override void InvokeStep (double x, double y, IDrawingView view) {
RectangleD r = Owner.DisplayBox;
PointD new_location = new PointD (r.X, Math.Min (r.Y + r.Height, y));
PointD new_corner = new PointD (Math.Max (r.X, x), r.Y + r.Height);
Owner.DisplayBox = new RectangleD (new_location, new_corner);
}
示例4: ChangeAttributeUndoActivity
public ChangeAttributeUndoActivity (IDrawingView drawingView,
FigureAttribute attribute, object value) : base (drawingView) {
_originalValues = new Dictionary<IFigure, object> ();
Undoable = true;
Redoable = true;
Attribute = attribute;
Value = value;
}
示例5: InvokeStep
public override void InvokeStep(double x, double y, IDrawingView view)
{
RectangleD r = Owner.DisplayBox;
var new_location = new PointD (Math.Min (r.X + r.Width, x), r.Y);
var new_corner = new PointD (r.X + r.Width, Math.Max (r.Y, y));
Owner.DisplayBox = new RectangleD (new_location, new_corner);
}
示例6: InvokeStep
public override void InvokeStep(double x, double y, IDrawingView view)
{
LabelFigure label = (LabelFigure) Owner;
PointD delta = label.HandleDeltaPosition();
Owner.MoveTo(x - delta.X, y - delta.Y);
double offsetX = Owner.DisplayBox.Width/2 - delta.X;
double offsetY = Owner.DisplayBox.Height/2 - delta.Y;
label.SetPosition(new PointD(x + offsetX, y + offsetY));
}
示例7: InvokeEnd
public void InvokeEnd (double x, double y, IDrawingView view) {
WrappedHandle.InvokeEnd(x, y, view);
IUndoActivity activity = WrappedHandle.UndoActivity;
if (activity != null && activity.Undoable && view.Editor.UndoManager != null) {
view.Editor.UndoManager.PushUndo(activity);
view.Editor.UndoManager.ClearRedos();
}
}
示例8: Draw
public virtual void Draw (Context context, IDrawingView view) {
RectangleD rect = ViewDisplayBox(view);
context.Save();
context.LineWidth = LineWidth;
context.Rectangle (GdkCairoHelper.CairoRectangle (rect));
context.Color = FillColor;
context.FillPreserve ();
context.Color = LineColor;
context.Stroke ();
context.Restore();
}
示例9: InvokeEnd
public override void InvokeEnd (double x, double y, IDrawingView view) {
PolyLineFigure figure = ((PolyLineFigure) Owner);
// eliminates handles in the middle of a straight line
if (figure.PointCount > 2 && Index != 0 && Index != (figure.PointCount - 1)) {
PointD p1 = figure.PointAt (Index - 1);
PointD p2 = figure.PointAt (Index + 1);
if (Geometry.LineContainsPoint (p1.X, p1.Y, p2.X, p2.Y, x, y)) {
figure.RemovePointAt (Index);
}
}
base.InvokeEnd(x, y, view);
}
示例10: InvokeStart
public override void InvokeStart(double x, double y, IDrawingView view)
{
m_connection = CreateConnection();
m_connection.EndPoint = new PointD (x, y);
m_connection.StartPoint = new PointD (x, y);
m_connection.ConnectStart (Owner.ConnectorAt(x, y));
m_connection.UpdateConnection();
view.Drawing.Add(m_connection);
view.ClearSelection();
view.AddToSelection(m_connection);
m_handle = view.FindHandle(x, y);
}
示例11: InvokeEnd
public override void InvokeEnd (double x, double y, IDrawingView view)
{
base.InvokeEnd (x, y, view);
if (clicked)
{
Experiment ownerExperiment = m_ownerConnection.Owner;
ownerExperiment.RemoveConnection(m_ownerConnection.ExperimentNodeConnection);
}
clicked = false;
}
示例12: InvokeEnd
public override void InvokeEnd(double x, double y, IDrawingView view)
{
if (m_handle != null) {
m_handle.InvokeEnd(x, y, view);
}
if (m_connection.EndConnector == null) {
m_connection.DisconnectStart ();
m_connection.DisconnectEnd ();
view.Drawing.Remove(m_connection);
view.ClearSelection();
}
}
示例13: SelectFiguresOnRect
public void SelectFiguresOnRect (IDrawingView view, bool shift_pressed) {
foreach (IFigure figure in view.Drawing.FiguresEnumeratorReverse) {
RectangleD rect = figure.DisplayBox;
if (_selectionRect.Contains (rect.X, rect.Y)
&& _selectionRect.Contains (rect.X2, rect.Y2)) {
if (shift_pressed) {
view.ToggleSelection (figure);
}
else {
view.AddToSelection (figure);
}
}
}
}
示例14: Draw
public override void Draw (Cairo.Context context, IDrawingView view)
{
context.Save();
base.Draw(context, view);
context.LineWidth = 1.0;
if (Active) {
DrawOn(context, view);
}
else {
DrawOff(context, view);
}
context.Restore();
}
示例15: InvokeEnd
public override void InvokeEnd (double x, double y, IDrawingView view)
{
base.InvokeEnd (x, y, view);
if (clicked)
{
IEditableExperiment experiment = m_ownerComponent.ExperimentNode.Owner as IEditableExperiment;
if(experiment != null)
{
experiment.RemoveVertex(m_ownerComponent.ExperimentNode);
}
}
clicked = false;
}