Alice Community  

Go Back   Alice Community > General Discussion > The Lounge

Reply
 
Thread Tools Display Modes
Adding a new class and/or folder to the gallery
Old
DickBaldwin
Guest
 
Status:
Posts: n/a
Smile Adding a new class and/or folder to the gallery - 04-03-2007, 05:43 PM

I am probably the only person in the world who hasn't known about this for years, but I have never seen the second part of this posting written down anywhere. When I discovered it, I thought it was pretty neat, so I decided to post it just in case someone finds it useful.

EXTENDING A CLASS
Probably everyone knows that you can extend an existing Alice class (or do something very similar to extending a class) by doing the following:

* Create a new world.
* Add an object from the gallery into the world.
* Select the object in the object tree and select the methods tab below the property tree.
* Write one or more new class-level methods for that object.
* Declare some new class-level variables (properties) for that object if needed.
* Right click on the object in the object tree and select the "save object..." item in the popup menu that results.
* Specify the name and location for the new file that represents the new class in the dialog that pops up. Don't change the default extension for the new file, which is a2c.

ADDING THE NEW CLASS TO THE GALLERY
This is what I haven't seen written down anywhere. I discovered and confirmed experimentally, that you can add your new class to the gallery simply by copying it into one of the sub-directories of the directory named Alice\Required\gallery. If you do that, it will appear in the gallery with a thumbnail similar to that shown in the attached image with the question mark.

ADDING A NEW FOLDER TO THE GALLERY
Taking this concept even further, you can create a new folder to be used as the repository for new classes in the gallery by creating a new directory as a child of the directory named Alice\Required\gallery. Then you can store your new classes in that folder. For example, the attached image with the picture of the file folder shows the thumbnail for a new folder in the gallery named A-Custom.

This makes it easy for you to create a library of new classes and easily add objects of those new classes to your worlds simply by following the normal procedures for adding objects from the gallery. With this approach, you don't need to use the "Import..." item on the File menu to add an object of a new class. Among other advantages, this means that you can drag a new object directly from the gallery and drop drop it in a specific position in the world.

BE SURE TO KEEP A BACKUP
Be aware, however, that if you later find it necessary to re-install Alice 2.0, your new folder may not be there following the installation. Therefore, you should include that folder in your daily backup routine so you will have it available to be copied back into the gallery if needed. (You do have a daily backup routine, don't you?

IS THERE ANY DANGER IN DOING THIS
There is always a modest danger in modifying anything about a program and its disk structure that was designed by someone else. However, the danger seems to be pretty benign in this case. About the worst thing that could happen is that you might have to reinstall Alice 2.0, which is the easiest program that I know of to install under Windows.

Dick Baldwin
Attached Images
File Type: jpg alice0150a01.jpg (6.4 KB, 206 views)
File Type: jpg alice0150a03.jpg (8.4 KB, 202 views)

Last edited by DickBaldwin; 04-03-2007 at 05:45 PM.
   
Reply With Quote
Some reference threads on the topic.
Old
DrJim
Guest
 
Status:
Posts: n/a
Arrow Some reference threads on the topic. - 04-03-2007, 10:00 PM

There are some threads on this - it seems to be something that causes problems for some people. A quick search on "ojects" and "gallery" gave the following and several others:

http://www.alice.org/community/showt...bjects+gallery

http://www.alice.org/community/showt...bjects+gallery

http://www.alice.org/community/showt...bjects+gallery

Note in particular Mr. Nemo's discovery about saving events in the last thread. Don't know if he ever did solve his initial problem.
   
Reply With Quote
Java installation and Documentation
Old
DickBaldwin
Guest
 
Status:
Posts: n/a
Default Java installation and Documentation - 04-03-2007, 11:30 PM

Hi DrJim,

Like I said, apparently everyone in the world knew about the capability to add new classes to the gallery but me

However, the links that you provided raised a couple of questions in my mind:

1. Several of the postings on those threads talked about the Java version on the machine. I don't understand what that was all about. I don't recall reading anything in the Alice installation instructions about having to install Java, unless you intend to export and run applets. (In that case, the student is facing a major Java installation task.) Of course, I already had Java V1.6 on my machine and Java 1.5 on the other machine that I have used for testing Alice worlds, so I would't know that it may be required. It looks like everything that should be needed to write and run Alice programs is already included in the Alice download package in the folder named jre1.3.1_10_win32.

So the question is, if a student doesn't plan to write and run applets (which seems to be impractical anyway) is it necessary for that student to have Java installed on his/her computer, and if so, what version of Java is required, and is the full JDK required, or is just the JRE satisfactory?

2. The only documentation that I have found on Alice is in the tutorial tab that shows up in the welcome screen. While the tutorial is impressive as far as it goes (as an interactive teaching tool), it is far from being documentation. Is there any real software documentation available from Carnegie or elsewhere (excluding commercial textbooks) that I simply haven't found.

Also, is there any place where things like adding class files to the gallery, and putting 128x128 png files into the a2c files to produce thumbnail pictures is documented for the benefit of students, or is it always necessary for students to search through pages of threaded forum conversations to find that sort of information?

Maybe a good project for some very knowledgable and willing person would be to compile a free online "Alice Tips and Techniques" document containing as many of these small but important tips and techniques as possible. And since you seem to be the most knowledgable person around... (hint I would be more than happy to provide server space and host such a document on my web site at http://www.dickbaldwin.com/toc.htm if you or someone else who had that knowledge would write the document.

Dick Baldwin
   
Reply With Quote
Old
DrJim
Guest
 
Status:
Posts: n/a
Default 04-04-2007, 09:37 PM

Quote:
Originally Posted by DickBaldwin View Post
... is it necessary for that student to have Java installed on his/her computer, and if so, what version of Java is required, and is the full JDK required, or is just the JRE satisfactory?
Pretty sure the JRE (only) is required but that it loads automatically with Alice - it's been a long time since I loaded Alice onto my system. I'm probably sensitive to problems here since I got a corrupted file for one JRE upgrade, which really goofed things up (though the problem was quite obvious ). Don't know of anyone else that's had the problem - but seems worth checking when things really don't work.
   
Reply With Quote
Old
DickBaldwin
Guest
 
Status:
Posts: n/a
Default 04-04-2007, 11:17 PM

Thanks, I was assuming that Alice would run on a machine that had never heard of Java, but was capable of running the Java JRE, version 1.3 that is included in the download file.

One reason this is of great interest to me is that we have lots of students with extremely limited financial means. Needless to say, these students don't have computers in their homes.

I have been believing that they could copy Alice onto a 256mb USB flash memory and take it to the closest public library where they have access to computers to do their homework.

Thanks,
Dick Baldwin
   
Reply With Quote
Old
gabe
Administrator
 
gabe's Avatar
 
Status: Offline
Posts: 461
Join Date: Jul 2005
Location: Pittsburgh, PA
Default 04-04-2007, 11:51 PM

Quote:
Originally Posted by DickBaldwin View Post
Thanks, I was assuming that Alice would run on a machine that had never heard of Java, but was capable of running the Java JRE, version 1.3 that is included in the download file.

One reason this is of great interest to me is that we have lots of students with extremely limited financial means. Needless to say, these students don't have computers in their homes.

I have been believing that they could copy Alice onto a 256mb USB flash memory and take it to the closest public library where they have access to computers to do their homework.

Thanks,
Dick Baldwin
It was my understanding too that Alice didn't require Java be installed on a computer in order to work, as it comes bundled with its own virtual machine. I thought the idea was to not have dependencies that people would have to download and install (the exception being export as a web page). I will double check on this.

It's pretty remarkable how people are going off on their own and discovering new and useful things you can do with Alice.
   
Reply With Quote
Accessibility
Old
DickBaldwin
Guest
 
Status:
Posts: n/a
Default Accessibility - 04-05-2007, 12:23 AM

Hello Gabe,

As long as we are on new and useful things, let me mention that although I may simply have missed it, here is something very important that I have never seen published in any of the material regarding Alice,

Alice has the potential of being much more accessible to students with various handicaps than any other programming environment of which I am aware. This, by the way, that is a very big deal.

An example. A few years ago, I had a student in one of my Java classes who had been in an automobile accident several years earlier as a young teenager. He was a very bright young man, but he had very limited use of his hands. He could barely use a pencil to write, and he could only type with one finger. Needless to say, he had a great deal more difficulty writing the required Java programs than the other students in the class. When I learned about Alice, it didn't take me very long to figure out that a student with one working finger and a mouse pad could program in Alice just as well and just as quickly as a student who can type 100 wpm. Everything else being equal, the student with the handicap would not be at a disadvantage at all.

On more than one occasion, I have had students in my classes who were completely deaf. When they came to lab, they brought their signing interpreters with them. Of course, the interpreters don't know anything about programming jargon so they often have to revert to spelling the words out with their fingers. When programming with a language like Java, working through an interpreter to instruct a deaf student on a one-on-one basis is extremely difficult because the student must try to watch the interpreter and the computer screen both at the same time. Although I haven't thought it through completely, I believe it would be much easier to instruct such a student using Alice because it wouldn't be necessary to type in large amounts of code while trying to explain something. With a few drags, drops, and mouse clicks, you can construct long and complex statements. You can spend more time explaining and less time typing.

Bottom line, part of my campaign to switch our Programming Fundamentals course from C++ to Alice includes an argument that such a switch would open the course up to students with a variety of handicaps. While in theory we accommodate those students now, I believe we could do a better job of accommodating them with an Alice-based course than with our current C++ based course.

Perhaps you should mention this to the folks at CMU in case it hasn't occurred to them yet.

Dick Baldwin
   
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Copyright ©2023, Carnegie Mellon University
Alice 2.x © 1999-2012, Alice 3.x © 2008-2012, Carnegie Mellon University. All rights reserved.