Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lab07 submissions #13

Open
wants to merge 87 commits into
base: lab07branch
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
8c50f71
Step 5: done
kmai12 Feb 13, 2014
8c8716d
added updated version of SimpleGUI1 to my src directory - done with S…
Feb 13, 2014
61eac6a
copied SimpleGui1.java and personalized the widget
Feb 14, 2014
5e763dd
Added head object to snowman
Feb 14, 2014
6f1631d
added jrcryan sibling directory (done with step 7)
jennacryan Feb 14, 2014
85ee1fe
Finished lab
kmai12 Feb 15, 2014
42ca2b9
added updated version of SimpleGUI1 to my src directory - done with S…
andrewpang Feb 15, 2014
5e7177b
added updated version of SimpleGui1 yo my src directory - done with S…
jennyvien Feb 16, 2014
8239fe8
added updated version of SimpleGui1 to my src directory - done with S…
jennyvien Feb 16, 2014
2d37dea
added updated version of SimpleGUI1 to my src directory - done with S…
bzimm Feb 17, 2014
25fe0da
added updated version of SimpleGui1 to my src dir - done with step5
bernardyan Feb 17, 2014
a049ae6
added updated version of SimpleGui1 to my src directory - done with S…
Migueld37 Feb 18, 2014
682da3e
added updated version of SimpleGUI1 to my src directory - done with S…
Feb 18, 2014
e96acce
rabbit looks retarded
jovo123 Feb 20, 2014
6bfb445
rabbit doesn't suck anymore
jovo123 Feb 20, 2014
5d92f36
copied files & changed package names in advanced (done with step 9)
jennacryan Feb 20, 2014
355a8dc
Fixed snowman head
andrewpang Feb 21, 2014
b91dadd
Finished
Feb 21, 2014
c9ce399
Created folders
Feb 22, 2014
27edd71
Added Plate and coolPlate classes
andrewpang Feb 22, 2014
abbf907
Finished AllMyDrawings
andrewpang Feb 22, 2014
34b4331
Changes to javadoc
andrewpang Feb 22, 2014
d6f9594
Finished Step 11
jennyvien Feb 23, 2014
9eeb0e8
Fixed WPTF file
andrewpang Feb 23, 2014
74ce357
added my subdirectory and copied in the simple gui file
krbriggs Feb 24, 2014
4985f7c
added the snowman's head
krbriggs Feb 24, 2014
7c2f24d
Added Flag.java
Migueld37 Feb 24, 2014
748a54b
made the santa hat, still have to make santa with the hat
krbriggs Feb 24, 2014
01ee6a2
Modified the three methods to my classes
Migueld37 Feb 24, 2014
46a9c5f
Added simple directory to repo
Migueld37 Feb 24, 2014
34db133
finished the santawithhat implementation and the code that draws these
krbriggs Feb 26, 2014
fa437b3
made Popsicle and PopsicleOnAStick classes for contructing drawings
jennacryan Feb 27, 2014
89d15fc
ready to be pulled
bernardyan Feb 27, 2014
72abe59
finished my drawings
Feb 27, 2014
bff963d
added simple gui
Feb 27, 2014
616415b
created drawings and added comments/javadoc
bzimm Feb 27, 2014
7edf435
added updated version of SimpleGUI1 to my src directory - done with S…
christopherluo Feb 27, 2014
752b22a
Created Pie, ApplePie classes, new testing functions for these drawings
Feb 28, 2014
116e862
Changed some comments, indents
Feb 28, 2014
8285dd4
Minor comment changes
Feb 28, 2014
2b5ccf3
Update ApplePie.java
Feb 28, 2014
686b190
added updated version of SimpleGUI1 to my src directory - done with S…
acantor Feb 28, 2014
ddea43b
Fixed Apple.java
Feb 28, 2014
5187a64
Fixed the snowman
acantor Feb 28, 2014
6d19907
fixed drawings, updated some comments
jennacryan Feb 28, 2014
e937002
added updated version of SImpleGUI1 to my src directory - done with s…
108498asdf Feb 28, 2014
4680db0
finished lab06
108498asdf Feb 28, 2014
999e185
changed readme
108498asdf Feb 28, 2014
7a66b9f
my drawings
acantor Feb 28, 2014
1738510
fixed comments
acantor Feb 28, 2014
42d99a0
Added Camera and CameraWithStand classes and drew them
Feb 28, 2014
63627cf
Fixed CameraWithStand
Feb 28, 2014
aeaf0b6
final changes
christopherluo Mar 1, 2014
680ddde
Merge branch 'lab07branch' of github.com:UCSB-CS56-W14/CS56-W14-lab06…
kmai12 Mar 6, 2014
9a500d8
Animation
kmai12 Mar 6, 2014
cf591f2
Merge pull request #16 from christopherluo/master
Mar 7, 2014
57c1264
Added a second star/thread
kmai12 Mar 7, 2014
b3e3211
Merge pull request #15 from ericchen94/master
Mar 7, 2014
ca94969
Merge pull request #14 from acantor/master
Mar 7, 2014
bdbe99f
Merge pull request #11 from bzimm/master
Mar 7, 2014
3a0e172
Merge pull request #10 from zhansaya19/master
Mar 7, 2014
068e6d2
Merge pull request #9 from Migueld37/master
Mar 7, 2014
da05b96
Merge pull request #8 from Nazgugu/master
Mar 7, 2014
4415dc3
Merge pull request #6 from krbriggs/master
Mar 7, 2014
064c50d
Merge pull request #7 from bernardyan/master
Mar 7, 2014
19475a4
Merge pull request #5 from andrewpang/master
Mar 7, 2014
0233885
Merge pull request #4 from jennyvien/master
Mar 7, 2014
d2949ae
Merge pull request #3 from bhammel/master
Mar 7, 2014
f7934d3
Merge pull request #2 from jovo123/master
Mar 7, 2014
01eeb2d
Merge pull request #1 from kmai12/master
Mar 7, 2014
30fae84
Delete README.md
108498asdf Mar 7, 2014
fe389dd
Create README.md
108498asdf Mar 7, 2014
94853ee
reverted changes to README
jennacryan Mar 7, 2014
4d6ee0d
Merge pull request #12 from jrcryan/master
Mar 8, 2014
cab1bff
Update build.xml
108498asdf Mar 8, 2014
1b4d199
Merge pull request #13 from 108498asdf/master
Mar 8, 2014
99c5c5b
merging
acantor Mar 11, 2014
e710fd4
myAnim complete
acantor Mar 11, 2014
1024ca1
added animation
christopherluo Mar 14, 2014
2fbb9fc
Added animation
Mar 14, 2014
5d31b5c
added animation that makes the santa go up and down and randomly chan…
krbriggs Mar 14, 2014
f70fec5
Merge pull request #24 from ericchen94/lab07branch
pconrad Mar 18, 2014
fb7be4b
fixed problem in ericchen PictureComponent.java (did not have Circle.…
pconrad Mar 18, 2014
643270c
Merge pull request #23 from krbriggs/lab07branch
kjorg50 Mar 22, 2014
77bbac8
Merge pull request #22 from christopherluo/lab07branch
kjorg50 Mar 22, 2014
130f071
Merge pull request #25 from kmai12/lab07branch
kjorg50 Mar 22, 2014
407afd3
Merge pull request #18 from acantor/lab07branch
kjorg50 Mar 22, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
added animation that makes the santa go up and down and randomly chan…
…ge color and thickness
krbriggs committed Mar 14, 2014
commit 5d31b5c653d5bad2f3e0c8ab9ba3f7b1997d299c
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
package edu.ucsb.cs56.w14.drawings.krbriggs.advanced;

import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
import java.util.Random;

public class AnimatedPictureViewer {

private DrawPanel panel = new DrawPanel();

private SantaWithHat santa = new SantaWithHat(400, 50, 19);

Thread anim;

private int x = 300;
private int y = 100;

private int dy = 5;

public static void main (String[] args) {
new AnimatedPictureViewer().go();
}

public void go() {
JFrame frame = new JFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

frame.getContentPane().add(panel);
frame.setSize(640,480);
frame.setVisible(true);

frame.getContentPane().addMouseListener(new MouseAdapter() {
public void mouseEntered(MouseEvent e){
System.out.println("mouse entered");
anim = new Animation();
anim.start();
}

public void mouseExited(MouseEvent e){
System.out.println("Mouse exited");
// Kill the animation thread
anim.interrupt();
while (anim.isAlive()){}
anim = null;
panel.repaint();
}
});

} // go()

class DrawPanel extends JPanel {
public void paintComponent(Graphics g) {

Graphics2D g2 = (Graphics2D) g;

// Clear the panel first
g2.setColor(Color.white);
g2.fillRect(0,0,this.getWidth(), this.getHeight());

//random colors
int R = (int)(Math.random()*256);
int G = (int)(Math.random()*256);
int B= (int)(Math.random()*256);
Color color = new Color(R, G, B); //random color, but can be bright or dull



// Draw the santa
//random thickness
float ra = (float)(Math.random()*10);
Stroke thick = new BasicStroke (ra, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL);
Stroke orig=g2.getStroke();
g2.setStroke(thick);
g2.setColor(color);
SantaWithHat test = new SantaWithHat(x, y, 19);
g2.draw(test);
}
}

class Animation extends Thread {
public void run() {
try {
while (true) {
// Bounce off the walls

if (y >= 350) { dy = -5; }
if (y <= 50) { dy = 5; }

y += dy;
panel.repaint();
Thread.sleep(50);
}
} catch(Exception ex) {
if (ex instanceof InterruptedException) {
// Do nothing - expected on mouseExited
} else {
ex.printStackTrace();
System.exit(1);
}
}
}
}

}
You are viewing a condensed version of this merge commit. You can view the full changes here.