Java MapObjects kai moving point

Συζητήσεις για την Java

Συντονιστές: WebDev Moderators, Super-Moderators

Απάντηση
dimman24
Δημοσιεύσεις: 4
Εγγραφή: 11 Οκτ 2009 22:05

Java MapObjects kai moving point

Δημοσίευση από dimman24 » 26 Ιαν 2010 17:46

Paidia exw megalo problima ayrio paradidw ergasia kai den mporw na koynisw ena point...!!!

Se genikes kai mperdemenes grammes einai o parakatw kwdikas alla mexri ekei...!!!
ti prepei na kanw gia na koynisw ena point poy ftiaxnw???

Κώδικας: Επιλογή όλων

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * UserFrame.java
 *
 * Created on 18-Dec-2009, 08:20:52
 */

package ppt;

import com.esri.mo2.cs.geom.BasePointsArray;
import com.esri.mo2.map.core.AcetateLayer;
import com.esri.mo2.map.dpy.FeatureLayer;
import com.esri.mo2.map.draw.SimpleMarkerSymbol;
import com.esri.mo2.map.mem.MemoryFeatureClass;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.MouseWheelEvent;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Time;
import java.text.DecimalFormat;
import java.util.Timer;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import org.omg.CORBA.TIMEOUT;

/**
 *
 * @author dimman
 */
public class UserFrame extends javax.swing.JFrame {
public static final String JDBC_DRIVER="com.mysql.jdbc.Driver";
public static final String DB_URL="jdbc:mysql://localhost:3306/mapdb";

    /** Creates new form UserFrame */
    public UserFrame() throws InterruptedException {
        initComponents();
        this.setLocationRelativeTo(null);

        
 
        //queryRadar();
        
       
        
        

       

       
        
        }

   
private MemoryFeatureClass _fClass;
private FeatureLayer _fLayer;
private int featureId = 0;
private FeatureLayer testLayer;





    @SuppressWarnings("static-access")
public void test() throws InterruptedException  {


        String ww = "23.00";
        double WW = Double.parseDouble(ww);
        String qq = "38.23";
        double QQ = Double.parseDouble(qq);
    for &#40;int i = 0; i < 10; i++&#41; &#123;
       
        System.out.println&#40;"arxh"&#41;;
        QQ = QQ+0.1;
        WW = WW+0.1;
        
        
        addPointsToMap&#40;getPointsFromFile&#40;WW,QQ&#41;&#41;;
        Thread.sleep&#40;500&#41;;

        map1.update&#40;null&#41;;
        System.out.println&#40;"telos"&#41;;

      
        
    &#125;


&#125;

    public void queryRadar&#40;&#41; throws InterruptedException  &#123;
        try&#123;
            Class.forName&#40;JDBC_DRIVER&#41;;
            Connection con = DriverManager.getConnection&#40;DB_URL, "root", "1234"&#41;;
            PreparedStatement st = con.prepareStatement&#40;"SELECT * FROM RADAR_DATA"&#41;;
            ResultSet rs =st.executeQuery&#40;&#41;;
            while&#40;rs.next&#40;&#41;&#41;
            &#123;
                String X=rs.getString&#40;4&#41;;
                String Y=rs.getString&#40;5&#41;;
                System.out.println&#40;rs.getString&#40;4&#41;+"    "+rs.getString&#40;5&#41;&#41;;

                double qx = Double.parseDouble&#40;X&#41;;
                double qy = Double.parseDouble&#40;Y&#41;;

                addPointsToMap&#40;getPointsFromFile&#40;qx,qy&#41;&#41;;

            &#125;

             con.close&#40;&#41;;
             st.close&#40;&#41;;
        &#125; catch &#40;SQLException ex&#41; &#123;
            Logger.getLogger&#40;MainMethods.class.getName&#40;&#41;&#41;.log&#40;Level.SEVERE, null, ex&#41;;
        &#125; catch &#40;ClassNotFoundException ex&#41; &#123;
            Logger.getLogger&#40;MainMethods.class.getName&#40;&#41;&#41;.log&#40;Level.SEVERE, null, ex&#41;;
        &#125;

    &#125;






    private BasePointsArray getPointsFromFile&#40;double x, double y&#41; &#123;
    double x_array&#91;&#93; = null;
    double y_array&#91;&#93; = null;
    x_array = new double&#91;1&#93;;
    y_array = new double&#91;1&#93;;

    BasePointsArray points = null;

    x_array&#91;0&#93; = x;  //edw ta points
    y_array&#91;0&#93; = y;    //edw ta points

    points = new BasePointsArray&#40;x_array, y_array&#41;;
    return points;


    &#125; //return points



    private final void addPointsToMap&#40;BasePointsArray a&#41; throws InterruptedException &#123;
    com.esri.mo2.cs.geom.Point p;
    int n = a.size&#40;&#41;;

      p = a.getPoint&#40;0&#41;;
      addPointToMemoryFeatureClass&#40;getMemoryFeatureClass&#40;&#41;, p&#41;;

    _fLayer = createFeatureLayer&#40;&#41;;
    map1.getLayerset&#40;&#41;.addLayer&#40;_fLayer&#41;;
    //map1.redraw&#40;&#41;;   //Prepei opws dipote!!!

  &#125;



     private final com.esri.mo2.map.mem.MemoryFeatureClass getMemoryFeatureClass&#40;&#41; &#123;
    if &#40;_fClass == null&#41; &#123;
      com.esri.mo2.data.feat.BaseFields fields = new com.esri.mo2.data.feat.
          BaseFields&#40;1&#41;;
      fields.addField&#40;com.esri.mo2.data.feat.Field.ShapeField&#41;;
      int ftype = com.esri.mo2.data.feat.MapDataset.POINT;
      _fClass = new com.esri.mo2.map.mem.MemoryFeatureClass&#40;ftype, fields&#41;;
      _fClass.setName&#40;"Ship"&#41;;
    &#125;
    return _fClass;
  &#125;  //return fClass = Memory Feature Layer!!!!


     private com.esri.mo2.map.mem.MemoryFeatureClass delFC = _fClass;


     private void removeFeat&#40;MemoryFeatureClass testFC,com.esri.mo2.cs.geom.Point point&#41; &#123;



     &#125;



     private final void addPointToMemoryFeatureClass&#40;MemoryFeatureClass fc,
                                                  com.esri.mo2.cs.geom.Point
                                                  point&#41; throws InterruptedException &#123;
    com.esri.mo2.data.feat.Feature feature = constructFeature&#40;point&#41;;
    if &#40;fc != null&#41; &#123;
      fc.addFeature&#40;feature&#41;;
//      Thread.sleep&#40;1000&#41;;
//      fc.removeFeature&#40;feature&#41;;

    &#125;

  &#125;



      private final com.esri.mo2.data.feat.Feature constructFeature&#40;com.esri.mo2.cs.
      geom.Point point&#41; &#123;
    com.esri.mo2.data.feat.BaseFeature feature = new com.esri.mo2.data.feat.
        BaseFeature&#40;&#41;;
    com.esri.mo2.data.feat.BaseDataID id = new com.esri.mo2.data.feat.BaseDataID&#40;"Sample", featureId++&#41;;
    feature.setDataID&#40;id&#41;;
    com.esri.mo2.data.feat.Fields fields = getMemoryFeatureClass&#40;&#41;.getFields&#40;&#41;;
    feature.setFields&#40;fields&#41;;
    feature.setValue&#40;0, point&#41;;
    
    return feature;
  &#125;
      
    private final com.esri.mo2.map.dpy.FeatureLayer createFeatureLayer&#40;&#41; &#123;
    com.esri.mo2.map.mem.MemoryLayerSource source = new com.esri.mo2.map.mem.
        MemoryLayerSource&#40;&#41;;
    com.esri.mo2.map.mem.MemoryFeatureClass featureClass =
        getMemoryFeatureClass&#40;&#41;;
    source.addFeatureClass&#40;featureClass&#41;;
    com.esri.mo2.map.dpy.LayerInfo layerInfo = source.getLayerInfo&#40;0&#41;;
    FeatureLayer fLayer = &#40;com.esri.mo2.map.dpy.FeatureLayer&#41; source.getLayer&#40;
        layerInfo&#41;;
    com.esri.mo2.map.draw.SimpleRenderer renderer = &#40;com.esri.mo2.map.draw.
        SimpleRenderer&#41; fLayer.getRenderer&#40;&#41;;
    com.esri.mo2.map.draw.SimpleMarkerSymbol symbol = new com.esri.mo2.map.draw.
        SimpleMarkerSymbol&#40;&#41;;
    symbol.setType&#40;SimpleMarkerSymbol.CIRCLE_MARKER&#41;;
    symbol.setWidth&#40;10.0&#41;;
    symbol.setSymbolColor&#40;java.awt.Color.RED&#41;;
    renderer.setSymbol&#40;symbol&#41;;
    return fLayer;
  &#125;  //Ftiakse edw oti 8eleis...!!!


       /** This method is called from within the constructor to
     * initialize the form.
     * WARNING&#58; Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings&#40;"unchecked"&#41;
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents&#40;&#41; &#123;

        BottomUserPanel = new javax.swing.JPanel&#40;&#41;;
        map1 = new com.esri.mo2.ui.bean.Map&#40;&#41;;
        layer1 = new com.esri.mo2.ui.bean.Layer&#40;&#41;;
        Xlabel = new javax.swing.JLabel&#40;&#41;;
        YLabel = new javax.swing.JLabel&#40;&#41;;
        jLabel1 = new javax.swing.JLabel&#40;&#41;;
        jLabel2 = new javax.swing.JLabel&#40;&#41;;
        layerToolBar1 = new com.esri.mo2.ui.tb.LayerToolBar&#40;&#41;;
        zoomPanToolBar1 = new com.esri.mo2.ui.tb.ZoomPanToolBar&#40;&#41;;
        jButton1 = new javax.swing.JButton&#40;&#41;;
        jMenuBar1 = new javax.swing.JMenuBar&#40;&#41;;
        jMenu1 = new javax.swing.JMenu&#40;&#41;;
        jMenuItem1 = new javax.swing.JMenuItem&#40;&#41;;
        jMenuItem2 = new javax.swing.JMenuItem&#40;&#41;;
        jMenuItem3 = new javax.swing.JMenuItem&#40;&#41;;
        jMenuItem4 = new javax.swing.JMenuItem&#40;&#41;;
        UserAdminMenu = new javax.swing.JMenu&#40;&#41;;
        AdminMenuAdminItem = new javax.swing.JMenuItem&#40;&#41;;
        ToolAdminMenu = new javax.swing.JMenu&#40;&#41;;
        jSeparator1 = new javax.swing.JSeparator&#40;&#41;;
        jMenu2 = new javax.swing.JMenu&#40;&#41;;
        MapUserCheckBoxMenu = new javax.swing.JCheckBoxMenuItem&#40;&#41;;
        RadarUserCheckBoxMenu = new javax.swing.JCheckBoxMenuItem&#40;&#41;;
        TargetsUserCheckBoxMenu = new javax.swing.JCheckBoxMenuItem&#40;&#41;;
        RangeRadarUserCheckBoxMenu = new javax.swing.JCheckBoxMenuItem&#40;&#41;;
        jCheckBoxMenuItem5 = new javax.swing.JCheckBoxMenuItem&#40;&#41;;
        UserToolkitCheckBox = new javax.swing.JCheckBoxMenuItem&#40;&#41;;

        setDefaultCloseOperation&#40;javax.swing.WindowConstants.EXIT_ON_CLOSE&#41;;
        setTitle&#40;"Radar Search Targets"&#41;;

        javax.swing.GroupLayout BottomUserPanelLayout = new javax.swing.GroupLayout&#40;BottomUserPanel&#41;;
        BottomUserPanel.setLayout&#40;BottomUserPanelLayout&#41;;
        BottomUserPanelLayout.setHorizontalGroup&#40;
            BottomUserPanelLayout.createParallelGroup&#40;javax.swing.GroupLayout.Alignment.LEADING&#41;
            .addGap&#40;0, 589, Short.MAX_VALUE&#41;
        &#41;;
        BottomUserPanelLayout.setVerticalGroup&#40;
            BottomUserPanelLayout.createParallelGroup&#40;javax.swing.GroupLayout.Alignment.LEADING&#41;
            .addGap&#40;0, 27, Short.MAX_VALUE&#41;
        &#41;;

        layer1.setDataset&#40;"com.esri.mo2.src.file.FileSystemConnection!C&#58;/ESRI/MOJ20/Samples/Data/Greece/greek_land.shp!"&#41;;

        javax.swing.GroupLayout layer1Layout = new javax.swing.GroupLayout&#40;layer1&#41;;
        layer1.setLayout&#40;layer1Layout&#41;;
        layer1Layout.setHorizontalGroup&#40;
            layer1Layout.createParallelGroup&#40;javax.swing.GroupLayout.Alignment.LEADING&#41;
            .addGap&#40;0, 440, Short.MAX_VALUE&#41;
        &#41;;
        layer1Layout.setVerticalGroup&#40;
            layer1Layout.createParallelGroup&#40;javax.swing.GroupLayout.Alignment.LEADING&#41;
            .addGap&#40;0, 310, Short.MAX_VALUE&#41;
        &#41;;

        layer1.setBounds&#40;0, 0, 440, 310&#41;;
        map1.add&#40;layer1, javax.swing.JLayeredPane.DEFAULT_LAYER&#41;;

        Xlabel.setText&#40;"jLabel1"&#41;;

        YLabel.setText&#40;"jLabel1"&#41;;

        jLabel1.setText&#40;"X &#58;"&#41;;

        jLabel2.setText&#40;"Y &#58;"&#41;;

        layerToolBar1.setRollover&#40;true&#41;;
        layerToolBar1.setMap&#40;map1&#41;;

        zoomPanToolBar1.setRollover&#40;true&#41;;
        zoomPanToolBar1.setMap&#40;map1&#41;;

        jButton1.setText&#40;"jButton1"&#41;;
        jButton1.addActionListener&#40;new java.awt.event.ActionListener&#40;&#41; &#123;
            public void actionPerformed&#40;java.awt.event.ActionEvent evt&#41; &#123;
                jButton1ActionPerformed&#40;evt&#41;;
            &#125;
        &#125;&#41;;

        jMenu1.setText&#40;"File"&#41;;

        jMenuItem1.setText&#40;"jMenuItem1"&#41;;
        jMenu1.add&#40;jMenuItem1&#41;;

        jMenuItem2.setText&#40;"jMenuItem1"&#41;;
        jMenu1.add&#40;jMenuItem2&#41;;

        jMenuItem3.setText&#40;"jMenuItem1"&#41;;
        jMenu1.add&#40;jMenuItem3&#41;;

        jMenuItem4.setText&#40;"jMenuItem1"&#41;;
        jMenu1.add&#40;jMenuItem4&#41;;

        jMenuBar1.add&#40;jMenu1&#41;;

        UserAdminMenu.setText&#40;"User"&#41;;

        AdminMenuAdminItem.setText&#40;"Admin"&#41;;
        AdminMenuAdminItem.addActionListener&#40;new java.awt.event.ActionListener&#40;&#41; &#123;
            public void actionPerformed&#40;java.awt.event.ActionEvent evt&#41; &#123;
                AdminMenuAdminItemActionPerformed&#40;evt&#41;;
            &#125;
        &#125;&#41;;
        UserAdminMenu.add&#40;AdminMenuAdminItem&#41;;

        jMenuBar1.add&#40;UserAdminMenu&#41;;

        ToolAdminMenu.setText&#40;"Tools"&#41;;
        ToolAdminMenu.add&#40;jSeparator1&#41;;

        jMenu2.setText&#40;"Layers"&#41;;

        MapUserCheckBoxMenu.setSelected&#40;true&#41;;
        MapUserCheckBoxMenu.setText&#40;"Map"&#41;;
        jMenu2.add&#40;MapUserCheckBoxMenu&#41;;

        RadarUserCheckBoxMenu.setSelected&#40;true&#41;;
        RadarUserCheckBoxMenu.setText&#40;"Radar"&#41;;
        jMenu2.add&#40;RadarUserCheckBoxMenu&#41;;

        TargetsUserCheckBoxMenu.setSelected&#40;true&#41;;
        TargetsUserCheckBoxMenu.setText&#40;"Targets"&#41;;
        jMenu2.add&#40;TargetsUserCheckBoxMenu&#41;;

        RangeRadarUserCheckBoxMenu.setSelected&#40;true&#41;;
        RangeRadarUserCheckBoxMenu.setText&#40;"Range Radar"&#41;;
        jMenu2.add&#40;RangeRadarUserCheckBoxMenu&#41;;

        jCheckBoxMenuItem5.setSelected&#40;true&#41;;
        jCheckBoxMenuItem5.setText&#40;"Null"&#41;;
        jMenu2.add&#40;jCheckBoxMenuItem5&#41;;

        ToolAdminMenu.add&#40;jMenu2&#41;;

        UserToolkitCheckBox.setSelected&#40;true&#41;;
        UserToolkitCheckBox.setText&#40;"Toolkit"&#41;;
        UserToolkitCheckBox.addActionListener&#40;new java.awt.event.ActionListener&#40;&#41; &#123;
            public void actionPerformed&#40;java.awt.event.ActionEvent evt&#41; &#123;
                UserToolkitCheckBoxActionPerformed&#40;evt&#41;;
            &#125;
        &#125;&#41;;
        ToolAdminMenu.add&#40;UserToolkitCheckBox&#41;;

        jMenuBar1.add&#40;ToolAdminMenu&#41;;

        setJMenuBar&#40;jMenuBar1&#41;;

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout&#40;getContentPane&#40;&#41;&#41;;
        getContentPane&#40;&#41;.setLayout&#40;layout&#41;;
        layout.setHorizontalGroup&#40;
            layout.createParallelGroup&#40;javax.swing.GroupLayout.Alignment.LEADING&#41;
            .addGroup&#40;layout.createSequentialGroup&#40;&#41;
                .addContainerGap&#40;&#41;
                .addGroup&#40;layout.createParallelGroup&#40;javax.swing.GroupLayout.Alignment.LEADING&#41;
                    .addGroup&#40;layout.createSequentialGroup&#40;&#41;
                        .addGap&#40;247, 247, 247&#41;
                        .addComponent&#40;BottomUserPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE&#41;
                        .addGap&#40;10, 10, 10&#41;&#41;
                    .addGroup&#40;layout.createSequentialGroup&#40;&#41;
                        .addComponent&#40;map1, javax.swing.GroupLayout.PREFERRED_SIZE, 442, javax.swing.GroupLayout.PREFERRED_SIZE&#41;
                        .addGap&#40;53, 53, 53&#41;
                        .addComponent&#40;jButton1&#41;
                        .addGap&#40;278, 278, 278&#41;&#41;
                    .addGroup&#40;layout.createSequentialGroup&#40;&#41;
                        .addComponent&#40;zoomPanToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 236, javax.swing.GroupLayout.PREFERRED_SIZE&#41;
                        .addGap&#40;18, 18, 18&#41;
                        .addComponent&#40;layerToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE&#41;
                        .addContainerGap&#40;&#41;&#41;&#41;&#41;
            .addGroup&#40;javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup&#40;&#41;
                .addGap&#40;20, 20, 20&#41;
                .addGroup&#40;layout.createParallelGroup&#40;javax.swing.GroupLayout.Alignment.TRAILING, false&#41;
                    .addComponent&#40;jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE&#41;
                    .addComponent&#40;jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, 15, Short.MAX_VALUE&#41;&#41;
                .addGap&#40;18, 18, 18&#41;
                .addGroup&#40;layout.createParallelGroup&#40;javax.swing.GroupLayout.Alignment.TRAILING&#41;
                    .addComponent&#40;Xlabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 143, Short.MAX_VALUE&#41;
                    .addComponent&#40;YLabel, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 143, Short.MAX_VALUE&#41;&#41;
                .addGap&#40;660, 660, 660&#41;&#41;
        &#41;;
        layout.setVerticalGroup&#40;
            layout.createParallelGroup&#40;javax.swing.GroupLayout.Alignment.LEADING&#41;
            .addGroup&#40;javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup&#40;&#41;
                .addGroup&#40;layout.createParallelGroup&#40;javax.swing.GroupLayout.Alignment.LEADING&#41;
                    .addGroup&#40;layout.createSequentialGroup&#40;&#41;
                        .addContainerGap&#40;&#41;
                        .addGroup&#40;layout.createParallelGroup&#40;javax.swing.GroupLayout.Alignment.LEADING&#41;
                            .addComponent&#40;layerToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE&#41;
                            .addComponent&#40;zoomPanToolBar1, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE&#41;&#41;
                        .addPreferredGap&#40;javax.swing.LayoutStyle.ComponentPlacement.RELATED&#41;
                        .addComponent&#40;map1, javax.swing.GroupLayout.PREFERRED_SIZE, 316, javax.swing.GroupLayout.PREFERRED_SIZE&#41;
                        .addGap&#40;38, 38, 38&#41;
                        .addGroup&#40;layout.createParallelGroup&#40;javax.swing.GroupLayout.Alignment.BASELINE&#41;
                            .addComponent&#40;YLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 25, javax.swing.GroupLayout.PREFERRED_SIZE&#41;
                            .addComponent&#40;jLabel1&#41;&#41;&#41;
                    .addGroup&#40;layout.createSequentialGroup&#40;&#41;
                        .addGap&#40;134, 134, 134&#41;
                        .addComponent&#40;jButton1&#41;&#41;&#41;
                .addGroup&#40;layout.createParallelGroup&#40;javax.swing.GroupLayout.Alignment.LEADING&#41;
                    .addGroup&#40;layout.createSequentialGroup&#40;&#41;
                        .addGap&#40;45, 45, 45&#41;
                        .addComponent&#40;BottomUserPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE&#41;&#41;
                    .addGroup&#40;layout.createSequentialGroup&#40;&#41;
                        .addGap&#40;18, 18, 18&#41;
                        .addGroup&#40;layout.createParallelGroup&#40;javax.swing.GroupLayout.Alignment.BASELINE&#41;
                            .addComponent&#40;Xlabel, javax.swing.GroupLayout.PREFERRED_SIZE, 24, javax.swing.GroupLayout.PREFERRED_SIZE&#41;
                            .addComponent&#40;jLabel2&#41;&#41;&#41;&#41;&#41;
        &#41;;

        pack&#40;&#41;;
    &#125;// </editor-fold>

    private void UserToolkitCheckBoxActionPerformed&#40;java.awt.event.ActionEvent evt&#41; &#123;                                                    
       /* if &#40;UserToolkitCheckBox.getState&#40;&#41;&#41; &#123;
            userToolkitPanel1.setVisible&#40;false&#41;;
        &#125;else &#123;
            userToolkitPanel1.setVisible&#40;true&#41;;
        &#125;
*/

        // TODO add your handling code here&#58;
    &#125;                                                   

    private void AdminMenuAdminItemActionPerformed&#40;java.awt.event.ActionEvent evt&#41; &#123;                                                   

        setVisible&#40;false&#41;;
    MainMethods admin=new MainMethods&#40;&#41;;
    admin.SwitchUserToAdmin&#40;&#41;;
        // TODO add your handling code here&#58;
    &#125;                                                  

   




    double tstX= 23.727865;
    double tstY= 38.02058;


public void run&#40;double X,double Y&#41; throws InterruptedException &#123;
         System.out.println&#40;"run start"&#41;;
         for &#40;int i = 0; i < 10; i++&#41; &#123;

             tstX = tstX + 0.1;
             tstY= tstY + 0.1;
             System.out.println&#40;tstX&#41;;
            System.out.println&#40;"while loop"&#41;;
            addPointsToMap&#40;getPointsFromFile&#40;tstX,tstY&#41;&#41;;
            repaint&#40;&#41;;
            map1.redraw&#40;&#41;;
            try&#123;  Thread.sleep&#40;20&#41;;&#125;
            catch&#40;InterruptedException e&#41;&#123;&#125;
         &#125;
&#125;


    private void jButton1ActionPerformed&#40;java.awt.event.ActionEvent evt&#41; &#123;
        try &#123;
            run&#40;tstX, tstY&#41;;
            //        tstX = tstX + 0.1;
            //        try &#123;
            //            addPointsToMap&#40;getPointsFromFile&#40;tstX, tstY&#41;&#41;;
            //            map1.wait&#40;500&#41;;
            //
            //            map1.removeAll&#40;&#41;;
            //            Thread.sleep&#40;7000&#41;;
            //            initComponents&#40;&#41;;
            //            addPointsToMap&#40;getPointsFromFile&#40;tstX+0.5, tstY+0.5&#41;&#41;;
            //        &#125; catch &#40;InterruptedException ex&#41; &#123;
            //            Logger.getLogger&#40;UserFrame.class.getName&#40;&#41;&#41;.log&#40;Level.SEVERE, null, ex&#41;;
            //        &#125;
            // TODO add your handling code here&#58;
        &#125; catch &#40;InterruptedException ex&#41; &#123;
            Logger.getLogger&#40;UserFrame.class.getName&#40;&#41;&#41;.log&#40;Level.SEVERE, null, ex&#41;;
        &#125;
    &#125;

  


    /**
    * @param args the command line arguments
   
    public static void main&#40;String args&#91;&#93;&#41; &#123;
        java.awt.EventQueue.invokeLater&#40;new Runnable&#40;&#41; &#123;
            public void run&#40;&#41; &#123;
                new UserFrame&#40;&#41;.setVisible&#40;true&#41;;
            &#125;
        &#125;&#41;;
    &#125; */

    // Variables declaration - do not modify
    private javax.swing.JMenuItem AdminMenuAdminItem;
    private javax.swing.JPanel BottomUserPanel;
    private javax.swing.JCheckBoxMenuItem MapUserCheckBoxMenu;
    private javax.swing.JCheckBoxMenuItem RadarUserCheckBoxMenu;
    private javax.swing.JCheckBoxMenuItem RangeRadarUserCheckBoxMenu;
    private javax.swing.JCheckBoxMenuItem TargetsUserCheckBoxMenu;
    private javax.swing.JMenu ToolAdminMenu;
    private javax.swing.JMenu UserAdminMenu;
    private javax.swing.JCheckBoxMenuItem UserToolkitCheckBox;
    private javax.swing.JLabel Xlabel;
    private javax.swing.JLabel YLabel;
    private javax.swing.JButton jButton1;
    private javax.swing.JCheckBoxMenuItem jCheckBoxMenuItem5;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JSeparator jSeparator1;
    private com.esri.mo2.ui.bean.Layer layer1;
    private com.esri.mo2.ui.tb.LayerToolBar layerToolBar1;
    private com.esri.mo2.ui.bean.Map map1;
    private com.esri.mo2.ui.tb.ZoomPanToolBar zoomPanToolBar1;
    // End of variables declaration

&#125;

Άβαταρ μέλους
Basilakis
PHP Moderator
Δημοσιεύσεις: 8574
Εγγραφή: 17 Νοέμ 2003 13:03
Τοποθεσία: Womans' Brain
Επικοινωνία:

Java MapObjects kai moving point

Δημοσίευση από Basilakis » 27 Ιαν 2010 19:23

dimman24 έγραψε:
Se genikes kai mperdemenes grammes einai o parakatw kwdikas alla mexri ekei...!!!
ti prepei na kanw gia na koynisw ena point poy ftiaxnw???
Αυτό τώρα τι σημαίνει; Το έκανες εσύ ή όχι; :)

dimman24
Δημοσιεύσεις: 4
Εγγραφή: 11 Οκτ 2009 22:05

Java MapObjects kai moving point

Δημοσίευση από dimman24 » 27 Ιαν 2010 19:25

Basilakis έγραψε:
dimman24 έγραψε:
Se genikes kai mperdemenes grammes einai o parakatw kwdikas alla mexri ekei...!!!
ti prepei na kanw gia na koynisw ena point poy ftiaxnw???
Αυτό τώρα τι σημαίνει; Το έκανες εσύ ή όχι; :)

οχι αυτο σας λεω...! αλλα deadline ευχαριστω παντως για το ενδιαφερον!

Απάντηση

Επιστροφή στο “Java”

Μέλη σε σύνδεση

Μέλη σε αυτήν τη Δ. Συζήτηση: Δεν υπάρχουν εγγεγραμμένα μέλη και 1 επισκέπτης