Rafał Selewońko avatar Rafał Selewońko committed 6bdcd4b

dzialajaca wlasna macierz dla morfologicznych i wlasny splotowy

Comments (0)

Files changed (2)

Binary file modified.

src/selershop/SelerShopView.java

         int y = Integer.parseInt(rozmiarYSpinner.getValue().toString());
         int a,b;
         for (Component c : panelMacierzy.getComponents()){
-            a = Integer.parseInt(((JTextField)c).getName().substring(7, 8));
-            b = Integer.parseInt(((JTextField)c).getName().substring(8, 9));
+            a = Integer.parseInt(((JTextField)c).getName().substring(8, 9));
+            b = Integer.parseInt(((JTextField)c).getName().substring(7, 8));
             if(a < x && b < y){
                 ((JTextField)c).setEnabled(true);
             } else {
         float[] m = new float[rozmiarX*rozmiarY];
         int a=0,b=0, i=0, j=0;
         for (Component c : panelMacierzy.getComponents()){
-            a = Integer.parseInt(((JTextField)c).getName().substring(7, 8));
-            b = Integer.parseInt(((JTextField)c).getName().substring(8, 9));
+            a = Integer.parseInt(((JTextField)c).getName().substring(8, 9));
+            b = Integer.parseInt(((JTextField)c).getName().substring(7, 8));
             if(a < rozmiarX && b < rozmiarY){
-                m[i+j]= new Float(((JTextField)c).getText());
+                m[a*rozmiarX+b]= Float.parseFloat(((JTextField)c).getText());
+                System.out.println("x="+a + ", y="+b+", z="+ Float.parseFloat(((JTextField)c).getText()));
             }
             i++; j++;
             if(i >= rozmiarX) i = 0;
         // TODO add your handling code here:
     }//GEN-LAST:event_jMenu2ActionPerformed
     private void wlasnyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_wlasnyActionPerformed
-           pobierzMacierz();
-           plotno.Splot(macierz, rozmiarX, rozmiarY);
+        pobierzMacierz();
+        for(int i=0; i<macierz.length;i++)
+            System.out.print(macierz[i]+ ", ");
+        plotno.Splot(macierz, rozmiarX, rozmiarY);
     }//GEN-LAST:event_wlasnyActionPerformed
 
     private void obliczHistogramActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_obliczHistogramActionPerformed
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.