本文整理汇总了Java中com.jme3.util.JmeFormatter类的典型用法代码示例。如果您正苦于以下问题:Java JmeFormatter类的具体用法?Java JmeFormatter怎么用?Java JmeFormatter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JmeFormatter类属于com.jme3.util包,在下文中一共展示了JmeFormatter类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import com.jme3.util.JmeFormatter; //导入依赖的package包/类
public static void main(String[] args){
JmeFormatter formatter = new JmeFormatter();
Handler consoleHandler = new ConsoleHandler();
consoleHandler.setFormatter(formatter);
Logger.getLogger("").removeHandler(Logger.getLogger("").getHandlers()[0]);
Logger.getLogger("").addHandler(consoleHandler);
SwingUtilities.invokeLater(new Runnable(){
public void run(){
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
createFrame();
createCanvas(appClass);
frame.getContentPane().add(canvas);
frame.pack();
startApp();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
});
}
示例2: initialize
import com.jme3.util.JmeFormatter; //导入依赖的package包/类
public void initialize(AppSettings settings) {
if (initialized) {
return;
}
initialized = true;
try {
JmeFormatter formatter = new JmeFormatter();
// Handler consoleHandler = new AndroidLogHandler();
// consoleHandler.setFormatter(formatter);
} catch (SecurityException ex) {
logger.log(Level.SEVERE, "Security error in creating log file", ex);
}
logger.log(Level.INFO, "Running on {0}", getFullName());
}
示例3: initialize
import com.jme3.util.JmeFormatter; //导入依赖的package包/类
public static void initialize(AppSettings settings) {
if (initialized) {
return;
}
initialized = true;
try {
JmeFormatter formatter = new JmeFormatter();
Handler consoleHandler = new AndroidLogHandler();
consoleHandler.setFormatter(formatter);
} catch (SecurityException ex) {
logger.log(Level.SEVERE, "Security error in creating log file", ex);
}
logger.log(Level.INFO, "Running on {0}", getFullName());
}
示例4: start
import com.jme3.util.JmeFormatter; //导入依赖的package包/类
public void start() {
JmeFormatter formatter = new JmeFormatter();
Handler consoleHandler = new ConsoleHandler();
consoleHandler.setFormatter(formatter);
Logger.getLogger("").removeHandler(
Logger.getLogger("").getHandlers()[0]);
Logger.getLogger("").addHandler(consoleHandler);
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception e) {
e.printStackTrace();
}
createCanvas();
try {
Thread.sleep(500);
} catch (InterruptedException ex) {
}
SwingUtilities.invokeLater(new Runnable() {
public void run() {
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
createFrame();
canvasPanel.add(canvas, BorderLayout.CENTER);
frame.pack();
startApp();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
});
}
示例5: main
import com.jme3.util.JmeFormatter; //导入依赖的package包/类
public static void main(String[] args){
JmeFormatter formatter = new JmeFormatter();
Handler consoleHandler = new ConsoleHandler();
consoleHandler.setFormatter(formatter);
Logger.getLogger("").removeHandler(Logger.getLogger("").getHandlers()[0]);
Logger.getLogger("").addHandler(consoleHandler);
createCanvas(appClass);
try {
Thread.sleep(500);
} catch (InterruptedException ex) {
}
SwingUtilities.invokeLater(new Runnable(){
public void run(){
JPopupMenu.setDefaultLightWeightPopupEnabled(false);
createFrame();
currentPanel.add(canvas, BorderLayout.CENTER);
frame.pack();
startApp();
frame.setLocationRelativeTo(null);
frame.setVisible(true);
}
});
}
示例6: main
import com.jme3.util.JmeFormatter; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public static void main(String[] args) {
//load save
File root = new File("./saves/");
JFileChooser chooser = new JFileChooser(root);
chooser.addChoosableFileFilter(new FileNameExtensionFilter(null, "save"));
chooser.setFileFilter(new FileNameExtensionFilter(null, "save"));
int result = chooser.showOpenDialog(null);
if (result == JFileChooser.APPROVE_OPTION) {
try (ObjectInputStream in = new ObjectInputStream(new BufferedInputStream(new FileInputStream(chooser.getSelectedFile())))) {
loadedStep = (Class<? extends AbstractTerrainStep>) in.readObject();
loadedProperties = (Map<Object, Object>) in.readObject();
} catch (Exception ex) {
LOG.log(Level.SEVERE, "unable to load save file", ex);
}
}
Logger rootLogger = Logger.getLogger("");
for (Handler h : rootLogger.getHandlers()) {
if (h instanceof ConsoleHandler) {
((ConsoleHandler) h).setFormatter(new JmeFormatter());
}
}
//create app
TerrainHeighmapCreator app = new TerrainHeighmapCreator();
app.getStateManager().detach(app.getStateManager().getState(FlyCamAppState.class));
AppSettings settings = new AppSettings(true);
settings.setUseJoysticks(true);
settings.setResolution(1280, 800);
settings.setVSync(true);
if (RECORDING_TIMER) {
settings.setFrameRate(30);
}
app.setSettings(settings);
app.setShowSettings(true);
if (RECORDING_TIMER) {
app.setTimer(new VideoRecorderAppState.IsoTimer(30));
}
app.start();
}