Exemplo n.º 1
0
 void drawOvalOrRectangle(Graphics g, DrawObject R, boolean isRect) {
   if (R == null) {
     return;
   }
   if ((sequencingOn) && (R.sequenceNum != currentSequenceNumDisplay)) {
     return;
   }
   Graphics2D g2 = (Graphics2D) g;
   g2.setStroke(R.drawStroke);
   int x1 = (int) ((R.x - minX) / (maxX - minX) * (D.width - 2 * inset));
   int y1 = (int) ((R.y - minY) / (maxY - minY) * (D.height - 2.0 * inset));
   double x = R.x + R.width;
   double y = R.y - R.height;
   int x2 = (int) ((x - minX) / (maxX - minX) * (D.width - 2 * inset));
   int y2 = (int) ((y - minY) / (maxY - minY) * (D.height - 2.0 * inset));
   if (isRect) {
     g.drawRect(inset + x1, D.height - y1 - inset, x2 - x1, y1 - y2);
   } else {
     g.drawOval(inset + x1, D.height - y1 - inset, x2 - x1, y1 - y2);
   }
 }
 // Paint the border of the button using a simple stroke.
 protected void paintBorder(Graphics g) {
   g.setColor(getForeground());
   g.drawOval(0, 0, getSize().width - 1, getSize().height - 1);
 }