Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch to introduce cross-window copy & paste.
I wanted to be able to copy and paste song segments between windows so I thought I would investigate adding this to TuxGuitar in support of this awesome software. === This patch required: === * Making the model serializable so that it could be sent "across the wire" * Making part of the graphics model (Rectangles/Points/Dimensions) Serializable * Changing the Transferable abstract to inherit from java.awt.datatransfer.Transferable, and changing the MeasureTransferable to implement that interface. * MeasureTransferable also had needed to be attachable/detachable to the TablatureEditor, and PasteMeasureAction needs to be aware of that. * Refactoring of TGFactory / abstract class instatiation, to concrete class instantiation to avoid closing in the hidden variable this$0, which causes the serialization to fail. (And who says java has no closures?) :/ This should also improve debugging, as classes will have their own name rather than eg: TGFactory$0. This also meant making the whole model concrete rather than abstract classes. As best I can tell, this didnt change the semantics (as we were in fact just creating non specialized anonymous instances of those same classes. === Places to look for bugs / future improvements === * I didnt investigate the graphics model heavily, so it is possible I missed something that needs to be serialized there. * Its possible I overlooked something (or some theoretical gain) in moving from abstract classes in the model to concrete classes. * Test Cases
- Loading branch information
1 parent
29ead04
commit f5dd0be
Showing
37 changed files
with
125 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.