aroelke / mtg-workstation Goto Github PK
View Code? Open in Web Editor NEWMagic: the Gathering deck editor (Java)
License: MIT License
Magic: the Gathering deck editor (Java)
License: MIT License
For large decks (e.g. Commander), it can be unwieldy to look through the main deck for cards. This could be aided by adding a filter bar above the deck list similar to the one above the inventory.
ManaSymbol
s needs to be implemented.ManaSymbol
s in a Map<ManaSymbol, Integer>
in ManaCost
s might be better than just a List<ManaCost>
equals
can be implemented just using the Map
's equals
methodWhenever a file is saved, keep a snapshot of the prior-saved version and store them all alongside the new version. The changelog tab should display a history of these snapshots with these features:
In the past, some cards did not have numbers in their JSON fields. This post indicates how this might be fixed, if it hasn't already.
TristateCheckBox
does/may not necessarily correctly follow the color behaviors of the look-and-feel. For example, on Windows 10 the box for partially selected does not change color upon rollover.
It takes several seconds to wait for loading the inventory, which could get worse when on a slow machine. Possible solutions:
Rather than having SettingsDialog
call functions in various components to update them, have them listen to settings changes confirmations and update themselves automatically.
Or Supplier<FilterLeaf<?>>
.
Add a tab where a user can input arbitrary text. Make it support text formatting if possible.
Possible formats:
Pros:
Cons:
Steps:
Filter
and CategorySpec
to serialize in the desired format (don't remove existing serialization yet)DeckSerializer
to serialize decksd in the desired formatSettingsDialog
On some machines, tooltip text doesn't fit properly and some of it gets cut off.
Menu bar items are disabled if their actions wouldn't (or shouldn't) do anything while the menu is open. Popup menu items should be dynamically disabled/enabled the same way.
Three changes:
At some point in the past, mtgjson.com changed the way it determines format legality, but this code has not been updated for the change.
Class CategorySpec
currently allows its fields to be changed via mutators. However, some components of the editor make copies of CategorySpec
s and operate on those rather than the originals, throwing out the originals when done. This should be made the universal behavior my making the class immutable and having mutators return copies with the specific change made in a similar manner to how Scala's case classes work with their copy
methods (except with separate functions for each field since Java doesn't have this feature).
MTGJSON now includes links to the TCGPlayer page for a card. Add the ability to go there, and possibly scrape the page for pricing as well.
Sometimes keyboard shortcuts fail to work for a little while. They appear to start working again after a menu has been opened in the top menu bar.
The oracle and printed text panes appear to be missing the flavor text of the card.
The popup menu item to fill a playset of cards in an extra list adds four copies instead of filling up to four copies.
Sometimes CardImagePanel
will throw an exception:
Exception in thread "AWT-EventQueue-0" java.lang.IndexOutOfBoundsException: Index 0 out of bounds for length 0
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:248)
at java.base/java.util.Objects.checkIndex(Objects.java:372)
at java.base/java.util.ArrayList.get(ArrayList.java:458)
at editor.gui.display.CardImagePanel.setBounds(CardImagePanel.java:331)
at java.desktop/javax.swing.plaf.basic.BasicTabbedPaneUI$TabbedPaneLayout.layoutContainer(BasicTabbedPaneUI.java:2904)
at java.desktop/java.awt.Container.layout(Container.java:1537)
at java.desktop/java.awt.Container.doLayout(Container.java:1526)
at java.desktop/java.awt.Container.validateTree(Container.java:1722)
at java.desktop/java.awt.Container.validate(Container.java:1657)
at java.desktop/javax.swing.plaf.basic.BasicTabbedPaneUI.ensureCurrentLayout(BasicTabbedPaneUI.java:1646)
at java.desktop/javax.swing.plaf.basic.BasicTabbedPaneUI.getTabBounds(BasicTabbedPaneUI.java:1666)
at java.desktop/javax.swing.plaf.basic.BasicTabbedPaneUI.repaintTab(BasicTabbedPaneUI.java:2338)
at java.desktop/javax.swing.plaf.basic.BasicTabbedPaneUI$Handler.focusLost(BasicTabbedPaneUI.java:4117)
at java.desktop/java.awt.Component.processFocusEvent(Component.java:6524)
at java.desktop/java.awt.Component.processFocusEvent(Component.java:6524)
at java.desktop/java.awt.Component.processEvent(Component.java:6388)
at java.desktop/java.awt.Container.processEvent(Container.java:2263)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:5008)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
at java.desktop/java.awt.KeyboardFocusManager.redispatchEvent(KeyboardFocusManager.java:1950)
at java.desktop/java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(DefaultKeyboardFocusManager.java:1060)
at java.desktop/java.awt.DefaultKeyboardFocusManager.dispatchEvent(DefaultKeyboardFocusManager.java:726)
at java.desktop/java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.desktop/java.awt.Container.dispatchEventImpl(Container.java:2321)
at java.desktop/java.awt.Component.dispatchEvent(Component.java:4840)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:772)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:95)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:745)
at java.desktop/java.awt.EventQueue$5.run(EventQueue.java:743)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Estimate download speed somehow and figure out an ETA if it's taking too long.
When sorting a list of cards using the mana cost column, make it be consistent by color (for example, single-color cards should be listed in WUBRG order).
So as to not blow up the file system size for images for every card, add a setting to only keep a certain number of cards and delete the oldest/least-frequently-used/etc. image when a new one is downloaded and the assigned limit is exceeded. Unlimited is also allowed.
Sometimes the card tables' row sorter will throw a warning:
WARNING: row index is bigger than sorter's row count. Most likely this is a wrong sorter usage.
Add some indication in the card image panel that there are multiple faces to a card.
Because of the EclipseLink static weaving plugin, Eclipse messes around with final variables in ways that aren't compliant with Java and are being enforced with Java 9 (see https://stackoverflow.com/questions/46376045/eclipselink-static-weaving-with-final-fields-on-java-9). For now, source and .class compliance with Java 1.8 (Java 8) are being used with the compiler so that it is not enforced.
Hi,
After resolving encoding errors I still have some errors during maven compilation. It's mostly errors about types :
[ERROR] .../deck-editor/MTG Deck Editor/src/editor/database/characteristics/ManaType.java:[111,64] array required, but java.util.List<editor.database.characteristics.ManaType> found
Do you have them ?
Do you think I miss some step during the initialization of the project ?
I found a way to correct them http://stackoverflow.com/questions/20067956/array-required-but-arrayliststring-found but I would like to make sure I don't miss something before begin : there is almost 100 errors of this type.
Thanks!
Change NumberFilter
so that it works with any Comparable
, since all it does is test for equality or inequality, which can be done using compareTo
. This should make it more compatible with CombatState
and Loyalty
.
Because of type erasure, it may then be necessary to make NumberFilter
a subclass of this.
MTGJSON may not update the multiverseid
field for cards, but the uuid
field seems to always exist. Try several methods of identifying a card:
uuid
multiverseid
This may cause items that aren't real cards, like tokens to appear in the inventory. This can be solved by removing non-card layouts and skipping items that aren't cards (or adding them and giving them a flag saying they aren't real cards).
With the recent changes to split card CMC rules, all cards should now only have one CMC and not a list.
cmc()
so it returns int
instead of List<Integer>
minCmc()
, as there is only one CMC nowcmc()
so they don't refer to a listSearch for uses of Expansion
's fields and delete unused ones.
Fields to delete:
magicCardsInfoCode
(magiccards.info no longer exists)oldCode
Fields to add:
baseSetSize
vs. totalSetSize
type
isOnlineOnly
Now that the code uses Java's object serialization to store categories to disk, having a unique string "code" for them is probably unnecessary and using one of the existing enums is better.
An earlier restructure changed Card
s to be stored in the inventory by Gatherer number rather than ID generated from mtgjson.com (not its ID field; this was generated from the card's name, expansion, and "image name"), making its id()
method obsolete.
id()
id()
with multiverseid()
hashCode()
Card images aren't downloading for some reason.
Hi,
I’m really curious about your app !
I tried to deploy it (mvn install
, then mvn deploy
), but I had some encoding issues during deployment.
...
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
…
[ERROR] /.../deck-editor/MTG Deck Editor/src/editor/gui/CardTagPanel.java:[117,67] unmappable character for encoding UTF-8
…
I guess you’re using Windows OS, I tried on ubuntu with several encoding (UTF-8, ASCII, windows-1252…) but I doesn’t work.
I think that add encoding in pom.xml
file could resolve the problem but I can’t find witch encoding… If by any chance you’ve got an idea about this issue.
Celia
NumberFilter
to work on all Comparable
s (this may require making NumberFilter
a subclass of this new class, like how VariableNumberFilter
is a subclass of NumberFilter
)TextFilter
s. For example \cardtype
, [cardtype]
, or ${cardtype}
would match any card type, and so on for other attributesIntelliJ IDEA added spaces to parameter descriptions so they're all aligned. They should be removed.
Add tokens that can be input that match a specific set of words for TextFilter
s. For example:
Add more to this list as ideas appear.
Possibilities for delimiters:
multiverseid
TextCardListFormat
can't differentiate between lines ending in dates and lines ending in numbers.The only logical difference between FilterAttribute
and CardAttribute
is what they are used for.
database.characteristics
package should be renamed to database.attributes
.The Optional
class is better than allowing null
values, as it makes it explicit when a value can be missing. Also, it may reduce code because you can use x.ifPresent(x -> code)
rather than if (x == null) { code }
. There's also ifPresentOrElse
for when stuff should be done when the object is null
.
Places where this could be useful:
MainFrame.selectedFrame
MainFrame.selectedCard
selectedCards.get(0)
)MainFrame.selectedTable
MainFrame.selectedList
EditorFrame.getSelectedExtraName
and friendsEditorFrame.createCategory
CardMenuItems
supplier of list name to modifyCardList
and subclasses that can return null
null
)InventoryLoadDialog
(card.has("x") ? card.get("x").getAsString() : ""
-> Optional.ofNullable(card.get("x")).map(x -> x.getAsString).orElse("")
) (there is a ParseException
that needs to be properly handled)SingleCard
Optional
with defaults for missing values rather than have the defaults be determined by InventoryLoadDialog
Deck
that can return null
, on a case-by-case basisAn IndexOutOfBoundsException
for attempting to access index 0 of a list of size 0 occurs when the "New Hand" button is pressed on the sample hand tab.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.