diff --git a/shukan/ShukanView.java b/shukan/ShukanView.java index cb45a9de5d6f322053452c6bb11ed6e08871b40e..a8f3e92eec8547c43ae17b2dbb59e85892c750f4 100644 --- a/shukan/ShukanView.java +++ b/shukan/ShukanView.java @@ -135,7 +135,7 @@ public class ShukanView extends JPanel return (appliHeight); } - /** Draws Shukan view. + /** Draws Shukan view. */ public void paintComponent (Graphics g) { @@ -151,9 +151,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); @@ -164,19 +164,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; @@ -237,7 +238,7 @@ public class ShukanView extends JPanel appliHeight = STD_APPLI_HEIGHT; } } - + /** Displays the calendar grid background. */ private void displayCalendar (Graphics2D g2)