Add translatable text names to the texture wrap mode enum

This commit is contained in:
Bill Kuker 2012-07-14 14:45:26 +00:00 committed by U-WINDOWS-C28163E\Administrator
parent 74783afe3f
commit 6a2ebb6851
3 changed files with 15 additions and 2 deletions

View File

@ -714,6 +714,10 @@ AppearanceCfg.lbl.texture.center = Center:
AppearanceCfg.lbl.texture.rotation = Rotation:
AppearanceCfg.lbl.texture.repeat = Repeat:
! Texture Wrap Modes
TextureWrap.Repeat = Repeat
TextureWrap.Mirror = Repeat & Mirror
TextureWrap.Clamp = Clamp Edge Pixels
! RocketConfig
RocketCfg.lbl.Designname = Design name:

View File

@ -2,6 +2,7 @@ package net.sf.openrocket.appearance;
import java.net.URL;
import net.sf.openrocket.startup.Application;
import net.sf.openrocket.util.Coordinate;
/**
@ -12,7 +13,15 @@ import net.sf.openrocket.util.Coordinate;
public class Decal {
public static enum EdgeMode {
REPEAT, MIRROR, CLAMP;
REPEAT("TextureWrap.Repeat"), MIRROR("TextureWrap.Mirror"), CLAMP("TextureWrap.Clamp");
private final String transName;
EdgeMode(final String name){
this.transName = name;
}
@Override
public String toString(){
return Application.getTranslator().get(transName);
}
}
private final Coordinate offset, center, scale;

View File

@ -352,7 +352,7 @@ public class AppearancePanel extends JPanel {
}
{ // Repeat
new JLabel(trans.get("AppearanceCfg.lbl.texture.rotation"));
add(new JLabel(trans.get("AppearanceCfg.lbl.texture.repeat")));
EdgeMode[] list = new EdgeMode[EdgeMode.values().length + 1];
System.arraycopy(EdgeMode.values(), 0, list, 1, EdgeMode.values().length);
JComboBox combo = new JComboBox(new EnumModel<EdgeMode>(ab, "EdgeMode", list));