diff --git a/build/built-jar.properties b/build/built-jar.properties index 72ac385..85dcdc7 100644 --- a/build/built-jar.properties +++ b/build/built-jar.properties @@ -1,4 +1,4 @@ -#Thu, 07 Feb 2019 21:38:24 -0600 +#Fri, 08 Feb 2019 09:19:53 -0600 C\:\\Users\\cd109\\Desktop\\temp2\\CancerGrowth= diff --git a/build/classes/cancergrowth/Cell.class b/build/classes/cancergrowth/Cell.class index aa6a2ac..084300d 100644 Binary files a/build/classes/cancergrowth/Cell.class and b/build/classes/cancergrowth/Cell.class differ diff --git a/build/classes/cancergrowth/CellPanel$1.class b/build/classes/cancergrowth/CellPanel$1.class index e4b16a8..45709dc 100644 Binary files a/build/classes/cancergrowth/CellPanel$1.class and b/build/classes/cancergrowth/CellPanel$1.class differ diff --git a/build/classes/cancergrowth/CellPanel$2.class b/build/classes/cancergrowth/CellPanel$2.class index 4dd5c55..c54dc76 100644 Binary files a/build/classes/cancergrowth/CellPanel$2.class and b/build/classes/cancergrowth/CellPanel$2.class differ diff --git a/build/classes/cancergrowth/CellPanel$3.class b/build/classes/cancergrowth/CellPanel$3.class index 8c83dfa..62e09a0 100644 Binary files a/build/classes/cancergrowth/CellPanel$3.class and b/build/classes/cancergrowth/CellPanel$3.class differ diff --git a/build/classes/cancergrowth/CellPanel$4.class b/build/classes/cancergrowth/CellPanel$4.class index 73cb6c0..8117c49 100644 Binary files a/build/classes/cancergrowth/CellPanel$4.class and b/build/classes/cancergrowth/CellPanel$4.class differ diff --git a/build/classes/cancergrowth/CellPanel.class b/build/classes/cancergrowth/CellPanel.class index 66ad2e2..3233701 100644 Binary files a/build/classes/cancergrowth/CellPanel.class and b/build/classes/cancergrowth/CellPanel.class differ diff --git a/src/cancergrowth/Cell.java b/src/cancergrowth/Cell.java index fcde5a9..2f0e240 100644 --- a/src/cancergrowth/Cell.java +++ b/src/cancergrowth/Cell.java @@ -21,7 +21,7 @@ public class Cell extends Object private int xval; // Declare variables like position, cycle timing private int yval; private ArrayList stages = new ArrayList(); - private int currentStage; + int currentStage; private int currentTime; private static final BufferedImage p0; private static BufferedImage[] p1 = new BufferedImage[12]; // Create cell images before the widnow opens diff --git a/src/cancergrowth/CellPanel.form b/src/cancergrowth/CellPanel.form index 718df4e..1145ccb 100644 --- a/src/cancergrowth/CellPanel.form +++ b/src/cancergrowth/CellPanel.form @@ -18,15 +18,23 @@ - - - - - - - - - + + + + + + + + + + + + + + + + + @@ -37,14 +45,16 @@ - + - + + + @@ -103,5 +113,13 @@ + + + + + + + + diff --git a/src/cancergrowth/CellPanel.java b/src/cancergrowth/CellPanel.java index 01aa37e..7eb35f7 100644 --- a/src/cancergrowth/CellPanel.java +++ b/src/cancergrowth/CellPanel.java @@ -97,7 +97,10 @@ public class CellPanel extends javax.swing.JPanel implements ActionListener, Cha { super.paintComponent(g); - + int g1 = 0; + int s = 0; + int g2 = 0; + int m = 0; int x = cells.size() - 1; for (int k = x; k >= 0; k--) // Use a loop to draw each cell { @@ -112,6 +115,18 @@ public class CellPanel extends javax.swing.JPanel implements ActionListener, Cha } else g.drawImage(t.getImage(), t.getX(), t.getY(), this); // otherwise, draw the cell + if(t.currentStage == 0) { + g1 ++; + } + if(t.currentStage == 1) { + s ++; + } + if(t.currentStage == 2) { + g2 ++; + } + if(t.currentStage == 3) { + m ++; + } //swingTimer.stop(); //} } @@ -136,6 +151,7 @@ public class CellPanel extends javax.swing.JPanel implements ActionListener, Cha kill = false; // turn off pacman } jLabel1.setText("Delay: " + delay + "ms. Hours since start: " + count + ". Cell Count: " + cells.size()); + jLabel2.setText("Cyclin G1: " + g1 * 99 + ". Cyclin S: " + s * 99 + ". Cyclin G2: " + g2 * 99 + ". Cyclin M: " + m * 99); System.out.println("Cell Count: " + cells.size()); //growing = false; } @@ -157,6 +173,7 @@ public class CellPanel extends javax.swing.JPanel implements ActionListener, Cha jButton1 = new javax.swing.JButton(); jButton2 = new javax.swing.JButton(); jButton3 = new javax.swing.JButton(); + jLabel2 = new javax.swing.JLabel(); speed.setMaximum(1000); speed.setMinimum(1); @@ -204,21 +221,29 @@ public class CellPanel extends javax.swing.JPanel implements ActionListener, Cha } }); + jLabel2.setFont(new java.awt.Font("Dialog", 1, 14)); // NOI18N + jLabel2.setText("jLabel2"); + org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this); this.setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) .add(layout.createSequentialGroup() .addContainerGap() - .add(speed, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(jLabel1) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 513, Short.MAX_VALUE) - .add(jButton3) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(jButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 63, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) - .add(jButton1) + .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) + .add(layout.createSequentialGroup() + .add(jLabel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 789, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .add(0, 199, Short.MAX_VALUE)) + .add(layout.createSequentialGroup() + .add(speed, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jLabel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .add(18, 18, 18) + .add(jButton3) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jButton2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 63, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) + .add(jButton1))) .add(18, 18, 18)) ); layout.setVerticalGroup( @@ -227,12 +252,14 @@ public class CellPanel extends javax.swing.JPanel implements ActionListener, Cha .addContainerGap() .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false) .add(org.jdesktop.layout.GroupLayout.LEADING, layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) - .add(jButton1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE) + .add(jButton1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .add(jLabel1) .add(jButton2) .add(jButton3)) .add(org.jdesktop.layout.GroupLayout.LEADING, speed, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addContainerGap(959, Short.MAX_VALUE)) + .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED, 934, Short.MAX_VALUE) + .add(jLabel2) + .addContainerGap()) ); }// //GEN-END:initComponents @@ -247,6 +274,8 @@ public class CellPanel extends javax.swing.JPanel implements ActionListener, Cha {//GEN-HEADEREND:event_jButton1ActionPerformed swingTimer.setDelay(delay); // When we press start, start the simulation swingTimer.start(); + kill = false; + dontkill = false; }//GEN-LAST:event_jButton1ActionPerformed private void jButton2ActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_jButton2ActionPerformed @@ -289,6 +318,7 @@ public class CellPanel extends javax.swing.JPanel implements ActionListener, Cha // TODO add your handling code here: kill = true; dontkill = true; + swingTimer.setDelay(100); }//GEN-LAST:event_jButton3ActionPerformed @@ -297,6 +327,7 @@ public class CellPanel extends javax.swing.JPanel implements ActionListener, Cha private javax.swing.JButton jButton2; private javax.swing.JButton jButton3; private javax.swing.JLabel jLabel1; + private javax.swing.JLabel jLabel2; private javax.swing.JSlider speed; // End of variables declaration//GEN-END:variables