1 16 17 package com.buchuki.ensmer.builtin; 18 19 import com.buchuki.ensmer.EnsmerManager; 20 import com.buchuki.ensmer.input.InputManager; 21 import com.buchuki.ensmer.input.command.*; 22 import com.buchuki.ensmer.input.event.*; 23 import com.buchuki.ensmer.object.Backend; 24 import com.buchuki.ensmer.text.TextInput; 25 import com.sun.j3d.utils.geometry.Text2D; 26 import java.awt.Font ; 27 import java.awt.event.KeyEvent ; 28 import java.io.Serializable ; 29 import javax.media.j3d.*; 30 import javax.vecmath.Color3f; 31 32 39 public class Background extends Backend { 40 41 44 public Background() { 45 } 46 47 51 public Background(Serializable data) { 52 this(); 53 } 54 55 58 public void setId(Long id) { 59 super.setId(id); 60 if (getConfigProperty("filename") == null) { 61 setConfigProperty("filename", ""); 62 } 63 } 64 65 70 public Serializable getSerializable() { 71 return null; 72 } 73 74 77 public String getFilename() { 78 String filename = getConfigProperty("filename"); 79 return filename == null ? "" : filename; 80 } 81 82 90 @Override 91 public static BranchGroup getRepresentation() { 92 Text2D text = new Text2D("Background", new Color3f(.7f, .1f, .6f), "Times", 93 16, Font.BOLD); 94 Appearance app = text.getAppearance(); 95 PolygonAttributes poly = new PolygonAttributes(); 96 poly.setCullFace(poly.CULL_NONE); 97 app.setPolygonAttributes(poly); 98 BranchGroup ret = new BranchGroup(); 99 ret.addChild(text); 100 return ret; 101 } 102 } 103 | Popular Tags |