add cyclin measurements
This commit is contained in:
parent
98f6c0f768
commit
bbb3ae4870
@ -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=
|
||||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -21,7 +21,7 @@ public class Cell extends Object
|
||||
private int xval; // Declare variables like position, cycle timing
|
||||
private int yval;
|
||||
private ArrayList<Integer> stages = new ArrayList<Integer>();
|
||||
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
|
||||
|
@ -18,15 +18,23 @@
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" alignment="0" attributes="0">
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="speed" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace pref="513" max="32767" attributes="0"/>
|
||||
<Component id="jButton3" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jButton2" min="-2" pref="63" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="0" attributes="0">
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="jLabel2" min="-2" pref="789" max="-2" attributes="0"/>
|
||||
<EmptySpace min="0" pref="199" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<Group type="102" attributes="0">
|
||||
<Component id="speed" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jLabel1" max="32767" attributes="0"/>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
<Component id="jButton3" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jButton2" min="-2" pref="63" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
<EmptySpace type="separate" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
@ -37,14 +45,16 @@
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
<Group type="103" groupAlignment="1" max="-2" attributes="0">
|
||||
<Group type="103" alignment="0" groupAlignment="3" attributes="0">
|
||||
<Component id="jButton1" alignment="3" pref="0" max="32767" attributes="0"/>
|
||||
<Component id="jButton1" alignment="3" max="32767" attributes="0"/>
|
||||
<Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
<Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||
</Group>
|
||||
<Component id="speed" alignment="0" max="32767" attributes="0"/>
|
||||
</Group>
|
||||
<EmptySpace pref="959" max="32767" attributes="0"/>
|
||||
<EmptySpace pref="934" max="32767" attributes="0"/>
|
||||
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
|
||||
<EmptySpace max="-2" attributes="0"/>
|
||||
</Group>
|
||||
</Group>
|
||||
</DimensionLayout>
|
||||
@ -103,5 +113,13 @@
|
||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/>
|
||||
</Events>
|
||||
</Component>
|
||||
<Component class="javax.swing.JLabel" name="jLabel2">
|
||||
<Properties>
|
||||
<Property name="font" type="java.awt.Font" editor="org.netbeans.beaninfo.editors.FontEditor">
|
||||
<Font name="Dialog" size="14" style="1"/>
|
||||
</Property>
|
||||
<Property name="text" type="java.lang.String" value="jLabel2"/>
|
||||
</Properties>
|
||||
</Component>
|
||||
</SubComponents>
|
||||
</Form>
|
||||
|
@ -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())
|
||||
);
|
||||
}// </editor-fold>//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
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user