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 2010/06/23 18:23:29 UTC
svn commit: r957261 - in /pivot/trunk: tests/src/org/apache/pivot/tests/
tools/src/org/apache/pivot/tools/wtk/
tutorials/src/org/apache/pivot/tutorials/text/
wtk-terra/src/org/apache/pivot/wtk/skin/terra/
wtk/src/org/apache/pivot/wtk/ wtk/src/org/apach...
Author: gbrown
Date: Wed Jun 23 16:23:28 2010
New Revision: 957261
URL: http://svn.apache.org/viewvc?rev=957261&view=rev
Log:
Eliminate Component preferred size limit properties and replace with size limits (PIVOT-473).
Modified:
pivot/trunk/tests/src/org/apache/pivot/tests/WindowTest.java
pivot/trunk/tools/src/org/apache/pivot/tools/wtk/ComponentInspectorSkin.java
pivot/trunk/tutorials/src/org/apache/pivot/tutorials/text/text_areas.bxml
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.java
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSplitPaneSkin.java
pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSuggestionPopupSkin.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentListener.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java
pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java
Modified: pivot/trunk/tests/src/org/apache/pivot/tests/WindowTest.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tests/src/org/apache/pivot/tests/WindowTest.java?rev=957261&r1=957260&r2=957261&view=diff
==============================================================================
--- pivot/trunk/tests/src/org/apache/pivot/tests/WindowTest.java (original)
+++ pivot/trunk/tests/src/org/apache/pivot/tests/WindowTest.java Wed Jun 23 16:23:28 2010
@@ -42,10 +42,10 @@ public class WindowTest implements Appli
public void startup(Display display, Map<String, String> properties) {
window1.setTitle("Window 1");
window1.setPreferredSize(320, 240);
- window1.setMinimumPreferredWidth(220);
- window1.setMaximumPreferredWidth(420);
- window1.setMinimumPreferredHeight(140);
- window1.setMaximumPreferredHeight(340);
+ window1.setMinimumWidth(220);
+ window1.setMaximumWidth(420);
+ window1.setMinimumHeight(140);
+ window1.setMaximumHeight(340);
window1.getComponentListeners().add(new ComponentListener.Adapter() {
@Override
Modified: pivot/trunk/tools/src/org/apache/pivot/tools/wtk/ComponentInspectorSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/tools/src/org/apache/pivot/tools/wtk/ComponentInspectorSkin.java?rev=957261&r1=957260&r2=957261&view=diff
==============================================================================
--- pivot/trunk/tools/src/org/apache/pivot/tools/wtk/ComponentInspectorSkin.java (original)
+++ pivot/trunk/tools/src/org/apache/pivot/tools/wtk/ComponentInspectorSkin.java Wed Jun 23 16:23:28 2010
@@ -1312,7 +1312,7 @@ abstract class ComponentInspectorSkin ex
CalendarDate calendarDate = (CalendarDate)dictionary.get(key);
CalendarButton calendarButton = new CalendarButton();
- calendarButton.setMinimumPreferredWidth(75);
+ calendarButton.setMinimumWidth(75);
calendarButton.setSelectedDate(calendarDate);
section.add(calendarButton);
Form.setLabel(calendarButton, key);
Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/text/text_areas.bxml
URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/text/text_areas.bxml?rev=957261&r1=957260&r2=957261&view=diff
==============================================================================
--- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/text/text_areas.bxml (original)
+++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/text/text_areas.bxml Wed Jun 23 16:23:28 2010
@@ -38,7 +38,7 @@ limitations under the License.
<TablePane.Row height="-1">
<Border styles="{color:10}">
- <TextArea minimumPreferredHeight="80" text="@sample2.txt"/>
+ <TextArea minimumHeight="80" text="@sample2.txt"/>
</Border>
</TablePane.Row>
</TablePane>
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.java?rev=957261&r1=957260&r2=957261&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.java Wed Jun 23 16:23:28 2010
@@ -81,8 +81,8 @@ public class TerraFileBrowserSheetSkin e
super.install(component);
final FileBrowserSheet fileBrowserSheet = (FileBrowserSheet)component;
- fileBrowserSheet.setMinimumPreferredWidth(360);
- fileBrowserSheet.setMinimumPreferredHeight(180);
+ fileBrowserSheet.setMinimumWidth(360);
+ fileBrowserSheet.setMinimumHeight(180);
// Load the sheet content
Resources resources;
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java?rev=957261&r1=957260&r2=957261&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java Wed Jun 23 16:23:28 2010
@@ -721,15 +721,15 @@ public class TerraFrameSkin extends Wind
if (frame.isPreferredWidthSet()) {
preferredWidth = Math.max(location.x - frame.getX() + resizeOffset.x,
titleBarTablePane.getPreferredWidth(-1) + 2);
- preferredWidth = Math.min(preferredWidth, frame.getMaximumPreferredWidth());
- preferredWidth = Math.max(preferredWidth, frame.getMinimumPreferredWidth());
+ preferredWidth = Math.min(preferredWidth, frame.getMaximumWidth());
+ preferredWidth = Math.max(preferredWidth, frame.getMinimumWidth());
}
if (frame.isPreferredHeightSet()) {
preferredHeight = Math.max(location.y - frame.getY() + resizeOffset.y,
titleBarTablePane.getHeight() + resizeHandle.getHeight() + 7);
- preferredHeight = Math.min(preferredHeight, frame.getMaximumPreferredHeight());
- preferredHeight = Math.max(preferredHeight, frame.getMinimumPreferredHeight());
+ preferredHeight = Math.min(preferredHeight, frame.getMaximumHeight());
+ preferredHeight = Math.max(preferredHeight, frame.getMinimumHeight());
}
frame.setPreferredSize(preferredWidth, preferredHeight);
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java?rev=957261&r1=957260&r2=957261&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java Wed Jun 23 16:23:28 2010
@@ -458,15 +458,15 @@ public class TerraPaletteSkin extends Wi
if (palette.isPreferredWidthSet()) {
preferredWidth = Math.max(location.x - palette.getX() + resizeOffset.x,
titleBarTablePane.getPreferredWidth(-1) + 2);
- preferredWidth = Math.min(preferredWidth, palette.getMaximumPreferredWidth());
- preferredWidth = Math.max(preferredWidth, palette.getMinimumPreferredWidth());
+ preferredWidth = Math.min(preferredWidth, palette.getMaximumWidth());
+ preferredWidth = Math.max(preferredWidth, palette.getMinimumWidth());
}
if (palette.isPreferredHeightSet()) {
preferredHeight = Math.max(location.y - palette.getY() + resizeOffset.y,
titleBarTablePane.getHeight() + resizeHandle.getHeight() + 7);
- preferredHeight = Math.min(preferredHeight, palette.getMaximumPreferredHeight());
- preferredHeight = Math.max(preferredHeight, palette.getMinimumPreferredHeight());
+ preferredHeight = Math.min(preferredHeight, palette.getMaximumHeight());
+ preferredHeight = Math.max(preferredHeight, palette.getMinimumHeight());
}
palette.setPreferredSize(preferredWidth, preferredHeight);
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java?rev=957261&r1=957260&r2=957261&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java Wed Jun 23 16:23:28 2010
@@ -382,15 +382,15 @@ public class TerraSheetSkin extends Wind
if (preferredWidthSet || noPreferredSet) {
preferredWidth = Math.max(location.x - sheet.getX() + resizeOffset.x, 2);
- preferredWidth = Math.min(preferredWidth, sheet.getMaximumPreferredWidth());
- preferredWidth = Math.max(preferredWidth, sheet.getMinimumPreferredWidth());
+ preferredWidth = Math.min(preferredWidth, sheet.getMaximumWidth());
+ preferredWidth = Math.max(preferredWidth, sheet.getMinimumWidth());
}
if (preferredHeightSet || noPreferredSet) {
preferredHeight = Math.max(location.y - sheet.getY() + resizeOffset.y,
resizeHandle.getHeight() + 7);
- preferredHeight = Math.min(preferredHeight, sheet.getMaximumPreferredHeight());
- preferredHeight = Math.max(preferredHeight, sheet.getMinimumPreferredHeight());
+ preferredHeight = Math.min(preferredHeight, sheet.getMaximumHeight());
+ preferredHeight = Math.max(preferredHeight, sheet.getMinimumHeight());
}
sheet.setPreferredSize(preferredWidth, preferredHeight);
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSplitPaneSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSplitPaneSkin.java?rev=957261&r1=957260&r2=957261&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSplitPaneSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSplitPaneSkin.java Wed Jun 23 16:23:28 2010
@@ -560,14 +560,14 @@ public class TerraSplitPaneSkin extends
upper = Math.max(getWidth() - splitterThickness, 0);
if (topLeft != null) {
- int leftLimit = topLeft.getMinimumPreferredWidth();
+ int leftLimit = topLeft.getMinimumWidth();
if (leftLimit >= 0) {
lower = Math.min(leftLimit, upper);
}
}
if (bottomRight != null) {
- int rightLimit = bottomRight.getMinimumPreferredWidth();
+ int rightLimit = bottomRight.getMinimumWidth();
if (rightLimit >= 0) {
upper = Math.max(upper - rightLimit, lower);
}
@@ -577,14 +577,14 @@ public class TerraSplitPaneSkin extends
upper = Math.max(getHeight() - splitterThickness, 0);
if (topLeft != null) {
- int topLimit = topLeft.getMinimumPreferredHeight();
+ int topLimit = topLeft.getMinimumHeight();
if (topLimit >= 0) {
lower = Math.min(topLimit, upper);
}
}
if (bottomRight != null) {
- int bottomLimit = bottomRight.getMinimumPreferredHeight();
+ int bottomLimit = bottomRight.getMinimumHeight();
if (bottomLimit >= 0) {
upper = Math.max(upper - bottomLimit, lower);
}
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSuggestionPopupSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSuggestionPopupSkin.java?rev=957261&r1=957260&r2=957261&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSuggestionPopupSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSuggestionPopupSkin.java Wed Jun 23 16:23:28 2010
@@ -269,7 +269,7 @@ public class TerraSuggestionPopupSkin ex
// Reposition under text input
Point location = textInput.mapPointToAncestor(textInput.getDisplay(), 0, 0);
suggestionPopup.setLocation(location.x, location.y + textInput.getHeight() - 1);
- suggestionPopup.setMinimumPreferredWidth(textInput.getWidth());
+ suggestionPopup.setMinimumWidth(textInput.getWidth());
}
@Override
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java?rev=957261&r1=957260&r2=957261&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java Wed Jun 23 16:23:28 2010
@@ -296,20 +296,20 @@ public abstract class Component implemen
}
@Override
- public void preferredWidthLimitsChanged(Component component, int previousMinimumPreferredWidth,
- int previousMaximumPreferredWidth) {
+ public void widthLimitsChanged(Component component, int previousMinimumWidth,
+ int previousMaximumWidth) {
for (ComponentListener listener : this) {
- listener.preferredWidthLimitsChanged(component, previousMinimumPreferredWidth,
- previousMaximumPreferredWidth);
+ listener.widthLimitsChanged(component, previousMinimumWidth,
+ previousMaximumWidth);
}
}
@Override
- public void preferredHeightLimitsChanged(Component component, int previousMinimumPreferredHeight,
- int previousMaximumPreferredHeight) {
+ public void heightLimitsChanged(Component component, int previousMinimumHeight,
+ int previousMaximumHeight) {
for (ComponentListener listener : this) {
- listener.preferredHeightLimitsChanged(component, previousMinimumPreferredHeight,
- previousMaximumPreferredHeight);
+ listener.heightLimitsChanged(component, previousMinimumHeight,
+ previousMaximumHeight);
}
}
@@ -582,10 +582,10 @@ public abstract class Component implemen
private int preferredHeight = -1;
// Bounds on preferred size
- private int minimumPreferredWidth = 0;
- private int maximumPreferredWidth = Integer.MAX_VALUE;
- private int minimumPreferredHeight = 0;
- private int maximumPreferredHeight = Integer.MAX_VALUE;
+ private int minimumWidth = 0;
+ private int maximumWidth = Integer.MAX_VALUE;
+ private int minimumHeight = 0;
+ private int maximumHeight = Integer.MAX_VALUE;
// Calculated preferred size value
private Dimensions preferredSize = null;
@@ -935,8 +935,7 @@ public abstract class Component implemen
&& preferredSize.height == height) {
preferredWidth = preferredSize.width;
} else {
- Limits limits = new Limits(minimumPreferredWidth, maximumPreferredWidth);
- preferredWidth = limits.limit(skin.getPreferredWidth(height));
+ preferredWidth = skin.getPreferredWidth(height);
}
}
} else {
@@ -998,8 +997,7 @@ public abstract class Component implemen
&& preferredSize.width == width) {
preferredHeight = preferredSize.height;
} else {
- Limits limits = new Limits(minimumPreferredHeight, maximumPreferredHeight);
- preferredHeight = limits.limit(skin.getPreferredHeight(width));
+ preferredHeight = skin.getPreferredHeight(width);
}
}
} else {
@@ -1050,12 +1048,6 @@ public abstract class Component implemen
} else {
preferredSize = new Dimensions(preferredWidth, preferredHeight);
}
-
- Limits preferredWidthLimits = new Limits(minimumPreferredWidth, maximumPreferredWidth);
- Limits preferredHeightLimits = new Limits(minimumPreferredHeight, maximumPreferredHeight);
-
- preferredSize = new Dimensions(preferredWidthLimits.limit(preferredSize.width),
- preferredHeightLimits.limit(preferredSize.height));
}
return preferredSize;
@@ -1120,220 +1112,165 @@ public abstract class Component implemen
}
/**
- * Gets the minimum preferred width of this component. A component
- * will always report a preferred size whose width is greater than or equal
- * to its minimum preferred width.
- *
- * @return
- * The minimum preferred width
+ * Returns the minimum width of this component.
*/
- public int getMinimumPreferredWidth() {
- return minimumPreferredWidth;
+ public int getMinimumWidth() {
+ return minimumWidth;
}
/**
- * Sets the minimum preferred width of this component. A component
- * will always report a preferred size whose width is greater than or equal
- * to its minimum preferred width.
+ * Sets the minimum width of this component.
*
- * @param minimumPreferredWidth
- * The minimum preferred width, or <tt>-1</tt> to specify no minimum
- * preferred width
+ * @param minimumWidth
*/
- public void setMinimumPreferredWidth(int minimumPreferredWidth) {
- setPreferredWidthLimits(minimumPreferredWidth, getMaximumPreferredWidth());
+ public void setMinimumWidth(int minimumWidth) {
+ setWidthLimits(minimumWidth, getMaximumWidth());
}
/**
- * Gets the maximum preferred width of this component. A component
- * will always report a preferred size whose width is less than or equal
- * to its maximum preferred width.
- *
- * @return
- * The maximum preferred width
+ * Returns the maximum width of this component.
*/
- public int getMaximumPreferredWidth() {
- return maximumPreferredWidth;
+ public int getMaximumWidth() {
+ return maximumWidth;
}
/**
- * Sets the maximum preferred width of this component. A component
- * will always report a preferred size whose width is less than or equal
- * to its maximum preferred width.
+ * Sets the maximum width of this component.
*
- * @param maximumPreferredWidth
- * The maximum preferred width
+ * @param maximumWidth
*/
- public void setMaximumPreferredWidth(int maximumPreferredWidth) {
- setPreferredWidthLimits(getMinimumPreferredWidth(), maximumPreferredWidth);
+ public void setMaximumWidth(int maximumWidth) {
+ setWidthLimits(getMinimumWidth(), maximumWidth);
}
/**
- * Gets the preferred width limits for this component. A component will
- * always report a preferred size whose width is within these limits.
- *
- * @return
- * The preferred width limits
+ * Returns the width limits for this component.
*/
- public Limits getPreferredWidthLimits() {
- return new Limits(minimumPreferredWidth, maximumPreferredWidth);
+ public Limits getWidthLimits() {
+ return new Limits(minimumWidth, maximumWidth);
}
/**
- * Sets the preferred width limits for this component. A component will
- * always report a preferred size whose width is within these limits.
+ * Sets the width limits for this component.
*
- * @param minimumPreferredWidth
- * The minimum preferred width for the component
- *
- * @param maximumPreferredWidth
- * The maximum preferred width for the component
+ * @param minimumWidth
+ * @param maximumWidth
*/
- public void setPreferredWidthLimits(int minimumPreferredWidth, int maximumPreferredWidth) {
- int previousMinimumPreferredWidth = this.minimumPreferredWidth;
- int previousMaximumPreferredWidth = this.maximumPreferredWidth;
+ public void setWidthLimits(int minimumWidth, int maximumWidth) {
+ int previousMinimumWidth = this.minimumWidth;
+ int previousMaximumWidth = this.maximumWidth;
- if (previousMinimumPreferredWidth != minimumPreferredWidth
- || previousMaximumPreferredWidth != maximumPreferredWidth) {
- if (minimumPreferredWidth < 0) {
- throw new IllegalArgumentException("minimumPreferredWidth is negative.");
+ if (previousMinimumWidth != minimumWidth
+ || previousMaximumWidth != maximumWidth) {
+ if (minimumWidth < 0) {
+ throw new IllegalArgumentException("minimumWidth is negative.");
}
- if (minimumPreferredWidth > maximumPreferredWidth) {
- throw new IllegalArgumentException("minimumPreferredWidth > maximumPreferredWidth");
+ if (minimumWidth > maximumWidth) {
+ throw new IllegalArgumentException("minimumWidth is greater than maximumWidth.");
}
- this.minimumPreferredWidth = minimumPreferredWidth;
- this.maximumPreferredWidth = maximumPreferredWidth;
+ this.minimumWidth = minimumWidth;
+ this.maximumWidth = maximumWidth;
invalidate();
- componentListeners.preferredWidthLimitsChanged(this, previousMinimumPreferredWidth,
- previousMaximumPreferredWidth);
+ componentListeners.widthLimitsChanged(this, previousMinimumWidth, previousMaximumWidth);
}
}
/**
- * Sets the preferred width limits for this component. A component will
- * always report a preferred size whose width is within these limits.
+ * Sets the width limits for this component.
*
- * @param preferredWidthLimits
- * The preferred width limits for the component
+ * @param widthLimits
*/
- public final void setPreferredWidthLimits(Limits preferredWidthLimits) {
- if (preferredWidthLimits == null) {
- throw new IllegalArgumentException("preferredWidthLimits is null.");
+ public final void setWidthLimits(Limits widthLimits) {
+ if (widthLimits == null) {
+ throw new IllegalArgumentException("widthLimits is null.");
}
- setPreferredWidthLimits(preferredWidthLimits.min, preferredWidthLimits.max);
+ setWidthLimits(widthLimits.min, widthLimits.max);
}
/**
- * Gets the minimum preferred height of this component. A component
- * will always report a preferred size whose height is greater than or equal
- * to its minimum preferred height.
- *
- * @return
- * The minimum preferred height
+ * Returns the minimum height of this component.
*/
- public int getMinimumPreferredHeight() {
- return minimumPreferredHeight;
+ public int getMinimumHeight() {
+ return minimumHeight;
}
/**
- * Sets the minimum preferred height of this component. A component
- * will always report a preferred size whose height is greater than or equal
- * to its minimum preferred height.
+ * Sets the minimum height of this component.
*
- * @param minimumPreferredHeight
- * The minimum preferred height
+ * @param minimumHeight
*/
- public void setMinimumPreferredHeight(int minimumPreferredHeight) {
- setPreferredHeightLimits(minimumPreferredHeight, getMaximumPreferredHeight());
+ public void setMinimumHeight(int minimumHeight) {
+ setHeightLimits(minimumHeight, getMaximumHeight());
}
/**
- * Gets the maximum preferred height of this component. A component
- * will always report a preferred size whose height is less than or equal
- * to its maximum preferred height.
- *
- * @return
- * The maximum preferred height
+ * Returns the maximum height of this component.
*/
- public int getMaximumPreferredHeight() {
- return maximumPreferredHeight;
+ public int getMaximumHeight() {
+ return maximumHeight;
}
/**
- * Sets the maximum preferred height of this component. A component
- * will always report a preferred size whose height is less than or equal
- * to its maximum preferred height.
+ * Sets the maximum height of this component.
*
- * @param maximumPreferredHeight
- * The maximum preferred height
+ * @param maximumHeight
*/
- public void setMaximumPreferredHeight(int maximumPreferredHeight) {
- setPreferredHeightLimits(getMinimumPreferredHeight(), maximumPreferredHeight);
+ public void setMaximumHeight(int maximumHeight) {
+ setHeightLimits(getMinimumHeight(), maximumHeight);
}
/**
- * Gets the preferred height limits for this component. A component will
- * always report a preferred size whose height is within these limits.
- *
- * @return
- * The preferred height limits
+ * Returns the height limits for this component.
*/
- public Limits getPreferredHeightLimits() {
- return new Limits(minimumPreferredHeight, maximumPreferredHeight);
+ public Limits getHeightLimits() {
+ return new Limits(minimumHeight, maximumHeight);
}
/**
- * Sets the preferred height limits for this component. A component will
- * always report a preferred size whose height is within these limits.
- *
- * @param minimumPreferredHeight
- * The minimum preferred height for the component
+ * Sets the height limits for this component.
*
- * @param maximumPreferredHeight
- * The maximum preferred height for the component
+ * @param minimumHeight
+ * @param maximumHeight
*/
- public void setPreferredHeightLimits(int minimumPreferredHeight, int maximumPreferredHeight) {
- int previousMinimumPreferredHeight = this.minimumPreferredHeight;
- int previousMaximumPreferredHeight = this.maximumPreferredHeight;
+ public void setHeightLimits(int minimumHeight, int maximumHeight) {
+ int previousMinimumHeight = this.minimumHeight;
+ int previousMaximumHeight = this.maximumHeight;
- if (previousMinimumPreferredHeight != minimumPreferredHeight
- || previousMaximumPreferredHeight != maximumPreferredHeight) {
- if (minimumPreferredHeight < 0) {
- throw new IllegalArgumentException("minimumPreferredHeight is negative.");
+ if (previousMinimumHeight != minimumHeight
+ || previousMaximumHeight != maximumHeight) {
+ if (minimumHeight < 0) {
+ throw new IllegalArgumentException("minimumHeight is negative.");
}
- if (minimumPreferredHeight > maximumPreferredHeight) {
- throw new IllegalArgumentException("minimumPreferredHeight > maximumPreferredHeight");
+ if (minimumHeight > maximumHeight) {
+ throw new IllegalArgumentException("minimumHeight is greater than maximumHeight.");
}
- this.minimumPreferredHeight = minimumPreferredHeight;
- this.maximumPreferredHeight = maximumPreferredHeight;
+ this.minimumHeight = minimumHeight;
+ this.maximumHeight = maximumHeight;
invalidate();
- componentListeners.preferredHeightLimitsChanged(this, previousMinimumPreferredHeight,
- previousMaximumPreferredHeight);
+ componentListeners.heightLimitsChanged(this, previousMinimumHeight, previousMaximumHeight);
}
}
/**
- * Sets the preferred height limits for this component. A component will
- * always report a preferred size whose height is within these limits.
+ * Sets the height limits for this component.
*
- * @param preferredHeightLimits
- * The preferred height limits for the component
+ * @param heightLimits
*/
- public final void setPreferredHeightLimits(Limits preferredHeightLimits) {
- if (preferredHeightLimits == null) {
- throw new IllegalArgumentException("preferredHeightLimits is null.");
+ public final void setHeightLimits(Limits heightLimits) {
+ if (heightLimits == null) {
+ throw new IllegalArgumentException("heightLimits is null.");
}
- setPreferredHeightLimits(preferredHeightLimits.min, preferredHeightLimits.max);
+ setHeightLimits(heightLimits.min, heightLimits.max);
}
/**
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentListener.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentListener.java?rev=957261&r1=957260&r2=957261&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentListener.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentListener.java Wed Jun 23 16:23:28 2010
@@ -38,13 +38,13 @@ public interface ComponentListener {
}
@Override
- public void preferredWidthLimitsChanged(Component component, int previousMinimumPreferredWidth,
- int previousMaximumPreferredWidth) {
+ public void widthLimitsChanged(Component component, int previousMinimumWidth,
+ int previousMaximumWidth) {
}
@Override
- public void preferredHeightLimitsChanged(Component component, int previousMinimumPreferredHeight,
- int previousMaximumPreferredHeight) {
+ public void heightLimitsChanged(Component component, int previousMinimumHeight,
+ int previousMaximumHeight) {
}
@Override
@@ -116,21 +116,21 @@ public interface ComponentListener {
* Called when a component's preferred width limits have changed.
*
* @param component
- * @param previousMinimumPreferredWidth
- * @param previousMaximumPreferredWidth
+ * @param previousMinimumWidth
+ * @param previousMaximumWidth
*/
- public void preferredWidthLimitsChanged(Component component, int previousMinimumPreferredWidth,
- int previousMaximumPreferredWidth);
+ public void widthLimitsChanged(Component component, int previousMinimumWidth,
+ int previousMaximumWidth);
/**
* Called when a component's preferred height limits have changed.
*
* @param component
- * @param previousMinimumPreferredHeight
- * @param previousMaximumPreferredHeight
+ * @param previousMinimumHeight
+ * @param previousMaximumHeight
*/
- public void preferredHeightLimitsChanged(Component component, int previousMinimumPreferredHeight,
- int previousMaximumPreferredHeight);
+ public void heightLimitsChanged(Component component, int previousMinimumHeight,
+ int previousMaximumHeight);
/**
* Called when a component's location has changed.
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java?rev=957261&r1=957260&r2=957261&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java Wed Jun 23 16:23:28 2010
@@ -491,14 +491,14 @@ public class TableViewRowEditor implemen
}
@Override
- public void preferredWidthLimitsChanged(Component component, int previousMinimumPreferredWidth,
- int previousMaximumPreferredWidth) {
+ public void widthLimitsChanged(Component component, int previousMinimumWidth,
+ int previousMaximumWidth) {
// No-op
}
@Override
- public void preferredHeightLimitsChanged(Component component, int previousMinimumPreferredHeight,
- int previousMaximumPreferredHeight) {
+ public void heightLimitsChanged(Component component, int previousMinimumHeight,
+ int previousMaximumHeight) {
// No-op
}
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java?rev=957261&r1=957260&r2=957261&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java Wed Jun 23 16:23:28 2010
@@ -173,14 +173,14 @@ public abstract class ComponentSkin impl
}
@Override
- public void preferredWidthLimitsChanged(Component component, int previousMinimumPreferredWidth,
- int previousMaximumPreferredWidth) {
+ public void widthLimitsChanged(Component component, int previousMinimumWidth,
+ int previousMaximumWidth) {
// No-op
}
@Override
- public void preferredHeightLimitsChanged(Component component, int previousMinimumPreferredHeight,
- int previousMaximumPreferredHeight) {
+ public void heightLimitsChanged(Component component, int previousMinimumHeight,
+ int previousMaximumHeight) {
// No-op
}