You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(76) |
Jul
(65) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <ben...@id...> - 2004-05-22 12:48:26
|
Dear Open Source developer I am doing a research project on "Fun and Software Development" in which I kindly invite you to participate. You will find the online survey under http://fasd.ethz.ch/qsf/. The questionnaire consists of 53 questions and you will need about 15 minutes to complete it. With the FASD project (Fun and Software Development) we want to define the motivational significance of fun when software developers decide to engage in Open Source projects. What is special about our research project is that a similar survey is planned with software developers in commercial firms. This procedure allows the immediate comparison between the involved individuals and the conditions of production of these two development models. Thus we hope to obtain substantial new insights to the phenomenon of Open Source Development. With many thanks for your participation, Benno Luthiger PS: The results of the survey will be published under http://www.isu.unizh.ch/fuehrung/blprojects/FASD/. We have set up the mailing list fa...@we... for this study. Please see http://fasd.ethz.ch/qsf/mailinglist_en.html for registration to this mailing list. _______________________________________________________________________ Benno Luthiger Swiss Federal Institute of Technology Zurich 8092 Zurich Mail: benno.luthiger(at)id.ethz.ch _______________________________________________________________________ |
From: <moj...@us...> - 2003-07-14 19:27:13
|
Update of /cvsroot/ordweb/uop/pos407/poulh/week2 In directory sc8-pr-cvs1:/tmp/cvs-serv13583/pos407/poulh/week2 Modified Files: JSmileFace.class Log Message: refresh Index: JSmileFace.class =================================================================== RCS file: /cvsroot/ordweb/uop/pos407/poulh/week2/JSmileFace.class,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvsGutiZd and /tmp/cvsakzjGh differ |
Update of /cvsroot/ordweb/uop/pos407/team/week3 In directory sc8-pr-cvs1:/tmp/cvs-serv13509/pos407/team/week3 Modified Files: Calculation.java Added Files: cwW2.psp teamW3.pjt teamW3.sbl tw3.html tw3.java Log Message: init; Added header commentsto Calculation.java --- NEW FILE: cwW2.psp --- ;Codewright Project Space File (do not remove or modify this line) [State] StateWindowFrame=0,0,768,537,0x43097fca _StateHistory=PROJECTS,'.\w2.pjt','.\teamW3.pjt' _RestoreProject='.\teamW3.pjt' ProjSpaceFlags=0x00000001, 1 ProjViewSetShow=ABCcccccb [Project] ConfigSetUserWorkspace='' ConfigSetUserWorkspaceParser='' ConfigSetUserWorkspaceTimeStamp=0 ConfigSetUserWorkspaceAutoSync=0 [Project.".\teamW3.pjt"] [Project.".\w2.pjt"] --- NEW FILE: teamW3.pjt --- ;Codewright Project File (do not remove or modify this line) [ProjInit] ConfigSetExtMode=2 ProjSetConfigFlags=0x0c110940 [State] SysSetCwd='H:\uop\pos407\team\week3' SrchSetFlags=0x0410680a SrchSetAgainFlags=0x04100003,0 SrchSetAgainFlags=0x06100003,1 SrchSetAttrElements= SrchSetAgainAttrElements= FileSortMode=0x0 _StateView='H:\uop\pos407\team\week3\tw3.java',44,44,690,266,-1,-1,24,5,17,1,1,'',0x00100018,0,80,0,0,'',0,1 _StateView='H:\uop\pos407\team\week3\Calculation.java',66,66,690,266,-1,-1,10,61,10,1,2,'',0x00100008,0,80,0,0,'',0,2 _StateBuffer='H:\uop\pos407\team\week3\tw3.java',0x0400048e,24,5,25,'5 9','',0x0,'',1,72,1,0,'','' _StateBuffer='H:\uop\pos407\team\week3\Calculation.java',0x0c00048e,10,61,25,'5 9','',0x0,'',1,72,0,0,'','' _StateHistory=FILELIST,'H:\uop\pos407\team\week3\tw3.java','H:\uop\pos407\team\week3\Calculation.java','H:\uop\pos407\poulh\week2\JSmileFace.java','H:\uop\pos407\team\week3\tw3.html' _StateHistory=EDITFILE,'H:\uop\pos407\team\week3\tw3.html','H:\uop\pos407\team\week3\tw3.java','C:\j2sdk14\src.zip' _StateHistory=DOSHISTORY,'dir','cd ../../team','dir','cd week2','dir','cd week3','javac tw3.java' _StateHistory=DOCUMENTVISIT,'40 52 H:\uop\pos407\poulh\week2\JSmileFace.java','27 11 H:\uop\pos407\team\week3\tw3.java','40 52 H:\uop\pos407\poulh\week2\JSmileFace.java','25 27 H:\uop\pos407\team\week3\tw3.java','7 1 H:\uop\pos407\poulh\week2\JSmileFace.java','27 23 H:\uop\pos407\team\week3\tw3.java','19 71 H:\uop\pos407\poulh\week2\JSmileFace.java','36 6 H:\uop\pos407\team\week3\tw3.java','6 23 H:\uop\pos407\team\week3\tw3.html','19 71 H:\uop\pos407\poulh\week2\JSmileFace.java' _StateDocumentVisit=10 [Files] .\Calculation.java .\tw3.html .\tw3.java [Editor] _RestoreSysFlags=0x43097fca, 0xfffffffc, 0 FilterProjDeleteList FilterProjAdd='Source Files','*.c;*.cs;*.cpp;*.cxx;*.hxx;*.prg;*.pas;*.asm;*.bas;*.sc;*.jav*',-1 FilterProjAdd='Header Files','*.h;*.hpp;*.inc',-1 FilterProjAdd='Web Files','*.htm;*.html;*.shtm;*.asp;*.css',-1 FilterProjAdd='XML Files','*.xml;*.xsl;*.dtd;*.xhtml;*.xdr;*.dcd',-1 FilterProjAdd='Resources','*.rc;*.bmp;*.ico;*.cur;*.dlg',-1 FilterProjAdd='Other Files','*.*',-1 VCSProject='' VCSProjectPath='' VCSProjectLocalPath='' ScrapSetCount=1 ClipboardSetCount=1 ClipboardEnableSepStr=1 ClipboardSetSepStr='\r\n',0 ClipboardEnableTermStr=1 ClipboardSetTermStr='\r\n',0 [Tools] ToolDeleteList ToolAddCmd='$_custom_tool_$_1','exec Applet',1342177600,'' [Compiler] CompilerNewExt=Release|.asp CompilerNewExt=Release|.java CompilerNewExt=.v CompilerNewExt=.htm CompilerNewExt=Release|.txt CompilerNewExt=.mac CompilerNewExt=Debug|.rul CompilerNewExt=Debug|.rc CompilerNewExt=Release|.nrx CompilerNewExt=.bas CompilerNewExt=Debug|.awk CompilerNewExt=.awk CompilerNewExt=.c CompilerNewExt=Release|.tk CompilerNewExt=Debug|.php CompilerNewExt=Release|.php CompilerNewExt=.jsp CompilerNewExt=.cfml CompilerNewExt=Release|.bat CompilerNewExt=.adb CompilerAssign='Sun Java','Debug|.java' CompilerNewExt=Debug|.jav CompilerNewExt=Release|.awk CompilerNewExt=.vhd CompilerNewExt=.pl CompilerNewExt=.h CompilerNewExt=.pas CompilerNewExt=Release|.xml CompilerNewExt=Release|.bas CompilerNewExt=Release|.cfml CompilerNewExt=Release|.adb CompilerNewExt=Release|.rc CompilerNewExt=Debug|.txt CompilerNewExt=Debug|.bas CompilerNewExt=.tk CompilerNewExt=Release|.tcl CompilerNewExt=Release|.pas CompilerNewExt=.asp CompilerNewExt=Release|.cs CompilerNewExt=Release|.jav CompilerNewExt=Release|.htm CompilerNewExt=Debug|.tk CompilerNewExt=Debug|.tcl CompilerNewExt=.rul CompilerNewExt=Debug|.html CompilerNewExt=Debug|.pas CompilerNewExt=Release|.pl CompilerNewExt=Debug|.cob CompilerNewExt=Release|.ini CompilerNewExt=Release|.v CompilerNewExt=Debug|.nrx CompilerNewExt=Debug|.js CompilerNewExt=.js CompilerNewExt=.cob CompilerNewExt=Debug|.jsp CompilerNewExt=Release|.js CompilerNewExt=.tcl CompilerNewExt=Debug|.sqlj CompilerNewExt=.rc CompilerNewExt=.php CompilerNewExt=Release|.html CompilerNewExt=.ini CompilerNewExt=Debug|.htm CompilerNewExt=Release|.sqlj CompilerNewExt=Debug|.cs CompilerNewExt=.cs CompilerNewExt=Debug|.v CompilerNewExt=Release|.jsp CompilerNewExt=Release|.vhd CompilerNewExt=Debug|.pl CompilerNewExt=Release|.cob CompilerNewExt=.html CompilerNewExt=.bat CompilerNewExt=.* CompilerNewExt=.cpp CompilerNewExt=Debug|.vhd CompilerNewExt=Debug|.bat CompilerNewExt=.cxx CompilerNewExt=Debug|.ini CompilerNewExt=Debug|.asp CompilerNewExt=Debug|.adb CompilerNewExt=.hpp CompilerNewExt=.asm CompilerNewExt=.txt CompilerNewExt=.nrx CompilerNewExt=Debug|.xml CompilerNewExt=.xml CompilerNewExt=.java CompilerNewExt=.jav CompilerNewExt=Debug|.cfml CompilerNewExt=Release|.rul CompilerNewExt=.sqlj TagSetCmd='"${HOME}${WTAGS}" -oc -d -t"${TAGFILE}.tag" -p"${TAGFILE}.ptg"',0x8000060 BrowseSetFile='D:\CodeWright\tagfile.ptg' TagSetFile='D:\CodeWright\tagfile.tag' CompilerAddCmdEx='Debug|$_cw_proj_hash_$','',1073741824,'',0,'javac tw3.java',432,'${FTEE} nmake',0,'${FTEE} javac %b%e',432,'${FTEE} nmake',0,'${FTEE} jdb %y.java',0,'${FTEE} appletviewer %b.html',320,'_ErrorInfoDefault','','','proj.err','%x' CompilerAddResponse='Debug|$_cw_proj_hash_$', CompilerAddCmdEx='Sun Java','${FTEE} javac -O %r%e',1073741936,'javac %r%e',1073742161,'',144,'',144,'',144,'',144,'',0,'',0,'_JAVAErrorInfo','','','','' CompilerAddResponse='Sun Java', CompilerAddCmdEx='Release|$_cw_proj_hash_$','',1073741824,'',0,'javac %y',176,'${FTEE} nmake',0,'${FTEE} nmake',176,'${FTEE} nmake',0,'',0,'',0,'_ErrorInfoDefault','','','proj.err','%x' CompilerAddResponse='Release|$_cw_proj_hash_$', CFGSetActive='Debug' [VersionControl:RCS] VCSSetCmd=VCS_CHECKIN_ID,'ci -f -I "%b%e" <"%Q"',0x8000040 VCSSetCmd=VCS_CHECKINLOCK_ID,'ci -f -I -l "%b%e" <"%Q"',0x8000040 VCSSetCmd=VCS_CHECKOUT_ID,'co -f "%b%e"',0x8000040 VCSSetCmd=VCS_CHECKOUTLOCK_ID,'co -f -l "%b%e"',0x8000040 VCSSetCmd=VCS_CHECKLOCK_ID,'rcs -l "%b%e"',0x8000040 VCSSetCmd=VCS_CHECKUNLOCK_ID,'rcs -u "%b%e"',0x8000040 VCSSetCmd=VCS_CHECKLABEL_ID,'rcs -N"${VCSLABEL}": "%b%e"',0x8000040 VCSSetCmd=VCS_CHECKLOG_ID,'rlog "%b%e"',0x8000040 VCSSetCmd=VCS_CHECKPROP_ID,'rlog -t "%b%e"',0x8000040 VCSSetCmd=VCS_CHECKDIFF_ID,'rcsdiff -r "%b%e"',0x8000040 VCSSetCmd=VCS_CHECKMENU_ID,'mksrcs',0x8000000 VCSSetCmd=VCS_ADD_ID,'ci -f -t -I "%b%e" <"%Q"',0x8000040 VCSSetCmd=VCS_REMOVE_ID,'del /f "%b%%e,v"',0x8000040 [Project] ConfigSetUserMakefile='' ConfigSetUserMakefileParser='' ConfigSetUserMakefileTimeStamp=0 ConfigSetUserMakefileAutoSync=0 ConfigSetLinkDBFilename='D:\CodeWright\cwright.ldb' ConfigSetMarkDBFilename='D:\CodeWright\cwright.mrk' ConfigSetSymbolDBFilename='H:\uop\pos407\team\week3\teamW3.sbl' EditSetPath='' --- NEW FILE: teamW3.sbl --- (This appears to be a binary file; contents omitted.) --- NEW FILE: tw3.html --- <HTML> <HEAD> <TITLE>Applet HTML Page</TITLE> </HEAD> <BODY> <H3><HR WIDTH="100%">Applet HTML Page<HR WIDTH="100%"></H3> <P> <APPLET code="tw3.class" width=350 height=200></APPLET> </P> <HR WIDTH="100%"><FONT SIZE=-1><I>Generated by Team 3</I></FONT> </BODY> </HTML> --- NEW FILE: tw3.java --- /* * Class: tw3.java * Author: poulh, bmeier * * Date: 7/14/2003 * Time: 10:26:08 AM * Purpose: Application Entry Point */ import java.awt.*; import java.applet.*; import javax.swing.*; import java.awt.event.*; public class tw3 extends Applet { /* * Name of Method: init * Date: 7/10/2003 * Notes: Application driver */ public void init(){ super.init(); } /** * Name of Method: paint * Date: 7/14/2003 * Notes: Paints the container. This forwards the paint to any lightweight * components that are children of this container. */ public void paint (Graphics g) { Font bigFont = new Font("Arial", Font.BOLD + Font.ITALIC, 20); g.setFont(bigFont); g.setColor(new Color(165, 165, 0)); } } Index: Calculation.java =================================================================== RCS file: /cvsroot/ordweb/uop/pos407/team/week3/Calculation.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Calculation.java 13 Jul 2003 04:18:37 -0000 1.1 --- Calculation.java 14 Jul 2003 19:26:35 -0000 1.2 *************** *** 1,2 **** --- 1,12 ---- + /* + * Class: tw3 + * Method: tw3 + * Author: whernandex * + * Date: 7/14/2003 + * Time: 10:26:08 AM + * Purpose: Calculation implementation + */ + + public class Calculation { /* display result */ |
From: <moj...@us...> - 2003-07-14 17:18:46
|
Update of /cvsroot/ordweb/uop/pos407/poulh/week2 In directory sc8-pr-cvs1:/tmp/cvs-serv18331/pos407/poulh/week2 Modified Files: JSmileFace.java Log Message: refresh Index: JSmileFace.java =================================================================== RCS file: /cvsroot/ordweb/uop/pos407/poulh/week2/JSmileFace.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** JSmileFace.java 12 Jul 2003 21:45:03 -0000 1.1 --- JSmileFace.java 14 Jul 2003 17:18:41 -0000 1.2 *************** *** 1,7 **** /* * filename: JSmileFace.java ! * author: poul hoecherl * version: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ordweb/uop/pos407/poulh/JSmileFace.java ! * notes: */ import java.awt.*; --- 1,7 ---- /* * filename: JSmileFace.java ! * author: poul hoecherl / moj...@us... * version: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ordweb/uop/pos407/poulh/JSmileFace.java ! * notes: This is the one and only file for this program. */ import java.awt.*; *************** *** 11,71 **** public class JSmileFace extends javax.swing.JApplet implements ActionListener { ! //JPanel pnl = new ; ! JButton cmdFrown; ! int arcAngle = 180; /** Creates a new instance of JSmileFace */ ! public JSmileFace() { ! ! } ! Font bigFont = new Font("Arial", Font.BOLD + Font.ITALIC, 20); ! public void init () { this.setBackground(new Color (255,255, 255)); ! this.getContentPane().setLayout(new FlowLayout()); ! ! this.getContentPane().add(cmdFrown = new JButton("Frown")); ! cmdFrown.setBackground(new Color(0,0,0,0)); ! cmdFrown.addActionListener(this); } /** * Paints the container. This forwards the paint to any lightweight ! * components that are children of this container. If this method is ! * reimplemented, super.paint(g) should be called so that lightweight ! * components are properly rendered. If a child component is entirely ! * clipped by the current clipping setting in g, paint() will not be ! * forwarded to that child. ! * ! * @param g the specified Graphics window ! * @see Component#update(Graphics) ! * ! */ public void paint (Graphics g) { ! ! g.setFont(bigFont); ! g.setColor(new Color(255, 0, 0)); ! ! g.setColor(new Color(0, 255, 0)); ! g.drawLine(15, 40, 125, 40); ! g.setColor(new Color(165, 165, 0)); ! g.fillOval(15, 50, 110, 50); ! ! g.setColor(new Color(255, 0, 0)); ! g.drawArc(45, 60, 50, 25, 180, 180); // for smile ! //g.drawArc(45,60,50,25,180,-180); for a frown ! cmdFrown.paint(g); ! } - ! /** Invoked when an action occurs. ! * ! */ public void actionPerformed(ActionEvent e) { if (e.getSource() == cmdFrown) { arcAngle = 180 * -1 ; // toggle the module-level arcAngle ! this.paint(this.getGraphics()); ! } } --- 11,55 ---- public class JSmileFace extends javax.swing.JApplet implements ActionListener { ! JButton cmdFrown; // one and only JButton ! int arcAngle = 180; // module var holding Smile state /** Creates a new instance of JSmileFace */ ! public JSmileFace() {} ! Font bigFont = new Font("Arial", Font.BOLD + Font.ITALIC, 20); ! ! public void init () { this.setBackground(new Color (255,255, 255)); ! Container con = getContentPane(); ! con.setLayout(new FlowLayout()); ! con.add(cmdFrown = new JButton("Frown")); ! cmdFrown.addActionListener(this); ! } /** * Paints the container. This forwards the paint to any lightweight ! * components that are children of this container. */ public void paint (Graphics g) { ! rePaintMe(g); // cal rePaint worker } ! /** Worker to implement RePaint functionality */ ! private void rePaintMe(Graphics g){ ! g.setFont(bigFont); ! g.setColor(new Color(165, 165, 0)); ! g.fillOval(15, 50, 110, 50); ! g.setColor(new Color(255, 0, 0)); ! g.drawArc(45, 60, 50, 25, 180, arcAngle); // arcAngle is +/- 180 ! cmdFrown.paint(g); // repaint the gui ! ! } ! /** handles cmdFrown click event */ public void actionPerformed(ActionEvent e) { + if (e.getSource() == cmdFrown) { arcAngle = 180 * -1 ; // toggle the module-level arcAngle ! rePaintMe(this.getGraphics()); // repaint ! } } |
From: <whe...@us...> - 2003-07-13 17:42:30
|
Update of /cvsroot/ordweb/uop/pos407/wayneh/week3 In directory sc8-pr-cvs1:/tmp/cvs-serv27212/pos407/wayneh/week3 Added Files: Account.java Checking.java Savings.java Log Message: initial stubs for week3 assignment --- NEW FILE: Account.java --- /* @author Wayne Hernandez */ public class Account { private integer myAccount; private double myBalance; public Account(integer account) { myBalance = 0.0; } public setBalance(integer account) { myAccount = account; } public double getBalance() { return(myBalance); } public integer getAccount() { return(myAccount); } } --- NEW FILE: Checking.java --- /* @author Wayne Hernandez */ public class Checking extends Account { public Checking { System.out.println("Checking account information"); } } --- NEW FILE: Savings.java --- /* @author Wayne Hernandez */ public class Savings extends Account { Integer interestRate; public Savings() { Account ref; System.out.println("Savings account information"); ref.getAccount(); ref.getBalance(); getRate(); } public integer getRate(interger inRate) { interestRate = inRate; } } |
From: <whe...@us...> - 2003-07-13 16:14:35
|
Update of /cvsroot/ordweb/uop/pos407/wayneh/week3 In directory sc8-pr-cvs1:/tmp/cvs-serv16516/pos407/wayneh/week3 Added Files: problems.txt Log Message: assignment for week3 - listing pages for 1st and 2nd editions of the book. --- NEW FILE: problems.txt --- page 459 in 2nd edition - page 428 (Chapter 9 in 1st editon) 2 a. Create an abstract class named Account for a bank. Include an integer field for the account number and a double field for the account balance. Also include a constructor that requires an account number and sets the balance to 0.0. Include a set method for the balance. Also include two abstract get methods-one for each field. Create two child classes of Account: Checking and Savings. Within the Checking class, the get method displays the String "Checking Account Information", the account number, and the balance. Within the Savings class, add a field to hold the interest rate, and require the Savings constructor to accept an argument for the value of the interest rate. The Savings get method displays the String "Savings Account Information", the account number, the balance, and the interest rate. SAve the Account.java, Checking.java and SAvings.java programs in the Chapter.12 folder on your student disk. b. Write a program named AccountArray in which you enteer data for a mix of 10 Checking and Savings accounts. Use a for loop to display the data. Save the AccountArray.java program in the Chapter.,12 folder on your student disk. |
From: <whe...@us...> - 2003-07-13 16:13:31
|
Update of /cvsroot/ordweb/uop/pos407/wayneh/week3 In directory sc8-pr-cvs1:/tmp/cvs-serv16394/week3 Log Message: Directory /cvsroot/ordweb/uop/pos407/wayneh/week3 added to the repository |
From: <whe...@us...> - 2003-07-13 04:18:40
|
Update of /cvsroot/ordweb/uop/pos407/team/week3 In directory sc8-pr-cvs1:/tmp/cvs-serv30718/pos407/team/week3 Added Files: Calculation.java Log Message: init - creating stubs for calculation class --- NEW FILE: Calculation.java --- public class Calculation { /* display result */ public double displayResult() { return 0; } /* get cumulative total of wagers */ public double getCumulative() { return 0; } /* what is the payout so far */ public double GetPayOut(String in1, String in2, String in3) { return 0; } } |
From: <whe...@us...> - 2003-07-13 04:15:23
|
Update of /cvsroot/ordweb/uop/pos407/team/week3 In directory sc8-pr-cvs1:/tmp/cvs-serv30445 Added Files: .cvsignore Log Message: Updated by TortoiseCVS --- NEW FILE: .cvsignore --- Calculation.class |
From: <whe...@us...> - 2003-07-13 03:50:18
|
Update of /cvsroot/ordweb/uop/pos407/wayneh/week2 In directory sc8-pr-cvs1:/tmp/cvs-serv27937/pos407/wayneh/week2 Added Files: JSmileFace.java JSmileFace2.java Log Message: init --- NEW FILE: JSmileFace.java --- import java.awt.*; import javax.swing.*; /* * @author Wayne Hernandez */ public class JSmileFace extends JApplet { public void init () { this.setBackground(new Color (0, 0, 50)); } public void paint (Graphics g) { g.setColor(new Color(255, 255, 0)); g.fillOval(25, 70, 120, 70); /*x, y (upper left), width, height */ g.setColor(new Color(0, 128, 128)); g.drawArc(55, 80, 60, 30, 180, 180); /*x, y, width, height, begin, angle */ } } --- NEW FILE: JSmileFace2.java --- import java.awt.*; import java.awt.event.*; import javax.swing.*; /* * @author Wayne Hernandez */ public class JSmileFace2 extends JApplet implements ActionListener { JButton pressButton = new JButton("Press"); public void init () { this.setBackground(new Color (0, 0, 50)); Container con = getContentPane(); con.setLayout(new FlowLayout() ); con.add(pressButton); pressButton.addActionListener(this); pressButton.repaint(); } public void paint (Graphics g) { g.setColor(new Color(255, 255, 0)); g.fillOval(25, 70, 120, 70); /*x, y (upper left), width, height */ g.setColor(new Color(0, 128, 128)); g.drawArc(55, 80, 60, 30, 180, 180); /*x, y, width, height, begin, angle */ pressButton.repaint(); } public void actionPerformed(ActionEvent e) { Object source = e.getSource(); if (source == pressButton) { Graphics g = getGraphics(); g.setColor(new Color(255, 255, 0)); g.fillOval(25, 70, 120, 70); /*x, y (upper left), width, height */ g.setColor(new Color(0, 128, 128)); g.drawArc(55, 100, 60, 30, 180, -180); /*x, y, width, height, begin, angle */ } } } |
From: <whe...@us...> - 2003-07-13 03:49:42
|
Update of /cvsroot/ordweb/uop/pos407/wayneh/week2 In directory sc8-pr-cvs1:/tmp/cvs-serv27857/week2 Log Message: Directory /cvsroot/ordweb/uop/pos407/wayneh/week2 added to the repository |
From: <moj...@us...> - 2003-07-12 21:45:06
|
Update of /cvsroot/ordweb/uop/pos407/poulh/week2 In directory sc8-pr-cvs1:/tmp/cvs-serv11220/pos407/poulh/week2 Added Files: .nbattrs JApplet.html JSmileFace.class JSmileFace.html JSmileFace.java Log Message: init --- NEW FILE: .nbattrs --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE attributes PUBLIC "-//NetBeans//DTD DefaultAttributes 1.0//EN" "http://www.netbeans.org/dtds/attributes-1_0.dtd"> <attributes version="1.0"> <fileobject name="JSmileFace.java"> <attr name="class_dependency_javax.swing.JApplet" stringvalue="JSmileFace"/> <attr name="class_dependency_java.awt.event.ActionListener" stringvalue="JSmileFace"/> <attr name="NetBeansAttrDebuggerType" serialvalue="aced00057372001e6f72672e6f70656e6964652e53657276696365547970652448616e646c6564612acc871b81080300024c0009636c6173734e616d657400124c6a6176612f6c616e672f537472696e673b4c00046e616d6571007e000178707400104170706c657420446562756767696e6774002e6f72672e6e65746265616e732e6d6f64756c65732e6170706c65742e4170706c657444656275676765725479706578"/> <attr name="NetBeansAttrExecutor" serialvalue="aced00057372001e6f72672e6f70656e6964652e53657276696365547970652448616e646c6564612acc871b81080300024c0009636c6173734e616d657400124c6a6176612f6c616e672f537472696e673b4c00046e616d6571007e000178707400104170706c657420457865637574696f6e74002a6f72672e6e65746265616e732e6d6f64756c65732e6170706c65742e4170706c65744578656375746f7278"/> </fileobject> </attributes> --- NEW FILE: JApplet.html --- <HTML> <HEAD> <TITLE>Applet HTML Page</TITLE> </HEAD> <BODY> <H3><HR WIDTH="100%">Applet HTML Page<HR WIDTH="100%"></H3> <P> <APPLET code="JApplet.class" width=350 height=200></APPLET> </P> <HR WIDTH="100%"><FONT SIZE=-1><I>Generated by NetBeans IDE</I></FONT> </BODY> </HTML> --- NEW FILE: JSmileFace.class --- (This appears to be a binary file; contents omitted.) --- NEW FILE: JSmileFace.html --- <HTML> <HEAD> <TITLE>Applet HTML Page</TITLE> </HEAD> <BODY> <H3><HR WIDTH="100%">Applet HTML Page<HR WIDTH="100%"></H3> <P> <APPLET code="JSmileFace.class" width=350 height=200></APPLET> </P> <HR WIDTH="100%"><FONT SIZE=-1><I>Generated by NetBeans IDE</I></FONT> </BODY> </HTML> --- NEW FILE: JSmileFace.java --- /* * filename: JSmileFace.java * author: poul hoecherl * version: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/ordweb/uop/pos407/poulh/JSmileFace.java * notes: */ import java.awt.*; import javax.swing.*; import java.awt.event.*; public class JSmileFace extends javax.swing.JApplet implements ActionListener { //JPanel pnl = new ; JButton cmdFrown; int arcAngle = 180; /** Creates a new instance of JSmileFace */ public JSmileFace() { } Font bigFont = new Font("Arial", Font.BOLD + Font.ITALIC, 20); public void init () { this.setBackground(new Color (255,255, 255)); this.getContentPane().setLayout(new FlowLayout()); this.getContentPane().add(cmdFrown = new JButton("Frown")); cmdFrown.setBackground(new Color(0,0,0,0)); cmdFrown.addActionListener(this); } /** * Paints the container. This forwards the paint to any lightweight * components that are children of this container. If this method is * reimplemented, super.paint(g) should be called so that lightweight * components are properly rendered. If a child component is entirely * clipped by the current clipping setting in g, paint() will not be * forwarded to that child. * * @param g the specified Graphics window * @see Component#update(Graphics) * */ public void paint (Graphics g) { g.setFont(bigFont); g.setColor(new Color(255, 0, 0)); g.setColor(new Color(0, 255, 0)); g.drawLine(15, 40, 125, 40); g.setColor(new Color(165, 165, 0)); g.fillOval(15, 50, 110, 50); g.setColor(new Color(255, 0, 0)); g.drawArc(45, 60, 50, 25, 180, 180); // for smile //g.drawArc(45,60,50,25,180,-180); for a frown cmdFrown.paint(g); } /** Invoked when an action occurs. * */ public void actionPerformed(ActionEvent e) { if (e.getSource() == cmdFrown) { arcAngle = 180 * -1 ; // toggle the module-level arcAngle this.paint(this.getGraphics()); } } } |
Update of /cvsroot/ordweb/uop/pos407/poulh/week3 In directory sc8-pr-cvs1:/tmp/cvs-serv30667/pos407/poulh/week3 Added Files: .nbattrs Account.class Account.java Checking.class Checking.java Savings.class Savings.java driver.class driver.java Log Message: init --- NEW FILE: .nbattrs --- <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE attributes PUBLIC "-//NetBeans//DTD DefaultAttributes 1.0//EN" "http://www.netbeans.org/dtds/attributes-1_0.dtd"> <attributes version="1.0"> <fileobject name="Account.java"> <attr name="EA-OpenIDE-Connection" serialvalue="aced0005737200146a6176612e7574696c2e4c696e6b65644c6973740c29535d4a60882203000078707704000000017372002a6f72672e6f70656e6964652e6c6f61646572732e436f6e6e656374696f6e537570706f72742450616972055f8af6f04a3bd80200024c00047479706574002b4c6f72672f6f70656e6964652f636f6f6b6965732f436f6e6e656374696f6e436f6f6b696524547970653b4c000576616c75657400124c6a6176612f6c616e672f4f626a6563743b78707372002e6f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661436f6e6e656374696f6e732454797065a83dd01001306d7402000149000666696c746572787000000050737200436f72672e6e65746265616e732e6d6f64756c65732e6a6176612e4a617661446174614f626a6563742450657273697374656e74436f6e6e656374696f6e48616e646c65ba16f1d2dd4c1cb60200014c000e646174614e6f646548616e646c6574001f4c6f72672f6f70656e6964652f6e6f6465732f4e6f64652448616e646c653b7870737200296f72672e6f70656e6964652e6c6f61646572732e446174614e6f6465244f626a65637448616e646c655bd0f82e01811d2e0200025a0005636c6f6e654c00036f626a7400244c6f72672f6f70656e6964652f66696c6573797374656d732f46696c654f626a6563743b787000737200326f72672e6f70656e6964652e66696c6573797374656d732e416273747261637446696c654f626a656374245265706c616365896fa1bce4b5219f0200024c000866696c654e616d657400124c6a6176612f6c616e672f537472696e673b4c000666734e616d6571007e000f787074000c536176696e67732e6a617661740046433a2f446f63756d656e747320616e642053657474696e67732f762d706f686f65632f4d7920446f63756d656e74732f756f702f706f733430372f706f756c682f7765656b3378"/> </fileobject> </attributes> --- NEW FILE: Account.class --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Account.java --- /** * * @author bmeier */ public abstract class Account { private int actNum; private double actBal; /** Creates a new instance of Account */ public Account(int num) { actNum = num; actBal = 0.0; } public void SetBalance(double bal) { actBal = bal; } public abstract void getActBal(); public abstract void getActNum(); } --- NEW FILE: Checking.class --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Checking.java --- /** * * @author bmeier */ public class Checking extends Account { /** Creates a new instance of Checking */ public Checking(int num) { super(num); } public void getActBal() { System.out.println((double)345.23); } public void getActNum() { System.out.println((int)555); } } --- NEW FILE: Savings.class --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Savings.java --- /** * * @author bmeier */ public class Savings extends Account { private double interest; /** Creates a new instance of Savings */ public Savings(int args) { super(args); } public void getActBal() { } public void getActNum() { } } --- NEW FILE: driver.class --- (This appears to be a binary file; contents omitted.) --- NEW FILE: driver.java --- /* * driver.java * * Created on July 10, 2003, 8:45 PM */ /** * * @author v-pohoec */ public class driver { public static void main(String[] args) throws Exception { try{ Checking chk = new Checking(100); chk.SetBalance(200.00); Savings sav = new Savings(100); System.out.println("OK"); } catch(Exception ex) { System.out.println("BAD"); } } } |
From: <moj...@us...> - 2003-07-12 16:28:49
|
Update of /cvsroot/ordweb/uop/pos407/poulh/week2 In directory sc8-pr-cvs1:/tmp/cvs-serv30667/pos407/poulh/week2 Added Files: Account.java Log Message: init --- NEW FILE: Account.java --- /** * * @author bmeier */ public abstract class Account { private int actNum; private double actBal; /** Creates a new instance of Account */ public Account(int num) { actNum = num; actBal = 0.0; } public void SetBalance(double bal) { actBal = bal; } public abstract void getActBal(); public abstract void getActNum(); } |
From: <moj...@us...> - 2003-07-12 16:28:32
|
Update of /cvsroot/ordweb/uop/pos407/poulh/week2 In directory sc8-pr-cvs1:/tmp/cvs-serv30623/week2 Log Message: Directory /cvsroot/ordweb/uop/pos407/poulh/week2 added to the repository |
From: <moj...@us...> - 2003-07-12 16:28:31
|
Update of /cvsroot/ordweb/uop/pos407/poulh/week3 In directory sc8-pr-cvs1:/tmp/cvs-serv30623/week3 Log Message: Directory /cvsroot/ordweb/uop/pos407/poulh/week3 added to the repository |
From: <moj...@us...> - 2003-07-11 06:03:23
|
Update of /cvsroot/ordweb/uop/pos407/team/week3 In directory sc8-pr-cvs1:/tmp/cvs-serv23064/pos407/team/week3 Added Files: approach.txt Log Message: init --- NEW FILE: approach.txt --- (This appears to be a binary file; contents omitted.) |
From: <moj...@us...> - 2003-07-11 05:44:13
|
Update of /cvsroot/ordweb/uop/pos407/team/week3 In directory sc8-pr-cvs1:/tmp/cvs-serv20986/week3 Log Message: Directory /cvsroot/ordweb/uop/pos407/team/week3 added to the repository |
From: <b_...@us...> - 2003-07-11 03:30:48
|
Update of /cvsroot/ordweb/uop/pos407/bryanm/week3 In directory sc8-pr-cvs1:/tmp/cvs-serv5768/pos407/bryanm/week3 Added Files: Account.java Checking.java Savings.java Log Message: init --- NEW FILE: Account.java --- /** * * @author bmeier */ public abstract class Account { private int actNum; private double actBal; /** Creates a new instance of Account */ public Account(int num) { actNum = num; actBal = 0.0; } public void SetBalance(double bal) { actBal = bal; } public abstract void getActBal(); public abstract void getActNum(); } --- NEW FILE: Checking.java --- /** * * @author bmeier */ public class Checking extends Account { /** Creates a new instance of Checking */ public Checking(int num) { super(num); } public void getActBal() { System.out.println((double)345.23); } public void getActNum() { System.out.println((int)555); } } --- NEW FILE: Savings.java --- /** * * @author bmeier */ public class Savings extends Account { private double interest; /** Creates a new instance of Savings */ public Savings(double Int) { } public void getActBal() { } public void getActNum() { } } |
From: <b_...@us...> - 2003-07-11 03:17:31
|
Update of /cvsroot/ordweb/uop/pos407/bryanm/Examples/Classes In directory sc8-pr-cvs1:/tmp/cvs-serv720 Added Files: Classes1.java Classes2.java Classes3.java Classes4.java Classes5.java Classes6.java Classes7.java Classes8.java Classes9.java Vector1.java Log Message: init --- NEW FILE: Classes1.java --- //Demonstrates objects and attributes. import java.io.*; public class Classes1 { public static void main (String[ ] args) throws java.io.IOException { App a = new App(); a.start(); return; } } class App { void start() { Dog d = new Dog(); d.name = "Bonzo"; d.yearBorn = 1996; System.out.println(d.name + " was born in " + d.yearBorn); return; } } class Dog { String name; int yearBorn; } --- NEW FILE: Classes2.java --- //Demonstrates objects, attributes, and methods. import java.io.*; import java.util.Date; public class Classes2 { public static void main (String[ ] args) throws java.io.IOException { App a = new App(); a.start(); return; } } class App { void start() { Dog d = new Dog(); d.name = "Bonzo"; d.yearBorn = 1996; System.out.println(d.name + " is " + d.getAge() + " years old."); return; } } class Dog { String name; int yearBorn; int getAge() { return (new Date().getYear() + 1900 - this.yearBorn); } } --- NEW FILE: Classes3.java --- //Demonstrates use of several objects import java.io.*; import java.util.Date; public class Classes3 { public static void main (String[ ] args) { App a = new App(); a.start(); return; } } class App { void start() { Dog firstDog = new Dog(); firstDog.name = "Bonzo"; firstDog.yearBorn = 1996; Dog secondDog = new Dog(); secondDog.name = "Fido"; secondDog.yearBorn = 2000; System.out.println(firstDog.name + " is " + firstDog.getAge() + " years old."); System.out.println(secondDog.name + " is " + secondDog.getAge() + " years old."); return; } } class Dog { String name; int yearBorn; int getAge() { return (new Date().getYear() + 1900 - this.yearBorn); } } --- NEW FILE: Classes4.java --- //Demonstrates the use of a constructor import java.io.*; import java.util.Date; public class Classes4 { public static void main (String[ ] args) { App a = new App(); a.start(); return; } } class App { void start() { Dog firstDog = new Dog("Bonzo", 1996); Dog secondDog = new Dog("Fido", 2000); System.out.println(firstDog.name + " is " + firstDog.getAge() + " years old."); System.out.println(secondDog.name + " is " + secondDog.getAge() + " years old."); return; } } class Dog { String name; int yearBorn; Dog (String name, int year) { this.name = name; yearBorn = year; return; } int getAge() { return (new Date().getYear() + 1900 - yearBorn); } } --- NEW FILE: Classes5.java --- //Demonstrates the use of 'getter' methods import java.io.*; import java.util.Date; public class Classes5 { public static void main (String[ ] args) { App a = new App(); a.start(); return; } } class App { void start() { Dog firstDog = new Dog("Bonzo", 1996); Dog secondDog = new Dog("Fido", 2000); System.out.println(firstDog.getName() + " is " + firstDog.getAge() + " years old."); System.out.println(secondDog.getName() + " is " + secondDog.getAge() + " years old."); return; } } class Dog { private String name; private int yearBorn; Dog (String name, int year) { this.name = name; yearBorn = year; return; } String getName() { return name; } int getAge() { return (new Date().getYear() + 1900 - yearBorn); } } --- NEW FILE: Classes6.java --- //Demonstrates private and encapsulation. import java.io.*; import java.util.Date; public class Classes6 { public static void main (String[ ] args) { App a = new App(); a.start(); return; } } class App { void start() { Dog firstDog = new Dog("Bonzo", 1996); Dog secondDog = new Dog("Fido", 2003); System.out.println(firstDog.getName() + " is " + firstDog.getAge() + " years old."); System.out.println(secondDog.getName() + " is " + secondDog.getAge() + " years old."); return; } } class Dog { private String name; private int yearBorn; Dog (String name, int year) { this.name = name; if (year < 1970 || year > new Date().getYear() + 1900) yearBorn = 0; else yearBorn = year; return; } String getName() { return name; } int getAge() { if (yearBorn == 0) return -1; else return (new Date().getYear() + 1900 - yearBorn); } } --- NEW FILE: Classes7.java --- //Demonstrates the use of object references and 'this' import java.io.*; import java.util.Date; public class Classes7 { public static void main (String[ ] args) { App a = new App(); a.start(); return; } } class App { void start() { Dog firstDog = new Dog("Bonzo", 1996); Dog secondDog = new Dog("Fido", 2001); if (firstDog.olderThan(secondDog)) System.out.println("Older dog is " + firstDog.getName()); else System.out.println("Older dog is " + secondDog.getName()); return; } } class Dog { private String name; private int yearBorn; Dog (String name, int year) { this.name = name; if (year < 1970 || year > new Date().getYear() + 1900) yearBorn = 0; else yearBorn = year; return; } String getName() { return name; } int getAge() { if (yearBorn == 0) return -1; else return (new Date().getYear() + 1900 - yearBorn); } boolean olderThan (Dog a) { if (this.getAge() >= a.getAge()) return true; else return false; } } --- NEW FILE: Classes8.java --- //Demonstrates that object variables are references. import java.io.*; import java.util.Date; public class Classes8 { public static void main (String[ ] args) { App a = new App(); a.start(); return; } } class App { void start() { Dog firstDog = new Dog("Bonzo", 1996); Dog secondDog = firstDog; System.out.println("Second Dog is " + secondDog.getName()); firstDog.name = "Fido"; System.out.println("Second Dog is now " + secondDog.getName()); return; } } class Dog { String name; private int yearBorn; Dog (String name, int year) { this.name = name; if (year < 1970 || year > new Date().getYear() + 1900) yearBorn = 0; else yearBorn = year; return; } String getName() { return name; } int getAge() { if (yearBorn == 0) return -1; else return (new Date().getYear() + 1900 - yearBorn); } boolean olderThan (Dog a) { if (this.getAge() >= a.getAge()) return true; else return false; } } --- NEW FILE: Classes9.java --- //Demonstrates objects referencing other objects. import java.io.*; import java.util.Date; public class Classes9 { public static void main (String[ ] args) { App a = new App(); a.start(); } } class App { void start() { Dog firstDog = new Dog("Bonzo", 1996); Dog secondDog = new Dog("Fido", 2001); Person one = new Person("Henry", "The Eighth"); Person two = new Person("Anne", "Boleyn"); firstDog.owner = one; secondDog.owner = two; System.out.println("The owner of " + firstDog.getName() + " is " + firstDog.owner.getName()); } } class Dog { private String name; private int yearBorn; Person owner; Dog (String name, int year) { this.name = name; yearBorn = year; } String getName() { return name; } int getAge() { return (new Date().getYear() + 1900 - yearBorn); } boolean olderThan (Dog a) { if (this.getAge() >= a.getAge()) return true; else return false; } } class Person { String firstName; String lastName; Person(String fName, String lName) { firstName = fName; lastName = lName; } String getName() { return firstName + " " + lastName; } } --- NEW FILE: Vector1.java --- //Demonstrates Vectors import java.io.*; import java.util.Date; import java.util.Vector; public class Vector1 { public static void main (String[ ] args) throws IOException { App a = new App(); a.start(); } } class App { void start() throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); Vector dogs = new Vector(); Dog dog = new Dog(); dog.readDogData(br); dogs.addElement(dog); dog = new Dog(); dog.readDogData(br); dogs.addElement(dog); int totalAge = 0; for (int i = 0; i < dogs.size(); i++){ dog = (Dog) dogs.elementAt(i); System.out.println("Dog " + i + " is " + dog.getName() + " aged " + dog.getAge()); totalAge += dog.getAge(); } System.out.println("The total number of dogs is " + dogs.size()); System.out.println("The average age is " + totalAge/dogs.size()); } } class Dog { private String name; private int yearBorn; Person owner; Dog () { } String getName() { return name; } int getAge() { return (new Date().getYear() + 1900 - yearBorn); } boolean olderThan (Dog a) { if (this.getAge() >= a.getAge()) return true; else return false; } void readDogData(BufferedReader br) throws IOException { System.out.print("Please enter dog's name: "); name = br.readLine(); System.out.print("Please enter the year born: "); try { yearBorn = Integer.parseInt(br.readLine()); } catch (NumberFormatException e) { yearBorn = new Date().getYear() + 1900; } } } class Person { String firstName; String lastName; Person(String fName, String lName) { firstName = fName; lastName = lName; } String getName() { return firstName + " " + lastName; } } |
Update of /cvsroot/ordweb/uop/pos407/bryanm/Examples/Arrays In directory sc8-pr-cvs1:/tmp/cvs-serv633 Added Files: App.class Arrays1.java Arrays2.java Arrays3.java Arrays4.java Arrays5.java Card.class Deck.class Log Message: init --- NEW FILE: App.class --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Arrays1.java --- public class Arrays1 { public static void main (String [] args) { App app = new App(); app.start(); } } class App { void start () { Deck d = new Deck(); System.out.println(d.toString()); } } class Deck { int count = 52; Card [ ] cards = new Card[52]; Deck() { for (int suit = 1; suit <= 4; suit ++) { for (int face = 1; face <= 13; face++) { cards[((suit-1)*13)+(face-1)] = new Card(face, suit); } } } public String toString() { String result = ""; for (int i = 0; i < count; i++) { result += cards[i].toString() + '\n'; } return result; } } class Card { int face; int suit; Card (int f, int s) { this.face = f; //or just face = f; this.suit = s; //or just suit = s; return; } public String toString() { String result = ""; if (face == 1) result = "Ace"; if (face == 11) result = "Jack"; if (face == 12) result = "Queen"; if (face == 13) result = "King"; if (face > 1 && face < 11) result = Integer.toString(face); result = result + " of "; if (suit == 1) result += "Clubs"; if (suit == 2) result += "Diamonds"; if (suit == 3) result += "Hearts"; if (suit == 4) result += "Spades"; return result; } } --- NEW FILE: Arrays2.java --- import java.io.*; public class Arrays2 { public static void main (String [] args) throws IOException { App app = new App(); app.start(); } } class App { void start () throws IOException { BufferedReader br = new BufferedReader (new InputStreamReader(System.in)); Deck d = new Deck(); Card c = null; boolean again = true; while (again) { System.out.print ("Main Menu: (D)eal (L)ist (Q)uit: "); String input = br.readLine().toLowerCase(); if (input == null || input.length() == 0) continue; char letter = input.charAt(0); switch (letter) { case 'd': c = d.deal(); System.out.println("Card is: " + c); break; case 'l': System.out.println (d); break; case 'q': again = false; break; default: System.out.println ("Reply not recongized. Please try again."); } } } } class Deck { int count = 52; Card [ ] cards = new Card[52]; Deck() { for (int suit = 1; suit <= 4; suit ++) { for (int face = 1; face <= 13; face++) { cards[((suit-1)*13)+(face-1)] = new Card(face, suit); } } } Card deal () { if (count <= 0) return null; count = count - 1; return cards[count]; } public String toString() { String result = ""; for (int i = 0; i < count; i++) { result += cards[i].toString() + '\n'; } return result; } } class Card { int face; int suit; Card (int f, int s) { this.face = f; //or just face = f; this.suit = s; //or just suit = s; return; } public String toString() { String result = ""; if (face == 1) result = "Ace"; if (face == 11) result = "Jack"; if (face == 12) result = "Queen"; if (face == 13) result = "King"; if (face > 1 && face < 11) result = Integer.toString(face); result = result + " of "; if (suit == 1) result += "Clubs"; if (suit == 2) result += "Diamonds"; if (suit == 3) result += "Hearts"; if (suit == 4) result += "Spades"; return result; } } --- NEW FILE: Arrays3.java --- //This demonstrates shuffling. import java.io.*; public class Arrays3 { public static void main (String [] args) throws IOException { App app = new App(); app.start(); } } class App { void start () throws IOException { BufferedReader br = new BufferedReader (new InputStreamReader(System.in)); Deck d = new Deck(); Card c = null; boolean again = true; while (again) { System.out.print ("Main Menu: (D)eal (L)ist (S)huffle (Q)uit: "); String input = br.readLine().toLowerCase(); if (input == null || input.length() == 0) continue; char letter = input.charAt(0); switch (letter) { case 'd': c = d.deal(); System.out.println("Card is: " + c); break; case 'l': System.out.println (d); break; case 's': d.shuffle(); System.out.println("Deck shuffled"); break; case 'q': again = false; break; default: System.out.println ("Reply not recongized. Please try again."); } } } } class Deck { int count = 52; Card [ ] cards = new Card[52]; Deck() { for (int suit = 1; suit <= 4; suit ++) { for (int face = 1; face <= 13; face++) { cards[((suit-1)*13)+(face-1)] = new Card(face, suit); } } } Card deal () { if (count <= 0) return null; count = count - 1; return cards[count]; } public void shuffle () { if (count <= 0) return; for (int i = 0; i <100; i++) { int a = (int) (Math.random() * count); int b = (int) (Math.random() * count); Card temp = cards[a]; cards[a] = cards[b]; cards[b] = temp; } } public String toString() { String result = "Number of cards is " + count + ".\n"; for (int i = 0; i < count; i++) { result += cards[i].toString() + '\n'; } return result; } } class Card { int face; int suit; Card (int f, int s) { this.face = f; //or just face = f; this.suit = s; //or just suit = s; return; } public String toString() { String result = ""; if (face == 1) result = "Ace"; if (face == 11) result = "Jack"; if (face == 12) result = "Queen"; if (face == 13) result = "King"; if (face > 1 && face < 11) result = Integer.toString(face); result = result + " of "; if (suit == 1) result += "Clubs"; if (suit == 2) result += "Diamonds"; if (suit == 3) result += "Hearts"; if (suit == 4) result += "Spades"; return result; } } --- NEW FILE: Arrays4.java --- //This demonstrates finding the max and min of an array. import java.io.*; public class Arrays4 { public static void main (String [] args) throws IOException { App app = new App(); app.start(); } } class App { void start () throws IOException { BufferedReader br = new BufferedReader (new InputStreamReader(System.in)); Deck d = new Deck(); Card c = null; boolean again = true; while (again) { System.out.print ("Main Menu: (D)eal (L)ist (S)huffle (Q)uit: "); String input = br.readLine().toLowerCase(); if (input == null || input.length() == 0) continue; char letter = input.charAt(0); switch (letter) { case 'd': c = d.deal(); System.out.println("Card is: " + c); break; case 'l': System.out.println (d); break; case 's': d.shuffle(); System.out.println("Deck shuffled"); break; case 'q': again = false; break; default: System.out.println ("Reply not recongized. Please try again."); } } } } class Deck { int count = 52; Card [ ] cards = new Card[52]; Deck() { for (int suit = 1; suit <= 4; suit ++) { for (int face = 1; face <= 13; face++) { cards[((suit-1)*13)+(face-1)] = new Card(face, suit); } } } Card deal () { if (count <= 0) return null; count = count - 1; return cards[count]; } Card highest () { if (count <= 0) return null; Card h = cards[0]; for (int i = 1; i < count; i++) { if (cards[i].higherThan(h)) h = cards[i]; } return h; } Card lowest () { if (count <= 0) return null; Card h = cards[0]; for (int i = 1; i < count; i++) { if (!cards[i].higherThan(h)) h = cards[i]; } return h; } public void shuffle () { if (count <= 0) return; for (int i = 0; i <100; i++) { int a = (int) (Math.random() * count); int b = (int) (Math.random() * count); Card temp = cards[a]; cards[a] = cards[b]; cards[b] = temp; } } public String toString() { String result = "Number of cards is " + count + ".\n"; result += "Highest card is " + highest() + ".\n"; result += "Lowest card is " + lowest() + ".\n"; for (int i = 0; i < count; i++) { result += cards[i].toString() + '\n'; } return result; } } class Card { int face; int suit; Card (int f, int s) { this.face = f; //or just face = f; this.suit = s; //or just suit = s; return; } boolean higherThan (Card a) { if (this.face > a.face) return true; else if (this.face < a.face) return false; else if (this.suit > a.suit) return true; else return false; } public String toString() { String result = ""; if (face == 1) result = "Ace"; if (face == 11) result = "Jack"; if (face == 12) result = "Queen"; if (face == 13) result = "King"; if (face > 1 && face < 11) result = Integer.toString(face); result = result + " of "; if (suit == 1) result += "Clubs"; if (suit == 2) result += "Diamonds"; if (suit == 3) result += "Hearts"; if (suit == 4) result += "Spades"; return result; } } --- NEW FILE: Arrays5.java --- //This demonstrates sorting an array. import java.io.*; public class Arrays5 { public static void main (String [] args) throws IOException { App app = new App(); app.start(); } } class App { void start () throws IOException { BufferedReader br = new BufferedReader (new InputStreamReader(System.in)); Deck d = new Deck(); Card c = null; boolean again = true; while (again) { System.out.print ("Main Menu: (D)eal (L)ist (S)huffle (O)rder (Q)uit: "); String input = br.readLine().toLowerCase(); if (input == null || input.length() == 0) continue; char letter = input.charAt(0); switch (letter) { case 'd': c = d.deal(); System.out.println("Card is: " + c); break; case 'l': System.out.println (d); break; case 's': d.shuffle(); System.out.println("Deck shuffled"); break; case 'o': d.sort(); System.out.println("Deck Ordered (sorted)"); break; case 'q': again = false; break; default: System.out.println ("Reply not recongized. Please try again."); } } } } class Deck { int count = 52; Card [ ] cards = new Card[52]; Deck() { for (int suit = 1; suit <= 4; suit ++) { for (int face = 1; face <= 13; face++) { cards[((suit-1)*13)+(face-1)] = new Card(face, suit); } } } Card deal () { if (count <= 0) return null; count = count - 1; return cards[count]; } void sort () { boolean swap = true; while (swap) { swap = false; for (int i = 0; i <= count - 2; i++) { if (!cards[i].higherThan(cards[i+1])) { Card temp = cards[i]; cards[i] = cards[i+1]; cards[i+1] = temp; swap = true; } } } } Card highest () { if (count <= 0) return null; Card h = cards[0]; for (int i = 1; i < count; i++) { if (cards[i].higherThan(h)) h = cards[i]; } return h; } Card lowest () { if (count <= 0) return null; Card h = cards[0]; for (int i = 1; i < count; i++) { if (!cards[i].higherThan(h)) h = cards[i]; } return h; } public void shuffle () { if (count <= 0) return; for (int i = 0; i <100; i++) { int a = (int) (Math.random() * count); int b = (int) (Math.random() * count); Card temp = cards[a]; cards[a] = cards[b]; cards[b] = temp; } } public String toString() { String result = "Number of cards is " + count + ".\n"; result += "Highest card is " + highest() + ".\n"; result += "Lowest card is " + lowest() + ".\n"; for (int i = 0; i < count; i++) { result += cards[i].toString() + '\n'; } return result; } } class Card { int face; int suit; Card (int f, int s) { this.face = f; //or just face = f; this.suit = s; //or just suit = s; return; } boolean higherThan (Card a) { if (this.face > a.face) return true; else if (this.face < a.face) return false; else if (this.suit > a.suit) return true; else return false; } public String toString() { String result = ""; if (face == 1) result = "Ace"; if (face == 11) result = "Jack"; if (face == 12) result = "Queen"; if (face == 13) result = "King"; if (face > 1 && face < 11) result = Integer.toString(face); result = result + " of "; if (suit == 1) result += "Clubs"; if (suit == 2) result += "Diamonds"; if (suit == 3) result += "Hearts"; if (suit == 4) result += "Spades"; return result; } } --- NEW FILE: Card.class --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Deck.class --- (This appears to be a binary file; contents omitted.) |
From: <b_...@us...> - 2003-07-11 02:59:51
|
Update of /cvsroot/ordweb/uop/pos407/bryanm/Examples/Arrays In directory sc8-pr-cvs1:/tmp/cvs-serv527a/Arrays Log Message: Directory /cvsroot/ordweb/uop/pos407/bryanm/Examples/Arrays added to the repository |
From: <b_...@us...> - 2003-07-11 02:55:36
|
Update of /cvsroot/ordweb/uop/pos407/bryanm/Examples/Classes In directory sc8-pr-cvs1:/tmp/cvs-serv651/Classes Log Message: Directory /cvsroot/ordweb/uop/pos407/bryanm/Examples/Classes added to the repository |
From: <b_...@us...> - 2003-07-11 02:54:56
|
Update of /cvsroot/ordweb/uop/pos407/bryanm/Examples/Applet In directory sc8-pr-cvs1:/tmp/cvs-serv514 Added Files: ac.gif ad.gif ah.gif Applet1.class Applet1.html Applet1.java Applet2.java Applet3.java Applet4.java as.gif j.gif Log Message: init --- NEW FILE: ac.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ad.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: ah.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Applet1.class --- (This appears to be a binary file; contents omitted.) --- NEW FILE: Applet1.html --- <html> <head> <title> Colin's Applet Demo </title> </head> <body> <center> <h1> Colin's Applet Demo </h1> <applet code="Applet1.class" width="200" height="200"> </applet> </center> </body> </html> --- NEW FILE: Applet1.java --- import java.awt.*; import javax.swing.*; public class Applet1 extends JApplet { Font bigFont = new Font("Arial", Font.BOLD + Font.ITALIC, 20); public void init () { this.setBackground(new Color (0, 0, 50)); } public void paint (Graphics g) { g.setFont(bigFont); g.setColor(new Color(255, 0, 0)); g.drawString ("Hello World", 15, 30); g.setColor(new Color(0, 255, 0)); g.drawLine(15, 40, 125, 40); g.setColor(new Color(165, 165, 0)); g.fillOval(15, 50, 110, 50); g.setColor(new Color(255, 0, 0)); g.drawArc(45, 60, 50, 25, 180, 180); } } --- NEW FILE: Applet2.java --- import java.awt.*; import javax.swing.*; public class Applet2 extends JApplet { Font bigFont = new Font("Arial", Font.BOLD + Font.ITALIC, 20); String s; int inits = 0; int starts = 0; int stops = 0; int paints = 0; public void init() { inits++; } public void start() { starts++; } public void stop() { stops++; } public void paint(Graphics g) { paints++; s = "Inits: " + inits + " Starts: " + starts + " Stops: " + stops + " Paints: " + paints; g.clearRect(0, 0, 500, 200); g.setFont(bigFont); g.setColor(new Color(255, 0, 0)); g.drawString(s, 10, 30); } } --- NEW FILE: Applet3.java --- import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Applet3 extends JApplet implements ActionListener { Font bigFont = new Font("Arial", Font.BOLD + Font.ITALIC, 20); Color appletColor = new Color(150, 150, 0); Color textColor = Color.blue; JLabel lblGreeting = new JLabel ("Hello World!!!"); JTextField txtName = new JTextField(15); JButton btnPushMe = new JButton("Push Me!!!"); int clickCounter = 0; public void init() { lblGreeting.setFont(bigFont); lblGreeting.setForeground(textColor); lblGreeting.setBackground(appletColor); btnPushMe.setForeground(textColor); this.getContentPane().setLayout(new FlowLayout()); this.getContentPane().add (lblGreeting); this.getContentPane().add (txtName); this.getContentPane().add (btnPushMe); btnPushMe.addActionListener(this); txtName.addActionListener(this); this.getContentPane().setBackground(appletColor); } public void start() { txtName.requestFocus(); } public void actionPerformed (ActionEvent evt) { if (evt.getSource() == btnPushMe || evt.getSource() == txtName) { lblGreeting.setText("Hello " + txtName.getText()); this.showStatus(txtName.getText()); Graphics g = this.getGraphics(); g.setFont(bigFont); g.setColor(appletColor); String strCounter = "Click Counter: " + clickCounter; g.drawString(strCounter, 20, 150); clickCounter++; strCounter = "Click Counter: " + clickCounter; g.setColor(textColor); g.drawString(strCounter, 20, 150); int fontHeight = g.getFontMetrics().getHeight(); int stringWidth = g.getFontMetrics().stringWidth(strCounter); g.drawLine(20, 150 + fontHeight, 20 + stringWidth, 150 + fontHeight); } } } --- NEW FILE: Applet4.java --- import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Applet4 extends JApplet implements ActionListener { JLabel card1 = new JLabel(getRandomImage()); JLabel card2 = new JLabel(getRandomImage()); JLabel card3 = new JLabel(getRandomImage()); JButton btn1 = new JButton("Lucky"); JButton btn2 = new JButton("Strike"); JButton btn3 = new JButton("Slots"); public void init() { this.getContentPane().setLayout(null); this.getContentPane().add(card1); card1.setBounds(10, 10, 75, 100); this.getContentPane().add(card2); card2.setBounds(110, 10, 75, 100); this.getContentPane().add(card3); card3.setBounds(210, 10, 75, 100); this.getContentPane().add(btn1); btn1.setBounds(10, 130, 75, 25); this.getContentPane().add(btn2); btn2.setBounds(110, 130, 75, 25); this.getContentPane().add(btn3); btn3.setBounds(210, 130, 75, 25); btn1.addActionListener(this); btn2.addActionListener(this); btn3.addActionListener(this); } public void actionPerformed (ActionEvent evt) { if (evt.getSource() == btn1) { card1.setIcon(getRandomImage()); } else if (evt.getSource() == btn2) { card2.setIcon(getRandomImage()); } else if (evt.getSource() == btn3) { card3.setIcon(getRandomImage()); } } public ImageIcon getRandomImage() { int r = (int) (4.0*Math.random()); switch (r) { case 0: return new ImageIcon("./ac.gif"); case 1: return new ImageIcon("./ad.gif"); case 2: return new ImageIcon("./ah.gif"); case 3: return new ImageIcon("./as.gif"); default: return new ImageIcon("./j.gif"); } } } --- NEW FILE: as.gif --- (This appears to be a binary file; contents omitted.) --- NEW FILE: j.gif --- (This appears to be a binary file; contents omitted.) |
From: <b_...@us...> - 2003-07-11 02:53:26
|
Update of /cvsroot/ordweb/uop/pos407/bryanm/Examples In directory sc8-pr-cvs1:/tmp/cvs-serv1094/pos407/bryanm/Examples Added Files: slotimages.zip Log Message: init --- NEW FILE: slotimages.zip --- (This appears to be a binary file; contents omitted.) |