PageRenderTime 55ms CodeModel.GetById 2ms app.highlight 47ms RepoModel.GetById 1ms app.codeStats 0ms

/examples/advanced/mtShell/MTShellScene.java

http://mt4j.googlecode.com/
Java | 583 lines | 341 code | 75 blank | 167 comment | 14 complexity | 04a5e63925bfb6abc8cf97e4c9b90476 MD5 | raw file
  1/***********************************************************************
  2 * mt4j Copyright (c) 2008 - 2010 Christopher Ruff, Fraunhofer-Gesellschaft All rights reserved.
  3 *  
  4 *   This program is free software: you can redistribute it and/or modify
  5 *   it under the terms of the GNU General Public License as published by
  6 *   the Free Software Foundation, either version 3 of the License, or
  7 *   (at your option) any later version.
  8 *
  9 *   This program is distributed in the hope that it will be useful,
 10 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 11 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 12 *   GNU General Public License for more details.
 13 *
 14 *   You should have received a copy of the GNU General Public License
 15 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 16 *
 17 ***********************************************************************/
 18package advanced.mtShell;
 19
 20import java.awt.event.KeyEvent;
 21
 22import org.mt4j.MTApplication;
 23import org.mt4j.components.TransformSpace;
 24import org.mt4j.components.visibleComponents.font.FontManager;
 25import org.mt4j.components.visibleComponents.font.IFont;
 26import org.mt4j.components.visibleComponents.shapes.MTPolygon;
 27import org.mt4j.components.visibleComponents.widgets.MTList;
 28import org.mt4j.components.visibleComponents.widgets.MTListCell;
 29import org.mt4j.components.visibleComponents.widgets.MTSceneMenu;
 30import org.mt4j.components.visibleComponents.widgets.MTSceneWindow;
 31import org.mt4j.components.visibleComponents.widgets.MTTextArea;
 32import org.mt4j.input.gestureAction.InertiaDragAction;
 33import org.mt4j.input.inputProcessors.IGestureEventListener;
 34import org.mt4j.input.inputProcessors.MTGestureEvent;
 35import org.mt4j.input.inputProcessors.componentProcessors.dragProcessor.DragProcessor;
 36import org.mt4j.input.inputProcessors.componentProcessors.tapProcessor.TapEvent;
 37import org.mt4j.input.inputProcessors.componentProcessors.tapProcessor.TapProcessor;
 38import org.mt4j.input.inputProcessors.globalProcessors.CursorTracer;
 39import org.mt4j.sceneManagement.AbstractScene;
 40import org.mt4j.sceneManagement.Iscene;
 41import org.mt4j.sceneManagement.transition.BlendTransition;
 42import org.mt4j.sceneManagement.transition.FadeTransition;
 43import org.mt4j.util.MTColor;
 44import org.mt4j.util.logging.ILogger;
 45import org.mt4j.util.logging.MTLoggerFactory;
 46import org.mt4j.util.math.Vector3D;
 47import org.mt4j.util.math.Vertex;
 48import org.mt4j.util.opengl.GLFBO;
 49
 50import processing.core.PApplet;
 51import processing.core.PImage;
 52import scenes.WaterSceneExportObf;
 53import sun.misc.GC;
 54import advanced.drawing.MainDrawingScene;
 55import advanced.flickrMT.FlickrScene;
 56import advanced.fluidSimulator.FluidSimulationScene;
 57import advanced.models3D.Models3DScene;
 58import advanced.modestMapsMT.MapsScene;
 59import advanced.physics.scenes.AirHockeyScene;
 60import advanced.physics.scenes.PhysicsScene;
 61import advanced.puzzle.PuzzleScene;
 62import advanced.space3D.Space3DScene;
 63import advanced.touchTail.TouchTailScene;
 64
 65/**
 66 * The Class MTShellScene. A scene which displays other scenes icons and loads them.
 67 * 
 68 * @author Christopher Ruff
 69 */
 70public class MTShellScene extends AbstractScene {
 71	/** The Constant logger. */
 72	private static final ILogger logger = MTLoggerFactory.getLogger(MTShellScene.class.getName());
 73	static{
 74//		logger.setLevel(ILogger.WARN);
 75//		logger.setLevel(ILogger.DEBUG);
 76		logger.setLevel(ILogger.INFO);
 77	}
 78	
 79	/** The app. */
 80	private MTApplication app;
 81	
 82	/** The has fbo. */
 83	private boolean hasFBO;
 84	
 85	/** The list. */
 86	private MTList list;
 87	
 88	/** The font. */
 89	private IFont font;
 90	
 91	/** The preferred icon height. */
 92	private int preferredIconHeight;
 93	
 94	/** The gap between icon and reflection. */
 95	private int gapBetweenIconAndReflection;
 96	
 97	/** The display height of reflection. */
 98	private float displayHeightOfReflection;
 99	
100	/** The list width. */
101	private float listWidth;
102	
103	/** The list height. */
104	private int listHeight;
105	
106	/** The preferred icon width. */
107	private int preferredIconWidth;
108	
109	/** The switch directly to scene. */
110	private boolean switchDirectlyToScene = false;
111
112	private boolean useBackgroundGradient = true;
113	
114	//TODO (dont allow throwing stuff out of the screen) or destroy it then
115	//TODO loading screen
116	
117	/**
118	 * Instantiates a new mT shell scene.
119	 * 
120	 * @param mtApplication the mt application
121	 * @param name the name
122	 */
123	public MTShellScene(MTApplication mtApplication, String name) {
124		super(mtApplication, name);
125		this.app = mtApplication;
126		this.hasFBO = GLFBO.isSupported(app);
127//		this.hasFBO = false; // TEST
128		//IF we have no FBO directly switch to scene and ignore setting
129		this.switchDirectlyToScene = !this.hasFBO || switchDirectlyToScene;
130		
131		this.registerGlobalInputProcessor(new CursorTracer(app, this));
132		
133//		this.setClearColor(new MTColor(230,230,230,255));
134//		this.setClearColor(new MTColor(30,30,30,255));
135		this.setClearColor(new MTColor(0,0,0,255));
136		
137		//BACKGROUND GRADIENT
138		if (this.useBackgroundGradient){
139			Vertex[] vertices = new Vertex[]{
140					new Vertex(0, 			app.height/3f,	0, 	0,0,0,255),
141					new Vertex(app.width, 	app.height/3,	0, 	0,0,0,255),
142					new Vertex(app.width, 	app.height/1.7f,0,	170,170,140,255),
143					new Vertex(0,			app.height/1.7f,0,	170,170,140,255),
144					new Vertex(0, 			app.height/3,	0,	0,0,0,255),
145			};
146			MTPolygon p = new MTPolygon(getMTApplication(), vertices);
147			p.setName("upper gradient");
148			p.setNoStroke(true);
149			p.generateAndUseDisplayLists();
150			p.setPickable(false);
151			this.getCanvas().addChild(p);
152			
153			Vertex[] vertices2 = new Vertex[]{
154					new Vertex(0, 			app.height/1.7f,	0, 	170,170,140,255),
155					new Vertex(app.width, 	app.height/1.7f,	0, 	170,170,140,255),
156					new Vertex(app.width, 	app.height,			0,	0,0,0,255),
157					new Vertex(0,			app.height,			0,	0,0,0,255),
158					new Vertex(0, 			app.height/1.7f,	0, 	170,170,140,255),
159			};
160			MTPolygon p2 = new MTPolygon(getMTApplication(), vertices2);
161			p2.setNoStroke(true);
162			p2.generateAndUseDisplayLists();
163			p2.setPickable(false);
164			this.getCanvas().addChild(p2);
165		}
166		//BACKGROUND
167		
168		preferredIconWidth = 256;
169		preferredIconHeight = 192;
170		gapBetweenIconAndReflection = 9;
171		displayHeightOfReflection = preferredIconHeight * 0.6f;
172		
173		//CREATE LIST
174		listWidth = preferredIconHeight + displayHeightOfReflection + gapBetweenIconAndReflection;
175//		listHeight = app.width - 50;
176		listHeight = app.width;
177		list = new MTList(mtApplication,0, 0, listWidth, listHeight, 40);
178		list.setFillColor(new MTColor(150,150,150,200));
179		list.setNoFill(true);
180		list.setNoStroke(true);
181		
182		/*
183		//List ends fade images //Background gradient has to be set to false!
184		PImage gradImage = app.loadImage(this.getPathToIcons() + "gradx3.png");
185		MTRectangle grad1 = new MTRectangle(gradImage, app);
186		grad1.setUseDirectGL(true);
187		grad1.setNoStroke(true);
188		grad1.setPickable(false);
189		list.addChild(grad1);
190		grad1.setFillColor(this.getClearColor());
191		
192		MTRectangle grad2 = new MTRectangle(0, listHeight-gradImage.height , gradImage.width, gradImage.height, app);
193		grad2.rotateZ(grad2.getCenterPointLocal(), 180, TransformSpace.LOCAL);
194		grad2.setTexture(gradImage);
195		grad2.setNoStroke(true);
196		grad2.setPickable(false);
197		list.addChild(grad2);
198		grad2.setFillColor(this.getClearColor());
199		 */
200		
201		font = FontManager.getInstance().createFont(app, "SansSerif", 18, MTColor.WHITE);
202		
203		this.addScene(new ICreateScene() {
204			public Iscene getNewScene() {
205				return new TouchTailScene(app, "Touch Tails");
206			}
207			public String getTitle() {
208				return "Touch Tails";
209			}
210		}, app.loadImage(this.getPathToIcons() + "touchtails_s.png"));
211		
212		this.addScene(new ICreateScene() {
213			public Iscene getNewScene() {
214				return new MapsScene(app, "Maps");
215			}
216			public String getTitle() {
217				return "Maps";
218			}
219		}, app.loadImage(this.getPathToIcons() + "maps_ss.png"));
220		
221		this.addScene(new ICreateScene() {
222			public Iscene getNewScene() {
223				return new AirHockeyScene(app, "Air Hockey");
224			}
225			public String getTitle() {
226				return "Air Hockey";
227			}
228		}, app.loadImage(this.getPathToIcons() + "airhockey_s.png"));
229		
230		this.addScene(new ICreateScene() {
231			public Iscene getNewScene() {
232				return new PuzzleScene(app, "Puzzle");
233			}
234			public String getTitle() {
235				return "Puzzle";
236			}
237		}, app.loadImage(this.getPathToIcons() + "puzz.png"));
238		
239		if (this.hasFBO){
240			this.addScene(new ICreateScene() {
241				public Iscene getNewScene() {
242					return new MainDrawingScene(app, "MT Paint");
243				}
244				public String getTitle() {
245					return "MT Paint";
246				}
247			}, app.loadImage(this.getPathToIcons() + "drawing_s.png"));
248		}
249		
250		this.addScene(new ICreateScene() {
251			public Iscene getNewScene() {
252				return new FlickrScene(app, "Flickr");
253			}
254			public String getTitle() {
255				return "Photo Search";
256			}
257		}, app.loadImage(this.getPathToIcons() + "flickr_s.png"));
258		
259		this.addScene(new ICreateScene() {
260			public Iscene getNewScene() {
261				return new WaterSceneExportObf(app, "Interactive Water"); 
262			}
263			public String getTitle() {
264				return "Interactive Water";
265			}
266		}, app.loadImage(this.getPathToIcons() + "water_s.png"));
267		
268		this.addScene(new ICreateScene() {
269			public Iscene getNewScene() {
270				return new FluidSimulationScene(app, "Fluid Particles");
271			}
272			public String getTitle() {
273				return "Fluid Particles";
274			}
275		}, app.loadImage(this.getPathToIcons() + "fluidparticles_s.png"));
276		
277		this.addScene(new ICreateScene() {
278			public Iscene getNewScene() {
279				return new Models3DScene(app, "3D Models");
280			}
281			public String getTitle() {
282				return "3D Models";
283			}
284		}, app.loadImage(this.getPathToIcons() + "teapot.jpg"));
285		
286		this.addScene(new ICreateScene() {
287			public Iscene getNewScene() {
288				return new PhysicsScene(app, "Physics Playground");
289			}
290			public String getTitle() {
291				return "Physics Playground";
292			}
293		}, app.loadImage(this.getPathToIcons() + "pyhsics_s.png"));
294		
295		this.addScene(new ICreateScene() {
296			public Iscene getNewScene() {
297				return new Space3DScene(app, "Earth 3D");
298			}
299			public String getTitle() {
300				return "Earth 3D";
301			}
302		}, app.loadImage(this.getPathToIcons() + "earth_s.png"));
303				
304		
305		getCanvas().addChild(list);
306		list.rotateZ(list.getCenterPointLocal(), -90, TransformSpace.LOCAL);
307//		list.setPositionGlobal(new Vector3D(app.width/2f, app.height - list.getHeightXY(TransformSpace.GLOBAL) - 1));
308		list.setPositionGlobal(new Vector3D(app.width/2f, app.height/2f));
309//		list.setAnchor(PositionAnchor.UPPER_LEFT);
310//		list.setPositionGlobal(new Vector3D(app.width/2f - list.getWidthXY(TransformSpace.GLOBAL)/2f, app.height - 20));
311		getCanvas().setFrustumCulling(true); 
312		
313		//Scene transition effect
314		if (this.hasFBO){
315			this.setTransition(new BlendTransition(app, 730));	
316		}else{
317			this.setTransition(new FadeTransition(app, 730));	
318		}
319	}
320	
321	
322	/**
323	 * Gets the path to icons.
324	 * 
325	 * @return the path to icons
326	 */
327	private String getPathToIcons(){
328//		return System.getProperty("user.dir")+File.separator+"examples"+File.separator+"advanced"+File.separator+"mtShell"+ File.separator +"data"+ File.separator+"images"+File.separator; 
329		//Load from classpath
330		return  "advanced" + MTApplication.separator + "mtShell" + MTApplication.separator + "data"+ MTApplication.separator + "images" + MTApplication.separator;
331	}
332	
333	
334	/**
335	 * Adds the tap processor.
336	 * 
337	 * @param cell the cell
338	 * @param createScene the create scene
339	 */
340	private void addTapProcessor(MTListCell cell, final ICreateScene createScene){
341		cell.registerInputProcessor(new TapProcessor(app, 15));
342		cell.addGestureListener(TapProcessor.class, new IGestureEventListener() {
343			public boolean processGestureEvent(MTGestureEvent ge) {
344				TapEvent te = (TapEvent)ge;
345				if (te.isTapped()){
346					//System.out.println("Clicked cell: " + te.getTargetComponent());
347					final Iscene scene = createScene.getNewScene();
348							
349					if (!switchDirectlyToScene){//We have FBO support -> show scene in a window first
350						
351						if (hasFBO && scene instanceof AbstractScene){
352							((AbstractScene) scene).setTransition(new BlendTransition(app, 300));	
353						}
354						
355						final MTSceneWindow sceneWindow = new MTSceneWindow(app, scene,100, 50);
356						sceneWindow.setFillColor(new MTColor(50,50,50,200));
357						sceneWindow.scaleGlobal(0.5f, 0.5f, 0.5f, sceneWindow.getCenterPointGlobal());
358						sceneWindow.addGestureListener(DragProcessor.class, new InertiaDragAction());
359						getCanvas().addChild(sceneWindow);
360					}else{
361						//No FBO available -> change to the new scene fullscreen directly
362						
363						float menuWidth = 64;
364						float menuHeight = 64;
365						MTSceneMenu sceneMenu = 
366						//new MTSceneMenu(this, app.width-menuWidth/2f, 0-menuHeight/2f, menuWidth, menuHeight, app);
367						new MTSceneMenu(app, scene, app.width-menuWidth, app.height-menuHeight, menuWidth, menuHeight);
368						sceneMenu.addToScene();
369						
370						app.addScene(scene);
371						app.pushScene();
372						app.changeScene(scene);
373					}
374				}
375				return false;
376			}
377		});
378	}
379
380	
381	/**
382	 * Adds the scene.
383	 * 
384	 * @param sceneToCreate the scene to create
385	 * @param icon the icon
386	 */
387	public void addScene(ICreateScene sceneToCreate, PImage icon){
388//		System.out.println("Width: " + width + " Height:" + height);
389		
390		//Create reflection image
391		PImage reflection = this.getReflection(getMTApplication(), icon);
392		
393		float border = 1;
394		float bothBorders = 2*border;
395		float topShift = 30;
396		float reflectionDistanceFromImage = topShift + gapBetweenIconAndReflection; //Gap width between image and reflection
397		
398		float listCellWidth = listWidth;		
399		float realListCellWidth = listCellWidth - bothBorders;
400//		float listCellHeight = preferredIconWidth - border;
401		float listCellHeight = preferredIconWidth ;
402		
403		MTListCell cell = new MTListCell(app ,  realListCellWidth, listCellHeight);
404		cell.setNoFill(true);
405		cell.setNoStroke(true);
406		
407//		/*
408		Vertex[] vertices = new Vertex[]{
409				new Vertex(realListCellWidth-topShift, 				border,		  		0, 0,0),
410				new Vertex(realListCellWidth-topShift, 				 listCellHeight -border,	0, 1,0),
411				new Vertex(realListCellWidth-topShift - icon.height, listCellHeight -border,	0, 1,1),
412				new Vertex(realListCellWidth-topShift - icon.height,	border,		  		0, 0,1),
413				new Vertex(realListCellWidth-topShift, 				border,		  		0, 0,0),
414		};
415		MTPolygon p = new MTPolygon(getMTApplication(), vertices);
416		p.setTexture(icon);
417//		p.setNoStroke(true);
418//		p.setStrokeColor(new MTColor(150,150,150, 255));
419		p.setStrokeColor(new MTColor(80,80,80, 255));
420		
421		Vertex[] verticesRef = new Vertex[]{
422				new Vertex(listCellWidth - icon.height - reflectionDistanceFromImage, 				 					border,	0, 	0,0),
423				new Vertex(listCellWidth - icon.height - reflectionDistanceFromImage,						listCellHeight -border,	0, 	1,0),
424				new Vertex(listCellWidth - icon.height - reflection.height - reflectionDistanceFromImage, 	listCellHeight -border,	0, 	1,1),
425				new Vertex(listCellWidth - icon.height - reflection.height - reflectionDistanceFromImage,				border,	0, 	0,1),
426				new Vertex(listCellWidth - icon.height - reflectionDistanceFromImage, 									border,	0, 	0,0),
427		};
428		MTPolygon pRef = new MTPolygon(getMTApplication(), verticesRef);
429		pRef.setTexture(reflection);
430		pRef.setNoStroke(true);
431		
432		cell.addChild(p);
433		cell.addChild(pRef);
434		
435		list.addListElement(cell);
436		addTapProcessor(cell, sceneToCreate);
437//		*/
438		
439		/*
440		MTRectangle rect = new MTRectangle(icon, getMTApplication());
441		rect.setUseDirectGL(true);
442//		rect.setNoStroke(true);
443		rect.rotateZ(rect.getCenterPointLocal(), 90, TransformSpace.LOCAL);
444		
445		MTRectangle reflectionRect = new MTRectangle(0, height, width, height, getMTApplication());
446		reflectionRect.setTexture(reflection);
447		reflectionRect.setUseDirectGL(true);
448//		reflectionRect.setNoStroke(true);
449		reflectionRect.rotateZ(rect.getCenterPointLocal(), 90, TransformSpace.LOCAL);
450		
451		cell.addChild(rect);
452		cell.addChild(reflectionRect);
453		list.addListElement(cell);
454		addTapProcessor(cell, sceneToCreate);
455		
456		rect.setAnchor(PositionAnchor.UPPER_LEFT);
457		reflectionRect.setAnchor(PositionAnchor.UPPER_LEFT);
458		
459		PositionAnchor oldCellAnchor = cell.getAnchor();
460		cell.setAnchor(PositionAnchor.UPPER_LEFT);
461		
462		rect.setPositionRelativeToParent(cell.getPosition(TransformSpace.LOCAL));
463		rect.translate(new Vector3D(realListCellWidth - topShift, 0));
464		
465		reflectionRect.setPositionRelativeToParent(cell.getPosition(TransformSpace.LOCAL));
466		reflectionRect.translate(new Vector3D(realListCellWidth - topShift - icon.height - gapBetweenIconAndReflection, 0));
467		
468		cell.setAnchor(oldCellAnchor);
469		
470//		rect.setPositionRelativeToParent(cell.getCenterPointLocal());
471		
472//		MTRoundRectangle r = new MTRoundRectangle(0, 0, 0, listCellWidth, listCellHeight, 30, 30, getMTApplication());
473//		cell.addChild(r);
474		
475//		getCanvas().addChild(rect);
476		*/
477		
478		///Add scene title
479		MTTextArea text = new MTTextArea(app, font);
480		text.setFillColor(new MTColor(150,150,250,200));
481		text.setNoFill(true);
482		text.setNoStroke(true);
483		text.setText(sceneToCreate.getTitle());
484		text.rotateZ(text.getCenterPointLocal(), 90, TransformSpace.LOCAL);
485		cell.addChild(text);
486		
487//		text.setAnchor(PositionAnchor.CENTER);
488//		PositionAnchor oldCellAnchor = cell.getAnchor();
489//		cell.setAnchor(PositionAnchor.CENTER);
490//		text.setPositionRelativeToParent(cell.getPosition(TransformSpace.LOCAL));
491//		text.translate(new Vector3D(realListCellWidth - topShift, 0));
492//		cell.setAnchor(oldCellAnchor);
493		
494		text.setPositionRelativeToParent(cell.getCenterPointLocal());
495		text.translate(new Vector3D(realListCellWidth*0.5f - text.getHeightXY(TransformSpace.LOCAL)*0.5f, 0));
496		///
497	}
498	
499	
500	/**
501	 * Creates the reflection image.
502	 * 
503	 * @param pa the pa
504	 * @param image the image
505	 * @return the reflection image
506	 */
507	private PImage getReflection(PApplet pa, PImage image) {
508		int width =  image.width; 
509		int height = image.height;
510		
511		PImage copyOfImage = pa.createImage(image.width, image.height, PApplet.ARGB);
512		image.loadPixels();
513		copyOfImage.loadPixels();
514		   
515		for (int y = 0; y < height; y++) {
516			for (int x = 0; x < width; x++) {
517				int imageIndex = y*image.width+x;
518//				int currA = (image.pixels[imageIndex] >> 32) & 0xFF;
519				int currR = (image.pixels[imageIndex] >> 16) & 0xFF;
520			    int currG = (image.pixels[imageIndex] >> 8) & 0xFF;
521			    int currB = image.pixels[imageIndex] & 0xFF;
522			    
523			    int col = image.pixels[imageIndex];
524			    float alpha = pa.alpha(col);
525			    
526			    int reflectImageIndex = (image.height-y-1) * image.width+x;
527			    
528			    //TOD clamp 0-255, map 0-255, 255- y*y * x
529//			    copyOfImage.pixels[reflectImageIndex] = pa.color(currR , currG , currB , Math.round(y*0.8));
530//			    copyOfImage.pixels[reflectImageIndex] = pa.color(currR , currG , currB , Math.round(y * (0.005f*y) * 0.5));
531//			    copyOfImage.pixels[reflectImageIndex] = pa.color(currR , currG , currB , Math.round(Tools3D.clamp(255 - y*y , 0, 255)));
532//			    copyOfImage.pixels[reflectImageIndex] = pa.color(currR , currG , currB , Math.round(y*y*y * (0.00003f) - 20)); //WORKS
533			    if (alpha <= 0.0f){
534			    	copyOfImage.pixels[reflectImageIndex] = pa.color(currR , currG , currB , 0.0f); 
535			    }else{
536			    	copyOfImage.pixels[reflectImageIndex] = pa.color(currR , currG , currB , Math.round(y*y*y * (0.00003f) - 60)); //WORKS	
537			    }
538			}
539		} 
540		copyOfImage.updatePixels();
541		return copyOfImage;
542	}
543	
544	
545	public void onEnter() {
546		getMTApplication().registerKeyEvent(this);
547	}
548	
549	public void onLeave() {	
550		getMTApplication().unregisterKeyEvent(this);
551	}
552	
553	/**
554	 * Key event.
555	 * 
556	 * @param e the e
557	 */
558	public void keyEvent(KeyEvent e){
559		int evtID = e.getID();
560		if (evtID != KeyEvent.KEY_PRESSED)
561			return;
562		switch (e.getKeyCode()){
563		case KeyEvent.VK_F:
564			System.out.println("FPS: " + getMTApplication().frameRate);
565			break;
566		case KeyEvent.VK_M:
567			System.out.println("Max memory: " + Runtime.getRuntime().maxMemory() + " <-> Free memory: " + Runtime.getRuntime().freeMemory());
568			break;	
569		case KeyEvent.VK_C:
570			getMTApplication().invokeLater(new Runnable() {
571				public void run() {
572					System.gc();
573					GC.maxObjectInspectionAge();
574					System.runFinalization();
575				}
576			});
577			break;
578		default:
579			break;
580		}
581	}
582
583}