Search in sources :

Example 6 with Rom

use of com.github.jakz.romlib.data.game.Rom in project rom-manager by Jakz.

the class TextAttributeField method setValue.

void setValue(Game game) {
    deleteButton.setVisible(this.infoPanel.mode == Mode.EDIT && game.hasCustomAttribute(attrib));
    if (attrib == GameAttribute.PATH) {
        Handle handle = game.rom().handle();
        String handleValue = handle == null ? "" : handle.toString();
        value.setText(handleValue);
    } else if (attrib instanceof RomAttribute) {
        Rom rom = game.rom();
        value.setText(attrib.prettyValue(rom.getAttribute((RomAttribute) attrib)));
    } else
        value.setText(attrib.prettyValue(game.getAttribute(attrib)));
}
Also used : Rom(com.github.jakz.romlib.data.game.Rom) RomAttribute(com.github.jakz.romlib.data.game.attributes.RomAttribute) Handle(com.pixbits.lib.io.archive.handles.Handle)

Aggregations

Rom (com.github.jakz.romlib.data.game.Rom)6 Handle (com.pixbits.lib.io.archive.handles.Handle)3 Component (java.awt.Component)3 GameSet (com.github.jakz.romlib.data.set.GameSet)2 ArchiveHandle (com.pixbits.lib.io.archive.handles.ArchiveHandle)2 BinaryHandle (com.pixbits.lib.io.archive.handles.BinaryHandle)2 NestedArchiveHandle (com.pixbits.lib.io.archive.handles.NestedArchiveHandle)2 ColorGenerator (com.pixbits.lib.ui.color.ColorGenerator)2 PastelColorGenerator (com.pixbits.lib.ui.color.PastelColorGenerator)2 NimbusBooleanCellRenderer (com.pixbits.lib.ui.table.renderers.NimbusBooleanCellRenderer)2 Main (jack.rm.Main)2 GameSetManager (jack.rm.data.romset.GameSetManager)2 ScanResult (jack.rm.files.ScanResult)2 BorderLayout (java.awt.BorderLayout)2 Color (java.awt.Color)2 Frame (java.awt.Frame)2 ArrayList (java.util.ArrayList)2 Arrays (java.util.Arrays)2 Collections (java.util.Collections)2 HashMap (java.util.HashMap)2