public UmlAssociationModel(ConnectionType type, IBoundedSketchItemModel from, IBoundedSketchItemModel to, Point connectorStartHint, Point connectorEndHint, ISketchItemContainer container) : base(type, from, to, connectorStartHint, connectorEndHint, container) { UpdateGeometry(); }
public UmlStateModel(Point p, ISketchItemContainer container) : base(p, container, new Size(DefaultWidth, DefaultHeight)) { IsSelected = true; CanChangeSize = true; Label = "new state"; }
public UmlChoiceModel(Point p, ISketchItemContainer container) : base(p, container, new Size(UmlChoiceModel.DefaultWidth, UmlChoiceModel.DefaultHeight), "Choice", Colors.Snow) { CanChangeSize = false; }
public UmlDependencyModel(ConnectionType type, IBoundedSketchItemModel from, IBoundedSketchItemModel to, Point connectorStartHint, Point connectorEndHint, ISketchItemContainer container) : base(type, from, to, connectorStartHint, connectorEndHint, container) { StrokeDashArray = new DoubleCollection(_dashPattern); }
public PictureModel(System.Windows.Point p, ISketchItemContainer container) : base(p, container, new Size(PictureModel.DefaultWidth, PictureModel.DefaultHeight), "new image", Colors.Snow) { CanChangeSize = true; UpdateGeometry(); }
//EllipseGeometry _geometry; public UmlInitialStateModel(Point p, ISketchItemContainer container) : base(p, container, new Size(DefaultHeight, DefaultWidth), "Initial-State", Colors.Black) { CanEditLabel = false; CanChangeSize = false; LabelArea = Rect.Empty; IsSelected = true; }
public UmlMessageModel(ConnectionType type, IBoundedSketchItemModel from, IBoundedSketchItemModel to, Point connectorStartHint, Point connectorEndHint, ISketchItemContainer container) : base(ConnectionType.StrightLine, from, to, connectorStartHint, connectorEndHint, container) { Label = "message()"; UpdateGeometry(); }
public UmlPackageModel(Point p, ISketchItemContainer container) : base(p, container, new Size(DefaultWidth, DefaultHeight)) { IsSelected = true; CanChangeSize = true; Label = "new package"; UpdateGeometry(); }
public UmlAwaitEventModel(Point p, ISketchItemContainer container) : base(p, container, new Size(DefaultWidth, DefaultHeight), "await event", ConnectableBase.DefaultColor) { IsSelected = true; CanChangeSize = true; RotationAngle = 0.0; Commands = GetUmlWaitForEventCommands(); }
//readonly PathFigure[] _notePath = new PathFigure[1]; public UmlNoteModel(Point p, ISketchItemContainer container) : base(p, container, new Size(DefaultWidth, DefaultHeight), "a note", Colors.White) { CanChangeSize = true; CanEditLabel = true; Note = "a note"; }
public UmlActionConnector(Point p, ISketchItemContainer container) : base(p, container, new Size(DefaultHeight, DefaultWidth), "A", Colors.White) { CanEditLabel = true; CanChangeSize = false; StrokeThickness = 3; UpdateGeometry(); }
public UmlActivityModel(Point p, ISketchItemContainer container) : base(p, container, new Size(DefaultWidth, DefaultHeight)) { IsSelected = true; CanChangeSize = true; Label = "new action"; RotationAngle = 0.0; //Commands = GetUmlActivityModelCommands(); }
public UmlClassModel(Point p, ISketchItemContainer container) : base(p, container, new Size(DefaultWidth, DefaultHeight)) { CanChangeSize = true; CanEditLabel = true; Label = "new class"; RotationAngle = 0.0; _members.CollectionChanged += Members_CollectionChanged;; //UpdateGeometry(); }
public UmlLifeLineModel(Point p, ISketchItemContainer container) : base(p, container, new Size(UmlLifeLineModel.DefaultWidth, UmlLifeLineModel.DefaultHeight), "Object Life Line", Colors.Snow) { FillColor = new Color() { A = 0, R = 0xFF, G = 0xFF, B = 0xFF }; CanChangeSize = true; UpdateGeometry(); }
public ConnectorLabelModel(ConnectorModel connector, ISketchItemContainer container, bool isStartPointLabel, bool showLabelConnection, Point labelPosition) : base(labelPosition, container, ComputeSizeOfBounds(connector.GetLabel(isStartPointLabel)), connector.GetLabel(isStartPointLabel), Colors.Snow) { _connector = connector; _connector.PropertyChanged += Connector_PropertyChanged; _isStartpointLabel = isStartPointLabel; _showLabelConnection = showLabelConnection; CanChangeSize = false; StrokeThickness = 0.2; FillColor = Color.FromArgb(0x31, 0xFF, 0xFA, 0xFA); UpdateGeometry(); }
public ConnectableBase(Point pos, ISketchItemContainer container, Size size, string label, Color color) { ParentNode = container; IsSelected = true; Label = label; FillColor = color; LabelArea = ComputeLabelArea(DisplayedLabel()); _bounds = ComputeBounds(pos, size, LabelArea); _rotateTransform.CenterX = Bounds.Width / 2; _rotateTransform.CenterY = Bounds.Height / 2; _rotateTransform.Changed += RotateTransform_Changed; Initialize(); }
public ConnectorModel(ConnectionType type, IBoundedSketchItemModel from, IBoundedSketchItemModel to, System.Windows.Point connectorStartHint, System.Windows.Point connectorEndHint, ISketchItemContainer container) //:base(new Guid()) { ParentNode = container; _connectionType = type; MiddlePointRelativePosition = 0.5; From = from; To = to; _myConnectorStrategy = ConnectorUtilities.GetConnectionType(this, _connectionType, connectorStartHint, connectorEndHint); Label = string.Format("{0}->{1}", from.Label, to.Label); LineWidth = 1; _geometry.Children.Add(_path); Initialize(); }
public SketchItemDisplayLabel(ISketchItemContainer container, Canvas canvas) { Contract.Requires <ArgumentNullException>(container != null, "Container must not be null"); Contract.Requires <ArgumentNullException>(canvas != null, "Canvas must not be null"); DataContext = container; SetBinding(TagProperty, "Label"); _container = container; _canvas = canvas; Stroke = Brushes.Black; StrokeThickness = 0.5; Fill = _fillBrush; _canvas.Children.Add(this); Visibility = Visibility.Visible; UpdateGeometry(); }
public static void RestoreSnapshot(Stream stream, ISketchItemContainer container) { IList <ISketchItemModel> outlines = container.SketchItems; outlines.Clear(); var ss = new SurrogateSelector(); ss.AddSurrogate(typeof(SketchItemContainerProxy), new StreamingContext(StreamingContextStates.All), new SketchItemContainerSerializationSurrogate(container)); IFormatter formatter = new BinaryFormatter() { SurrogateSelector = ss }; var list = (List <ISketchItemModel>)formatter.Deserialize(stream); RestoreChildren(outlines, list); }
public static void TakeSnapshot(Stream stream, ISketchItemContainer container) { var outlines = container.SketchItems; var ss = new SurrogateSelector(); ss.AddSurrogate(typeof(SketchItemContainerProxy), new StreamingContext(StreamingContextStates.All), new SketchItemContainerSerializationSurrogate(container)); IFormatter formatter = new BinaryFormatter() { SurrogateSelector = ss }; List <ISketchItemModel> list = new List <ISketchItemModel>(outlines.Where( (x) => x.IsSerializable)); formatter.Serialize(stream, list); }
public SketchItemDisplay(SketchPad parent, ISketchItemContainer container, bool activateCanvas = true) { this.Height = parent.Height; this.Width = parent.Width; _parent = parent; _container = container; Focusable = true; Background = Brushes.White; var items = new List <ISketchItemModel>(_container.SketchItems); foreach (var item in items) { AddVisualChild(item); } _container.SketchItems.CollectionChanged += SketchItems_CollectionChanged; if (activateCanvas) { Visibility = Visibility.Visible; _myLabel = new SketchItemDisplayLabel(container, this); BeginEdit(new SelectUisOperation(this)); } }
public UmlGeneralizationModel(ConnectionType type, IBoundedSketchItemModel from, IBoundedSketchItemModel to, Point connectorStartHint, Point connectorEndHint, ISketchItemContainer container) : base(type, from, to, connectorStartHint, connectorEndHint, container) { }
public FreeTextModel(Point p, ISketchItemContainer container) : base(p, container, new Size(DefaultWidth, DefaultHeight), "a text", Colors.White) { CanChangeSize = true; }
//Point _textPosition = new Point(); //bool _boundsChanging; public UmlCombinedFragment(Point location, ISketchItemContainer container) : base(location, container, new Size(150, 50), $"{_default}", DefaultColor) { CanChangeSize = true; CanEditLabel = false; _formattedLabel = ComputeFormattedText(Label, ConnectableBase.DefaultFont, ConnectableBase.DefaultFontSize); }
public UmlActivityDiagramEdge(ConnectionType type, IBoundedSketchItemModel from, IBoundedSketchItemModel to, Point connectorStartHint, Point connectorEndHint, ISketchItemContainer container) : base(type, from, to, connectorStartHint, connectorEndHint, container) { }
public SketchItemContainerProxy(ISketchItemContainer realContainer) { _realContainer = realContainer; }
public ContainerModel(Point location, ISketchItemContainer container, Size size) : base(location, container, size, "new container", ConnectableBase.DefaultColor) { _children.CollectionChanged += SketchItemsChanged; }