[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz/doc/pegboard 1019/PEG_1019.rst 1020/PEG_102...
From: |
Tuomas J. Lukka |
Subject: |
[Gzz-commits] gzz/doc/pegboard 1019/PEG_1019.rst 1020/PEG_102... |
Date: |
Fri, 25 Oct 2002 04:17:06 -0400 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Tuomas J. Lukka <address@hidden> 02/10/25 04:17:06
Modified files:
doc/pegboard/1019: PEG_1019.rst
doc/pegboard/1020: PEG_1020.rst
Added files:
doc/pegboard/1021: click.rst
Log message:
Mouse click peg
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/doc/pegboard/1019/PEG_1019.rst.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/doc/pegboard/1020/PEG_1020.rst.diff?tr1=1.4&tr2=1.5&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/doc/pegboard/1021/click.rst?rev=1.1
Patches:
Index: gzz/doc/pegboard/1019/PEG_1019.rst
diff -u gzz/doc/pegboard/1019/PEG_1019.rst:1.1
gzz/doc/pegboard/1019/PEG_1019.rst:1.2
--- gzz/doc/pegboard/1019/PEG_1019.rst:1.1 Sat Oct 19 04:55:45 2002
+++ gzz/doc/pegboard/1019/PEG_1019.rst Fri Oct 25 04:17:05 2002
@@ -3,8 +3,8 @@
=============================================================
:Authors: Tuomas Lukka
-:Date: $Date: 2002/10/19 08:55:45 $
-:Revision: $Revision: 1.1 $
+:Date: $Date: 2002/10/25 08:17:05 $
+:Revision: $Revision: 1.2 $
:Status: Incomplete
The newest VobCoorder changes make it much more usable but leave
@@ -32,7 +32,7 @@
rename affineCoordsys to affine, to be consistent with others.
VobScene
- for all *CS methods, add two versions. for example::
+ for all ``*CS`` methods, add two versions. for example::
final public int orthoCS(int into, Object key, float depth,
float x, float y, float w, float h) ;
Index: gzz/doc/pegboard/1020/PEG_1020.rst
diff -u gzz/doc/pegboard/1020/PEG_1020.rst:1.4
gzz/doc/pegboard/1020/PEG_1020.rst:1.5
--- gzz/doc/pegboard/1020/PEG_1020.rst:1.4 Thu Oct 24 10:42:29 2002
+++ gzz/doc/pegboard/1020/PEG_1020.rst Fri Oct 25 04:17:06 2002
@@ -3,8 +3,8 @@
=============================================================
:Authors: Matti Katila
-:Date: $Date: 2002/10/24 14:42:29 $
-:Revision: $Revision: 1.4 $
+:Date: $Date: 2002/10/25 08:17:06 $
+:Revision: $Revision: 1.5 $
:Status: Incomplete
@@ -26,7 +26,8 @@
What is needed for Calendar?
- -Coordinating system:
+ -Coordinating system::
+
.......
---------- . ----.-------
| Screen | <---- mapping <--- . | Ja.uary |
@@ -49,25 +50,25 @@
-Use cpu wisely and draw only needed parts.
- -Format/layout?
+ -Format/layout? ::
- |---|
- | |
- |---| -----------...-------------
- | | | | | | | | |
- |---| -----------...-------------
- | | horizontal
- |---|
- . .
- . .
- . . -----------------
- |---| | | | | |
- | | -----------------
- |---| | | | | |
- -----------------
- vertical | | | | |
- -----------------
- matrix
+ |---|
+ | |
+ |---| -----------...-------------
+ | | | | | | | | |
+ |---| -----------...-------------
+ | | horizontal
+ |---|
+ . .
+ . .
+ . . -----------------
+ |---| | | | | |
+ | | -----------------
+ |---| | | | | |
+ -----------------
+ vertical | | | | |
+ -----------------
+ matrix
New Object
@@ -79,14 +80,15 @@
-Weekdays: string[7]
-these must be countable:
- -first weekday of the Month
- _______________
- |___________|_| /|\
- |_|_|_|_|_|_|_| |
- |_|_|_|_|_|_|_| -height (4...6)
- |_|_|_|_|_|_|_| |
- |_|_|_|_|_|_|_| |
- |_|_|_________| \|/
+ -first weekday of the Month ::
+
+ _______________
+ |___________|_| /|\
+ |_|_|_|_|_|_|_| |
+ |_|_|_|_|_|_|_| -height (4...6)
+ |_|_|_|_|_|_|_| |
+ |_|_|_|_|_|_|_| |
+ |_|_|_________| \|/
-also days per month is needed
@@ -100,144 +102,145 @@
TextPrototype
-------------
+Code::
-import java.util.*;
-
-public class TextCalendar {
- static void p(String s) { System.out.print(s); }
- static void pln(String s) { System.out.println(s); }
-
- // notice common factor, 12
- private int weeks_in_month[] = new int[12];
- private int empty_before_first_day[] = new int[12];
- private int days_in_month[] = new int[12];
-
-
- public TextCalendar() {
-
- // get the supported ids for GMT-08:00 (Pacific Standard Time)
- String[] ids = TimeZone.getAvailableIDs(-8 * 60 * 60 * 1000);
-
- // if no ids were returned, something is wrong. get out.
- if (ids.length == 0)
- System.exit(0);
+ import java.util.*;
- // create a Pacific Standard Time time zone
- SimpleTimeZone pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids[0]);
+ public class TextCalendar {
+ static void p(String s) { System.out.print(s); }
+ static void pln(String s) { System.out.println(s); }
+
+ // notice common factor, 12
+ private int weeks_in_month[] = new int[12];
+ private int empty_before_first_day[] = new int[12];
+ private int days_in_month[] = new int[12];
- // set up rules for daylight savings time
- pdt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2 * 60 * 60 *
1000);
- pdt.setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * 60 * 60 *
1000);
- Calendar calendar = new GregorianCalendar(pdt);
- calendar.setFirstDayOfWeek(Calendar.MONDAY);
+
+ public TextCalendar() {
- Date date = new Date();
- date.setYear(calendar.YEAR);
+ // get the supported ids for GMT-08:00 (Pacific Standard Time)
+ String[] ids = TimeZone.getAvailableIDs(-8 * 60 * 60 * 1000);
- pln(" * Year: " + calendar.get(calendar.YEAR));
+ // if no ids were returned, something is wrong. get out.
+ if (ids.length == 0)
+ System.exit(0);
- for (int month = 0; month < 12; month++) {
+ // create a Pacific Standard Time time zone
+ SimpleTimeZone pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000,
ids[0]);
- // set first day of month
- date.setDate(1);
- date.setMonth(month);
- calendar.setTime(date);
+ // set up rules for daylight savings time
+ pdt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2 * 60 * 60 *
1000);
+ pdt.setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * 60 * 60 *
1000);
+ Calendar calendar = new GregorianCalendar(pdt);
+ calendar.setFirstDayOfWeek(Calendar.MONDAY);
- // print month
- p("\n" +
- monthStr(calendar.get(Calendar.MONTH)) +
- " " + (calendar.get(Calendar.MONTH)+1) +
- "\n ");
-
- // count empty day at the beginning of the month.
- if (calendar.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
- empty_before_first_day[month] = 6;
- } else {
- empty_before_first_day[month] =
- calendar.get(Calendar.DAY_OF_WEEK) - 2;
- }
+ Date date = new Date();
+ date.setYear(calendar.YEAR);
- // print empty spaces at the beginning of month if needed..
- for (int i=0; i< empty_before_first_day[month]; i++) {
- p(" ");
- }
+ pln(" * Year: " + calendar.get(calendar.YEAR));
+ for (int month = 0; month < 12; month++) {
- // generate one month a day by day
- for (int day=1; day<33; day++) {
- date.setDate(day);
+ // set first day of month
+ date.setDate(1);
+ date.setMonth(month);
calendar.setTime(date);
- // over-month checking
- if (date.getDate() < day) {
- days_in_month[month] = day - 1;
- break;
+ // print month
+ p("\n" +
+ monthStr(calendar.get(Calendar.MONTH)) +
+ " " + (calendar.get(Calendar.MONTH)+1) +
+ "\n ");
+
+ // count empty day at the beginning of the month.
+ if (calendar.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
+ empty_before_first_day[month] = 6;
+ } else {
+ empty_before_first_day[month] =
+ calendar.get(Calendar.DAY_OF_WEEK) - 2;
}
- // print weekday and date
- p(dayStr(calendar.get(Calendar.DAY_OF_WEEK))+
- " " +
- calendar.get(Calendar.DATE) + ", "
- );
+ // print empty spaces at the beginning of month if needed..
+ for (int i=0; i< empty_before_first_day[month]; i++) {
+ p(" ");
+ }
- // if sunday, print "\n" and increment weeks
- if (calendar.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
- p("\n ");
- weeks_in_month[month] += 1;
+
+ // generate one month a day by day
+ for (int day=1; day<33; day++) {
+ date.setDate(day);
+ calendar.setTime(date);
+
+ // over-month checking
+ if (date.getDate() < day) {
+ days_in_month[month] = day - 1;
+ break;
+ }
+
+ // print weekday and date
+ p(dayStr(calendar.get(Calendar.DAY_OF_WEEK))+
+ " " +
+ calendar.get(Calendar.DATE) + ", "
+ );
+
+ // if sunday, print "\n" and increment weeks
+ if (calendar.get(Calendar.DAY_OF_WEEK) == Calendar.SUNDAY) {
+ p("\n ");
+ weeks_in_month[month] += 1;
+ }
}
+ pln("\n ** Weeks: " + weeks_in_month[month] +
+ ", " + empty_before_first_day[month] +
+ " - empty days at the beginning of the month, " +
+ days_in_month[month] +" days in month");
}
- pln("\n ** Weeks: " + weeks_in_month[month] +
- ", " + empty_before_first_day[month] +
- " - empty days at the beginning of the month, " +
- days_in_month[month] +" days in month");
- }
- }
+ }
- private String dayStr(int day) {
+ private String dayStr(int day) {
- if ( day < Calendar.SUNDAY || day > Calendar.SATURDAY ) return "ERROR";
+ if ( day < Calendar.SUNDAY || day > Calendar.SATURDAY ) return
"ERROR";
- switch(day) {
- case Calendar.MONDAY: return "Ma";
- case Calendar.TUESDAY: return "Ti";
- case Calendar.WEDNESDAY: return "Ke";
- case Calendar.THURSDAY: return "To";
- case Calendar.FRIDAY: return "Pe";
- case Calendar.SATURDAY: return "La";
- case Calendar.SUNDAY: return "Su";
- }
- return "Error";
- }
+ switch(day) {
+ case Calendar.MONDAY: return "Ma";
+ case Calendar.TUESDAY: return "Ti";
+ case Calendar.WEDNESDAY: return "Ke";
+ case Calendar.THURSDAY: return "To";
+ case Calendar.FRIDAY: return "Pe";
+ case Calendar.SATURDAY: return "La";
+ case Calendar.SUNDAY: return "Su";
+ }
+ return "Error";
+ }
- private String monthStr(int month) {
- if ( month < 0 || month > 11) return "ERROR";
-
- String ret ="";
+ private String monthStr(int month) {
+ if ( month < 0 || month > 11) return "ERROR";
+
+ String ret ="";
- switch(month) {
- case 0: ret = "Tammi"; break;
- case 1: ret = "Helmi"; break;
- case 2: ret = "Maalis"; break;
- case 3: ret = "Huhti"; break;
- case 4: ret = "Touko"; break;
- case 5: ret = "Kesä"; break;
- case 6: ret = "Heinä"; break;
- case 7: ret = "Elo"; break;
- case 8: ret = "Syys"; break;
- case 9: ret = "Loka"; break;
- case 10: ret = "Marras"; break;
- case 11: ret = "Joulu"; break;
+ switch(month) {
+ case 0: ret = "Tammi"; break;
+ case 1: ret = "Helmi"; break;
+ case 2: ret = "Maalis"; break;
+ case 3: ret = "Huhti"; break;
+ case 4: ret = "Touko"; break;
+ case 5: ret = "Kesä"; break;
+ case 6: ret = "Heinä"; break;
+ case 7: ret = "Elo"; break;
+ case 8: ret = "Syys"; break;
+ case 9: ret = "Loka"; break;
+ case 10: ret = "Marras"; break;
+ case 11: ret = "Joulu"; break;
+ }
+ return ret + "kuu";
}
- return ret + "kuu";
- }
- public static void main(String [] arg) {
- TextCalendar c = new TextCalendar();
+ public static void main(String [] arg) {
+ TextCalendar c = new TextCalendar();
+ }
}
-}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz/doc/pegboard 1019/PEG_1019.rst 1020/PEG_102...,
Tuomas J. Lukka <=