Java 类org.newdawn.slick.font.effects.OutlineWobbleEffect 实例源码

项目:slick2d-maven    文件:Hiero.java   
public Hiero () throws SlickException {
    super("Hiero v2.0 - Bitmap Font Tool");
    Splash splash = new Splash(this, "splash.jpg", 2000);
    try {
        initialize();
    } catch (SlickException ex) {
        dispose();
        throw ex;
    }
    splash.close();
    setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
    addWindowListener(new WindowAdapter() {
        public void windowClosing(WindowEvent e) {
            // stop slick2d event loop; maybe slick2d should use awt timer for that:
            // http://www.pushing-pixels.org/2008/07/17/awt-shutdown-and-daemon-threads.html
            canvasContainer.setVisible(false);
            dispose();
        }
    });

    prefs = Preferences.userNodeForPackage(Hiero.class);
    java.awt.Color backgroundColor = EffectUtil.fromString(prefs.get("background", "000000"));
    backgroundColorLabel.setIcon(getColorIcon(backgroundColor));
    renderingBackgroundColor = new Color(backgroundColor.getRed(), backgroundColor.getGreen(), backgroundColor.getBlue());
    fontList.setSelectedValue(prefs.get("system.font", "Arial"), true);
    fontFileText.setText(prefs.get("font.file", ""));

    java.awt.Color foregroundColor = EffectUtil.fromString(prefs.get("foreground", "ffffff"));
    colorEffect = new ColorEffect();
    colorEffect.setColor(foregroundColor);
    effectsListModel.addElement(colorEffect);
    effectsListModel.addElement(new GradientEffect());
    effectsListModel.addElement(new OutlineEffect());
    effectsListModel.addElement(new OutlineWobbleEffect());
    effectsListModel.addElement(new OutlineZigzagEffect());
    effectsListModel.addElement(new ShadowEffect());
    new EffectPanel(colorEffect);

    setVisible(true);
    gamePanel.add(canvasContainer);
    gamePanel.setVisible(false);
    canvasContainer.start();
}