first commit

This commit is contained in:
Boris
2024-01-15 20:14:10 +00:00
commit 8c81ee28b7
3106 changed files with 474415 additions and 0 deletions

View File

@@ -0,0 +1,748 @@
<!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.8.0_31) on Mon Oct 05 10:02:33 BST 2015 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Canvas
</TITLE>
<META NAME="date" CONTENT="2015-10-05">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Canvas";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
Class Canvas</H2>
<PRE>
java.lang.Object
<IMG SRC="./resources/inherit.gif" ALT="extended by "><B>Canvas</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>Canvas</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
Class Canvas - a class to allow for simple graphical
drawing on a canvas.
<P>
<P>
<DL>
<DT><B>Version:</B></DT>
<DD>2016.02.29</DD>
<DT><B>Author:</B></DT>
<DD>Michael Kölling (mik), Bruce Quig</DD>
</DL>
<HR>
<P>
<!-- ======== 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="Canvas.html#Canvas(java.lang.String)">Canvas</A></B>(java.lang.String&nbsp;title)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a Canvas with default height, width and background color
(300, 300, white).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="Canvas.html#Canvas(java.lang.String, int, int)">Canvas</A></B>(java.lang.String&nbsp;title,
int&nbsp;width,
int&nbsp;height)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a Canvas with default background color (white).</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="Canvas.html#Canvas(java.lang.String, int, int, java.awt.Color)">Canvas</A></B>(java.lang.String&nbsp;title,
int&nbsp;width,
int&nbsp;height,
java.awt.Color&nbsp;bgColor)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create a Canvas.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== 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>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#draw(java.awt.Shape)">draw</A></B>(java.awt.Shape&nbsp;shape)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Draw the outline of a given shape onto the canvas.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#drawImage(java.awt.Image, int, int)">drawImage</A></B>(java.awt.Image&nbsp;image,
int&nbsp;x,
int&nbsp;y)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Draws an image onto the canvas.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#drawLine(int, int, int, int)">drawLine</A></B>(int&nbsp;x1,
int&nbsp;y1,
int&nbsp;x2,
int&nbsp;y2)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Draws a line on the Canvas.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#drawString(java.lang.String, int, int)">drawString</A></B>(java.lang.String&nbsp;text,
int&nbsp;x,
int&nbsp;y)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Draws a String on the Canvas.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#erase()">erase</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Erase the whole canvas.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#erase(java.awt.Shape)">erase</A></B>(java.awt.Shape&nbsp;shape)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Erase a given shape's interior on the screen.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#eraseCircle(int, int, int)">eraseCircle</A></B>(int&nbsp;xPos,
int&nbsp;yPos,
int&nbsp;diameter)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Erase the internal dimensions of the given circle.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#eraseOutline(java.awt.Shape)">eraseOutline</A></B>(java.awt.Shape&nbsp;shape)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Erases a given shape's outline on the screen.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#eraseRectangle(int, int, int, int)">eraseRectangle</A></B>(int&nbsp;xPos,
int&nbsp;yPos,
int&nbsp;width,
int&nbsp;height)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Erase the internal dimensions of the given rectangle.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#eraseString(java.lang.String, int, int)">eraseString</A></B>(java.lang.String&nbsp;text,
int&nbsp;x,
int&nbsp;y)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Erases a String on the Canvas.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#fill(java.awt.Shape)">fill</A></B>(java.awt.Shape&nbsp;shape)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fill the internal dimensions of a given shape with the current
foreground color of the canvas.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#fillCircle(int, int, int)">fillCircle</A></B>(int&nbsp;xPos,
int&nbsp;yPos,
int&nbsp;diameter)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fill the internal dimensions of the given circle with the current
foreground color of the canvas.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#fillRectangle(int, int, int, int)">fillRectangle</A></B>(int&nbsp;xPos,
int&nbsp;yPos,
int&nbsp;width,
int&nbsp;height)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fill the internal dimensions of the given rectangle with the current
foreground color of the canvas.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.awt.Color</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#getBackgroundColor()">getBackgroundColor</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the current color of the background</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.awt.Font</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#getFont()">getFont</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the current font of the canvas.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.awt.Color</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#getForegroundColor()">getForegroundColor</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the current color of the foreground.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;java.awt.Dimension</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#getSize()">getSize</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns the size of the canvas.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#isVisible()">isVisible</A></B>()</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Provide information on visibility of the Canvas.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#setBackgroundColor(java.awt.Color)">setBackgroundColor</A></B>(java.awt.Color&nbsp;newColor)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the background color of the Canvas.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#setFont(java.awt.Font)">setFont</A></B>(java.awt.Font&nbsp;newFont)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;changes the current Font used on the Canvas</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#setForegroundColor(java.awt.Color)">setForegroundColor</A></B>(java.awt.Color&nbsp;newColor)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the foreground color of the Canvas.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#setSize(int, int)">setSize</A></B>(int&nbsp;width,
int&nbsp;height)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sets the size of the canvas.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#setVisible(boolean)">setVisible</A></B>(boolean&nbsp;visible)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the canvas visibility and brings canvas to the front of screen
when made visible.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="Canvas.html#wait(int)">wait</A></B>(int&nbsp;milliseconds)</CODE>
<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Waits for a specified number of milliseconds before finishing.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.Object</B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="Canvas(java.lang.String)"><!-- --></A><H3>
Canvas</H3>
<PRE>
public <B>Canvas</B>(java.lang.String&nbsp;title)</PRE>
<DL>
<DD>Create a Canvas with default height, width and background color
(300, 300, white).
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>title</CODE> - title to appear in Canvas Frame</DL>
</DL>
<HR>
<A NAME="Canvas(java.lang.String, int, int)"><!-- --></A><H3>
Canvas</H3>
<PRE>
public <B>Canvas</B>(java.lang.String&nbsp;title,
int&nbsp;width,
int&nbsp;height)</PRE>
<DL>
<DD>Create a Canvas with default background color (white).
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>title</CODE> - title to appear in Canvas Frame<DD><CODE>width</CODE> - the desired width for the canvas<DD><CODE>height</CODE> - the desired height for the canvas</DL>
</DL>
<HR>
<A NAME="Canvas(java.lang.String, int, int, java.awt.Color)"><!-- --></A><H3>
Canvas</H3>
<PRE>
public <B>Canvas</B>(java.lang.String&nbsp;title,
int&nbsp;width,
int&nbsp;height,
java.awt.Color&nbsp;bgColor)</PRE>
<DL>
<DD>Create a Canvas.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>title</CODE> - title to appear in Canvas Frame<DD><CODE>width</CODE> - the desired width for the canvas<DD><CODE>height</CODE> - the desired height for the canvas<DD><CODE>bgClour</CODE> - the desired background color of the canvas</DL>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="draw(java.awt.Shape)"><!-- --></A><H3>
draw</H3>
<PRE>
public void <B>draw</B>(java.awt.Shape&nbsp;shape)</PRE>
<DL>
<DD>Draw the outline of a given shape onto the canvas.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>shape</CODE> - the shape object to be drawn on the canvas</DL>
</DD>
</DL>
<HR>
<A NAME="drawImage(java.awt.Image, int, int)"><!-- --></A><H3>
drawImage</H3>
<PRE>
public boolean <B>drawImage</B>(java.awt.Image&nbsp;image,
int&nbsp;x,
int&nbsp;y)</PRE>
<DL>
<DD>Draws an image onto the canvas.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>image</CODE> - the Image object to be displayed<DD><CODE>x</CODE> - x co-ordinate for Image placement<DD><CODE>y</CODE> - y co-ordinate for Image placement
<DT><B>Returns:</B><DD>returns boolean value representing whether the image was
completely loaded</DL>
</DD>
</DL>
<HR>
<A NAME="drawLine(int, int, int, int)"><!-- --></A><H3>
drawLine</H3>
<PRE>
public void <B>drawLine</B>(int&nbsp;x1,
int&nbsp;y1,
int&nbsp;x2,
int&nbsp;y2)</PRE>
<DL>
<DD>Draws a line on the Canvas.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>x1</CODE> - x co-ordinate of start of line<DD><CODE>y1</CODE> - y co-ordinate of start of line<DD><CODE>x2</CODE> - x co-ordinate of end of line<DD><CODE>y2</CODE> - y co-ordinate of end of line</DL>
</DD>
</DL>
<HR>
<A NAME="drawString(java.lang.String, int, int)"><!-- --></A><H3>
drawString</H3>
<PRE>
public void <B>drawString</B>(java.lang.String&nbsp;text,
int&nbsp;x,
int&nbsp;y)</PRE>
<DL>
<DD>Draws a String on the Canvas.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>text</CODE> - the String to be displayed<DD><CODE>x</CODE> - x co-ordinate for text placement<DD><CODE>y</CODE> - y co-ordinate for text placement</DL>
</DD>
</DL>
<HR>
<A NAME="erase()"><!-- --></A><H3>
erase</H3>
<PRE>
public void <B>erase</B>()</PRE>
<DL>
<DD>Erase the whole canvas.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="erase(java.awt.Shape)"><!-- --></A><H3>
erase</H3>
<PRE>
public void <B>erase</B>(java.awt.Shape&nbsp;shape)</PRE>
<DL>
<DD>Erase a given shape's interior on the screen.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>shape</CODE> - the shape object to be erased</DL>
</DD>
</DL>
<HR>
<A NAME="eraseCircle(int, int, int)"><!-- --></A><H3>
eraseCircle</H3>
<PRE>
public void <B>eraseCircle</B>(int&nbsp;xPos,
int&nbsp;yPos,
int&nbsp;diameter)</PRE>
<DL>
<DD>Erase the internal dimensions of the given circle. This is a
convenience method. A similar effect can be achieved with
the "erase" method.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="eraseOutline(java.awt.Shape)"><!-- --></A><H3>
eraseOutline</H3>
<PRE>
public void <B>eraseOutline</B>(java.awt.Shape&nbsp;shape)</PRE>
<DL>
<DD>Erases a given shape's outline on the screen.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>shape</CODE> - the shape object to be erased</DL>
</DD>
</DL>
<HR>
<A NAME="eraseRectangle(int, int, int, int)"><!-- --></A><H3>
eraseRectangle</H3>
<PRE>
public void <B>eraseRectangle</B>(int&nbsp;xPos,
int&nbsp;yPos,
int&nbsp;width,
int&nbsp;height)</PRE>
<DL>
<DD>Erase the internal dimensions of the given rectangle. This is a
convenience method. A similar effect can be achieved with
the "erase" method.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="eraseString(java.lang.String, int, int)"><!-- --></A><H3>
eraseString</H3>
<PRE>
public void <B>eraseString</B>(java.lang.String&nbsp;text,
int&nbsp;x,
int&nbsp;y)</PRE>
<DL>
<DD>Erases a String on the Canvas.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>text</CODE> - the String to be displayed<DD><CODE>x</CODE> - x co-ordinate for text placement<DD><CODE>y</CODE> - y co-ordinate for text placement</DL>
</DD>
</DL>
<HR>
<A NAME="fill(java.awt.Shape)"><!-- --></A><H3>
fill</H3>
<PRE>
public void <B>fill</B>(java.awt.Shape&nbsp;shape)</PRE>
<DL>
<DD>Fill the internal dimensions of a given shape with the current
foreground color of the canvas.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>shape</CODE> - the shape object to be filled</DL>
</DD>
</DL>
<HR>
<A NAME="fillCircle(int, int, int)"><!-- --></A><H3>
fillCircle</H3>
<PRE>
public void <B>fillCircle</B>(int&nbsp;xPos,
int&nbsp;yPos,
int&nbsp;diameter)</PRE>
<DL>
<DD>Fill the internal dimensions of the given circle with the current
foreground color of the canvas.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>xPos</CODE> - The x-coordinate of the circle center point<DD><CODE>yPos</CODE> - The y-coordinate of the circle center point<DD><CODE>diameter</CODE> - The diameter of the circle to be drawn</DL>
</DD>
</DL>
<HR>
<A NAME="fillRectangle(int, int, int, int)"><!-- --></A><H3>
fillRectangle</H3>
<PRE>
public void <B>fillRectangle</B>(int&nbsp;xPos,
int&nbsp;yPos,
int&nbsp;width,
int&nbsp;height)</PRE>
<DL>
<DD>Fill the internal dimensions of the given rectangle with the current
foreground color of the canvas. This is a convenience method. A similar
effect can be achieved with the "fill" method.
<P>
<DD><DL>
</DL>
</DD>
</DL>
<HR>
<A NAME="getBackgroundColor()"><!-- --></A><H3>
getBackgroundColor</H3>
<PRE>
public java.awt.Color <B>getBackgroundColor</B>()</PRE>
<DL>
<DD>Returns the current color of the background
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the color of the background of the Canvas</DL>
</DD>
</DL>
<HR>
<A NAME="getFont()"><!-- --></A><H3>
getFont</H3>
<PRE>
public java.awt.Font <B>getFont</B>()</PRE>
<DL>
<DD>Returns the current font of the canvas.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the font currently in use</DL>
</DD>
</DL>
<HR>
<A NAME="getForegroundColor()"><!-- --></A><H3>
getForegroundColor</H3>
<PRE>
public java.awt.Color <B>getForegroundColor</B>()</PRE>
<DL>
<DD>Returns the current color of the foreground.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>the color of the foreground of the Canvas</DL>
</DD>
</DL>
<HR>
<A NAME="getSize()"><!-- --></A><H3>
getSize</H3>
<PRE>
public java.awt.Dimension <B>getSize</B>()</PRE>
<DL>
<DD>Returns the size of the canvas.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>The current dimension of the canvas</DL>
</DD>
</DL>
<HR>
<A NAME="isVisible()"><!-- --></A><H3>
isVisible</H3>
<PRE>
public boolean <B>isVisible</B>()</PRE>
<DL>
<DD>Provide information on visibility of the Canvas.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>true if canvas is visible, false otherwise</DL>
</DD>
</DL>
<HR>
<A NAME="setBackgroundColor(java.awt.Color)"><!-- --></A><H3>
setBackgroundColor</H3>
<PRE>
public void <B>setBackgroundColor</B>(java.awt.Color&nbsp;newColor)</PRE>
<DL>
<DD>Sets the background color of the Canvas.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>newColor</CODE> - the new color for the background of the Canvas</DL>
</DD>
</DL>
<HR>
<A NAME="setFont(java.awt.Font)"><!-- --></A><H3>
setFont</H3>
<PRE>
public void <B>setFont</B>(java.awt.Font&nbsp;newFont)</PRE>
<DL>
<DD>changes the current Font used on the Canvas
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>newFont</CODE> - new font to be used for String output</DL>
</DD>
</DL>
<HR>
<A NAME="setForegroundColor(java.awt.Color)"><!-- --></A><H3>
setForegroundColor</H3>
<PRE>
public void <B>setForegroundColor</B>(java.awt.Color&nbsp;newColor)</PRE>
<DL>
<DD>Sets the foreground color of the Canvas.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>newColor</CODE> - the new color for the foreground of the Canvas</DL>
</DD>
</DL>
<HR>
<A NAME="setSize(int, int)"><!-- --></A><H3>
setSize</H3>
<PRE>
public void <B>setSize</B>(int&nbsp;width,
int&nbsp;height)</PRE>
<DL>
<DD>Sets the size of the canvas.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>width</CODE> - new width<DD><CODE>height</CODE> - new height</DL>
</DD>
</DL>
<HR>
<A NAME="setVisible(boolean)"><!-- --></A><H3>
setVisible</H3>
<PRE>
public void <B>setVisible</B>(boolean&nbsp;visible)</PRE>
<DL>
<DD>Set the canvas visibility and brings canvas to the front of screen
when made visible. This method can also be used to bring an already
visible canvas to the front of other windows.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>visible</CODE> - boolean value representing the desired visibility of
the canvas (true or false)</DL>
</DD>
</DL>
<HR>
<A NAME="wait(int)"><!-- --></A><H3>
wait</H3>
<PRE>
public void <B>wait</B>(int&nbsp;milliseconds)</PRE>
<DL>
<DD>Waits for a specified number of milliseconds before finishing.
This provides an easy way to specify a small delay which can be
used when producing animations.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>milliseconds</CODE> - the number</DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>
<HR>
</BODY>
</HTML>

View File

@@ -0,0 +1,32 @@
<!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.8.0_31) on Mon Oct 05 10:02:33 BST 2015 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
All Classes
</TITLE>
<META NAME="date" CONTENT="2015-10-05">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<FONT size="+1" CLASS="FrameHeadingFont">
<B>All Classes</B></FONT>
<BR>
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="Canvas.html" title="class in &lt;Unnamed&gt;" target="classFrame">Canvas</A>
<BR>
</FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML>

View File

@@ -0,0 +1,32 @@
<!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.8.0_31) on Mon Oct 05 10:02:33 BST 2015 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
All Classes
</TITLE>
<META NAME="date" CONTENT="2015-10-05">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<FONT size="+1" CLASS="FrameHeadingFont">
<B>All Classes</B></FONT>
<BR>
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TD NOWRAP><FONT CLASS="FrameItemFont"><A HREF="Canvas.html" title="class in &lt;Unnamed&gt;">Canvas</A>
<BR>
</FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML>

View File

@@ -0,0 +1,45 @@
<!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.8.0_31) on Mon Oct 05 10:02:33 BST 2015 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Constant Field Values
</TITLE>
<META NAME="date" CONTENT="2015-10-05">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Constant Field Values";
}
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<HR>
<HR>
<CENTER>
<H1>
Constant Field Values</H1>
</CENTER>
<HR SIZE="4" NOSHADE>
<B>Contents</B><UL>
</UL>
<HR>
<HR>
</BODY>
</HTML>

View File

@@ -0,0 +1,37 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Mon Oct 05 10:02:33 BST 2015-->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Generated Documentation (Untitled)
</TITLE>
<SCRIPT type="text/javascript">
targetPage = "" + window.location.search;
if (targetPage != "" && targetPage != "undefined")
targetPage = targetPage.substring(1);
if (targetPage.indexOf(":") != -1)
targetPage = "undefined";
function loadFrames() {
if (targetPage != "" && targetPage != "undefined")
top.classFrame.location = top.targetPage;
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<FRAMESET cols="20%,80%" title="" onLoad="top.loadFrames()">
<FRAME src="allclasses-frame.html" name="packageFrame" title="All classes and interfaces (except non-static nested types)">
<FRAME src="Canvas.html" name="classFrame" title="Package, class and interface descriptions" scrolling="yes">
<NOFRAMES>
<H2>
Frame Alert</H2>
<P>
This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client.
<BR>
Link to<A HREF="Canvas.html">Non-frame version.</A>
</NOFRAMES>
</FRAMESET>
</HTML>

View File

@@ -0,0 +1,43 @@
Class documentation
<---- javadoc command: ---->
/Applications/BlueJ/BlueJ 3.1.5/BlueJ.app/Contents/Frameworks/jdk.framework/Versions/A/Contents/Home/bin/javadoc
-author
-version
-nodeprecated
-package
-noindex
-notree
-nohelp
-nonavbar
-source
1.8
-classpath
/Applications/BlueJ/BlueJ 3.1.5/BlueJ.app/Contents/Resources/Java/bluejcore.jar:/Applications/BlueJ/BlueJ 3.1.5/BlueJ.app/Contents/Resources/Java/junit-4.8.2.jar:/Applications/BlueJ/BlueJ 3.1.5/BlueJ.app/Contents/Resources/Java/userlib/pi4j-core.jar:/Applications/BlueJ/BlueJ 3.1.5/BlueJ.app/Contents/Resources/Java/userlib/pi4j-device.jar:/Applications/BlueJ/BlueJ 3.1.5/BlueJ.app/Contents/Resources/Java/userlib/pi4j-gpio-extension.jar:/Applications/BlueJ/BlueJ 3.1.5/BlueJ.app/Contents/Resources/Java/userlib/pi4j-service.jar:/Users/mik/Documents/Dropbox/ofwj/projects/chapter06/scribble
-d
/Users/mik/Documents/Dropbox/ofwj/projects/chapter06/scribble/doc
-encoding
UTF-8
-charset
UTF-8
-docletpath
/Applications/BlueJ/BlueJ 3.1.5/BlueJ.app/Contents/Resources/Java/bjdoclet.jar
-doclet
bluej.doclet.doclets.formats.html.HtmlDoclet
/Users/mik/Documents/Dropbox/ofwj/projects/chapter06/scribble/Canvas.java
<---- end of javadoc command ---->
Loading source file /Users/mik/Documents/Dropbox/ofwj/projects/chapter06/scribble/Canvas.java...
Constructing Javadoc information...
Standard Doclet version 1.8.0_31
Building tree for all the packages and classes...
Generating /Users/mik/Documents/Dropbox/ofwj/projects/chapter06/scribble/doc/Canvas.html...
/Users/mik/Documents/Dropbox/ofwj/projects/chapter06/scribble/Canvas.java:51: warning - @param argument "bgClour" is not a parameter name.
Generating /Users/mik/Documents/Dropbox/ofwj/projects/chapter06/scribble/doc/package-frame.html...
Generating /Users/mik/Documents/Dropbox/ofwj/projects/chapter06/scribble/doc/package-summary.html...
Generating /Users/mik/Documents/Dropbox/ofwj/projects/chapter06/scribble/doc/constant-values.html...
Building index for all the packages and classes...
Building index for all classes...
Generating /Users/mik/Documents/Dropbox/ofwj/projects/chapter06/scribble/doc/allclasses-frame.html...
Generating /Users/mik/Documents/Dropbox/ofwj/projects/chapter06/scribble/doc/allclasses-noframe.html...
Generating /Users/mik/Documents/Dropbox/ofwj/projects/chapter06/scribble/doc/index.html...
Generating /Users/mik/Documents/Dropbox/ofwj/projects/chapter06/scribble/doc/stylesheet.css...
1 warning

View File

@@ -0,0 +1,33 @@
<!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.8.0_31) on Mon Oct 05 10:02:33 BST 2015 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
&lt;Unnamed&gt;
</TITLE>
<META NAME="date" CONTENT="2015-10-05">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<FONT size="+1" CLASS="FrameTitleFont">
<A HREF="package-summary.html" target="classFrame">&lt;Unnamed&gt;</A></FONT>
<TABLE BORDER="0" WIDTH="100%" SUMMARY="">
<TR>
<TD NOWRAP><FONT size="+1" CLASS="FrameHeadingFont">
Classes</FONT>&nbsp;
<FONT CLASS="FrameItemFont">
<BR>
<A HREF="Canvas.html" title="class in &lt;Unnamed&gt;" target="classFrame">Canvas</A></FONT></TD>
</TR>
</TABLE>
</BODY>
</HTML>

View File

@@ -0,0 +1,47 @@
<!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.8.0_31) on Mon Oct 05 10:02:33 BST 2015 -->
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
</TITLE>
<META NAME="date" CONTENT="2015-10-05">
<LINK REL ="stylesheet" TYPE="text/css" HREF="stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">
<HR>
<HR>
<H2>
Package &lt;Unnamed&gt;
</H2>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD WIDTH="15%"><B><A HREF="Canvas.html" title="class in &lt;Unnamed&gt;">Canvas</A></B></TD>
<TD>Class Canvas - a class to allow for simple graphical
drawing on a canvas.</TD>
</TR>
</TABLE>
&nbsp;
<P>
<DL>
</DL>
<HR>
<HR>
</BODY>
</HTML>

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 B

View File

@@ -0,0 +1,29 @@
/* Javadoc style sheet */
/* Define colors, fonts and other style attributes here to override the defaults */
/* Page background color */
body { background-color: #FFFFFF; color:#000000 }
/* Headings */
h1 { font-size: 145% }
/* Table colors */
.TableHeadingColor { background: #CCCCFF; color:#000000 } /* Dark mauve */
.TableSubHeadingColor { background: #EEEEFF; color:#000000 } /* Light mauve */
.TableRowColor { background: #FFFFFF; color:#000000 } /* White */
/* Font used in left-hand frame lists */
.FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
.FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
.FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }
/* Navigation bar fonts and colors */
.NavBarCell1 { background-color:#EEEEFF; color:#000000} /* Light mauve */
.NavBarCell1Rev { background-color:#00008B; color:#FFFFFF} /* Dark Blue */
.NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;color:#000000;}
.NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;color:#FFFFFF;}
.NavBarCell2 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000}
.NavBarCell3 { font-family: Arial, Helvetica, sans-serif; background-color:#FFFFFF; color:#000000}