Working on tokenTool
Moderators: dorpond, trevor, Azhrei
- CoveredInFish
- Demigod
- Posts: 3104
- Joined: Mon Jun 29, 2009 10:37 am
- Location: Germany
- Contact:
Working on tokenTool
Hiho,
I'm working currently on two tokenTool features.
- incremental numbering for the file name (used by drag&drop)
- paste image from clipboard
Most if it already works fine, i have to invest more time in finetuning though. But before I do so ... has such a patch have any chance to be applied? Who has to be contacted?
I'm working currently on two tokenTool features.
- incremental numbering for the file name (used by drag&drop)
- paste image from clipboard
Most if it already works fine, i have to invest more time in finetuning though. But before I do so ... has such a patch have any chance to be applied? Who has to be contacted?
- jfrazierjr
- Deity
- Posts: 5176
- Joined: Tue Sep 11, 2007 7:31 pm
Re: Working on tokenTool
Azhrei, and I don't see any reason why not.CoveredInFish wrote:Hiho,
I'm working currently on two tokenTool features.
- incremental numbering for the file name (used by drag&drop)
- paste image from clipboard
Most if it already works fine, i have to invest more time in finetuning though. But before I do so ... has such a patch have any chance to be applied? Who has to be contacted?
I save all my Campaign Files to DropBox. Not only can I access a campaign file from pretty much any OS that will run Maptool(Win,OSX, linux), but each file is versioned, so if something goes crazy wild, I can always roll back to a previous version of the same file.
Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..
Get your Dropbox 2GB via my referral link, and as a bonus, I get an extra 250 MB of space. Even if you don't don't use my link, I still enthusiastically recommend Dropbox..
Re: Working on tokenTool
Those both sound like useful features, so yeah, I'd be willing to look at yoru patches.
One thing that has always bothered me about TT is how long it takes to start up?! I don't know what it's doing (that would be my first step) but on my Mac it takes about 20 seconds before the window opens. I can understand that with MT because I know of all the background stuff going on, but TT doesn't have any background stuff (that I know of)...
One thing that has always bothered me about TT is how long it takes to start up?! I don't know what it's doing (that would be my first step) but on my Mac it takes about 20 seconds before the window opens. I can understand that with MT because I know of all the background stuff going on, but TT doesn't have any background stuff (that I know of)...
- CoveredInFish
- Demigod
- Posts: 3104
- Joined: Mon Jun 29, 2009 10:37 am
- Location: Germany
- Contact:
Re: Working on tokenTool
I'm afraid I'm the wrong guy to hunt that down. I'm really pretty new to java and swing and stuff...Azhrei wrote:One thing that has always bothered me about TT is how long it takes to start up?!
Re: Working on tokenTool
Yeah, no problem. I was just mentioning it in case you were in there looking around and noticed something...
Re: Working on tokenTool
If you were not CoveredInFish. Id almost consider hugging you!CoveredInFish wrote:Hiho,
I'm working currently on two tokenTool features.
- incremental numbering for the file name (used by drag&drop)
- paste image from clipboard
Most if it already works fine, i have to invest more time in finetuning though. But before I do so ... has such a patch have any chance to be applied? Who has to be contacted?
I look "super foward" to these updates!
---
Glock-9mm (Wgtn, NZ)
Shooting from the hip... Never the lip!
Glock-9mm (Wgtn, NZ)
Shooting from the hip... Never the lip!
Re: Working on tokenTool
I'm guessing the startup slowness is for loading all of the token borders since they would be displayed immediately in the dropdown list.
- CoveredInFish
- Demigod
- Posts: 3104
- Joined: Mon Jun 29, 2009 10:37 am
- Location: Germany
- Contact:
Re: Working on tokenTool
Okay, here is the patch.
New features:
- user can select to either name the dragged file ".token.drag" or "<fileNamePrefix>_<fileNumber>" with file number incrementing by 1 each *DRAG* action. Note that if you cancel a drag-drop the file number still does get increased - i dont think you can check if the drop-action actually succeeded or not?!
- user can paste an image (like a win-screenshot made with PRINT key) from clipboard to tokentool)
- user can copy token-image to clipboard. (I think the transpareny gets lost with this but I dont see exactly why or have experience to handle it)
New features:
- user can select to either name the dragged file ".token.drag" or "<fileNamePrefix>_<fileNumber>" with file number incrementing by 1 each *DRAG* action. Note that if you cancel a drag-drop the file number still does get increased - i dont think you can check if the drop-action actually succeeded or not?!
- user can paste an image (like a win-screenshot made with PRINT key) from clipboard to tokentool)
- user can copy token-image to clipboard. (I think the transpareny gets lost with this but I dont see exactly why or have experience to handle it)
- Attachments
-
- tokentool_patch_cif_v1.txt
- (53.56 KiB) Downloaded 122 times
Re: Working on tokenTool
Yes, you can.CoveredInFish wrote:- user can select to either name the dragged file ".token.drag" or "<fileNamePrefix>_<fileNumber>" with file number incrementing by 1 each *DRAG* action. Note that if you cancel a drag-drop the file number still does get increased - i dont think you can check if the drop-action actually succeeded or not?!
Check the TransferableHelper code that is part of MapTool. In particular, the importData() method, IIRC.
This will be very handy.- user can paste an image (like a win-screenshot made with PRINT key) from clipboard to tokentool)
This might be because the clipboard supports JPEG and not PNG? It may work on a Unix system but someone will need to test that.- user can copy token-image to clipboard. (I think the transpareny gets lost with this but I dont see exactly why or have experience to handle it)
I'll try applying your patch some time over the weekend and playing with it.
@Jay: Thanks for the hint. If I get time I'll take a look at it. That's something that could be deferred to a separate thread as long as the first one is loaded synchronously (so it appears correctly in the dropdown list).
Hm, what happens if the data model for the dropdown list were to use file: URLs? Then Swing would ask for the images and they could be loaded as-needed. In the meantime a separate thread could be loading them. If the ImageIO cache were turned on that should work out...
- CoveredInFish
- Demigod
- Posts: 3104
- Joined: Mon Jun 29, 2009 10:37 am
- Location: Germany
- Contact:
Re: Working on tokenTool
Hah! Ineed I can. In fact all i had to do was using DragSourceDropEvent and its getDropSuccess() method. So easy if you know where to look.Azhrei wrote: Yes, you can.
Anyway, now the counting works even better, increasing only on successful drops.
New patch attached..
PS: i just realized that I executed a Source->CleanUp on the token tool source so the patch contains some classes I didnt changed manually. Hope this is a robust feature not causing trouble ..
- Attachments
-
- tokentool_patch_cif_v2.txt
- (53.97 KiB) Downloaded 172 times
- CoveredInFish
- Demigod
- Posts: 3104
- Joined: Mon Jun 29, 2009 10:37 am
- Location: Germany
- Contact:
Re: Working on tokenTool
This would be OverListModel.refresh()jay wrote:...the startup slowness is for loading all of the token borders ...
Its called on startup and when you end the "manage overlays" dialog.
It takes roughly 2 .. 2.5 sec on my machine with some custom overlays.
Re: Working on tokenTool
I updated TokenTool to load this code in the background. It's checked in if you would like to try it. It was written to rplib b87, so that is where some of those changes came from. The code needs some better error handling, but otherwise should be OK. Not sure how much faster it got You need to have rplib checked out since I made the TT project rely on it instead of the checked in lib.Azhrei wrote:@Jay: Thanks for the hint. If I get time I'll take a look at it. That's something that could be deferred to a separate thread as long as the first one is loaded synchronously (so it appears correctly in the dropdown list).
Hm, what happens if the data model for the dropdown list were to use file: URLs? Then Swing would ask for the images and they could be loaded as-needed. In the meantime a separate thread could be loading them. If the ImageIO cache were turned on that should work out...
Re: Working on tokenTool
Okay, cool. Thanks, jay.jay wrote:I updated TokenTool to load this code in the background. It's checked in if you would like to try it. It was written to rplib b87, so that is where some of those changes came from.
@CiF: You'll probably need to generate a new patch for me. Since Jay has checked in updated code your patch (which changes a lot of files) likely won't apply cleanly (although I haven't tried, to be honest ). When you generate the patch, you can uncheck all of the class files that you didn't modify to make your change. Then generate the patch. Now you can resynchronize from SVN and apply your newly created patch back to that project. Resynchronizing with SVN will give you exactly the same setup as what I'm going to have, so if your patch reapplies and works then I know it will with mine too.
Hm. I think it was more than just 2 seconds (like about 5-6) but it could have something to do with it being a Web Start app. I don't start timing it until the icon shows up in the Mac's docking bar though, which means the check for newer network resources has already been accomplished. I'm obviously going to need to profile it, I think.The code needs some better error handling, but otherwise should be OK. Not sure how much faster it got You need to have rplib checked out since I made the TT project rely on it instead of the checked in lib.
Thanks again, Jay. I'll take a look tomorrow as today is going to be pretty busy.
Re: Working on tokenTool
I only checked in 3, so it shouldn't be too bad (OverlayListModel, OverlayPanelModel & TokenCompositionPanel) You also now need to checkout the latest rplib into Eclipse, I made the TT project rely on it.
- CoveredInFish
- Demigod
- Posts: 3104
- Joined: Mon Jun 29, 2009 10:37 am
- Location: Germany
- Contact:
Re: Working on tokenTool
No problem, I'll do that. Not sure I find time to do so on sunday ..Azhrei wrote:You'll probably need to generate a new patch for me.