Package it.freedomotic.environment

Examples of it.freedomotic.environment.ZoneLogic


        }
    }//GEN-LAST:event_mnuRoomEditModeActionPerformed

    private void mnuRenameRoomActionPerformed(java.awt.event.ActionEvent evt)    {//GEN-FIRST:event_mnuRenameRoomActionPerformed

        ZoneLogic zone = drawer.getSelectedZone();

        if (zone == null) {
            JOptionPane.showMessageDialog(this,
                    I18n.msg("select_room_first"));
        } else {
            String input = JOptionPane.showInputDialog(I18n.msg("enter_new_name_for_zone") + zone.getPojo().getName());
            zone.getPojo().setName(input.trim());
            drawer.setNeedRepaint(true);
        }
    }//GEN-LAST:event_mnuRenameRoomActionPerformed
View Full Code Here


        drawer.createHandles(room);
    }//GEN-LAST:event_mnuAddRoomActionPerformed

    private void mnuRemoveRoomActionPerformed(java.awt.event.ActionEvent evt)    {//GEN-FIRST:event_mnuRemoveRoomActionPerformed

        ZoneLogic zone = drawer.getSelectedZone();

        if (zone == null) {
            JOptionPane.showMessageDialog(this, I18n.msg("select_room_first"));
        } else {
            drawer.getCurrEnv().removeZone(zone);
View Full Code Here

        }
    }//GEN-LAST:event_mnuBackgroundActionPerformed

    private void mnuRoomBackgroundActionPerformed(java.awt.event.ActionEvent evt)    {//GEN-FIRST:event_mnuRoomBackgroundActionPerformed

        ZoneLogic zone = drawer.getSelectedZone();

        if (zone == null) {
            JOptionPane.showMessageDialog(this,
                    I18n.msg("select_room_first"));
        } else {
            final JFileChooser fc = new JFileChooser(Info.getDatafilePath() + "/resources/");
            OpenDialogFileFilter filter = new OpenDialogFileFilter();
            filter.addExtension("png");
            filter.addExtension("jpeg");
            filter.addExtension("jpg");
            filter.setDescription("Image files (png, jpeg)");
            fc.addChoosableFileFilter(filter);
            fc.setFileFilter(filter);

            int returnVal = fc.showOpenDialog(this);

            if (returnVal == JFileChooser.APPROVE_OPTION) {
                File file = fc.getSelectedFile();
                //This is where a real application would open the file.
                LOG.info("Opening " + file.getAbsolutePath());
                zone.getPojo().setTexture(file.getName());
                drawer.setNeedRepaint(true);
                frameMap.validate();
            }
        }
    }//GEN-LAST:event_mnuRoomBackgroundActionPerformed
View Full Code Here

    public ListDrawer(JavaDesktopFrontend master) {
        super(master);
        cmbZone.removeAllItems();
        cmbZone.addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent e) {
                ZoneLogic zone = (ZoneLogic) cmbZone.getSelectedItem();
                enlistObjects(zone);
            }
        });
        this.setLayout(new BorderLayout());
        this.setBackground(Color.white);
View Full Code Here

    protected ZoneLogic mouseOnZone(Point p) {
        Iterator it = currEnv.getZones().iterator();
        boolean onZone = false;

        while (it.hasNext()) {
            ZoneLogic zone = (ZoneLogic) it.next();

            if (zone.getPojo().isRoom()) {
                Point mouse = toRealCoords(p);
                onZone =
                        TopologyUtils.contains(zone.getPojo().getShape(),
                        new FreedomPoint((int) mouse.getX(), (int) mouse.getY()));

                if (onZone == true) {
                    return zone;
                }
View Full Code Here

                        }
                    }
                }
            } else {
                //click on a zone in edit mode if no handle is selected
                ZoneLogic zone = mouseOnZone(e.getPoint());

                if (zone != null) {
                    removeIndicators();
                    addIndicator(TopologyUtils.convertToAWT(zone.getPojo().getShape()));
                    selectedZone = zone;
                    createHandles(zone);
                } else {
                    handles.clear();
                    // createHandles(null);
View Full Code Here

TOP

Related Classes of it.freedomotic.environment.ZoneLogic

Copyright © 2018 www.massapicom. 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.