/// <summary> /// Add a colorbar to display a colormap beside the data area /// </summary> public Colorbar AddColorbar(Drawing.Colormap colormap = null, int space = 100) { var cb = new Colorbar(colormap); Add(cb); YAxis2.SetSizeLimit(min: space); return(cb); }
/// <summary> /// Called when user chooses to display legendControl /// </summary> protected virtual void OnLegendClick(object sender, EventArgs e) { if (legendControl == null) { legendControl = new Colorbar(null); } legendControl.LoadImage(m_legendImagePath); }
/// <summary> /// Add a colorbar initialized with settings from a heatmap /// </summary> /// <param name="heatmap">A heatmap-containing plottable to connect with this colorbar</param> /// <param name="space">The size of the right axis will be set to this number of pixels to make room for the colorbar</param> /// <returns>the colorbar that was just created</returns> public Colorbar AddColorbar(IHasColormap heatmap, int space = 100) { var cb = new Colorbar(heatmap); Add(cb); YAxis2.SetSizeLimit(min: space); return(cb); }
/// <summary> /// Add a colorbar initialized with settings from a heatmap /// </summary> public Colorbar AddColorbar(Heatmap heatmap, int space = 100) { var cb = new Colorbar(heatmap.Colormap); cb.AddTick(0, heatmap.ColorbarMin); cb.AddTick(1, heatmap.ColorbarMax); Add(cb); YAxis2.SetSizeLimit(min: space); return(cb); }
/// <summary> /// Add a colorbar to display a colormap beside the data area /// </summary> /// <param name="colormap">Colormap to display in this colorbar</param> /// <param name="space">The size of the right axis will be set to this number of pixels to make room for the colorbar</param> /// <param name="rightSide">If false the colorbar will be displayed on the left edge of the plot.</param> /// <returns>the colorbar that was just created</returns> public Colorbar AddColorbar(Drawing.Colormap colormap = null, int space = 100, bool rightSide = true) { var cb = new Colorbar(colormap); if (rightSide) { cb.Edge = Renderable.Edge.Right; YAxis2.SetSizeLimit(min: space); } else { cb.Edge = Renderable.Edge.Left; YAxis.SetSizeLimit(min: space); } Add(cb); return(cb); }
/// <summary> /// Cleanup when layer is disabled /// </summary> public override void Dispose() { this.Inited = false; if (downloadThread != null) { if (downloadThread.IsAlive) { downloadThread.Abort(); } downloadThread = null; } if (m_SurfaceImage != null) { m_ParentWorld.WorldSurfaceRenderer.RemoveSurfaceImage(m_SurfaceImage.ImageFilePath); m_SurfaceImage = null; } if (this.texture != null) { this.texture.Dispose(); this.texture = null; } if (legendControl != null) { legendControl.Dispose(); legendControl = null; } if (refreshTimer != null && refreshTimer.Enabled) { refreshTimer.Stop(); refreshTimer = null; } }
/// <summary> /// Cleanup when layer is disabled /// </summary> public override void Dispose() { this.isInitialized = false; if(this.downloadThread != null) { if(this.downloadThread.IsAlive) { this.downloadThread.Abort(); } this.downloadThread = null; } if(this.m_SurfaceImage != null) { this.m_ParentWorld.WorldSurfaceRenderer.RemoveSurfaceImage(this.m_SurfaceImage.ImageFilePath); this.m_SurfaceImage = null; } if (this.texture!=null) { this.texture.Dispose(); this.texture = null; } if(this.legendControl != null) { this.legendControl.Dispose(); this.legendControl = null; } if(this.refreshTimer != null && this.refreshTimer.Enabled) { this.refreshTimer.Stop(); this.refreshTimer = null; } }