Exceptions.printStackTrace(ex);
}
}
- logger.log(Level.INFO, "Read AssetData properties for {0}", file);
+ logger.log(Level.FINE, "Read AssetData properties for {0}", file);
}
}
});
props.store(out, "");
out.flush();
lastLoaded = myFile.lastModified();
- logger.log(Level.INFO, "Written AssetData properties for {0}", file);
+ logger.log(Level.FINE, "Written AssetData properties for {0}", file);
} catch (IOException e) {
Exceptions.printStackTrace(e);
} finally {
*/
public class AssetsLookupProvider implements LookupProvider {
+ private static final Logger logger = Logger.getLogger(AssetsLookupProvider.class.getName());
private Project project;
public static final String[] keyList = new String[]{
"assets.jar.name",
in.close();
String assetsFolderName = properties.getProperty("assets.folder.name", "assets");
if (prj.getProjectDirectory().getFileObject(assetsFolderName) != null) {
- Logger.getLogger(AssetsLookupProvider.class.getName()).log(Level.INFO, "Valid jMP project, extending with ProjectAssetManager");
+ logger.log(Level.FINE, "Valid jMP project, extending with ProjectAssetManager");
return Lookups.fixed(new ProjectAssetManager(prj, assetsFolderName), openedHook);
}
} catch (Exception ex) {
return Lookups.fixed();
}
private ProjectOpenedHook openedHook = new ProjectOpenedHook() {
-
@Override
protected void projectClosed() {
}
//old properties files
FileObject oldProperties = projDir.getFileObject("nbproject/assets.properties");
if (oldProperties != null) {
- Logger.getLogger(AssetsLookupProvider.class.getName()).log(Level.INFO, "Deleting old project assets.properties");
+ logger.log(Level.FINE, "Deleting old project assets.properties");
try {
props.load(oldProperties.getInputStream());
store(props, project);
final InputStream is = projPropsFO.getInputStream();
// final InputStream pis = privPropsFO.getInputStream();
ProjectManager.mutex().writeAccess(new Mutex.ExceptionAction<Void>() {
-
@Override
public Void run() throws Exception {
try {
this.project = new DummyProject(this, path);
}
String projectRootPath = project.getProjectDirectory().getPath();
- logger.log(Level.INFO, "Add locator: {0}", projectRootPath);
+ logger.log(Level.FINE, "Add locator: {0}", projectRootPath);
registerLocator(projectRootPath, com.jme3.gde.core.assets.RootLockingFileLocator.class);
for (AssetManagerConfigurator di : Lookup.getDefault().lookupAll(AssetManagerConfigurator.class)) {
di.prepareManager(this);
if (jarItems.isEmpty() && classPathItems.isEmpty()) {
return;
}
- logger.log(Level.INFO, "Clear {0} classpath entries and {1} url locators for project {2}", new Object[]{classPathItems.size(), jarItems.size(), project.toString()});
+ logger.log(Level.FINE, "Clear {0} classpath entries and {1} url locators for project {2}", new Object[]{classPathItems.size(), jarItems.size(), project.toString()});
for (FileObject fileObject : jarItems) {
logger.log(Level.FINE, "Remove locator:{0}", fileObject.toURL());
unregisterLocator(fileObject.toURL().toExternalForm(),
}
loader = new URLClassLoader(urls.toArray(new URL[urls.size()]), getClass().getClassLoader());
addClassLoader(loader);
- logger.log(Level.INFO, "Updated {0} classpath entries and {1} url locators for project {2}", new Object[]{classPathItems.size(), jarItems.size(), project.toString()});
+ logger.log(Level.FINE, "Updated {0} classpath entries and {1} url locators for project {2}", new Object[]{classPathItems.size(), jarItems.size(), project.toString()});
}
}
FileChangeListener listener = new FileChangeListener() {
*/
public void addFolderLocator(String relativePath) {
String string = project.getProjectDirectory().getPath() + "/" + relativePath + "/";
- logger.log(Level.INFO, "Add locator:{0}", string);
+ logger.log(Level.FINE, "Add locator:{0}", string);
registerLocator(string,
"com.jme3.asset.plugins.FileLocator");
folderNames.add(relativePath);
geomName = "null";
}
geom.setUserData("ORIGINAL_NAME", geomName);
- logger.log(Level.INFO, "Set ORIGINAL_NAME for {0}", geomName);
+ logger.log(Level.FINE, "Set ORIGINAL_NAME for {0}", geomName);
while (curSpat != null) {
String name = curSpat.getName();
if (name == null) {
}
geomMap.add(id);
geom.setUserData("ORIGINAL_PATH", id);
- logger.log(Level.INFO, "Set ORIGINAL_PATH for {0}", id);
+ logger.log(Level.FINE, "Set ORIGINAL_PATH for {0}", id);
super.visit(geom);
}
});
@SuppressWarnings("unchecked")
public final class FilterExplorerTopComponent extends TopComponent implements ExplorerManager.Provider {
+ private static final Logger logger = Logger.getLogger(FilterExplorerTopComponent.class.getName());
private static FilterExplorerTopComponent instance;
private static final String PREFERRED_ID = "FilterExplorerTopComponent";
private transient ExplorerManager explorerManager = new ExplorerManager();
}
- /** This method is called from within the constructor to
- * initialize the form.
- * WARNING: Do NOT modify this code. The content of this method is
- * always regenerated by the Form Editor.
+ /**
+ * This method is called from within the constructor to initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is always
+ * regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
public HelpCtx getHelpCtx() {
return new HelpCtx("sdk.filters");
}
-
+
public void loadFile(FilterDataObject object) {
currentFile = object;
node = object.getLookup().lookup(FilterPostProcessorNode.class);
clearFilters();
if (filterEnabled && fpp != null) {
SceneApplication.getApplication().enqueue(new Callable() {
-
public Object call() throws Exception {
SceneApplication.getApplication().getViewPort().addProcessor(fpp);
- Logger.getLogger(FilterExplorerTopComponent.class.getName()).log(Level.INFO, "Enabled post filters");
+ logger.log(Level.FINE, "Enabled post filters");
return null;
}
});
private synchronized void clearFilters() {
SceneApplication.getApplication().enqueue(new Callable() {
-
public Object call() throws Exception {
for (Iterator<SceneProcessor> it = SceneApplication.getApplication().getViewPort().getProcessors().iterator(); it.hasNext();) {
SceneProcessor proc = it.next();
it.remove();
proc.cleanup();
}
- Logger.getLogger(FilterExplorerTopComponent.class.getName()).log(Level.INFO, "Disabled post filters");
+ logger.log(Level.FINE, "Disabled post filters");
}
return null;
}
}
/**
- * Gets default instance. Do not use directly: reserved for *.settings files only,
- * i.e. deserialization routines; otherwise you could get a non-deserialized instance.
- * To obtain the singleton instance, use {@link #findInstance}.
+ * Gets default instance. Do not use directly: reserved for *.settings files
+ * only, i.e. deserialization routines; otherwise you could get a
+ * non-deserialized instance. To obtain the singleton instance, use
+ * {@link #findInstance}.
*/
public static synchronized FilterExplorerTopComponent getDefault() {
if (instance == null) {
}
/**
- * Obtain the SceneExplorerTopComponent instance. Never call {@link #getDefault} directly!
+ * Obtain the SceneExplorerTopComponent instance. Never call
+ * {@link #getDefault} directly!
*/
public static synchronized FilterExplorerTopComponent findInstance() {
TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID);
* @author normenhansen
*/
public class ProjectExtensionManager {
+
private static final Logger logger = Logger.getLogger(ProjectExtensionManager.class.getName());
private String extensionName;
private String extensionVersion;
* @param proj
*/
public void checkExtension(Project proj) {
- Logger.getLogger(ProjectExtensionManager.class.getName()).log(Level.INFO, "Checking extension..");
+ logger.log(Level.FINE, "Checking extension..");
if (!(proj instanceof J2SEProject)) {
- Logger.getLogger(ProjectExtensionManager.class.getName()).log(Level.WARNING, "Trying to load Assets Properties from non-asset project");
+ logger.log(Level.WARNING, "Trying to load Assets Properties from non-asset project");
return;
}
FileObject projDir = proj.getProjectDirectory();
final FileObject buildXmlFO = J2SEProjectUtil.getBuildXml((J2SEProject) proj);
if (buildXmlFO == null) {
- Logger.getLogger(ProjectExtensionManager.class.getName()).log(Level.WARNING, "The project build script does not exist, the project cannot be extended by jMP.");
+ logger.log(Level.WARNING, "The project build script does not exist, the project cannot be extended by jMP.");
return;
}
FileObject assetsBuildFile = getImplFile(projDir, true);
if (extender != null) {
assert assetsBuildFile != null;
if (extender.getExtension(extensionName) == null) {
- Logger.getLogger(ProjectExtensionManager.class.getName()).log(Level.INFO, "Creating extension {0}", extensionName);
+ logger.log(Level.FINE, "Creating extension {0}", extensionName);
AntBuildExtender.Extension ext = extender.addExtension(extensionName, assetsBuildFile);
if (extensionDependencies != null) {
for (int i = 0; i < extensionDependencies.length; i += 2) {
}
}
} else {
- Logger.getLogger(ProjectExtensionManager.class.getName()).log(Level.WARNING, "Trying to include assets build snippet in project type that doesn't support AntBuildExtender API contract.");
+ logger.log(Level.WARNING, "Trying to include assets build snippet in project type that doesn't support AntBuildExtender API contract.");
}
}
*/
public void removeExtension(Project proj) {
if (!(proj instanceof J2SEProject)) {
- Logger.getLogger(ProjectExtensionManager.class.getName()).log(Level.WARNING, "Trying to load Assets Properties from non-asset project");
+ logger.log(Level.WARNING, "Trying to load Assets Properties from non-asset project");
return;
}
FileObject projDir = proj.getProjectDirectory();
final FileObject buildXmlFO = J2SEProjectUtil.getBuildXml((J2SEProject) proj);
if (buildXmlFO == null) {
- Logger.getLogger(ProjectExtensionManager.class.getName()).log(Level.WARNING, "The project build script does not exist, the project cannot be extended by jMP.");
+ logger.log(Level.WARNING, "The project build script does not exist, the project cannot be extended by jMP.");
return;
}
AntBuildExtender extender = proj.getLookup().lookup(AntBuildExtender.class);
if (extender != null) {
if (extender.getExtension(extensionName) != null) {
- Logger.getLogger(ProjectExtensionManager.class.getName()).log(Level.INFO, "Removing extension {0}", extensionName);
+ logger.log(Level.FINE, "Removing extension {0}", extensionName);
extender.removeExtension(extensionName);
try {
FileObject assetsBuildFile = getImplFile(projDir, false);
if (assetsBuildFile != null) {
- Logger.getLogger(ProjectExtensionManager.class.getName()).log(Level.INFO, "Deleting {0}", assetsBuildFile.getNameExt());
+ logger.log(Level.FINE, "Deleting {0}", assetsBuildFile.getNameExt());
assetsBuildFile.delete();
}
- Logger.getLogger(ProjectExtensionManager.class.getName()).log(Level.INFO, "Saving project {0}", proj.getProjectDirectory().getName());
+ logger.log(Level.FINE, "Saving project {0}", proj.getProjectDirectory().getName());
// ProjectManager.getDefault().saveProject(proj);
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
}
}
} else {
- Logger.getLogger(ProjectExtensionManager.class.getName()).log(Level.WARNING, "Trying to include assets build snippet in project type that doesn't support AntBuildExtender API contract.");
+ logger.log(Level.WARNING, "Trying to include assets build snippet in project type that doesn't support AntBuildExtender API contract.");
}
}
private FileObject getImplFile(FileObject projDir, boolean create) {
FileObject assetsImpl = projDir.getFileObject("nbproject/" + extensionName + "-impl.xml");
if (assetsImpl == null) {
- Logger.getLogger(ProjectExtensionManager.class.getName()).log(Level.INFO, "No extension file {0}-impl.xml found", extensionName);
+ logger.log(Level.FINE, "No extension file {0}-impl.xml found", extensionName);
if (create) {
- Logger.getLogger(ProjectExtensionManager.class.getName()).log(Level.INFO, "Creating extension file {0}-impl.xml", extensionName);
+ logger.log(Level.FINE, "Creating extension file {0}-impl.xml", extensionName);
assetsImpl = createImplFile(projDir);
}
} else {
- Logger.getLogger(ProjectExtensionManager.class.getName()).log(Level.INFO, "Found extension file {0}-impl.xml", extensionName);
+ logger.log(Level.FINE, "Found extension file {0}-impl.xml", extensionName);
try {
if (create && !assetsImpl.asLines().get(1).startsWith("<!--" + extensionName + "-impl.xml " + extensionVersion + "-->")) {
- Logger.getLogger(ProjectExtensionManager.class.getName()).log(Level.INFO, "Updating extension file {0}-impl.xml", extensionName);
+ logger.log(Level.FINE, "Updating extension file {0}-impl.xml", extensionName);
assetsImpl.delete();
- Logger.getLogger(ProjectExtensionManager.class.getName()).log(Level.INFO, "Deleted extension file {0}-impl.xml", extensionName);
+ logger.log(Level.FINE, "Deleted extension file {0}-impl.xml", extensionName);
assetsImpl = createImplFile(projDir);
- Logger.getLogger(ProjectExtensionManager.class.getName()).log(Level.INFO, "Recreated extension file {0}-impl.xml", extensionName);
+ logger.log(Level.FINE, "Recreated extension file {0}-impl.xml", extensionName);
}
} catch (Exception ex) {
Exceptions.printStackTrace(ex);
//XXX: deleting old (beta) files here
FileObject fo = projectRoot.getFileObject(entry.getName());
if (fo != null && entry.getSize() != -1 && entry.getSize() == fo.getSize()) {
- logger.log(Level.INFO, "Deleting old folder {0}", fo.getNameExt());
+ logger.log(Level.FINE, "Deleting old folder {0}", fo.getNameExt());
fo.delete();
}
FileUtil.createFolder(projectRoot, fileName);
//XXX: deleting old (beta) files here
FileObject fo = projectRoot.getFileObject(entry.getName());
if (fo != null && !fo.equals(projectRoot)) {
- logger.log(Level.INFO, "Deleting old file {0}", fo.getNameExt());
+ logger.log(Level.FINE, "Deleting old file {0}", fo.getNameExt());
fo.delete();
}
fo = projectRoot.getFileObject(fileName);
fo = FileUtil.createData(projectRoot, fileName);
writeFile(str, fo);
} else {
- logger.log(Level.INFO, "Not overwriting existing file {0}", fo.getNameExt());
+ logger.log(Level.FINE, "Not overwriting existing file {0}", fo.getNameExt());
}
}
}
//XXX: deleting old (beta) files here
FileObject old = projectRoot.getFileObject(entry.getName());
if (old != null && !old.equals(projectRoot)) {
- logger.log(Level.INFO, "Deleting old file {0}", old.getNameExt());
+ logger.log(Level.FINE, "Deleting old file {0}", old.getNameExt());
if (entry.getSize() != -1 && entry.getSize() == old.getSize()) {
old.delete();
}
FileObject obj = projectRoot.getFileObject(fileName);
if (obj != null && !obj.equals(projectRoot) && !obj.isFolder()) {
if (entry.getSize() != -1 && entry.getSize() == obj.getSize()) {
- logger.log(Level.INFO, "Deleting file {0}", obj.getNameExt());
+ logger.log(Level.FINE, "Deleting file {0}", obj.getNameExt());
obj.delete();
} else {
kept = true;
- logger.log(Level.INFO, "Keeping file {0}", obj.getNameExt());
+ logger.log(Level.FINE, "Keeping file {0}", obj.getNameExt());
}
}
}
private void writeFile(ZipInputStream str, FileObject fo) throws IOException {
OutputStream out = fo.getOutputStream();
try {
- logger.log(Level.INFO, "Creating file " + fo.getNameExt());
+ logger.log(Level.FINE, "Creating file " + fo.getNameExt());
FileUtil.copy(str, out);
} finally {
out.close();
*/
package com.jme3.gde.core.scene;
+import com.jme3.gde.core.icons.IconList;
import com.jme3.gde.core.util.notify.MessageType;
import com.jme3.gde.core.util.notify.NotifyUtil;
import com.jme3.util.JmeFormatter;
import java.util.logging.Handler;
import java.util.logging.Level;
import java.util.logging.LogRecord;
+import java.util.logging.Logger;
+import javax.swing.AbstractAction;
+import javax.swing.Action;
import javax.swing.JButton;
import org.openide.windows.IOProvider;
import org.openide.windows.InputOutput;
*/
public class ApplicationLogHandler extends Handler implements Callable<JButton> {
+ private static final Logger logger = Logger.getLogger(ApplicationLogHandler.class.getName());
+
public static class LogLevel extends Level {
/**
- * Log level of 801 (one above "INFO") - used to display messages
- * to the user via the little "monkey bubble" bottom right.
+ * Log level of 801 (one above "INFO") - used to display messages to the
+ * user via the little "monkey bubble" bottom right.
*/
public static final Level USERINFO = new LogLevel("User Info", 801, "User Info Log Level");
+
public LogLevel(String name, int level, String string) {
super(name, level, string);
}
}
- InputOutput io = IOProvider.getDefault().getIO("Application", true);
+ InputOutput io;
JmeFormatter formatter = new JmeFormatter();
ActionListener listener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
io.select();
}
};
+ Action levelFine = new AbstractAction() {
+ public void actionPerformed(ActionEvent e) {
+ Logger.getLogger("com.jme3").setLevel(Level.FINE);
+ NotifyUtil.info("Changed logging level", "Changed logging level to FINE");
+ }
+ };
+ Action levelInfo = new AbstractAction() {
+ public void actionPerformed(ActionEvent e) {
+ Logger.getLogger("com.jme3").setLevel(Level.INFO);
+ NotifyUtil.info("Changed logging level", "Changed logging level to INFO");
+ }
+ };
+ Action levelWarning = new AbstractAction() {
+ public void actionPerformed(ActionEvent e) {
+ Logger.getLogger("com.jme3").setLevel(Level.WARNING);
+ NotifyUtil.info("Changed logging level", "Changed logging level to WARNING");
+ }
+ };
public ApplicationLogHandler() {
+ levelFine.putValue(Action.SMALL_ICON, IconList.chimpConfused);
+ levelInfo.putValue(Action.SMALL_ICON, IconList.chimpSmile);
+ levelWarning.putValue(Action.SMALL_ICON, IconList.chimpNogood);
+ levelFine.putValue(Action.NAME, "Fine");
+ levelInfo.putValue(Action.NAME, "Normal");
+ levelWarning.putValue(Action.NAME, "Warning");
+ levelFine.putValue(Action.SHORT_DESCRIPTION, "Set Fine Logging Level");
+ levelInfo.putValue(Action.SHORT_DESCRIPTION, "Set Normal Logging Level");
+ levelWarning.putValue(Action.SHORT_DESCRIPTION, "Set Warning Logging Level");
+ io = IOProvider.getDefault().getIO("Application", new Action[]{levelFine, levelInfo, levelWarning});
io.setErrSeparated(true);
}
*/
public class OffScenePanel extends javax.swing.JPanel implements SceneProcessor {
+ private static final Logger logger = Logger.getLogger(OffScenePanel.class.getName());
private int width = 640, height = 480;
private ByteBuffer cpuBuf;
// private byte[] cpuArray;
this(640, 480);
}
- /** Creates new form ScenePanel */
+ /**
+ * Creates new form ScenePanel
+ */
public OffScenePanel(int width, int height) {
this.width = width;
this.height = height;
public void resizeGLView(final int x, final int y) {
SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
public Object call() throws Exception {
width = x;
height = y;
}
});
java.awt.EventQueue.invokeLater(new Runnable() {
-
public void run() {
Dimension dim = new Dimension(x, y);
setPreferredSize(dim);
// }
// });
SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
public Object call() throws Exception {
setupOffView();
setupOffBuffer();
public void stopPreview() {
//TODO add your handling code here:
SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
public Object call() throws Exception {
SceneApplication.getApplication().getRenderManager().removePreView(viewPort);
return null;
}
});
- Logger.getLogger(OffScenePanel.class.getName()).log(Level.INFO, "Component hidden");
+ logger.log(Level.FINE, "Component hidden");
}
private void setupScene() {
light.setColor(ColorRGBA.White);
rootNode.addLight(light);
}
-
+
private void attachScene() {
// attach the scene to the viewport to be rendered
//setup framebuffer's cam
/**
* threadsafe attach to root node
+ *
* @param spat
*/
public void attach(final Spatial spat) {
SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
public Object call() throws Exception {
rootNode.attachChild(spat);
return null;
/**
* threadsafe detach from root node
+ *
* @param spat
*/
public void detach(final Spatial spat) {
SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
public Object call() throws Exception {
rootNode.detachChild(spat);
return null;
/**
* threadsafe detach from root node
+ *
* @param spat
*/
public void detachAll() {
SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
public Object call() throws Exception {
rootNode.detachAllChildren();
return null;
public void setCamFocus(final Vector3f focus) {
SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
public Object call() throws Exception {
doSetCamFocus(focus);
return null;
public void doSetCamFocus(final Vector3f focus_) {
SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
public Object call() throws Exception {
focus.set(focus_);
camera.setLocation(focus_.add(vector, camera.getLocation()));
*/
public void rotateCamera(final Vector3f axis, final float amount_) {
SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
public Object call() throws Exception {
float amount = amount_;
if (axis.equals(camera.getLeft())) {
public void panCamera(final float left, final float up) {
SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
public Object call() throws Exception {
camera.getLeft().mult(left, vector);
vector.scaleAdd(up, camera.getUp(), vector);
public void moveCamera(final float forward) {
SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
public Object call() throws Exception {
camera.getDirection().mult(forward, vector);
camera.setLocation(camera.getLocation().add(vector));
public void zoomCamera(final float amount_) {
SceneApplication.getApplication().enqueue(new Callable<Object>() {
-
public Object call() throws Exception {
float amount = amount_;
amount = camera.getLocation().distance(focus) * amount;
});
}
- /** This method is called from within the constructor to
- * initialize the form.
- * WARNING: Do NOT modify this code. The content of this method is
- * always regenerated by the Form Editor.
+ /**
+ * This method is called from within the constructor to initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is always
+ * regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
autostore = false)
public final class SceneExplorerTopComponent extends TopComponent implements ExplorerManager.Provider, SceneListener/*, LookupListener */ {
+ private static final Logger logger = Logger.getLogger(SceneExplorerTopComponent.class.getName());
private static SceneExplorerTopComponent instance;
- /** path to the icon used by the component and its open action */
private static final String PREFERRED_ID = "SceneExplorerTopComponent";
- private SceneRequest request;
// private final Result<AbstractSceneExplorerNode> nodeSelectionResult;
private AbstractSceneExplorerNode selectedSpatial;
private AbstractSceneExplorerNode lastSelected;
getActionMap().put(delete.getActionMapKey(), ExplorerUtils.actionDelete(explorerManager, true));
}
- /** This method is called from within the constructor to
- * initialize the form.
- * WARNING: Do NOT modify this code. The content of this method is
- * always regenerated by the Form Editor.
+ /**
+ * This method is called from within the constructor to initialize the form.
+ * WARNING: Do NOT modify this code. The content of this method is always
+ * regenerated by the Form Editor.
*/
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
// End of variables declaration//GEN-END:variables
/**
- * Gets default instance. Do not use directly: reserved for *.settings files only,
- * i.e. deserialization routines; otherwise you could get a non-deserialized instance.
- * To obtain the singleton instance, use {@link #findInstance}.
+ * Gets default instance. Do not use directly: reserved for *.settings files
+ * only, i.e. deserialization routines; otherwise you could get a
+ * non-deserialized instance. To obtain the singleton instance, use
+ * {@link #findInstance}.
*/
public static synchronized SceneExplorerTopComponent getDefault() {
if (instance == null) {
}
/**
- * Obtain the SceneExplorerTopComponent instance. Never call {@link #getDefault} directly!
+ * Obtain the SceneExplorerTopComponent instance. Never call
+ * {@link #getDefault} directly!
*/
public static synchronized SceneExplorerTopComponent findInstance() {
TopComponent win = WindowManager.getDefault().findTopComponent(PREFERRED_ID);
if (win == null) {
- Logger.getLogger(SceneExplorerTopComponent.class.getName()).warning(
+ logger.warning(
"Cannot find " + PREFERRED_ID + " component. It will not be located properly in the window system.");
return getDefault();
}
if (win instanceof SceneExplorerTopComponent) {
return (SceneExplorerTopComponent) win;
}
- Logger.getLogger(SceneExplorerTopComponent.class.getName()).warning(
+ logger.warning(
"There seem to be multiple components with the '" + PREFERRED_ID
+ "' ID. That is a potential source of errors and unexpected behavior.");
return getDefault();
// selectedSpatial = null;
// }
public void sceneOpened(SceneRequest request) {
- this.request = request;
final JmeNode node = request.getJmeNode();
for (Iterator it = materialChangeProviders.values().iterator(); it.hasNext();) {
MaterialChangeProvider provider = (MaterialChangeProvider) it.next();
provider.clearMaterialChangeListeners();
}
if (node != null) {
- explorerManager.setRootContext(node);
- explorerManager.getRootContext().setDisplayName(node.getName());
- setActivatedNodes(new Node[]{node});
- requestVisible();
+ explorerManager.setRootContext(node);
+ explorerManager.getRootContext().setDisplayName(node.getName());
+ setActivatedNodes(new Node[]{node});
+ requestVisible();
try {
explorerManager.setSelectedNodes(new Node[]{node});
} catch (PropertyVetoException ex) {
}
public void sceneClosed(SceneRequest request) {
- this.request = null;
explorerManager.setRootContext(Node.EMPTY);
}
}
public void addMaterialChangeProvider(MaterialChangeProvider provider) {
- Logger.getLogger(SceneExplorerTopComponent.class.getName()).log(Level.INFO, "New materail provider registered for: {0}", provider.getKey());
+ logger.log(Level.FINE, "New materail provider registered for: {0}", provider.getKey());
materialChangeProviders.put(provider.getKey(), provider);
List<MaterialChangeListener> listeners = materialChangeListeners.get(provider.getKey());
if (listeners == null) {
}
public void removeMaterialChangeProvider(MaterialChangeProvider provider) {
- Logger.getLogger(SceneExplorerTopComponent.class.getName()).log(Level.INFO, "Removing material provider for : {0}", provider.getKey());
+ logger.log(Level.FINE, "Removing material provider for : {0}", provider.getKey());
materialChangeProviders.remove(provider.getKey());
}
public void addMaterialChangeListener(MaterialChangeListener listener) {
if (listener.getKey() != null) {
- Logger.getLogger(SceneExplorerTopComponent.class.getName()).log(Level.INFO, "New material listener for : {0}", listener.getKey());
+ logger.log(Level.FINE, "New material listener for : {0}", listener.getKey());
List<MaterialChangeListener> listeners = materialChangeListeners.get(listener.getKey());
if (listeners == null) {
listeners = new ArrayList<MaterialChangeListener>();
}
public void removeMaterialChangeListener(MaterialChangeListener listener) {
- Logger.getLogger(SceneExplorerTopComponent.class.getName()).log(Level.INFO, "Removing material listener for: {0}", listener.getKey());
+ logger.log(Level.FINE, "Removing material listener for: {0}", listener.getKey());
List<MaterialChangeListener> listeners = materialChangeListeners.get(listener.getKey());
if (listeners == null) {
return;
}
public void swapMaterialChangeListener(MaterialChangeListener listener, String oldKey, String newKey) {
- Logger.getLogger(SceneExplorerTopComponent.class.getName()).log(Level.INFO, "Swaping material listeners : {0} -> {1}", new Object[]{oldKey, newKey});
+ logger.log(Level.FINE, "Swaping material listeners : {0} -> {1}", new Object[]{oldKey, newKey});
if (oldKey != null) {
List<MaterialChangeListener> listeners = materialChangeListeners.get(oldKey);
if (listeners != null) {
@org.openide.util.lookup.ServiceProvider(service = SceneExplorerNode.class)
public class JmeTerrainGrid extends JmeTerrainQuad implements TerrainGridListener {
+ private static final Logger logger = Logger.getLogger(JmeTerrainGrid.class.getName());
private static Image smallImage = IconList.terrain.getImage();
private TerrainGrid geom;
super(spatial, children);
getLookupContents().add(spatial);
this.geom = spatial;
- // setName(spatial.getName());
+ // setName(spatial.getName());
geom.addListener(this);
}
}
public void tileAttached(Vector3f vctrf, TerrainQuad tq) {
- Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Calling TerrainGrid update for node: {0}" + this);
+ logger.log(Level.FINE, "Calling TerrainGrid update for node: {0}" + this);
java.awt.EventQueue.invokeLater(new Runnable() {
-
public void run() {
refresh(false);
}
}
public void tileDetached(Vector3f vctrf, TerrainQuad tq) {
- Logger.getLogger(this.getClass().getName()).log(Level.INFO, "Calling TerrainGrid update for node: {0}" + this);
+ logger.log(Level.FINE, "Calling TerrainGrid update for node: {0}" + this);
java.awt.EventQueue.invokeLater(new Runnable() {
-
public void run() {
refresh(false);
}
*/
public class ZipExtensionTool {
+ private static final Logger logger = Logger.getLogger(ZipExtensionTool.class.getName());
static final ConcurrentHashMap<String, Boolean> installMap = new ConcurrentHashMap<String, Boolean>();
static final int BUFFER = 2048;
private final String settingsFolder = System.getProperty("netbeans.user");
String line;
while ((line = in.readLine()) != null) {
if (line.trim().length() > 0) {
- Logger.getLogger(this.getClass().getName()).log(Level.INFO, line);
+ logger.log(Level.FINE, line);
}
}
} catch (Exception e) {
* @param message
*/
public static Notification info(String title, String message) {
- return error(title, message, true);
+ return info(title, message, true);
}
/**