use of net.drewke.tdme.tools.leveleditor.views.EmptyView in project tdme by andreasdr.
the class TDMELevelEditor method init.
/**
* Initialize tdme level editor
*/
public void init(GLAutoDrawable drawable) {
engine.init(drawable);
// register gui to mouse, keyboard events
glWindow.addMouseListener(engine.getGUI());
glWindow.addKeyListener(engine.getGUI());
// init off screen engine
Tools.oseInit(drawable);
// level editor model library screen controller
levelEditorEntityLibraryScreenController = new LevelEditorEntityLibraryScreenController(popUps);
levelEditorEntityLibraryScreenController.init();
engine.getGUI().addScreen(levelEditorEntityLibraryScreenController.getScreenNode().getId(), levelEditorEntityLibraryScreenController.getScreenNode());
// pop ups
popUps.init();
//
levelEditorView = new LevelEditorView(popUps);
levelEditorView.init();
modelViewerView = new ModelViewerView(popUps);
modelViewerView.init();
triggerView = new TriggerView(popUps);
triggerView.init();
emptyView = new EmptyView(popUps);
emptyView.init();
particleSystemView = new ParticleSystemView(popUps);
particleSystemView.init();
// show up level editor view
setView(levelEditorView);
}
use of net.drewke.tdme.tools.leveleditor.views.EmptyView in project tdme by andreasdr.
the class LevelEditorEntityLibraryScreenController method onEditEntity.
/**
* On edit entity
*/
public void onEditEntity() {
// check if we have a entity selected
LevelEditorEntity entity = TDMELevelEditor.getInstance().getEntityLibrary().getEntity(Tools.convertToIntSilent(entityLibraryListBox.getController().getValue().toString()));
if (entity == null)
return;
switch(entity.getType()) {
case MODEL:
// switch to model library view if not yet done
if (TDMELevelEditor.getInstance().getView() instanceof ModelViewerView == false) {
TDMELevelEditor.getInstance().switchToModelViewer();
}
// set model
((ModelViewerView) TDMELevelEditor.getInstance().getView()).setEntity(entity);
break;
case TRIGGER:
// switch to model trigger view if not yet done
if (TDMELevelEditor.getInstance().getView() instanceof TriggerView == false) {
TDMELevelEditor.getInstance().switchToTriggerView();
}
// set model
((TriggerView) TDMELevelEditor.getInstance().getView()).setEntity(entity);
break;
case EMPTY:
// switch to model trigger view if not yet done
if (TDMELevelEditor.getInstance().getView() instanceof EmptyView == false) {
TDMELevelEditor.getInstance().switchToEmptyView();
}
// set model
((EmptyView) TDMELevelEditor.getInstance().getView()).setEntity(entity);
break;
case PARTICLESYSTEM:
// switch to model trigger view if not yet done
if (TDMELevelEditor.getInstance().getView() instanceof ParticleSystemView == false) {
TDMELevelEditor.getInstance().switchToParticleSystemView();
}
// set model
((ParticleSystemView) TDMELevelEditor.getInstance().getView()).setEntity(entity);
break;
}
// button enabled
buttonEntityPlace.getController().setDisabled(true);
buttonLevelEdit.getController().setDisabled(false);
}
Aggregations