trackeditor: use String.format for hex numbers

git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@8622 30fe4595-0a0c-4342-8851-515496e4dcbd

Former-commit-id: 6407e146000d8ffd2f86123c215c87a6b92235f1
Former-commit-id: 211e5bc1dfa714d4dd5954e280401d255b9a06d5
This commit is contained in:
iobyte 2022-11-03 17:13:02 +00:00
parent 71ebf36c3f
commit c37f5a7776
3 changed files with 3 additions and 3 deletions

View file

@ -189,7 +189,7 @@ public class PropertyPanel extends JPanel
public String toHexString(int value)
{
if (value != Integer.MAX_VALUE)
return "0x" + Integer.toHexString(value).toUpperCase();
return String.format("0x%06X", value);
return null;
}

View file

@ -983,7 +983,7 @@ public class XmlWriter
{
if (value != Integer.MAX_VALUE)
{
section.addContent(attnumElement(attribute, units, "0x"+Integer.toHexString(value).toUpperCase()));
section.addContent(attnumElement(attribute, units, String.format("0x%06X", value)));
}
}

View file

@ -115,7 +115,7 @@ public final class TrackObject {
System.out.println(indent + "TrackObject");
System.out.println(indent + " name : " + name);
System.out.println(indent + " object : " + object);
System.out.println(indent + " color : 0x" + Integer.toHexString(color).toUpperCase());
System.out.println(indent + " color : " + String.format("0x%06X", color));
System.out.println(indent + " orientationType : " + orientationType);
System.out.println(indent + " borderDistance : " + borderDistance);
System.out.println(indent + " orientation : " + orientation);