Package megamek.client.ui.util
Class ImageAtlasMap
java.lang.Object
megamek.client.ui.util.ImageAtlasMap
Class to encapsulate a map that maps old image paths to the subsequent location in an image atlas. This allows us to
 keep the old MekSets while still packaging the images into an atlas.
 
 There's a potential cross-platform path issue as the Java File class uses the current system's file
 system to do file comparisons. If we write windows-style path strings to a file and read that in with UNIX, it can
 cause comparisons to fail. Because of this, the internal map is stored with file paths represented as strings, but
 they are passed in as paths which then are explicitly converted to UNIX-style file paths.
- 
Constructor SummaryConstructorsConstructorDescriptionDefault constructor.ImageAtlasMap(ImageAtlasRecords imgFileToAtlasMap) Constructor that takes an existing map.
- 
Method SummaryModifier and TypeMethodDescriptionbooleancontainsKey(Path key) Return true if the atlas map contains the given path, which is converted to UNIX-style path strings.Return the value for the given key, which is converted to a UNIX-style path string.voidInsert new values into the atlas map, using Paths which get converted to UNIX-style path strings.static ImageAtlasMapRead the map from the image atlas map file.static ImageAtlasMapreadFromFile(File filePath) Read the map from the provided file that should be an ImageAtlasMapFile.voidWrite the map to the image atlas map file.voidwriteToFile(File pathToFile) Writes to a custom file for testing or custom paths.
- 
Constructor Details- 
ImageAtlasMappublic ImageAtlasMap()Default constructor.
- 
ImageAtlasMapConstructor that takes an existing map.
 
- 
- 
Method Details- 
putInsert new values into the atlas map, using Paths which get converted to UNIX-style path strings.- Parameters:
- originalFilePath- The file path on the file system during build.
- atlasFilePath- Which file it is in for the atlas.
 
- 
getReturn the value for the given key, which is converted to a UNIX-style path string.
- 
containsKeyReturn true if the atlas map contains the given path, which is converted to UNIX-style path strings.
- 
writeToFileWrites to a custom file for testing or custom paths.- Parameters:
- pathToFile- Path to write to. Primarily used for testing but can be utilized elsewhere
 
- 
writeToFilepublic void writeToFile()Write the map to the image atlas map file.
- 
readFromFileRead the map from the provided file that should be an ImageAtlasMapFile.- Parameters:
- filePath- File to read from. Primarily used for testing but can be utilized elsewhere
 
- 
readFromFileRead the map from the image atlas map file.
 
-