public Polygon(Visualizer.GeoType geoType, StreamReader file, Pen pen) : base(geoType, file, pen) { int color = int.Parse(file.ReadLine()); if (geoType != Visualizer.GeoType.Region) color /= 100; switch (GeoType) { case Visualizer.GeoType.Landmass: MainBrush = new SolidBrush(MAP_COLORS[color]); HighlightedBrush = Brushes.ForestGreen; break; case Visualizer.GeoType.Country: case Visualizer.GeoType.Region: MainBrush = new SolidBrush(MAP_COLORS[color]); HighlightedBrush = Brushes.Purple; break; case Visualizer.GeoType.PhysicalRegion: MainBrush = new SolidBrush(Color.FromArgb(64, MAP_COLORS[color])); HighlightedBrush = new SolidBrush(Color.FromArgb(192, MAP_COLORS[color])); break; case Visualizer.GeoType.MarineArea: MainBrush = new SolidBrush(Color.FromArgb(222, 229, 237)); HighlightedBrush = Brushes.LightBlue; break; case Visualizer.GeoType.Lake: MainBrush = Brushes.PowderBlue; HighlightedBrush = Brushes.LightSkyBlue; break; } }
public GeoPoint(Visualizer.GeoType geoType, StreamReader file) { GeoType = geoType; string[] coords = file.ReadLine().Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries); point = new PointF(float.Parse(coords[0]), float.Parse(coords[1])); Box = new RectangleF(point.X, point.Y, 0.01f, 0.01f); size = (11 - float.Parse(file.ReadLine())) / 100; }
private void formMain_Load(object sender, EventArgs e) { //setup window StreamReader file = new StreamReader(Application.StartupPath + "\\config.txt"); this.Left = int.Parse(file.ReadLine()); this.Top = int.Parse(file.ReadLine()); this.Width = int.Parse(file.ReadLine()); this.Height = int.Parse(file.ReadLine()); file.Close(); picMini.Left = this.Width; logo = Bitmap.FromFile(LOGO_PATH); this.BackgroundImage = logo; this.MouseWheel += new System.Windows.Forms.MouseEventHandler(this.formMain_MouseWheel); //init variables mode = DisplayMode.Image; timelinePenWidth = 1; timelineLB = 0; setTimelineScale(); labelMonthFont = new Font(FontFamily.GenericSansSerif, 7); questionEvent = ""; mapMouseOverRegion = ""; timerDoubleClick.Interval = SystemInformation.DoubleClickTime; timerAudioDoubleClick.Interval = SystemInformation.DoubleClickTime; //init worker pipeWorker = new BackgroundWorker(); pipeWorker.DoWork += new DoWorkEventHandler(pipeWorker_DoWork); pipeWorker.RunWorkerCompleted += new RunWorkerCompletedEventHandler(pipeWorker_RunWorkerCompleted); pipeWorker.RunWorkerAsync(); //load data loadTimelineData(); initAudio(); viz = new Visualizer(this.ClientSize, GEO_DIR, ForceDraw); //processMsg("ftree Passeriformes ?"); }
public PolyLine(Visualizer.GeoType geoType, StreamReader file, Pen pen) { GeoType = geoType; this.pen = pen; Box = new RectangleF(float.Parse(file.ReadLine()), float.Parse(file.ReadLine()), float.Parse(file.ReadLine()), float.Parse(file.ReadLine())); int numParts = int.Parse(file.ReadLine()); parts = new PointF[numParts][]; for (int i = 0; i < numParts; i++) { parts[i] = new PointF[int.Parse(file.ReadLine())]; for (int j = 0; j < parts[i].Length; j++) { string[] coords = file.ReadLine().Split(new string[] { ", " }, StringSplitOptions.RemoveEmptyEntries); parts[i][j] = new PointF(float.Parse(coords[0]), float.Parse(coords[1])); } } if (geoType == Visualizer.GeoType.River) { int scaleRank = int.Parse(file.ReadLine()); this.pen = new Pen(Color.PowderBlue, 0.028f - (float)scaleRank / 400); } }