//这张牌应“背面向上” if(c==0){//当还没有发过牌时,玩牌区的纸牌列中,每两张纸牌之间的y坐标值相差5, //指的是背面牌与背面牌之间以及背面牌与第一张正面牌之间的y距离 lastPoint.y+=5; } //这张牌应“正面向上” else{//两张正面牌之间的y距离 lastPoint.y+=20; } map.remove(cards[c+i].getLocation()); cards[c+i].moveto(lastPoint); map.put(newPoint(lastPoint),cards[c+i]); cards[c+i].turnFront(); cards[c+i].setCanMove(true); //将组件card移动到容器中指定的顺序索引。 this.pane.ponentZOrder(cards[c+i],1); Pointpoint=newPoint(lastPoint); if(cards[c+i].getValue()==1){ intn=cards[c+i].whichColumnAvailable(point); point.y-=240; PKCardcard=(PKCard)this.map.get(point); if(card!=null&&card.isCanMove()){ this.haveFinish(n); } } x+=101; } c+=10;?}3纸牌移动放置操作:?//用鼠标拖动纸牌?publicvoidmouseDragged(MouseEventarg0){ if(canMove){ intx=0; inty=0; Pointp=arg0.getPoint(); x=p.x-point.x; y=p.y-point.y; this.moving(x,y); }?}?/*?*方法:放置纸牌