protected void NDrawingView1_AsyncClick(object sender, EventArgs e) { NCallbackMouseEventArgs args = e as NCallbackMouseEventArgs; NNodeList nodes = NDrawingView1.HitTest(args); NNodeList shapes = nodes.Filter(Nevron.Diagram.Filters.NFilters.Shape2D); NExpandCollapseCheck check = null; int length = shapes.Count; for (int i = 0; i < length; i++) { if (shapes[i] is NExpandCollapseCheck) { check = shapes[i] as NExpandCollapseCheck; break; } } if (check == null) { return; } NExpandableShape shape = check.ParentNode.ParentNode as NExpandableShape; shape.Expand(!shape.Expanded); }
protected void NDrawingView1_AsyncClick(object sender, EventArgs e) { NCallbackMouseEventArgs args = e as NCallbackMouseEventArgs; NNodeList nodes = NDrawingView1.HitTest(args); NNodeList shapes = nodes.Filter(TABLE_SHAPE_FILTER); if (shapes.Count == 0) { NDrawingView1.Document.Tag = null; return; } NNodeList decorators = nodes.Filter(DECORATOR_FILTER); if (decorators.Count > 0) { ((NShowHideSubtreeDecorator)decorators[0]).ToggleState(); } NTableShape table = (NTableShape)shapes[0]; NEmployee employee = (NEmployee)table.Tag; NDrawingView1.Document.Tag = employee; NDrawingView1.Document.SmartRefreshAllViews(); }
protected void OnMouseEvent(object sender, EventArgs e) { NCallbackMouseEventArgs args = e as NCallbackMouseEventArgs; NNodeList allShapes = NDrawingView1.Document.ActiveLayer.Children(Nevron.Diagram.Filters.NFilters.Shape2D); NNodeList affectedNodes = NDrawingView1.HitTest(args); NNodeList affectedShapes = affectedNodes.Filter(Nevron.Diagram.Filters.NFilters.Shape2D); int length; length = allShapes.Count; for (int i = 0; i < length; i++) { NShape shape = allShapes[i] as NShape; shape.Style.ShadowStyle = null; if (shape.Tag != null) { shape.Style.FillStyle = new NColorFillStyle((Color)shape.Tag); } } length = affectedShapes.Count; for (int i = 0; i < length; i++) { NShape shape = affectedShapes[i] as NShape; shape.Style.ShadowStyle = new NShadowStyle(ShadowType.GaussianBlur, Color.FromArgb(96, Color.Black), new NPointL(3, 3), 1, new NLength(10)); NColorFillStyle fs = shape.Style.FillStyle as NColorFillStyle; if (fs != null && fs.Color != Color.White) { shape.Tag = fs.Color; shape.Style.FillStyle = new NColorFillStyle(Color.YellowGreen); } } }
protected void Page_Load(object sender, System.EventArgs e) { // init document NDrawingView1.Document.BeginInit(); InitDocument(); NDrawingView1.Document.EndInit(); // size view control to content NDrawingView1.SizeToContent(); }
protected void NDrawingView1_AsyncClick(object sender, EventArgs e) { NCallbackMouseEventArgs args = e as NCallbackMouseEventArgs; NNodeList nodes = NDrawingView1.HitTest(args); NNodeList decorators = nodes.Filter(DecoratorFilter); if (decorators.Count > 0) { ((NShowHideSubtreeDecorator)decorators[0]).ToggleState(); } NDrawingView1.Document.SmartRefreshAllViews(); }
protected void NDrawingView1_AsyncClick(object sender, EventArgs e) { NCallbackMouseEventArgs args = e as NCallbackMouseEventArgs; NNodeList nodes = NDrawingView1.HitTest(args); NNodeList decorators = nodes.Filter(DECORATOR_FILTER); if (decorators.Count > 0) { ((NShowHideSubtreeDecorator)decorators[0]).ToggleState(); DoLayout(); } }
protected void Page_Load(object sender, System.EventArgs e) { NHtmlImageMapResponse imageMapResponse = new NHtmlImageMapResponse(); NDrawingView1.ServerSettings.BrowserResponseSettings.DefaultResponse = imageMapResponse; // init document NDrawingView1.Document.BeginInit(); InitDocument(); NDrawingView1.Document.EndInit(); // size view control to content NDrawingView1.SizeToContent(); }
protected void Page_Load(object sender, System.EventArgs e) { NHtmlImageMapResponse imageMapResponse = new NHtmlImageMapResponse(); NDrawingView1.ServerSettings.BrowserResponseSettings.DefaultResponse = imageMapResponse; // init document NDrawingView1.Document.BeginInit(); NDrawingView1.ViewLayout = CanvasLayout.Normal; InitDocument(NDrawingView1.Document, new NFlagsShapesFactory(NDrawingView1.Document)); NDrawingView1.SizeToContent(); NDrawingView1.Document.EndInit(); }
protected void Page_Load(object sender, EventArgs e) { // create some shape factories m_FilesAndFoldersFactory = new NFilesAndFoldersFactory(); m_FilesAndFoldersFactory.DefaultSize = VertexSize; m_BusinessProcessShapesFactory = new NBusinessProcessShapesFactory(); m_BusinessProcessShapesFactory.DefaultSize = SymbolSize; // import the data NDrawingView1.Document.BeginInit(); ImportData(); NDrawingView1.Document.EndInit(); // size the view to its content NDrawingView1.SizeToContent(); }
protected void Page_Load(object sender, System.EventArgs e) { base.DefaultGridOrigin = new NPointF(30, 30); base.DefaultGridCellSize = new NSizeF(100, 50); base.DefaultGridSpacing = new NSizeF(50, 40); // begin view init NDrawingView1.ViewLayout = CanvasLayout.Fit; NDrawingView1.DocumentPadding = new Nevron.Diagram.NMargins(10); // init NDrawingView1.Document. NDrawingView1.Document.BeginInit(); InitDocument(); NDrawingView1.Document.EndInit(); NDrawingView1.SizeToContent(); }
protected void Page_Load(object sender, System.EventArgs e) { NDrawingView1.StateManager = new NDiagramBatonSessionStateManager(Context, "Nevron.Examples.Diagram.Webform.NPrintingUC"); if (NDrawingView1.RequiresInitialization) { // begin view init NDrawingView1.ViewLayout = CanvasLayout.Normal; NDrawingView1.DocumentPadding = new Nevron.Diagram.NMargins(10); // init document NDrawingView1.Document.BeginInit(); InitDocument(); NDrawingView1.Document.EndInit(); NDrawingView1.SizeToContent(); } }
protected NEllipseShape HitTestEllipse(NCallbackMouseEventArgs args) { NNodeList nodes = NDrawingView1.HitTest(args); NNodeList shapes = nodes.Filter(Nevron.Diagram.Filters.NFilters.Shape2D); foreach (NShape node in shapes) { if (!(node is NEllipseShape)) { continue; } if (!node.Name.Contains("Ellipse")) { continue; } return(node as NEllipseShape); } return(null); }
protected void Page_Load(object sender, System.EventArgs e) { NDrawingView1.Document.BackgroundStyle.FrameStyle.Visible = false; NDrawingView1.ViewLayout = CanvasLayout.Normal; NDrawingView1.DocumentPadding = new Nevron.Diagram.NMargins(10); // start document initialization Document = NDrawingView1.Document; Document.BeginInit(); Document.Bounds = new NRectangleF(0, 0, 344, 540); Document.MeasurementUnit = NGraphicsUnit.Pixel; Document.DrawingScaleMode = DrawingScaleMode.NoScale; DocumentHelper = new NDrawingDocumentHelper(Document); DocumentHelper.DefaultGridCellSize = new NSizeF(120, 80); DocumentHelper.DefaultGridSpacing = new NSizeF(10, 10); Document.Style.TextStyle.FontStyle = new NFontStyle(new Font("Arial", 8)); Document.Style.ShadowStyle.Type = ShadowType.GaussianBlur; Document.Style.ShadowStyle.Offset = new Nevron.GraphicsCore.NPointL(5, 5); CreateRect(); CreateEllipse(); CreatePolygon(); CreateClosedCurve(); CreateSingleArrow(); CreateDoubleArrow(); // end document initialization Document.EndInit(); // change the response type to SVG NImageResponse response = new NImageResponse(); response.ImageFormat = new NSvgImageFormat(); NDrawingView1.ServerSettings.BrowserResponseSettings.DefaultResponse = response; NDrawingView1.SizeToContent(); }
protected void Page_Load(object sender, System.EventArgs e) { NHtmlImageMapResponse imageMapResponse = new NHtmlImageMapResponse(); NDrawingView1.ServerSettings.BrowserResponseSettings.DefaultResponse = imageMapResponse; // init document NDrawingView1.Document.BeginInit(); NDrawingView1.ViewLayout = CanvasLayout.Normal; // IMPORTANT: the floor plan shapes are defined with they real size in millimeters // that is why we must use drawing scale to display the content of this library NDrawingView1.Document.DrawingScaleMode = DrawingScaleMode.CustomScale; NDrawingView1.Document.MeasurementUnit = NGraphicsUnit.Millimeter; NDrawingView1.Document.CustomWorldMeasurementUnit = NGraphicsUnit.Millimeter; NDrawingView1.Document.CustomScale = 0.01f; InitDocument(NDrawingView1.Document, new NFloorPlanShapesFactory()); NDrawingView1.SizeToContent(); NDrawingView1.Document.EndInit(); }
protected void NDrawingView1_AsyncClick(object sender, EventArgs e) { NCallbackMouseEventArgs args = e as NCallbackMouseEventArgs; NNodeList nodes = NDrawingView1.HitTest(args); NNodeList shapes = nodes.Filter(CELL_FILTER); if (shapes.Count == 0) { return; } NTableCell cell = (NTableCell)shapes[0]; if (cell.ParentNode.ParentNode != table) { return; } if (cell.StyleSheetName != null && cell.StyleSheetName != string.Empty) { if (CellClicked(cell)) { UpdateInfo(); // Check for end of the game string status = string.Empty; if (AllClear()) { score *= 2; status = "You've cleared all cells !!!" + Environment.NewLine; } if (status == string.Empty && GameOver()) { status = "Game Over !" + Environment.NewLine; } if (status != string.Empty) { status += "Your score is " + score.ToString(); NTableShape gameOver = new NTableShape(); document.ActiveLayer.AddChild(gameOver); gameOver.BeginUpdate(); gameOver.CellPadding = new Nevron.Diagram.NMargins(2, 2, 8, 8); gameOver[0, 0].Text = status; NStyle.SetFillStyle(gameOver, new NAdvancedGradientFillStyle(AdvancedGradientScheme.Ocean1, 0)); NStyle.SetStrokeStyle(gameOver, new NStrokeStyle(Color.DarkBlue)); NTextStyle textStyle = (NTextStyle)table.ComposeTextStyle().Clone(); textStyle.FillStyle = new NColorFillStyle(Color.DarkBlue); NStyle.SetTextStyle(gameOver, textStyle); gameOver.EndUpdate(); gameOver.Center = table.Center; } } } }