⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 appendix-b.html

📁 java game programming e-book
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<HTML>
<HEAD>
<META name=vsisbn content="1571690433"><META name=vstitle content="Black Art of Java Game Programming"><META name=vsauthor content="Joel Fan"><META name=vsimprint content="Sams"><META name=vspublisher content="Macmillan Computer Publishing"><META name=vspubdate content="11/01/96"><META name=vscategory content="Web and Software Development: Programming, Scripting, and Markup Languages: Java"><TITLE>Black Art of Java Game Programming:Java API Reference</TITLE>
<!-- HEADER --><STYLE type="text/css">  <!-- A:hover  { 	color : Red; } --></STYLE><META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW"><script><!--function displayWindow(url, width, height) {         var Win = window.open(url,"displayWindow",'width=' + width +',height=' + height + ',resizable=1,scrollbars=yes');	if (Win) {		Win.focus();	}}//--></script><SCRIPT><!--function popUp(url) {        var Win = window.open(url,"displayWindow",'width=400,height=300,resizable=1,scrollbars=yes');	if (Win) {		Win.focus();	}}//--></SCRIPT><script language="JavaScript1.2"><!--function checkForQuery(fm) {  /* get the query value */  var i = escape(fm.query.value);  if (i == "") {      alert('Please enter a search word or phrase');      return false;  }                  /* query is blank, dont run the .jsp file */  else return true;  /* execute the .jsp file */}//--></script></HEAD><BODY> 
<TABLE border=0 cellspacing=0 cellpadding=0>
<tr>
<td width=75 valign=top>
<img src="1571690433.gif" width=60 height=73 alt="Black Art of Java Game Programming" border="1">
</td>
<td align="left">
    <font face="arial, helvetica" size="-1" color="#336633"><b>Black Art of Java Game Programming</b></font>
    <br>
    <font face="arial, helvetica" size="-1"><i>by Joel Fan</i>
    <br>
    Sams,&nbsp;Macmillan Computer Publishing
    <br>
    <b>ISBN:</b>&nbsp;1571690433<b>&nbsp;&nbsp;&nbsp;Pub Date:</b>&nbsp;11/01/96</font>&nbsp;&nbsp;
</td>
</tr>
</table>
<P>

<!--ISBN=1571690433//-->
<!--TITLE=Black Art of Java Game Programming//-->
<!--AUTHOR=Joel Fan//-->
<!--AUTHOR=Eric Ries//-->
<!--AUTHOR=Calin Tenitchi//-->
<!--PUBLISHER=Macmillan Computer Publishing//-->
<!--IMPRINT=Sams//-->
<!--APPENDIX=B//-->
<!--PAGES=833-855//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//-->

<CENTER>
<TABLE BORDER>
<TR>
<TD><A HREF="ewtoc.html">Table of Contents</A></TD>
</TR>
</TABLE>
</CENTER>
<P><BR></P>
<H2><A NAME="Heading1"></A><FONT COLOR="#000077">Appendix B:<BR>Java API Reference
</FONT></H2>
<P><FONT SIZE="+1"><B>Graphical Overview of API Packages</B></FONT></P>
<P>Figures B-1 through B-7 show the class hierarchy diagrams for the following packages of the Java API:
</P>
<DL>
<DD><B>&#149;</B>&nbsp;&nbsp;java.applet (classes for creating applets)
<DD><B>&#149;</B>&nbsp;&nbsp;java.awt (classes of the Abstract Windowing Toolkit)
<DD><B>&#149;</B>&nbsp;&nbsp;java.awt.image (classes for image processing)
<DD><B>&#149;</B>&nbsp;&nbsp;java.io (classes for performing I/O)
<DD><B>&#149;</B>&nbsp;&nbsp;java.lang (fundamental classes of the Java language)
<DD><B>&#149;</B>&nbsp;&nbsp;java.net. (classes for networking)
<DD><B>&#149;</B>&nbsp;&nbsp;java.util. (classes of data structures)
</DL>
<P><A NAME="Fig1"></A><A HREF="javascript:displayWindow('images/apb-01.jpg',510,347 )"><IMG SRC="images/apb-01t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/apb-01.jpg',510,347)"><FONT COLOR="#000077"><B>Figure B-1</B></FONT></A>&nbsp;&nbsp;java.applet</P>
<P><A NAME="Fig2"></A><A HREF="javascript:displayWindow('images/apb-02.jpg',621,647 )"><IMG SRC="images/apb-02t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/apb-02.jpg',621,647)"><FONT COLOR="#000077"><B>Figure B-2</B></FONT></A>&nbsp;&nbsp;java.awt</P>
<P><A NAME="Fig3"></A><A HREF="javascript:displayWindow('images/apb-03.jpg',621,646 )"><IMG SRC="images/apb-03t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/apb-03.jpg',621,646)"><FONT COLOR="#000077"><B>Figure B-3</B></FONT></A>&nbsp;&nbsp;java.awt.image</P>
<P><A NAME="Fig4"></A><A HREF="javascript:displayWindow('images/apb-04.jpg',620,648 )"><IMG SRC="images/apb-04t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/apb-04.jpg',620,648)"><FONT COLOR="#000077"><B>Figure B-4</B></FONT></A>&nbsp;&nbsp;java.io</P>
<P><A NAME="Fig5"></A><A HREF="javascript:displayWindow('images/apb-05.jpg',619,646 )"><IMG SRC="images/apb-05t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/apb-05.jpg',619,646)"><FONT COLOR="#000077"><B>Figure B-5</B></FONT></A>&nbsp;&nbsp;java.lang</P>
<P><A NAME="Fig6"></A><A HREF="javascript:displayWindow('images/apb-06.jpg',619,418 )"><IMG SRC="images/apb-06t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/apb-06.jpg',619,418)"><FONT COLOR="#000077"><B>Figure B-6</B></FONT></A>&nbsp;&nbsp;java.net</P>
<P><A NAME="Fig7"></A><A HREF="javascript:displayWindow('images/apb-07.jpg',618,418 )"><IMG SRC="images/apb-07t.jpg"></A>
<BR><A HREF="javascript:displayWindow('images/apb-07.jpg',618,418)"><FONT COLOR="#000077"><B>Figure B-7</B></FONT></A>&nbsp;&nbsp;java.util</P>
<P><FONT SIZE="+1"><B>Summary of Selected Packages</B></FONT></P>
<P>Here are classes and interfaces selected from the java.applet, java.awt, and java.lang packages. You&#146;ll find these classes to be essential in creating Java game applets and applications. Each class summary follows this format.
</P>
<P><FONT SIZE="+1"><B><I>Classname</I></B></FONT></P>
<P>Brief comments about the class.
</P>
<!-- CODE SNIP //-->
<PRE>
// SELECTED variables and methods in the class
</PRE>
<!-- END CODE SNIP //-->
<P>The following is <I>not</I> intended to be a comprehensive guide to the Java API. Check out Appendix C for further sources of information.</P>
<P><B>The java.applet Package</B></P>
<P>The classes in java.applet allow you to create applets and use sound.
</P>
<P><FONT SIZE="+1"><B><I>java.applet.Applet</I></B></FONT></P>
<P>To create an applet, extend the Applet class, and override the init(), start(), stop(), and destroy() methods. The methods defined in java.awt.Component and java.awt.Container are inherited by the Applet class, and they can be used or overridden.
</P>
<!-- CODE //-->
<PRE>
// public instance methods
public void destroy()
public AppletContext getAppletContext()
public String getAppletInfo()
public AudioClip getAudioClip(URL url)
public AudioClip getAudioClip(URL url,String name)
public URL getCodeBase()
public URL getDocumentBase()
public Image getImage(URL url)
public Image getImage(URL url,String name)
public String getParameter(String name)
public String[][] getParameterInfo()
public void init()
public boolean isActive()
public void play(URL url)
public void play(URL url,String name)
public void resize(int width,int height)
public void resize(Dimension d)
public final void setStub(AppletStub stub)
public void showStatus(String msg)
public void start()
public void stop()
</PRE>
<!-- END CODE //-->
<P><FONT SIZE="+1"><B><I>java.applet.AppletContext (Interface)</I></B></FONT></P>
<P>This interface allows an applet to retrieve information about its environment (e.g., the browser or viewer running it). Use the Applet method getAppletContext() to obtain an AppletContext object.
</P>
<!-- CODE SNIP //-->
<PRE>
public abstract  Applet getApplet(String name)
public abstract  Enumeration getApplets()
public abstract  AudioClip getAudioClip(URL url)
public abstract  Image getImage(URL url)
public abstract  void showDocument(URL url)
public abstract void showDocument(URL url, String target)
public abstract  void showStatus(String message)
</PRE>
<!-- END CODE SNIP //-->
<P><FONT SIZE="+1"><B><I>java.applet.AudioClip Interface</I></B></FONT></P>
<P>This interface provides a high-level abstraction of audio.
</P>
<!-- CODE SNIP //-->
<PRE>
public abstract void loop()
public abstract void play()
public abstract void stop()
</PRE>
<!-- END CODE SNIP //-->
<P><B>The java.awt Package</B></P>
<P>The java.awt package contains the classes of the Abstract Windowing Toolkit.
</P>
<P><FONT SIZE="+1"><B><I>java.awt.Color</I></B></FONT></P>
<P>This class allows you to create and manipulate RGB colors.
</P>
<!-- CODE //-->
<PRE>
// constructors
Color(int red, int green, int blue)
Color(float red, float green, float blue)
Color(int rgb)

// public constants

public final static Color black, blue, cyan, darkGray, gray, green,
lightGray, magenta, orange, pink, red, white, yellow

// public static methods
public static int HSBtoRGB(float hue, float saturation, float brightness)

public static float[] RGBtoHSB(int red, int green, int blue, float[] hsb)
public static Color getColor(String nm)
public static Color getColor(String nm, Color v)
public static Color getColor(String nm, int v)
public static Color getHSBColor(float hue, float saturation, float &lArr;
brightness)

// public instance methods
public Color brighter()
public Color darker()
public boolean equals(Object obj)
public int getBlue()
public int getGreen()
public int getRGB()
public int getRed()
public int hashCode()
public int toString()
</PRE>
<!-- END CODE //-->
<P><FONT SIZE="+1"><B><I>java.awt.Component</I></B></FONT></P>
<P>Component is an ancestor class for many of the GUI components of the AWT, such as Button, Checkbox, and Frame. The following methods are inherited by subclasses of Component.
</P>
<!-- CODE //-->
<PRE>
public boolean action(Event evt, Object what)
public Rectangle bounds()
public int checkImage(Image image, ImageObserver observer)
public int checkImage(Image image, int width, int height, ImageObserver &lArr;
observer)
public Image createImage(ImageProducer producer)
public Image createImage(int width, int height)
public synchronized void disable()
public synchronized void enable()
public Color getBackground()
public Font getFont()
public FontMetrics getFontMetrics(Font font)
public Graphics getGraphics()
public Container getParent()
public Toolkit getToolkit()
public boolean gotFocus(Event evt, Object what)
public boolean handleEvent(Event e)
public synchronized void hide()
public boolean imageUpdate(Image img,int flags,int x,int y,int w,int h)
public boolean isEnabled()
public boolean isShowing()
public boolean isValid()
public boolean isVisible()
public boolean keyDown(Event evt,int key)
public boolean keyUp(Event evt,int key)
public boolean lostFocus(Event evt, Object what)
public boolean mouseDown(Event evt,int x,int y)
public boolean mouseDrag(Event evt,int x,int y)
public boolean mouseEnter(Event evt,int x,int y)
public boolean mouseExit(Event evt,int x,int y)
public boolean mouseMove(Event evt,int x,int y)
public boolean mouseUp(Event evt,int x,int y)
public void paint(Graphics g)
public void repaint()
public void resize(int width,int height)
public setBackground(Color c)
public setFont(Font f)
public setForeground(Color c)
public synchronized void show()
public void update(Graphics g)
public void validate()
</PRE>
<!-- END CODE //-->
<P><FONT SIZE="+1"><B><I>java.awt.Container</I></B></FONT></P>
<P>Subclasses of the abstract class Container, such as Applet, Frame, Dialog, and Panel, inherit the following methods.
</P>
<!-- CODE SNIP //-->
<PRE>
public Component add(Component comp)
public Component add(String name,Component comp)
public Insets insets()
public Component locate(int x,int y)
public void setLayout(LayoutManager m)
public synchronized void remove(Component c)
public synchronized void removeAll()
</PRE>
<!-- END CODE SNIP //-->
<P><FONT SIZE="+1"><B><I>java.awt.Event</I></B></FONT></P>
<P>The Event class encapsulates variables, constants, and methods to interpret GUI events.
</P>
<!-- CODE //-->
<PRE>
// public instance variables
public Object arg
public int clickCount
public Event evt
public int id
public int key
public int modifiers
public Object target
public long when
public int x,y
// public constants for function keys
public final static int  UP, DOWN, LEFT, RIGHT,
F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,
HOME,END,PGUP,PGDN
// public constants for modifier keys
public final static int ALT_MASK, CTRL_MASK, META_MASK, SHIFT_MASK
// public constants for event types
public final static int ACTION_EVENT,
  GOT_FOCUS, LOST_FOCUS,
  KEY_ACTION, KEY_ACTION_RELEASE,
  KEY_PRESS, KEY_RELEASE,
  LIST_SELECT, LIST_DESELECT,
  LOAD_FILE, SAVE_FILE,
  MOUSE_DOWN, MOUSE_UP, MOUSE_DRAG,
  MOUSE_MOVE, MOUSE_ENTER, MOUSE_EXIT,
  SCROLL_ABSOLUTE,
  SCROLL_LINE_UP, SCROLL_LINE_DOWN ,
  SCROLL_PAGE_UP, SCROLL_PAGE_DOWN,
  WINDOW_DESTROY, WINDOW_EXPOSE,
  WINDOW_DEICONIFY, WINDOW_ICONIFY,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -