diff --git a/shukan/ShukanView.java b/shukan/ShukanView.java index cdf4d7bdccb8978b2c71a82a529336a73f2a53b4..61d33bc5eda81a96beb630d2a46b03ffaff1804a 100644 --- a/shukan/ShukanView.java +++ b/shukan/ShukanView.java @@ -133,7 +133,7 @@ public class ShukanView extends JPanel return (appliHeight); } - /** Draws Shukan view. + /** Draws Shukan view. */ public void paintComponent (Graphics g) { @@ -149,9 +149,9 @@ public class ShukanView extends JPanel for (i = 0; i <= nbModules; i++) { int y = appliHeight - (i + 1) * 3 * textHeight + 2*textHeight; - - - if (i % 2 == 1) + + + if (i % 2 == 1) { g2.setColor (BACK_COLOR); drawBox (g2,0, y, w, 3 * textHeight); @@ -162,19 +162,20 @@ public class ShukanView extends JPanel drawBox (g2, 0, y, w, 3 * textHeight); } } - + displayCalendar (g2); - + } - - + + /** Detects a zone from window coords. */ public boolean select (int x, int y, boolean zone) { // Out of the active part of the window if (y < textHeight || y > appliHeight - 2 * textHeight) return (false); + if (x < 0 || x > appliWidth) return (false); // Module detection y -= textHeight; @@ -235,7 +236,7 @@ public class ShukanView extends JPanel appliHeight = STD_APPLI_HEIGHT; } } - + /** Displays the calendar grid background. */ private void displayCalendar (Graphics2D g2)