Search in sources :

Example 1 with EmptyView

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);
}
Also used : ParticleSystemView(net.drewke.tdme.tools.leveleditor.views.ParticleSystemView) LevelEditorEntityLibraryScreenController(net.drewke.tdme.tools.leveleditor.controller.LevelEditorEntityLibraryScreenController) TriggerView(net.drewke.tdme.tools.leveleditor.views.TriggerView) ModelViewerView(net.drewke.tdme.tools.leveleditor.views.ModelViewerView) EmptyView(net.drewke.tdme.tools.leveleditor.views.EmptyView) LevelEditorView(net.drewke.tdme.tools.leveleditor.views.LevelEditorView)

Example 2 with EmptyView

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);
}
Also used : ParticleSystemView(net.drewke.tdme.tools.leveleditor.views.ParticleSystemView) TriggerView(net.drewke.tdme.tools.leveleditor.views.TriggerView) ModelViewerView(net.drewke.tdme.tools.leveleditor.views.ModelViewerView) LevelEditorEntity(net.drewke.tdme.tools.shared.model.LevelEditorEntity) EmptyView(net.drewke.tdme.tools.leveleditor.views.EmptyView)

Aggregations

EmptyView (net.drewke.tdme.tools.leveleditor.views.EmptyView)2 ModelViewerView (net.drewke.tdme.tools.leveleditor.views.ModelViewerView)2 ParticleSystemView (net.drewke.tdme.tools.leveleditor.views.ParticleSystemView)2 TriggerView (net.drewke.tdme.tools.leveleditor.views.TriggerView)2 LevelEditorEntityLibraryScreenController (net.drewke.tdme.tools.leveleditor.controller.LevelEditorEntityLibraryScreenController)1 LevelEditorView (net.drewke.tdme.tools.leveleditor.views.LevelEditorView)1 LevelEditorEntity (net.drewke.tdme.tools.shared.model.LevelEditorEntity)1