Some guidelines for this week's studio:
If the font is too small on the wall display, follow these simple :-) instructions:
- In the editor window of a Java file, right-click and choose Preferences
- Near the top of what you next see, click on Text Editors
- Near the bottom of what you next see, click on Colors and Fonts
- Expand Java (not Structured Text Editors!)
- Click Java Editor Text Font
- Click Change
- Pick a juicy font size like 18 or 20 or whatever you like, and OK
When you get to the point of entering the full and complete location of the repository, copy and paste the line below as the repository's URL:After pasting:https://shell.cec.wustl.edu:8443/cse132_sp15/svn/YYYY
- Change YYYY to your WUSTL key, using lower case letters only. Include all punctuation that is normally part of your WUSTL key.
If you would normally type in the WUSTL key shown on the left, you need to use the version shown in blue on the right to access your repository. Examples:
- RonKCytron → ronkcytron
- ima.StudeNt → ima.student
- Queen.Mary.4 → queen.mary.4
Although only you can access your repository, you should generally keep your WUSTL key a secret.
- OK, click Finish to get the repository location validated.
- When you are prompted for a username and password, supply your
- WUSTL key username (again, all letters must be lower-case)
- WUSTL key password
Your WUSTL key username and password are what you use to log into WebSTAC for registration.Be careful! If you provide a bad password repeatedly, your account will get locked out after a small number of such attempts. So be sure to follow these instructions carefully and ask if things are not working.
Add some labels that say something funny.
- Run the Controller application again, and make sure you see what you expect.
- Show your TA your progress and try to make him or her laugh at what is shown.
Write a similar Java class PercentModel that works like OpinionModel but allows integers from 0 to 100.
The integer value represents a percentage, whose initial value should be 100 percent.
- You will have to use eclipse to create the PercentModel as a new Java class in the studio1.percent package.
- The class you define should extend DefaultBoundedRangeModel, just as OpinionModel does.
- If you mouse-over the super constructor call in OpinionModel, the Java API should tell you what the parameters mean.
Your PercentModel class must have the following method:
public int computePercentOf(int n)The method takes in n and returns this.getValue() percent of n.
In your group, discuss how to write computePercentOf so that it performs arithmetic using the appropriate types.
Instantiate a couple of sliders hooked to the same model and watch them work in concert.
Show this to a TA and to other groups as needed.
Show this to a TA and to other students as needed.
Resources:You can use any one you want, but it should be used for some reasonable purpose. For example, a JButton might be used to reset the percentage to 0 or 100 percent.
JButton reset = new JButton("reset");
// ...
this.add(reset);
// ...
reset.addActionListener(this);
It's the last line above that will cause eclipse to suggest some
things to you. Get help as you need it.
There is a description of JButton here, but you only need the bold stuff.You can see how the action events are handled there at least.
Show the TAs this when you check out.
When you done with this studio, you must be cleared by the TA to receive credit.
- Commit all your work to your repository
- Fill in the form below with the relevant information
- Have a TA check your work
- The TA should check your work and then fill in his or her name
- Click OK while the TA watches
- If you request propagation, it does not happen immediately, but should be posted in the next day or so