Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
public void paintComponent(Graphics g) {
super.paintComponent(g);
Graphics2D g2 = (Graphics2D) g;
g2.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
g2.setFont(new Font("Arial", Font.BOLD, 10));
int hBase = 16;
int wBase = 45;
// draw vertical line
g2.drawLine(wBase, getHeight() - hBase, getWidth() - 1, getHeight() - hBase);
// draw vertical ticks
int nVerticalTicks = 5;
for (int i = 0; i < nVerticalTicks; i++) {
int x = wBase;
int y = (int) (getHeight() - hBase - (i + 0.5) * (getHeight() - hBase) / nVerticalTicks);
g2.drawLine(x - 2, y, x + 2, y);
}
// draw vertical labels
double vTickInterval = (this.solutionIntervalEnd - this.solutionIntervalStart) / nVerticalTicks;
for (int i = 0; i < nVerticalTicks; i++) {
long value = (long) (this.solutionIntervalStart + (i + 0.5) * vTickInterval);
String label = SolutionUtils.format(value);
FontMetrics fontMetrics = g2.getFontMetrics();
int width = fontMetrics.stringWidth(label);
int height = fontMetrics.getAscent();
int x = wBase - width - 4;
int y = (int) (getHeight() - hBase - (i + 0.5) * (getHeight() - hBase) / nVerticalTicks + height / 2 - 1);
g2.drawString(label, x, y);
}
// draw horizontal line
g2.drawLine(wBase, 0, wBase, getHeight() - hBase - 1);
// draw horizontal ticks
int nHorizontalTicks = 11;
for (int i = 0; i < nHorizontalTicks; i++) {
int x = (int) (wBase + (i + 0.5) * (getWidth() - wBase) / nHorizontalTicks);
int y = getHeight() - hBase;
g2.drawLine(x, y - 2, x, y + 2);
}
// draw horizontal labels
for (int i = 0; i < nHorizontalTicks; i++) {
String label = this.solutionTimes.size() / nHorizontalTicks * (i + 1) + "";
FontMetrics fontMetrics = g2.getFontMetrics();
int width = fontMetrics.stringWidth(label);
int height = fontMetrics.getAscent();
int x = (int) (wBase + (i + 0.5) * (getWidth() - wBase) / nHorizontalTicks - width / 2);
int y = getHeight() - (hBase - height) / 2;
g2.drawString(label, x, y);
}
// draw points
int nBins = getWidth() - wBase;
ArrayList<ArrayList<Long>> bins = new ArrayList<ArrayList<Long>>(this.solutionTimes.size());
for (int i = 0; i < this.solutionTimes.size(); i++) {
bins.add(new ArrayList<Long>());
}
for (int i = 0; i < this.solutionTimes.size(); i++) {
bins.get(this.solutionTimes.size() - (i + 1)).add(this.solutionTimes.get(i));
}
for (int i = 0; i < this.solutionTimes.size(); i++) {
if (bins.get(i).size() > 0) {
long mean = 0;
for (long time : bins.get(i)) {
mean += time;
}
mean /= bins.get(i).size();
if (mean >= this.solutionIntervalStart && mean < this.solutionIntervalEnd) {
int x = (int) (wBase + ((double) nBins / (double) this.solutionTimes.size()) * (i + 1));
int y = (int) (getHeight() - hBase - (getHeight() - hBase) * (mean - this.solutionIntervalStart) / (this.solutionIntervalEnd - this.solutionIntervalStart));
g2.fillRect(x - 1, y - 1, 3, 3);
}
}
}
}
Is there a way to see Ao100 (instead of just Mo100)?
How do I get this as a program on my computer, like one that I don't need internet to run? I'm not good with stuff like this, please help me out. Thanks.
i cant find something where you can type youre times...
I am on windows 8. First of all install Java. I am guessing you dont have java. Then reboot and then try opening it again! If it dosent open, try "Open With" and there select java!I am having trouble with this timer on windows 8, every time I attempt to open it, it opens in notepad and either freezes or has a bunch of nonsense in the notepad. Anyone know how to make it work on windows 8?
I am on windows 8. First of all install Java. I am guessing you dont have java. Then reboot and then try opening it again! If it dosent open, try "Open With" and there select java!
Java link: https://www.java.com/en/download/
In the top left of the scramble box, there is a hide box.