📄 ground.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_01) on Tue Jan 29 17:09:35 CST 2008 -->
<TITLE>
Ground
</TITLE>
<META NAME="keywords" CONTENT="cn.itcast.tetris.entities.Ground class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="Ground";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/Ground.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
PREV CLASS
<A HREF="../../../../cn/itcast/tetris/entities/Shape.html" title="class in cn.itcast.tetris.entities"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../../../index.html?cn/itcast/tetris/entities/Ground.html" target="_top"><B>FRAMES</B></A>
<A HREF="Ground.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
cn.itcast.tetris.entities</FONT>
<BR>
Class Ground</H2>
<PRE>
java.lang.Object
<IMG SRC="../../../../resources/inherit.gif" ALT="extended by "><B>cn.itcast.tetris.entities.Ground</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>Ground</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
可以叫做地形, 或地面<BR> 维护障碍物的信息<BR> 可以使用提供的 addObstacle(int, int) 和 addStubbornObstacle(int ,int) 方法添加障碍物。<BR> <BR> 可以通过setObstacleColor(), setStubbornObstacleColor() 或 setGriddingColor()方法更改障碍物或网格的颜色<BR> 通过setDrawGridding() 方法设置是否画空白(网格)<BR> 用 setColorfulSupport() 方法设置是否支持彩色显示<BR> <BR> 覆盖 drawObstacle(Graphics, int, int, int, int) 方法可以改变障碍物的显示方式<BR> 覆盖 drawStubbornObstacle(Graphics, int, int, int, int) 方法可以改变不可消除的障碍物的显示方式<BR> <BR>
<P>
<P>
<DL>
<DT><B>Version:</B></DT>
<DD>1.0, 01/01/08</DD>
<DT><B>Author:</B></DT>
<DD>汤阳光</DD>
</DL>
<HR>
<P>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.awt.Color</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#DEFAULT_FULL_LINE_COLOR">DEFAULT_FULL_LINE_COLOR</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.awt.Color</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#DEFAULT_GRIDDING_COLOR">DEFAULT_GRIDDING_COLOR</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static java.awt.Color</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#DEFAULT_OBSTACLE_COLOR">DEFAULT_OBSTACLE_COLOR</A></B></CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#Ground()">Ground</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#accept(cn.itcast.tetris.entities.Shape)">accept</A></B>(<A HREF="../../../../cn/itcast/tetris/entities/Shape.html" title="class in cn.itcast.tetris.entities">Shape</A> shape)</CODE>
<BR>
把指定的图形变成石头<BR> 然后将会调用 deleteFullLine() 方法扫描并删除满行</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#addGroundListener(cn.itcast.tetris.listener.GroundListener)">addGroundListener</A></B>(<A HREF="../../../../cn/itcast/tetris/listener/GroundListener.html" title="interface in cn.itcast.tetris.listener">GroundListener</A> l)</CODE>
<BR>
添加监听器, 可添加多个</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#addObstacle(int, int)">addObstacle</A></B>(int x,
int y)</CODE>
<BR>
在指定的位置添加一个障碍物</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#addStubbornObstacle(int, int)">addStubbornObstacle</A></B>(int x,
int y)</CODE>
<BR>
在指定的位置添加一块不可消除的障碍物</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#changeFullLineColor(int)">changeFullLineColor</A></B>(int lineNum)</CODE>
<BR>
改变指定行的颜色,(可以做为消行前的效果)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#clear()">clear</A></B>()</CODE>
<BR>
清空容器</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#deleteFullLine()">deleteFullLine</A></B>()</CODE>
<BR>
扫描并删除满行<BR> 将调用 deleteLine(int) 方法删除满行</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#deleteLine(int)">deleteLine</A></B>(int lineNum)</CODE>
<BR>
删除指定的行(这一行上面所有的石头整体下移一行)</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#drawGridding(java.awt.Graphics, int, int, int, int)">drawGridding</A></B>(java.awt.Graphics g,
int x,
int y,
int width,
int height)</CODE>
<BR>
画一个空白的方法(网格), 可以覆盖这个方法改变空白(网格)的显示</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#drawMe(java.awt.Graphics)">drawMe</A></B>(java.awt.Graphics g)</CODE>
<BR>
显示, 将调用 drawGridding(Graphics, int, int, int, int), drawObstacle(Graphics, int, int, int, int)和 drawStubbornObstacle(Graphics, int, int, int, int) 方法</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#drawObstacle(java.awt.Graphics, int, int, int, int)">drawObstacle</A></B>(java.awt.Graphics g,
int x,
int y,
int width,
int height)</CODE>
<BR>
画一个障碍物的方法, 可以覆盖这个方法改变障碍物的显示</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#drawStubbornObstacle(java.awt.Graphics, int, int, int, int)">drawStubbornObstacle</A></B>(java.awt.Graphics g,
int x,
int y,
int width,
int height)</CODE>
<BR>
画一个不可消除的障碍物的方法, 可以覆盖这个方法改变不可消除的障碍物的显示</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#generateSomeStochasticObstacle(int, int)">generateSomeStochasticObstacle</A></B>(int amount,
int lineNum)</CODE>
<BR>
在指定的范围内随机生成一些障碍物<BR> 产生的区域行是1 - lineNum</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#genernateAStubbornStochasticObstacle()">genernateAStubbornStochasticObstacle</A></B>()</CODE>
<BR>
随机生成一个不可消除的障碍物, 这个随机的坐标的y 坐标不小于5</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.awt.Color</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#getFullLineColor()">getFullLineColor</A></B>()</CODE>
<BR>
得到满行的颜色</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.awt.Color</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#getGriddingColor()">getGriddingColor</A></B>()</CODE>
<BR>
得到网格的颜色</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.awt.Color</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#getObstacleColor()">getObstacleColor</A></B>()</CODE>
<BR>
得到障碍物的颜色</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> java.awt.Color</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#getStubbornObstacleColor()">getStubbornObstacleColor</A></B>()</CODE>
<BR>
得到不可消除的障碍物的颜色</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#init()">init</A></B>()</CODE>
<BR>
初始化,将会调用clear() 方法<BR></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../cn/itcast/tetris/entities/Ground.html#isBlank(int, int)">isBlank</A></B>(int x,
int y)</CODE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -