You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2009/11/03 23:01:36 UTC
svn commit: r832576 - in /incubator/pivot/trunk:
tutorials/src/org/apache/pivot/tutorials/calendars/ tutorials/www/
wtk/src/org/apache/pivot/wtk/ wtk/src/org/apache/pivot/wtk/skin/
Author: gbrown
Date: Tue Nov 3 22:01:33 2009
New Revision: 832576
URL: http://svn.apache.org/viewvc?rev=832576&view=rev
Log:
Minor fixes and updates.
Modified:
incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/calendars/Calendars.java
incubator/pivot/trunk/tutorials/www/calendars.html
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Calendar.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/CalendarButton.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ColorChooserButton.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java
Modified: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/calendars/Calendars.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/calendars/Calendars.java?rev=832576&r1=832575&r2=832576&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/calendars/Calendars.java (original)
+++ incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/calendars/Calendars.java Tue Nov 3 22:01:33 2009
@@ -85,7 +85,11 @@
updatingSelectedDate = true;
calendar.setSelectedDate(selectedDate);
+ calendar.setYear(selectedDate.year);
+ calendar.setMonth(selectedDate.month);
+
calendarButton.setSelectedDate(selectedDate);
+
selectedDateLabel.setText(selectedDate.toString());
updatingSelectedDate = false;
Modified: incubator/pivot/trunk/tutorials/www/calendars.html
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/www/calendars.html?rev=832576&r1=832575&r2=832576&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/www/calendars.html (original)
+++ incubator/pivot/trunk/tutorials/www/calendars.html Tue Nov 3 22:01:33 2009
@@ -45,8 +45,8 @@
+ ",lib/pivot-wtk-" + version + ".jar"
+ ",lib/pivot-wtk-" + version + ".terra.jar"
+ ",lib/pivot-tutorials-" + version + ".jar",
- width:360,
- height:480
+ width:300,
+ height:400
};
var parameters = {application_class_name:"org.apache.pivot.tutorials.calendars.Calendars",
codebase_lookup:false,
@@ -159,7 +159,11 @@
updatingSelectedDate = true;
calendar.setSelectedDate(selectedDate);
+ calendar.setYear(selectedDate.year);
+ calendar.setMonth(selectedDate.month);
+
calendarButton.setSelectedDate(selectedDate);
+
selectedDateLabel.setText(selectedDate.toString());
updatingSelectedDate = false;
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Calendar.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Calendar.java?rev=832576&r1=832575&r2=832576&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Calendar.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Calendar.java Tue Nov 3 22:01:33 2009
@@ -175,9 +175,7 @@
public void setSelectedDate(CalendarDate selectedDate) {
CalendarDate previousSelectedDate = this.selectedDate;
- if (((previousSelectedDate == null) ^ (selectedDate == null))
- || (previousSelectedDate != null
- && !previousSelectedDate.equals(selectedDate))) {
+ if (previousSelectedDate != selectedDate) {
this.selectedDate = selectedDate;
calendarSelectionListeners.selectedDateChanged(this, previousSelectedDate);
}
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/CalendarButton.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/CalendarButton.java?rev=832576&r1=832575&r2=832576&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/CalendarButton.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/CalendarButton.java Tue Nov 3 22:01:33 2009
@@ -135,9 +135,7 @@
public void setSelectedDate(CalendarDate selectedDate) {
CalendarDate previousSelectedDate = this.selectedDate;
- if (((previousSelectedDate == null) ^ (selectedDate == null))
- || (previousSelectedDate != null
- && !previousSelectedDate.equals(selectedDate))) {
+ if (previousSelectedDate != selectedDate) {
this.selectedDate = selectedDate;
calendarButtonSelectionListeners.selectedDateChanged(this,
previousSelectedDate);
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ColorChooserButton.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ColorChooserButton.java?rev=832576&r1=832575&r2=832576&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ColorChooserButton.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ColorChooserButton.java Tue Nov 3 22:01:33 2009
@@ -109,9 +109,7 @@
public void setSelectedColor(Color selectedColor) {
Color previousSelectedColor = this.selectedColor;
- if (((previousSelectedColor == null) ^ (selectedColor == null))
- || (previousSelectedColor != null
- && !previousSelectedColor.equals(selectedColor))) {
+ if (previousSelectedColor != selectedColor) {
this.selectedColor = selectedColor;
colorChooserButtonSelectionListeners.selectedColorChanged(this,
previousSelectedColor);
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java?rev=832576&r1=832575&r2=832576&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextAreaSkin.java Tue Nov 3 22:01:33 2009
@@ -538,26 +538,28 @@
i++;
}
- NodeView nodeView = get(i);
- offset = nodeView.getNextInsertionPoint(x - nodeView.getX(),
- from - nodeView.getOffset(), direction);
+ if (i < n) {
+ NodeView nodeView = get(i);
+ offset = nodeView.getNextInsertionPoint(x - nodeView.getX(),
+ from - nodeView.getOffset(), direction);
+
+ if (offset == -1) {
+ // Move to the next or previous node view
+ if (direction == Direction.FORWARD) {
+ nodeView = (i < n - 1) ? get(i + 1) : null;
+ } else {
+ nodeView = (i > 0) ? get(i - 1) : null;
+ }
- if (offset == -1) {
- // Move to the next or previous node view
- if (direction == Direction.FORWARD) {
- nodeView = (i < n - 1) ? get(i + 1) : null;
- } else {
- nodeView = (i > 0) ? get(i - 1) : null;
+ if (nodeView != null) {
+ offset = nodeView.getNextInsertionPoint(x - nodeView.getX(), -1, direction);
+ }
}
- if (nodeView != null) {
- offset = nodeView.getNextInsertionPoint(x - nodeView.getX(), -1, direction);
+ if (offset != -1) {
+ offset += nodeView.getOffset();
}
}
-
- if (offset != -1) {
- offset += nodeView.getOffset();
- }
}
}