public void MoveView(DView view, int newX, int newY) { view.X = newX; view.Y = newY; views.Remove(view); views.AddLast(view); }
public void onScreenClick(int x, int y) { if(viewCollection.GetView(x, y)==null) { DView view = null; Random rand=new Random(DateTime.Now.Millisecond); int radius = minRadius + (int)(rand.NextDouble() * (maxRadius - minRadius)); int screenX = Convert.ToInt32(screenWidth * rand.NextDouble()); int screenY = Convert.ToInt32(screenHeight * rand.NextDouble()); if ( rand.Next(10)%2 == 1)//circle { view = new DView(DViewType.Circle, patternCache.DequeueColor(), screenX, screenY, radius); }else //square { view = new DView(DViewType.Square, patternCache.DequeuePattern(), screenX, screenY, radius); } viewCollection.AddView(view); surfaceViewRefresher.Refresh(); } }
public void UpdateView(DView view, DPattern newPattern) { view.Pattern = newPattern; }
public void AddView(DView view) { views.AddLast(view); }