Examples of EnvironmentLogic


Examples of it.freedomotic.environment.EnvironmentLogic

            if (loaded == null) {
                throw new IllegalStateException("Object data cannot be null at this stage");
            }
            for (Environment env : loaded) {
                EnvironmentLogic logic = INJECTOR.getInstance(EnvironmentLogic.class);
                logic.setPojo(env);
                logic.setSource(new File(folder + "/" + env.getUUID() + ".xenv"));
                EnvironmentPersistence.add(logic, false);
            }

            //now load related objects
            EnvObjectPersistence.loadObjects(new File(folder + "/data/obj"), false);
View Full Code Here

Examples of it.freedomotic.environment.EnvironmentLogic

//            }
//        }
        FreedomPolygon objShape =
                TopologyUtils.rotate(TopologyUtils.translate(pojoShape, xoffset, yoffset),
                (int) representation.getRotation());
        EnvironmentLogic env = EnvironmentPersistence.getEnvByUUID(getPojo().getEnvironmentID());

        if (env != null) {
            for (Room room : env.getRooms()) {
                if (TopologyUtils.intersects(objShape,
                        room.getPojo().getShape())) {
                    if (from == null) {
                        from = (Room) room;
                        to = (Room) room;
View Full Code Here

Examples of it.freedomotic.environment.EnvironmentLogic

        if (files != null) {
            for (File file : files) {
                EnvObjectLogic loaded = loadObject(file);

                if (loaded != null) {
                    EnvironmentLogic env = EnvironmentPersistence.getEnvByUUID(loaded.getPojo().getEnvironmentID());
                    if (env != null) {
                        loaded.setEnvironment(env);
                    } else {
                        loaded.setEnvironment(EnvironmentPersistence.getEnvironments().get(0));
                        LOG.warning("Reset environment UUID of object " + loaded.getPojo().getName()
View Full Code Here

Examples of it.freedomotic.environment.EnvironmentLogic

                        editor.finalizeEditing();
                    }
                }
            }
            if (environmentComboBox.getSelectedItem() != null) {
                EnvironmentLogic selEnv = (EnvironmentLogic) environmentComboBox.getSelectedItem();
                object.setEnvironment(selEnv);
                object.setChanged(true);
            }

            this.dispose();
View Full Code Here

Examples of it.freedomotic.environment.EnvironmentLogic

        setWindowedMode();
        updateMenusPermissions();

        String defEnv = master.getApi().getConfig().getProperty("KEY_ROOM_XML_PATH");
        EnvironmentLogic env = EnvironmentPersistence.getEnvByUUID(defEnv.substring(defEnv.length() - 41, defEnv.length() - 5));
        setEnvironment(env);

        checkDeletableEnvironments();

        KeyboardFocusManager manager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
View Full Code Here

Examples of it.freedomotic.environment.EnvironmentLogic

            frameClient.setSelected(true);
        } catch (PropertyVetoException ex) {
            LOG.severe(Freedomotic.getStackTraceInfo(ex));
        }

        EnvironmentLogic previousEnv = EnvironmentPersistence.getEnvironments().get(0);

        if (drawer != null) {
            previousEnv = drawer.getCurrEnv();
        }
View Full Code Here

Examples of it.freedomotic.environment.EnvironmentLogic

                if (returnVal == JFileChooser.APPROVE_OPTION) {
                    File folder = fc.getSelectedFile();

                    if (!folder.getName().isEmpty()) {
                        EnvironmentLogic newenv = EnvironmentPersistence.getEnvironments().get(0);
                        newenv.setSource(
                                new File(folder + "/" + newenv.getPojo().getUUID() + ".xenv"));
                        setEnvironment(newenv);
                        //save the new environment
                        EnvironmentPersistence.saveAs(newenv, folder);
                    }
                } else {
View Full Code Here

Examples of it.freedomotic.environment.EnvironmentLogic

            if (master.getApi().getEnvironments().size() == 1) {
                drawer.setCurrEnv(0);
                setMapTitle(master.getApi().getEnvironments().get(0).getPojo().getName());
            } else {
                Object[] possibilities = EnvironmentPersistence.getEnvironments().toArray();
                EnvironmentLogic input = (EnvironmentLogic) JOptionPane.showInputDialog(
                        this,
                        I18n.msg("select_env"),
                        I18n.msg("select_env_title"),
                        JOptionPane.PLAIN_MESSAGE,
                        null,
View Full Code Here

Examples of it.freedomotic.environment.EnvironmentLogic

            }
        }
    }//GEN-LAST:event_mnuSelectEnvironmentActionPerformed

    private void mnuAddDuplicateEnvironmentActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuAddDuplicateEnvironmentActionPerformed
        EnvironmentLogic newEnv = EnvironmentPersistence.add(drawer.getCurrEnv(), true);
        String input = JOptionPane.showInputDialog(I18n.msg("enter_new_name_for_env") + newEnv.getPojo().getName());
        newEnv.getPojo().setName(input.trim());
        newEnv.setSource(new File(drawer.getCurrEnv().getSource().getParentFile() + "/" + newEnv.getPojo().getUUID() + ".xenv"));
        setEnvironment(EnvironmentPersistence.getEnvByUUID(newEnv.getPojo().getUUID()));
        checkDeletableEnvironments();
    }//GEN-LAST:event_mnuAddDuplicateEnvironmentActionPerformed
View Full Code Here

Examples of it.freedomotic.environment.EnvironmentLogic

        drawer.getCurrEnv().getPojo().setName(input.trim());
        setMapTitle(drawer.getCurrEnv().getPojo().getName());
    }//GEN-LAST:event_mnuRenameEnvironmentActionPerformed

    private void mnuDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_mnuDeleteActionPerformed
        EnvironmentLogic oldenv = drawer.getCurrEnv();

        JLabel confirmLbl = new JLabel(I18n.msg("confirm_env_delete"));
        JLabel selectLbl = new JLabel(I18n.msg("select_env_to_reassing_objects"));
       
        ArrayList<Object> possibilities = new ArrayList<Object>();
        possibilities.add(I18n.msg("delete_envobj_alongside_environment"));
        possibilities.addAll(EnvironmentPersistence.getEnvironments());
        possibilities.remove(oldenv);
           
        JComboBox envCombo = new JComboBox(possibilities.toArray());
       
        int result = JOptionPane.showConfirmDialog(null,
                new Object[]{confirmLbl,selectLbl,envCombo},
                I18n.msg("confirm_deletion_title"),
                JOptionPane.OK_CANCEL_OPTION
                );

        if (result == JOptionPane.OK_OPTION) {
          if (envCombo.getSelectedItem() instanceof EnvironmentLogic) {
                // assign objects to new environment
                EnvironmentLogic env = (EnvironmentLogic) envCombo.getSelectedItem();
                for (EnvObjectLogic obj : EnvObjectPersistence.getObjectByEnvironment(oldenv.getPojo().getUUID())) {
                    obj.setEnvironment(env);
                }
                setEnvironment(env);
            } else {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.