Please do not post in this thread. The new thread is here.
I'm creating a sylladex program for files (not RP). This is what I have so far. If you can't see the image, it's a fully-functioning stack modus.
I'm working on adding support for custom fetch modi.
There will be a portable mode for use with USB sticks.
It is programmed in Java, so it should work on whatever operating system you use.
This is basically just me stating my intent. I'm going on holiday in a week's time, and although I hope to have something to share with you by then, I'm not optimistic. More to come, though...
[Stack modus rips by ZDG for this thread. Other rips The Cool. By the way, that's the thread to subscribe to if you want an RP sylladex.]
Last edited by gumptiousCreator; 09-03-2011 at 11:41 AM.
Do you plan on having it be like Tinychum's modules, where we can compile our own classes (probably with a function "Add" and "Get") and hook them in that way? Or will a custom modus mean you have to edit the default code, and compile it in to your version?
Actually, looking at the picture again, you have a folder that says modi so I assume the former. But can you verify?
This is awesome, though. I'm interested in seeing how this works! I'd certainly use it!
Your trolltag is chronoCoder and you // c0mment 0ut @11 0f y0ur text
I'm looking into different options for loading modi. Originally I thought of using .class files like Tinychum apparently does, but I didn't know whether it was actually possible until you mentioned it! That would probably be the easier option for me, and would give modus developers more power.
The alternative I've been considering is adding support for modi to be programmed in JavaScript or similar. That should be painless for developers, and would also mean that badly-programmed fetch modi would be less likely to break the app.
Perhaps I'll support both of these methods. We'll see.
I've got a class loader up and running, and preferences work (apart from the "Misc" ones). I haven't tried creating a modus from a project which has no link to the original source code yet, so that's what I'll be doing next.
In the meantime, here's a screenshot of the preferences window. As you can see, fetch modi can have their own preferences, just as in Homestuck. I will be creating a custom look-and-feel to override the default Java one, and I intend to have a modus selection screen like the one Jade uses rather than that combo box.
The rest of this week will be spent fixing bugs and getting some sort of consistent API down for programming modi.
I'm going to release an early "beta" (alpha, really) now. Warning: it may not even launch on your system. When you find bugs, especially on operating systems other than Windows, please make a note of them, and then post them as a list on this thread, because there are bound to be plenty.
If, through some kind of black magic, the program works for you and you want get on with programming fetch modi, then a) I love you and b) You'll have to import the .jar as an external library or whatever, and then use the template below to get started. Be warned that the API will probably change quite a bit, and your modus won't work with future versions. I intended to do most of the canon modi myself, but it looks like I'll have enough on my plate just fixing bugs.
If you have no programming knowledge but want to work on the look-and-feel of the preferences window, then I love you even more. Learn how to skin Swing's Synth style and get going! (If you can, make partially transparent components that'll look good whatever the modus' background colour is.)
Message me on Pesterchum if you want any more help.
Code:
import sylladex.*; //Important!
//Useful:
import java.awt.*;
import java.io.File;
import java.util.*;
import javax.swing.*;
public class MyModus extends FetchModus //best line
{
private Main m;
public MyModus(Main m)
{
this.m = m;
//pretty much all of these are required. There is no default, yet.
tbgurl = "modi/stack/dockbg_top.png";
bbgurl = "modi/stack/dockbg.png";
texturl = "modi/stack/docktext.png";
cardbgurl = "modi/stack/card.png";
dockcardbg = "modi/stack/dockcard.png";
bgcolour = new Color(255, 6, 124); //Will probably change to US spelling upon full release
startcards = 5; //Number of cards available
origin = new Point(21,120); //Position of card holder window
drawdefaultdockicons = true; //Whether the dock should draw empty cards or not
cardwidth = 146;
cardheight = 187;
preferencespanel = new JPanel(); //Populate this and it'll show up in the preferences window (I think). Get preferences by calling m.getPreferences.getModusPreferences() or something along those lines. Modus preferences aren't saved, currently.
icons = new ArrayList<JLabel>(); //An array of JLabels to be drawn on the dock
}
//Inherited methods
public void addItem(File file)
{
//I've included the code for Stack here as an example
if(m.getNextEmptyCardIndex()==-1)
{
SylladexCard bottomcard = stack.getLast();
open(m.getCards().indexOf(bottomcard));
}
int index = m.getNextEmptyCardIndex();
SylladexCard card = m.getCards().get(index);
card.setFile(file);
stack.addFirst(card);
JLabel icon = new JLabel(m.getIconFromFile(file));
icons.add(0, icon);
m.setIcons(icons);
card.setIcon(icon);
arrangeCards();
}
public void open(int id)
{
//Again, this is what Stack does.
SylladexCard card = m.getCardWithId(id);
icons.remove(card.getIcon());
icons.trimToSize();
m.setIcons(icons);
stack.remove(card);
m.open(card); //Must call this!
arrangeCards();
}
//Unique methods
public void arrangeCards()
{
//Methods of note here are m.getCards(), card.setPosition(), card.setLayer(), card.setAccessible(), m.setCardHolderSize, m.refreshCardHolder().
ArrayList<SylladexCard> cards = m.getCards();
for (SylladexCard card : cards)
{
int index = stack.indexOf(card);
card.setPosition(new Point(index*10, index*10));
card.setLayer(100-index);
//Accessible
card.setAccessible(false);
}
if(stack.size()!=0)
stack.getFirst().setAccessible(true);
m.setCardHolderSize(stack.size()*10 + cardwidth, stack.size()*10 + cardheight);
m.refreshCardHolder();
}
}
Last edited by gumptiousCreator; 08-16-2011 at 07:46 AM.
Reason: Updated file
Yes, that's supposed to be blank. I just didn't get around to filling it.
Nimz, are there any error messages in the console?
Bugs I'm aware of:
Code:
Dock can be moved
Specifying a card size other than the default will cause odd behaviour
Preferences window needs an OK button
Graphical glitches when horizontal resolution is greater than 1280? Please verify.
Background of preferences window is only partially the modus background colour. (I'm going to make the look-and-feel before I fix this.)
Relies on Sun's JVM for quite a bit of the code. Possibly the source of Nimz' problems?
Works for me, I'm using Windows XP. Also, the first bug you've listed(about the dock being movable) doesn't happen to me. The possibility of making custom fetch modi has me interested in making one, so may I ask, What program are you using to compile the files?
I've been doing other things since I took that screencapture of the error message, so I figured it would be easier to find the log in the console if I just redid the test.
Code:
Jul 22 01:20:02 .com.apple.JarLauncher[6159]: SystemFlippers: didn't consume all data for long ID 0 (pBase = 0x100148300, p = 0x100148304, pEnd = 0x100148308)
Jul 22 01:20:02 .com.apple.JarLauncher[6159]: SystemFlippers: didn't consume all data for long ID 0 (pBase = 0x10012e0d0, p = 0x10012e0d4, pEnd = 0x10012e0d8)
Jul 22 01:20:02 .com.apple.JarLauncher[6159]: Exception in thread "main"
Jul 22 01:20:02 .com.apple.JarLauncher[6159]: java.lang.UnsupportedClassVersionError: Bad version number in .class file
Jul 22 01:20:02 .com.apple.JarLauncher[6159]: at java.lang.ClassLoader.defineClass1(Native Method)
Jul 22 01:20:02 .com.apple.JarLauncher[6159]: at java.lang.ClassLoader.defineClass(ClassLoader.java:676)
Jul 22 01:20:02 .com.apple.JarLauncher[6159]: at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
Jul 22 01:20:02 .com.apple.JarLauncher[6159]: at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
Jul 22 01:20:02 .com.apple.JarLauncher[6159]: at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
Jul 22 01:20:02 .com.apple.JarLauncher[6159]: at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
Jul 22 01:20:02 .com.apple.JarLauncher[6159]: at java.security.AccessController.doPrivileged(Native Method)
Jul 22 01:20:02 .com.apple.JarLauncher[6159]: at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
Jul 22 01:20:02 .com.apple.JarLauncher[6159]: at java.lang.ClassLoader.loadClass(ClassLoader.java:317)
Jul 22 01:20:02 .com.apple.JarLauncher[6159]: at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280)
Jul 22 01:20:02 .com.apple.JarLauncher[6159]: at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
Jul 22 01:20:02 .com.apple.JarLauncher[6159]: at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:375)
There was another pointer-looking thingy right before each of the .com.apple.JarLauncher[6159] instances, but I don't know enough to know if leaving that there would be putting sensitive information about my system on a publicly viewable forum.
I have spoilers now?
-.
..
--
--..
spells Nimz
Serenity can blink your message in Morse code, too! Just PM me with your request.
Nicomon: I'm using Eclipse. You should be able to import the .jar as an external thingemy. (Also, welcome to the forums!)
Nimz: Which version of Java are you using? I know you said you have the latest updates, but apparently OSX does not use Java 1.6 by default.
Anyway, that's all for now. Development will continue in three to four weeks, and I may not have access to the forums until then. In the spoiler below, I'll post random thoughts for your perusal. Feel free to (in fact please do) continue to report bugs and make feature requests. I'll read it all when I get back.
Modus devs: Don't bother with the preferences screen; the call to getModusPrefs() will always return null.
UI: I've found that partially transparent black and white components seem to work well on most background colours.
Planned features: Dragging from cards to filesystem (i.e. dragging will work both ways); Text and image support (as well as files) with data being copied back to the clipboard when you click on the card; Ability to add more cards; Left-clicking on the dock or on a card marked as inaccessible shows the modus' selection window (a JFrame) which is where you'd play Memory or type in something to extract from the HashMap etc.
Last edited by gumptiousCreator; 07-22-2011 at 01:07 PM.
How interesting. In trying to find out the version number of java I have I found and opened up Java Preferences.app. What I saw was this:
So I changed the top two rows like so:
and now I get this when I try to open the beta/alpha/whatever-it-is:
Clicky on the dock and
Interesting that it takes the color of the sylladex, which does not seem to be the behavior exhibited in windows screenshots.
I have no idea why my computer decided the latest update was the second best option, nor why it failed to try that option when the first option obviously was not compatible. Could be that my system is biased against 64 bit (I got my computer when 10.5 was initially released - now OS X is up to 10.7). I didn't even know Java Preferences.app existed, but that's a separate issue...
Nice bonus from making that switcheroo: a bug in another .jar program I use from time to time fixed itself.
Comments on actual use:
The hiding/unhiding and always on top preferences seem to work okay, albeit not immediately. I couldn't figure out how to get anything into the sylladex, so either I fail at simple tasks or it doesn't work. Drag'n'drop into dock/into sylladex icon in the computer's dock/into cards doesn't seem to do anything, right click (or ctrl+click) on the dock opens the preferences window, just like left click. Right clicking stuff on my desktop doesn't show any added option in the context menu. But hey, at least it's an improvement over error on launch.
Last edited by Nimz; 07-23-2011 at 04:06 AM.
I have spoilers now?
-.
..
--
--..
spells Nimz
Serenity can blink your message in Morse code, too! Just PM me with your request.
How interesting. In trying to find out the version number of java I have I found and opened up Java Preferences.app. What I saw was this:
So I changed the top two rows like so:
and now I get this when I try to open the beta/alpha/whatever-it-is:
Clicky on the dock and
Interesting that it takes the color of the sylladex, which does not seem to be the behavior exhibited in windows screenshots.
I have no idea why my computer decided the latest update was the second best option, nor why it failed to try that option when the first option obviously was not compatible. Could be that my system is biased against 64 bit (I got my computer when 10.5 was initially released - now OS X is up to 10.7). I didn't even know Java Preferences.app existed, but that's a separate issue...
Nice bonus from making that switcheroo: a bug in another .jar program I use from time to time fixed itself.
Comments on actual use:
The hiding/unhiding and always on top preferences seem to work okay, albeit not immediately. I couldn't figure out how to get anything into the sylladex, so either I fail at simple tasks or it doesn't work. Drag'n'drop into dock/into sylladex icon in the computer's dock/into cards doesn't seem to do anything, right click (or ctrl+click) on the dock opens the preferences window, just like left click. Right clicking stuff on my desktop doesn't show any added option in the context menu. But hey, at least it's an improvement over error on launch.
When you drag'n'drop files onto the cards, is an image of the file shown on the card without actually moving the file (Also not letting you use the file directly from the card?)? If so, this happens to me as well.
@gumptiousCreator: Thanks for the welcome, I'll see if I can make something interesting as a fetch modi before you get back.
You know how when you drag something to a place you can't move it to (e.g. a scrollbar), it flies back to where you dragged it from and doesn't do anything else at all? That's almost exactly what's happening wherever I drag'n'drop anywhere on the sylladex. No image of the file shown on the card, just the empty stack. Also, it seems to me that it would be more canon to be unable to use a file in the sylladex while it is in a card. If the card can be accessed it should eject the contents before they can be used.
I have spoilers now?
-.
..
--
--..
spells Nimz
Serenity can blink your message in Morse code, too! Just PM me with your request.
Nimz: It sounds like it doesn't even recognise that there's a transfer handler attached to the dock, which is sad. It seems that the same thing is happening on Linux, so I'll do some more research into this issue.
As for making files unusable while they are in the sylladex, it's a good idea, and just the sort of needless complexity that this app is about, but it isn't really possible to do...what I could, and probably will do, though, is have the option of moving files to the sylladex's folder when you drag them in. That way, they're less accessible through conventional means, at least.
But before I do, one question: Should we (for whatever reason) want to get rid of the Captchalogue Deck, will we be able to move our files out of it, or will the program just provide another way to access them and we'll still be able to get at them in a "normal" fashion?
All the files will still exist where they were before, it's just that the deck provides an extra, more complicated way of getting at them.
At least, that's how it woks in the current version.
But before I do, one question: Should we (for whatever reason) want to get rid of the Captchalogue Deck, will we be able to move our files out of it, or will the program just provide another way to access them and we'll still be able to get at them in a "normal" fashion?
All your files still exist where they were, it's just that the sylladex provides an interesting way of getting to them.
Last edited by Karhs12; 07-27-2011 at 01:05 PM.
Reason: my post weirded?