コード例 #1
0
 public StandardSelection(MoonlightController controller)
 {
     Controller = controller;
     HandleGroups = new Dictionary<UIElement, IHandleGroup>();
     undo = new UndoGroup();
     clipboard = new List<UIElement>();
 }
コード例 #2
0
ファイル: StartPointHandle.cs プロジェクト: mono/lunareclipse
        public StartPointHandle(MoonlightController controller, IHandleGroup group, PathFigure pathFigure)
            : base(controller, group)
        {
            if (pathFigure == null)
                throw new ArgumentNullException("PathFigure");

            path_figure = pathFigure;
        }
コード例 #3
0
ファイル: TransformHandle.cs プロジェクト: mono/lunareclipse
        public TransformHandle(MoonlightController controller, IHandleGroup group, ILocator locator)
            : base(controller, group)
        {
            Locator = locator;

            rotation = new RotateTransform();
            Transforms.Children.Add(rotation);
        }
コード例 #4
0
ファイル: LineHandleGroup.cs プロジェクト: mono/lunareclipse
        public LineHandleGroup(MoonlightController controller, Line child)
            : base(controller, child)
        {
            AddHandle(new StartLineHandle(Controller, this));
            AddHandle(new EndLineHandle(Controller, this));

            Update();
        }
コード例 #5
0
        public PolyLineHandleGroup(MoonlightController controller, Polyline child)
            : base(controller, child)
        {
            PointCollection points = child.Points;
            for (int i=0; i<points.Count; i++)
                AddHandle(new PolyLineHandle(Controller, this, i));

            Update();
        }
コード例 #6
0
        public PathSegmentHandle(MoonlightController controller, IHandleGroup group, PathSegment seg, DependencyProperty point)
            : base(controller, group)
        {
            if (seg == null)
                throw new ArgumentNullException("seg");

            if (point == null)
                throw new ArgumentNullException("point");
            segment = seg;
            point_property = point;
        }
コード例 #7
0
ファイル: MainWindow.cs プロジェクト: mono/lunareclipse
        public MainWindow()
            : base(Gtk.WindowType.Toplevel)
        {
            this.Build();

            controller = new MoonlightController(moonlightwidget.Silver);

            propertypanel.Controller = controller;
            SetupUndoButtons(controller.UndoEngine);
            SetupFiguresButtons(controller.Selection);
        }
コード例 #8
0
ファイル: SelectionTool.cs プロジェクト: mono/lunareclipse
        public SelectionTool(MoonlightController controller)
            : base(controller)
        {
            SelectionRect = new Rectangle();
            SelectionRect.Opacity = 0.2;
            SelectionRect.Fill = new SolidColorBrush(Colors.Blue);
            SelectionRect.Stroke = new SolidColorBrush(Colors.Black);
            SelectionRect.StrokeThickness = 1.0;
            SelectionRect.SetValue(Canvas.ZIndexProperty, int.MaxValue);

            undo = new UndoGroup();
        }
コード例 #9
0
        public AbstractHandleGroup(MoonlightController controller, UIElement child)
        {
            if (child == null)
                throw new ArgumentNullException("child");

            if (controller == null)
                throw new ArgumentNullException("controller");

            Child = child;
            Controller = controller;
            handles = new List<IHandle>();
            frames = new List<IFrame>();
        }
コード例 #10
0
        public ResizeRotateHandleGroup(MoonlightController controller, UIElement child)
            : base(controller, child)
        {
            AddFrame(new RectangleFrame(Child) );

            AddHandle(new RotateHandle(controller, this, new RelativeLocator(child, 0.0, 0.0)));
            AddHandle(new RotateHandle(controller, this, new RelativeLocator(child, 1.0, 0.0)));
            AddHandle(new RotateHandle(controller, this, new RelativeLocator(child, 0.0, 1.0)));
            AddHandle(new RotateHandle(controller, this, new RelativeLocator(child, 1.0, 1.0)));

            AddHandle(new LeftResizeWidthHandle(controller, this, new RelativeLocator(child, 0.0, 0.5)));
            AddHandle(new RightResizeWidthHandle(controller, this, new RelativeLocator(child, 1.0, 0.5)));
            AddHandle(new TopResizeHeightHandle(controller, this, new RelativeLocator(child, 0.5, 0.0)));
            AddHandle(new BottomResizeHeightHandle(controller, this, new RelativeLocator(child, 0.5, 1.0)));

            Update();
        }
コード例 #11
0
ファイル: PathHandleGroup.cs プロジェクト: mono/lunareclipse
        public PathHandleGroup(MoonlightController controller, Path child)
            : base(controller, child)
        {
            PathGeometry geometry = child.Data as PathGeometry;

            if (geometry == null)
                return;

            foreach (PathFigure fig in geometry.Figures) {
                AddHandle(new StartPointHandle(Controller, this, fig) );
                foreach (PathSegment segment in fig.Segments) {
                    if (segment is LineSegment)
                        AddLineSegmentHandle(segment);
                    if (segment is BezierSegment) {
                        AddFrame(new BezierSegmentFrame(Child, fig, segment as BezierSegment));
                        AddBezierSegmentHandles(segment);
                    }
                }
            }

            Update();
        }
コード例 #12
0
ファイル: AbstractHandle.cs プロジェクト: mono/lunareclipse
        public AbstractHandle(MoonlightController controller, IHandleGroup group)
            : base()
        {
            Group = group;

            //inner = controller.GtkSilver.InitializeFromXaml(GetXaml(), this);
            //Application.LoadComponent(this, new Uri("ellipse.xml", UriKind.Relative));
            Content = CreateContent();

            Content.MouseLeftButtonDown += MouseStart;
            Content.MouseLeftButtonUp += MouseEnd;
            Content.MouseMove += MouseStep;

            highlight_fill = new SolidColorBrush(Colors.Red);
            normal_fill = (Brush) Content.GetValue(Shape.FillProperty);

            Content.MouseEnter += delegate {
                Content.SetValue(Shape.FillProperty, highlight_fill);
            };

            Content.MouseLeave += delegate {
                Content.SetValue(Shape.FillProperty, normal_fill);
            };

            SetValue(Canvas.ZIndexProperty, int.MaxValue);

            transforms = new TransformGroup();
            scaleTransform = new ScaleTransform();
            transforms.Children.Add(scaleTransform);
            Content.SetValue(UIElement.RenderTransformOriginProperty, new Point(0.5, 0.5));
             	Content.SetValue(UIElement.RenderTransformProperty, transforms);

            undo_group = new UndoGroup();

            Controller.ZoomChanged += delegate {
                Update();
            };
        }
コード例 #13
0
ファイル: PathCreationTool.cs プロジェクト: mono/lunareclipse
 public PathCreationTool(MoonlightController controller)
     : base(controller)
 {
     frames = new List<BezierSegmentFrame>();
 }
コード例 #14
0
ファイル: PointHandle.cs プロジェクト: mono/lunareclipse
 public PointHandle(MoonlightController controller, IHandleGroup group)
     : base(controller, group)
 {
 }
コード例 #15
0
 public BezierSegmentPoint3Handle(MoonlightController controller, IHandleGroup group, BezierSegment seg)
     : base(controller, group)
 {
     segment = seg;
 }
コード例 #16
0
 public LineSegmentHandle(MoonlightController controller, IHandleGroup group, PathSegment seg)
     : base(controller, group, seg, LineSegment.PointProperty)
 {
 }
コード例 #17
0
 public ImageCreationTool(MoonlightController controller)
     : base(controller)
 {
 }
コード例 #18
0
 // TODO: this should be changed with SL 2.0 custom properties
 public static IHandleGroup CreateHandleGroup(MoonlightController controller, UIElement element)
 {
     if (element is Line)
         return new LineHandleGroup(controller, element as Line);
     if (element is Path)
         return new PathHandleGroup(controller, element as Path);
     if (element is Polyline)
         return new PolyLineHandleGroup(controller, element as Polyline);
     return new ResizeRotateHandleGroup(controller, element);
 }
コード例 #19
0
 public ElementCreationTool(MoonlightController controller)
     : base(controller)
 {
 }
コード例 #20
0
 public SquareCreationTool(MoonlightController controller)
     : base(controller)
 {
 }
コード例 #21
0
ファイル: ResizeHandle.cs プロジェクト: mono/lunareclipse
 public ResizeHandle(MoonlightController controller, IHandleGroup group, ILocator locator)
     : base(controller, group, locator)
 {
 }
コード例 #22
0
 public EllipseCreationTool(MoonlightController controller)
     : base(controller)
 {
 }
コード例 #23
0
 public TextBlockCreationTool(MoonlightController controller)
     : base(controller)
 {
 }
コード例 #24
0
ファイル: StartLineHandle.cs プロジェクト: mono/lunareclipse
 public StartLineHandle(MoonlightController controller, IHandleGroup group)
     : base(controller, group)
 {
 }
コード例 #25
0
 public PolyLineCreationTool(MoonlightController controller)
     : base(controller)
 {
 }
コード例 #26
0
ファイル: AbstractTool.cs プロジェクト: mono/lunareclipse
 public AbstractTool(MoonlightController controller)
 {
     Controller = controller;
 }
コード例 #27
0
ファイル: PropertyManager.cs プロジェクト: mono/lunareclipse
        public PropertyManager(MoonlightController controller)
        {
            properties = new List<PropertyInfo>();

            controller.Selection.SelectionChanged += OnSelectionChanged;
        }
コード例 #28
0
 public ProportionalShapeCreationTool(MoonlightController controller)
     : base(controller)
 {
 }
コード例 #29
0
ファイル: PolyLineHandle.cs プロジェクト: mono/lunareclipse
 public PolyLineHandle(MoonlightController controller, IHandleGroup group, int i)
     : base(controller, group)
 {
     index = i;
 }
コード例 #30
0
 public RectangleCreationTool(MoonlightController controller)
     : base(controller)
 {
 }