graphicsdevice.html

来自「API資料大全」· HTML 代码 · 共 414 行 · 第 1/2 页

HTML
414
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc on Thu Apr 27 23:32:40 PDT 2000 --><TITLE>Java 2 Platform SE v1.3: Class  GraphicsDevice</TITLE><LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style"></HEAD><BODY BGCOLOR="white"><!-- ========== START OF NAVBAR ========== --><A NAME="navbar_top"><!-- --></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0"><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/GraphicsDevice.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Std.&nbsp;Ed. v1.3</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="../../java/awt/GraphicsConfiguration.html"><B>PREV CLASS</B></A>&nbsp;&nbsp;<A HREF="../../java/awt/GraphicsEnvironment.html"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;&nbsp;<A HREF="GraphicsDevice.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><!-- =========== END OF NAVBAR =========== --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">java.awt</FONT><BR>Class  GraphicsDevice</H2><PRE><A HREF="../../java/lang/Object.html">java.lang.Object</A>  |  +--<B>java.awt.GraphicsDevice</B></PRE><HR><DL><DT>public abstract class <B>GraphicsDevice</B><DT>extends <A HREF="../../java/lang/Object.html">Object</A></DL><P>The <code>GraphicsDevice</code> class describes the graphics devices that might be available in a particular graphics environment.  These include screen and printer devices. Note that there can be many screens and many printers in an instance of <A HREF="../../java/awt/GraphicsEnvironment.html"><CODE>GraphicsEnvironment</CODE></A>. Each graphics device has one or more <A HREF="../../java/awt/GraphicsConfiguration.html"><CODE>GraphicsConfiguration</CODE></A> objects associated with it.  These objects specify the different configurations in which the <code>GraphicsDevice</code> can be used. <p>   In a multi-screen environment, the <code>GraphicsConfiguration</code> objects can be used to render components on multiple screens.  The  following code sample demonstrates how to create a <code>JFrame</code> object for each <code>GraphicsConfiguration</code> on each screen device in the <code>GraphicsEnvironment</code>: <pre>   GraphicsEnvironment ge = GraphicsEnvironment.   getLocalGraphicsEnvironment();   GraphicsDevice[] gs = ge.getScreenDevices();   for (int j = 0; j < gs.length; j++) {       GraphicsDevice gd = gs[j];      GraphicsConfiguration[] gc = 	gd.getConfigurations();      for (int i=0; i < gc.length; i++) {         JFrame f = new         JFrame(gs[j].getDefaultConfiguration());         Canvas c = new Canvas(gc[i]);          Rectangle gcBounds = gc[i].getBounds();         int xoffs = gcBounds.x;         int yoffs = gcBounds.y;	   f.getContentPane().add(c);	   f.setLocation((i*50)+xoffs, (i*60)+yoffs);         f.show();      }   } </pre><P><DL><DT><B>See Also: </B><DD><A HREF="../../java/awt/GraphicsEnvironment.html"><CODE>GraphicsEnvironment</CODE></A>, <A HREF="../../java/awt/GraphicsConfiguration.html"><CODE>GraphicsConfiguration</CODE></A></DL><HR><P><!-- ======== INNER CLASS SUMMARY ======== --><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Field Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/GraphicsDevice.html#TYPE_IMAGE_BUFFER">TYPE_IMAGE_BUFFER</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Device is an image buffer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/GraphicsDevice.html#TYPE_PRINTER">TYPE_PRINTER</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Device is a printer.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/GraphicsDevice.html#TYPE_RASTER_SCREEN">TYPE_RASTER_SCREEN</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Device is a raster screen.</TD></TR></TABLE>&nbsp;<!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Constructor Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected </CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/GraphicsDevice.html#GraphicsDevice()">GraphicsDevice</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This is an abstract class that cannot be instantiated directly.</TD></TR></TABLE>&nbsp;<!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=2><FONT SIZE="+2"><B>Method Summary</B></FONT></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../../java/awt/GraphicsConfiguration.html">GraphicsConfiguration</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/GraphicsDevice.html#getBestConfiguration(java.awt.GraphicsConfigTemplate)">getBestConfiguration</A></B>(<A HREF="../../java/awt/GraphicsConfigTemplate.html">GraphicsConfigTemplate</A>&nbsp;gct)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the "best" configuration possible that passes the criteria defined in the <A HREF="../../java/awt/GraphicsConfigTemplate.html"><CODE>GraphicsConfigTemplate</CODE></A>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;<A HREF="../../java/awt/GraphicsConfiguration.html">GraphicsConfiguration</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/GraphicsDevice.html#getConfigurations()">getConfigurations</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns all of the <code>GraphicsConfiguration</code> objects associated with this <code>GraphicsDevice</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;<A HREF="../../java/awt/GraphicsConfiguration.html">GraphicsConfiguration</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/GraphicsDevice.html#getDefaultConfiguration()">getDefaultConfiguration</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the default <code>GraphicsConfiguration</code> associated with this <code>GraphicsDevice</code>.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;<A HREF="../../java/lang/String.html">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../java/awt/GraphicsDevice.html#getIDstring()">getIDstring</A></B>()</CODE><BR>

⌨️ 快捷键说明

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