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/08/10 15:56:07 UTC
svn commit: r802796 - in /incubator/pivot/trunk:
core/src/org/apache/pivot/beans/
tutorials/src/org/apache/pivot/tutorials/buttons/
tutorials/src/org/apache/pivot/tutorials/navigation/
wtk/src/org/apache/pivot/wtk/ wtk/src/org/apache/pivot/wtk/content/...
Author: gbrown
Date: Mon Aug 10 13:56:06 2009
New Revision: 802796
URL: http://svn.apache.org/viewvc?rev=802796&view=rev
Log:
Resolve issue PIVOT-212.
Modified:
incubator/pivot/trunk/core/src/org/apache/pivot/beans/BeanDictionary.java
incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/Checkboxes.java
incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/checkboxes.wtkx
incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/navigation/Accordions.java
incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/navigation/summary.wtkx
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentListener.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ButtonDataRenderer.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemRenderer.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/MenuBarItemDataRenderer.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/MenuItemDataRenderer.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewHeaderDataRenderer.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeRenderer.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/BorderSkin.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/BoxPaneSkin.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/DisplaySkin.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/FlowPaneSkin.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TablePaneSkin.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarSkin.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuSkin.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java
incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java
incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/test/flow_pane_test.wtkx
incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/test/table_pane_test.wtkx
Modified: incubator/pivot/trunk/core/src/org/apache/pivot/beans/BeanDictionary.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/core/src/org/apache/pivot/beans/BeanDictionary.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/core/src/org/apache/pivot/beans/BeanDictionary.java (original)
+++ incubator/pivot/trunk/core/src/org/apache/pivot/beans/BeanDictionary.java Mon Aug 10 13:56:06 2009
@@ -462,11 +462,15 @@
/**
* Returns the type of a property.
*
- * @param beanClass The bean class.
+ * @param beanClass
+ * The bean class.
*
- * @param key The property name.
+ * @param key
+ * The property name.
*
- * @return The type of the property, or <tt>null</tt> if no such bean property exists.
+ * @return
+ * The type of the property, or <tt>null</tt> if no such bean property
+ * exists.
*/
public static Class<?> getType(Class<?> beanClass, String key) {
if (key == null) {
Modified: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/Checkboxes.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/Checkboxes.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/Checkboxes.java (original)
+++ incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/Checkboxes.java Mon Aug 10 13:56:06 2009
@@ -49,19 +49,19 @@
// Wire up event listeners
bellCheckbox.getButtonPressListeners().add(new ButtonPressListener() {
public void buttonPressed(Button button) {
- bellImageView.setDisplayable(!bellImageView.isDisplayable());
+ bellImageView.setVisible(!bellImageView.isVisible());
}
});
clockCheckbox.getButtonPressListeners().add(new ButtonPressListener() {
public void buttonPressed(Button button) {
- clockImageView.setDisplayable(!clockImageView.isDisplayable());
+ clockImageView.setVisible(!clockImageView.isVisible());
}
});
houseCheckbox.getButtonPressListeners().add(new ButtonPressListener() {
public void buttonPressed(Button button) {
- houseImageView.setDisplayable(!houseImageView.isDisplayable());
+ houseImageView.setVisible(!houseImageView.isVisible());
}
});
Modified: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/checkboxes.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/checkboxes.wtkx?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/checkboxes.wtkx (original)
+++ incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/buttons/checkboxes.wtkx Mon Aug 10 13:56:06 2009
@@ -32,21 +32,21 @@
<BoxPane styles="{verticalAlignment:'center'}">
<Checkbox wtkx:id="bellCheckbox" buttonData="Bell"/>
</BoxPane>
- <ImageView wtkx:id="bellImageView" image="org/apache/pivot/tutorials/bell.png" displayable="false"/>
+ <ImageView wtkx:id="bellImageView" image="org/apache/pivot/tutorials/bell.png" visible="false"/>
</TablePane.Row>
<TablePane.Row height="24">
<BoxPane styles="{verticalAlignment:'center'}">
<Checkbox wtkx:id="clockCheckbox" buttonData="Clock"/>
</BoxPane>
- <ImageView wtkx:id="clockImageView" image="org/apache/pivot/tutorials/clock.png" displayable="false"/>
+ <ImageView wtkx:id="clockImageView" image="org/apache/pivot/tutorials/clock.png" visible="false"/>
</TablePane.Row>
<TablePane.Row height="24">
<BoxPane styles="{verticalAlignment:'center'}">
<Checkbox wtkx:id="houseCheckbox" buttonData="House"/>
</BoxPane>
- <ImageView wtkx:id="houseImageView" image="org/apache/pivot/tutorials/house.png" displayable="false"/>
+ <ImageView wtkx:id="houseImageView" image="org/apache/pivot/tutorials/house.png" visible="false"/>
</TablePane.Row>
</rows>
</TablePane>
Modified: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/navigation/Accordions.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/navigation/Accordions.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/navigation/Accordions.java (original)
+++ incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/navigation/Accordions.java Mon Aug 10 13:56:06 2009
@@ -101,7 +101,7 @@
public void buttonPressed(Button button) {
// Pretend to submit or cancel the order
activityIndicator.setActive(!activityIndicator.isActive());
- processingOrderLabel.setDisplayable(activityIndicator.isActive());
+ processingOrderLabel.setVisible(activityIndicator.isActive());
updateConfirmOrderButton();
}
});
Modified: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/navigation/summary.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/navigation/summary.wtkx?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/navigation/summary.wtkx (original)
+++ incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/navigation/summary.wtkx Mon Aug 10 13:56:06 2009
@@ -41,7 +41,7 @@
<PushButton wtkx:id="confirmOrderButton" styles="{minimumPreferredAspectRatio:3}"/>
<ActivityIndicator wtkx:id="activityIndicator" styles="{color:16}"
preferredWidth="48" preferredHeight="48"/>
- <Label wtkx:id="processingOrderLabel" text="Pretending to process order..." displayable="false"
+ <Label wtkx:id="processingOrderLabel" text="Pretending to process order..." visible="false"
styles="{fontItalic:true}"/>
</BoxPane>
</BoxPane>
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java Mon Aug 10 13:56:06 2009
@@ -344,12 +344,6 @@
}
}
- public void displayableChanged(Component component) {
- for (ComponentListener listener : this) {
- listener.displayableChanged(component);
- }
- }
-
public void styleUpdated(Component component, String styleKey, Object previousValue) {
for (ComponentListener listener : this) {
listener.styleUpdated(component, styleKey, previousValue);
@@ -598,9 +592,6 @@
// The component's visible flag
private boolean visible = true;
- // The component's displayable flag
- private boolean displayable = true;
-
// The component's decorators
private ArrayList<Decorator> decorators = new ArrayList<Decorator>();
private DecoratorSequence decoratorSequence = new DecoratorSequence();
@@ -1476,9 +1467,6 @@
/**
* Sets the component's visibility.
- * <p>
- * NOTE This method should only be called during layout. Callers should
- * use {@link #setDisplayable(boolean)}.
*
* @param visible
* <tt>true</tt> if the component should be painted; <tt>false</tt>,
@@ -1511,10 +1499,9 @@
parent.repaint(getDecoratedBounds());
}
- // Ensure the layout is valid
- if (visible
- && !valid) {
- validate();
+ // Invalidate the parent
+ if (parent != null) {
+ parent.invalidate();
}
componentListeners.visibleChanged(this);
@@ -1522,51 +1509,6 @@
}
/**
- * Returns the component's displayability.
- *
- * NOTE Container skins should generally try to respect this flag when
- * laying out, as follows:
- * <ul>
- * <li>
- * When a component's displayable flag is <tt>true</tt>, the
- * container skin should include the component in layout and set its
- * visibility to <tt>true</tt>.
- * </li>
- * <li>
- * When a component's displayable flag is <tt>false</tt>, the
- * container skin should not include the component in layout and set
- * its visibility to <tt>false</tt>.
- * </li>
- * </ul>
- * However, depending on the nature of the skin, it may ignore this flag
- * and manage its components' visibilities internally.
- *
- * @return
- * <tt>true</tt> if the component will participate in layout;
- * <tt>false</tt>, otherwise.
- */
- public boolean isDisplayable() {
- return displayable;
- }
-
- /**
- * Sets the component's displayability.
- *
- * @param displayable
- * <tt>true</tt> if the component will participate in layout;
- * <tt>false</tt>, otherwise.
- */
- public void setDisplayable(boolean displayable) {
- if (this.displayable != displayable) {
- this.displayable = displayable;
-
- invalidate();
-
- componentListeners.displayableChanged(this);
- }
- }
-
- /**
* Returns the component's decorator sequence.
*
* @return
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentListener.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentListener.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentListener.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentListener.java Mon Aug 10 13:56:06 2009
@@ -52,9 +52,6 @@
public void visibleChanged(Component component) {
}
- public void displayableChanged(Component component) {
- }
-
public void styleUpdated(Component component, String styleKey, Object previousValue) {
}
@@ -139,13 +136,6 @@
public void visibleChanged(Component component);
/**
- * Called when a component's displayable flag has changed.
- *
- * @param component
- */
- public void displayableChanged(Component component);
-
- /**
* Called when a component style has been updated.
*
* @param component
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java Mon Aug 10 13:56:06 2009
@@ -420,20 +420,20 @@
}
/**
- * Sets the displayable state of this window and all of its owned
+ * Sets the visible state of this window and all of its owned
* descendant windows.
*
- * @param displayable
- * If <tt>true</tt>, the window and its owned descendants are displayable;
- * otherwise, they are not displayable.
+ * @param visible
+ * If <tt>true</tt>, the window and its owned descendants are visible;
+ * otherwise, they are not visible.
*/
@Override
- public void setDisplayable(boolean displayable) {
- super.setDisplayable(displayable);
+ public void setVisible(boolean visible) {
+ super.setVisible(visible);
// Show/hide owned windows
for (Window ownedWindow : ownedWindows) {
- ownedWindow.setDisplayable(displayable);
+ ownedWindow.setVisible(visible);
}
}
@@ -485,7 +485,7 @@
if (owner != null) {
owner.ownedWindows.add(this);
- setDisplayable(owner.isDisplayable());
+ setVisible(owner.isVisible());
setEnabled(owner.isEnabled());
}
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ButtonDataRenderer.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ButtonDataRenderer.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ButtonDataRenderer.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ButtonDataRenderer.java Mon Aug 10 13:56:06 2009
@@ -74,9 +74,9 @@
// Update the image view
if (icon == null) {
- imageView.setDisplayable(false);
+ imageView.setVisible(false);
} else {
- imageView.setDisplayable(true);
+ imageView.setVisible(true);
imageView.setImage(icon);
imageView.getStyles().put("opacity", button.isEnabled() ? 1.0f : 0.5f);
@@ -86,9 +86,9 @@
label.setText(text);
if (text == null) {
- label.setDisplayable(false);
+ label.setVisible(false);
} else {
- label.setDisplayable(true);
+ label.setVisible(true);
Font font = (Font)button.getStyles().get("font");
label.getStyles().put("font", font);
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemRenderer.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemRenderer.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemRenderer.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemRenderer.java Mon Aug 10 13:56:06 2009
@@ -52,7 +52,7 @@
add(label);
imageView.setPreferredSize(DEFAULT_ICON_WIDTH, DEFAULT_ICON_HEIGHT);
- imageView.setDisplayable(DEFAULT_SHOW_ICON);
+ imageView.setVisible(DEFAULT_SHOW_ICON);
}
@Override
@@ -142,11 +142,11 @@
}
public boolean getShowIcon() {
- return imageView.isDisplayable();
+ return imageView.isVisible();
}
public void setShowIcon(boolean showIcon) {
- imageView.setDisplayable(showIcon);
+ imageView.setVisible(showIcon);
}
/**
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/MenuBarItemDataRenderer.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/MenuBarItemDataRenderer.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/MenuBarItemDataRenderer.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/MenuBarItemDataRenderer.java Mon Aug 10 13:56:06 2009
@@ -79,9 +79,9 @@
MenuBar menuBar = menuBarItem.getMenuBar();
if (icon == null) {
- imageView.setDisplayable(false);
+ imageView.setVisible(false);
} else {
- imageView.setDisplayable(true);
+ imageView.setVisible(true);
imageView.setImage(icon);
imageView.getStyles().put("opacity", button.isEnabled() ? 1.0f : 0.5f);
}
@@ -90,9 +90,9 @@
label.setText(text);
if (text == null) {
- label.setDisplayable(false);
+ label.setVisible(false);
} else {
- label.setDisplayable(true);
+ label.setVisible(true);
Font font = (Font)menuBar.getStyles().get("font");
label.getStyles().put("font", font);
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/MenuItemDataRenderer.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/MenuItemDataRenderer.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/MenuItemDataRenderer.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/MenuItemDataRenderer.java Mon Aug 10 13:56:06 2009
@@ -129,11 +129,11 @@
}
if (showKeyboardShortcuts) {
- keyboardShortcutLabel.setDisplayable(true);
+ keyboardShortcutLabel.setVisible(true);
keyboardShortcutLabel.setText(keyboardShortcut == null ?
null : keyboardShortcut.toString());
} else {
- keyboardShortcutLabel.setDisplayable(false);
+ keyboardShortcutLabel.setVisible(false);
}
}
}
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewHeaderDataRenderer.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewHeaderDataRenderer.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewHeaderDataRenderer.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewHeaderDataRenderer.java Mon Aug 10 13:56:06 2009
@@ -82,9 +82,9 @@
imageView.setImage(icon);
if (icon == null) {
- imageView.setDisplayable(false);
+ imageView.setVisible(false);
} else {
- imageView.setDisplayable(true);
+ imageView.setVisible(true);
imageView.getStyles().put("opacity", tableViewHeader.isEnabled() ? 1.0f : 0.5f);
}
@@ -92,9 +92,9 @@
label.setText(text);
if (text == null) {
- label.setDisplayable(false);
+ label.setVisible(false);
} else {
- label.setDisplayable(true);
+ label.setVisible(true);
// Update the label styles
Component.StyleDictionary labelStyles = label.getStyles();
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeRenderer.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeRenderer.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeRenderer.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeRenderer.java Mon Aug 10 13:56:06 2009
@@ -54,7 +54,7 @@
add(label);
imageView.setPreferredSize(DEFAULT_ICON_WIDTH, DEFAULT_ICON_HEIGHT);
- imageView.setDisplayable(DEFAULT_SHOW_ICON);
+ imageView.setVisible(DEFAULT_SHOW_ICON);
}
public void setSize(int width, int height) {
@@ -105,9 +105,9 @@
label.setText(text);
if (text == null) {
- label.setDisplayable(false);
+ label.setVisible(false);
} else {
- label.setDisplayable(true);
+ label.setVisible(true);
Font font = (Font)treeView.getStyles().get("font");
label.getStyles().put("font", font);
@@ -157,11 +157,11 @@
}
public boolean getShowIcon() {
- return imageView.isDisplayable();
+ return imageView.isVisible();
}
public void setShowIcon(boolean showIcon) {
- imageView.setDisplayable(showIcon);
+ imageView.setVisible(showIcon);
}
/**
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/BorderSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/BorderSkin.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/BorderSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/BorderSkin.java Mon Aug 10 13:56:06 2009
@@ -105,8 +105,7 @@
}
Component content = border.getContent();
- if (content != null
- && content.isDisplayable()) {
+ if (content != null) {
if (height != -1) {
height = Math.max(height - (topThickness + thickness) -
padding.top - padding.bottom, 0);
@@ -136,8 +135,7 @@
}
Component content = border.getContent();
- if (content != null
- && content.isDisplayable()) {
+ if (content != null) {
if (width != -1) {
width = Math.max(width - (thickness * 2)
- padding.left - padding.right, 0);
@@ -174,21 +172,15 @@
Component content = border.getContent();
if (content != null) {
- if (content.isDisplayable()) {
- content.setVisible(true);
-
- content.setLocation(padding.left + thickness,
- padding.top + topThickness);
+ content.setLocation(padding.left + thickness,
+ padding.top + topThickness);
- int contentWidth = Math.max(width - (padding.left + padding.right
- + (thickness * 2)), 0);
- int contentHeight = Math.max(height - (padding.top + padding.bottom
- + (topThickness + thickness)), 0);
+ int contentWidth = Math.max(width - (padding.left + padding.right
+ + (thickness * 2)), 0);
+ int contentHeight = Math.max(height - (padding.top + padding.bottom
+ + (topThickness + thickness)), 0);
- content.setSize(contentWidth, contentHeight);
- } else {
- content.setVisible(false);
- }
+ content.setSize(contentWidth, contentHeight);
}
}
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/BoxPaneSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/BoxPaneSkin.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/BoxPaneSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/BoxPaneSkin.java Mon Aug 10 13:56:06 2009
@@ -72,7 +72,7 @@
for (int i = 0, n = boxPane.getLength(); i < n; i++) {
Component component = boxPane.get(i);
- if (component.isDisplayable()) {
+ if (component.isVisible()) {
preferredWidth += component.getPreferredWidth(fill ? height : -1);
j++;
}
@@ -87,7 +87,7 @@
for (int i = 0, n = boxPane.getLength(); i < n; i++) {
Component component = boxPane.get(i);
- if (component.isDisplayable()) {
+ if (component.isVisible()) {
preferredWidth = Math.max(preferredWidth,
component.getPreferredWidth());
}
@@ -117,7 +117,7 @@
for (int i = 0, n = boxPane.getLength(); i < n; i++) {
Component component = boxPane.get(i);
- if (component.isDisplayable()) {
+ if (component.isVisible()) {
preferredHeight += component.getPreferredHeight(fill ? width : -1);
j++;
}
@@ -132,7 +132,7 @@
for (int i = 0, n = boxPane.getLength(); i < n; i++) {
Component component = boxPane.get(i);
- if (component.isDisplayable()) {
+ if (component.isVisible()) {
preferredHeight = Math.max(preferredHeight,
component.getPreferredHeight());
}
@@ -158,7 +158,7 @@
for (int i = 0, n = boxPane.getLength(); i < n; i++) {
Component component = boxPane.get(i);
- if (component.isDisplayable()) {
+ if (component.isVisible()) {
Dimensions preferredSize = component.getPreferredSize();
preferredWidth += preferredSize.width;
preferredHeight = Math.max(preferredSize.height, preferredHeight);
@@ -180,7 +180,7 @@
for (int i = 0, n = boxPane.getLength(); i < n; i++) {
Component component = boxPane.get(i);
- if (component.isDisplayable()) {
+ if (component.isVisible()) {
Dimensions preferredSize = component.getPreferredSize();
preferredWidth = Math.max(preferredSize.width, preferredWidth);
preferredHeight += preferredSize.height;
@@ -236,7 +236,7 @@
for (int i = 0; i < n; i++) {
Component component = boxPane.get(i);
- if (component.isDisplayable()) {
+ if (component.isVisible()) {
int componentWidth = 0;
int componentHeight = 0;
int y = 0;
@@ -306,7 +306,7 @@
for (int i = 0; i < n; i++) {
Component component = boxPane.get(i);
- if (component.isDisplayable()) {
+ if (component.isVisible()) {
int componentWidth = 0;
int componentHeight = 0;
int x = 0;
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java Mon Aug 10 13:56:06 2009
@@ -175,10 +175,6 @@
// No-op
}
- public void displayableChanged(Component component) {
- // No-op
- }
-
public void styleUpdated(Component component, String styleKey, Object previousValue) {
// No-op
}
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/DisplaySkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/DisplaySkin.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/DisplaySkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/DisplaySkin.java Mon Aug 10 13:56:06 2009
@@ -53,7 +53,7 @@
for (Component component : display) {
Window window = (Window)component;
- if (window.isDisplayable()) {
+ if (window.isVisible()) {
if (window.isMaximized()) {
window.setLocation(0, 0);
window.setSize(display.getSize());
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/FlowPaneSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/FlowPaneSkin.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/FlowPaneSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/FlowPaneSkin.java Mon Aug 10 13:56:06 2009
@@ -53,7 +53,7 @@
for (int i = 0, n = flowPane.getLength(); i < n; i++) {
Component component = flowPane.get(i);
- if (component.isDisplayable()) {
+ if (component.isVisible()) {
preferredWidth += component.getPreferredWidth();
j++;
}
@@ -81,7 +81,7 @@
for (int i = 0, n = flowPane.getLength(); i < n; i++) {
Component component = flowPane.get(i);
- if (component.isDisplayable()) {
+ if (component.isVisible()) {
preferredHeight = Math.max(preferredHeight,
component.getPreferredHeight());
}
@@ -97,7 +97,7 @@
for (int i = 0, n = flowPane.getLength(); i < n; i++) {
Component component = flowPane.get(i);
- if (component.isDisplayable()) {
+ if (component.isVisible()) {
Dimensions componentSize = component.getPreferredSize();
if (rowWidth + componentSize.width > contentWidth
@@ -145,7 +145,7 @@
for (int i = 0, n = flowPane.getLength(); i < n; i++) {
Component component = flowPane.get(i);
- if (component.isDisplayable()) {
+ if (component.isVisible()) {
Dimensions componentSize = component.getPreferredSize();
preferredWidth += componentSize.width;
preferredHeight = Math.max(preferredHeight, componentSize.height);
@@ -180,7 +180,7 @@
for (int i = 0, n = flowPane.getLength(); i < n; i++) {
Component component = flowPane.get(i);
- if (component.isDisplayable()) {
+ if (component.isVisible()) {
Dimensions componentSize = component.getPreferredSize();
component.setSize(componentSize);
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TablePaneSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TablePaneSkin.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TablePaneSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TablePaneSkin.java Mon Aug 10 13:56:06 2009
@@ -156,7 +156,7 @@
Component component = row.get(j);
if (component != null
- && component.isDisplayable()) {
+ && component.isVisible()) {
int columnSpan = TablePane.getColumnSpan(component);
if (columnSpan > 1) {
@@ -330,7 +330,7 @@
Component component = row.get(j);
if (component != null
- && component.isDisplayable()) {
+ && component.isVisible()) {
int rowSpan = TablePane.getRowSpan(component);
if (rowSpan > 1) {
@@ -450,7 +450,7 @@
Component child = row.get(j);
if (child != null) {
- if (child.isDisplayable()) {
+ if (child.isVisible()) {
child.setLocation(componentX, componentY);
int columnSpan = TablePane.getColumnSpan(child);
@@ -467,12 +467,6 @@
// Set the component's size
child.setSize(Math.max(childWidth, 0), Math.max(childHeight, 0));
-
- // Show the component
- child.setVisible(true);
- } else {
- // Hide the component
- child.setVisible(false);
}
}
@@ -843,7 +837,7 @@
Component component = row.get(columnIndex);
if (component != null
- && component.isDisplayable()
+ && component.isVisible()
&& TablePane.getColumnSpan(component) == 1) {
int rowHeight = -1;
@@ -894,7 +888,7 @@
Component component = row.get(i);
if (component != null
- && component.isDisplayable()
+ && component.isVisible()
&& TablePane.getRowSpan(component) == 1) {
TablePane.Column column = columns.get(i);
int columnWidth = -1;
@@ -986,7 +980,7 @@
Component component = row.get(j);
if (component != null
- && component.isDisplayable()) {
+ && component.isVisible()) {
int columnSpan = TablePane.getColumnSpan(component);
if (columnSpan > 1) {
@@ -1158,7 +1152,7 @@
Component component = row.get(j);
if (component != null
- && component.isDisplayable()) {
+ && component.isVisible()) {
int rowSpan = TablePane.getRowSpan(component);
if (rowSpan > 1) {
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java Mon Aug 10 13:56:06 2009
@@ -608,7 +608,7 @@
@Override
public void titleChanged(Expander expander, String previousTitle) {
String title = expander.getTitle();
- titleLabel.setDisplayable(title != null);
+ titleLabel.setVisible(title != null);
titleLabel.setText(title);
}
@@ -617,7 +617,7 @@
*/
@Override
public void collapsibleChanged(Expander expander) {
- buttonBoxPane.setDisplayable(expander.isCollapsible());
+ buttonBoxPane.setVisible(expander.isCollapsible());
}
/**
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java Mon Aug 10 13:56:06 2009
@@ -104,7 +104,7 @@
fieldIndex < fieldCount; fieldIndex++) {
Component field = section.get(fieldIndex);
- if (field.isDisplayable()) {
+ if (field.isVisible()) {
Label label = labels.get(sectionIndex).get(fieldIndex);
maximumLabelWidth = Math.max(maximumLabelWidth,
label.getPreferredWidth(-1));
@@ -141,7 +141,7 @@
fieldIndex < fieldCount; fieldIndex++) {
Component field = section.get(fieldIndex);
- if (field.isDisplayable()) {
+ if (field.isVisible()) {
Label label = labels.get(sectionIndex).get(fieldIndex);
maximumLabelWidth = Math.max(maximumLabelWidth,
label.getPreferredWidth(-1));
@@ -171,7 +171,7 @@
fieldIndex < fieldCount; fieldIndex++) {
Component field = section.get(fieldIndex);
- if (field.isDisplayable()) {
+ if (field.isVisible()) {
Label label = labels.get(sectionIndex).get(fieldIndex);
int preferredRowHeight = Math.max(label.getPreferredHeight(-1),
@@ -209,7 +209,7 @@
fieldIndex < fieldCount; fieldIndex++) {
Component field = section.get(fieldIndex);
- if (field.isDisplayable()) {
+ if (field.isVisible()) {
Label label = labels.get(sectionIndex).get(fieldIndex);
maximumLabelWidth = Math.max(maximumLabelWidth,
label.getPreferredWidth(-1));
@@ -249,7 +249,7 @@
Label label = labels.get(sectionIndex).get(fieldIndex);
ImageView flagImageView = flagImageViews.get(sectionIndex).get(fieldIndex);
- if (field.isDisplayable()) {
+ if (field.isVisible()) {
// Show the row components
label.setVisible(true);
field.setVisible(true);
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java Mon Aug 10 13:56:06 2009
@@ -324,7 +324,7 @@
Frame frame = (Frame)getComponent();
if (button == minimizeButton) {
- frame.setDisplayable(false);
+ frame.setVisible(false);
} else if (button == maximizeButton) {
frame.setMaximized(!frame.isMaximized());
} else if (button == closeButton) {
@@ -376,8 +376,7 @@
Frame frame = (Frame)getComponent();
MenuBar menuBar = frame.getMenuBar();
- if (menuBar != null
- && menuBar.isDisplayable()) {
+ if (menuBar != null) {
preferredWidth = Math.max(preferredWidth, menuBar.getPreferredWidth());
}
@@ -408,8 +407,7 @@
Frame frame = (Frame)getComponent();
MenuBar menuBar = frame.getMenuBar();
- if (menuBar != null
- && menuBar.isDisplayable()) {
+ if (menuBar != null) {
preferredHeight += menuBar.getPreferredHeight();
}
@@ -439,8 +437,7 @@
Frame frame = (Frame)getComponent();
MenuBar menuBar = frame.getMenuBar();
- if (menuBar != null
- && menuBar.isDisplayable()) {
+ if (menuBar != null) {
Dimensions preferredMenuBarSize = menuBar.getPreferredSize();
preferredWidth = Math.max(preferredWidth, preferredMenuBarSize.width);
@@ -495,7 +492,7 @@
menuBar.setLocation(1, contentY);
int menuBarWidth = width - 2;
- if (menuBar.isDisplayable()) {
+ if (menuBar.isVisible()) {
menuBar.setSize(menuBarWidth, menuBar.getPreferredHeight());
} else {
menuBar.setSize(menuBarWidth, 0);
@@ -566,27 +563,27 @@
}
public boolean getShowMinimizeButton() {
- return minimizeButton.isDisplayable();
+ return minimizeButton.isVisible();
}
public void setShowMinimizeButton(boolean showMinimizeButton) {
- minimizeButton.setDisplayable(showMinimizeButton);
+ minimizeButton.setVisible(showMinimizeButton);
}
public boolean getShowMaximizeButton() {
- return maximizeButton.isDisplayable();
+ return maximizeButton.isVisible();
}
public void setShowMaximizeButton(boolean showMaximizeButton) {
- maximizeButton.setDisplayable(showMaximizeButton);
+ maximizeButton.setVisible(showMaximizeButton);
}
public boolean getShowCloseButton() {
- return closeButton.isDisplayable();
+ return closeButton.isVisible();
}
public void setShowCloseButton(boolean showCloseButton) {
- closeButton.setDisplayable(showCloseButton);
+ closeButton.setVisible(showCloseButton);
}
public Insets getPadding() {
@@ -761,14 +758,14 @@
@Override
public void titleChanged(Window window, String previousTitle) {
String title = window.getTitle();
- titleLabel.setDisplayable(title != null);
+ titleLabel.setVisible(title != null);
titleLabel.setText(title);
}
@Override
public void iconChanged(Window window, Image previousIcon) {
Image icon = window.getIcon();
- iconImageView.setDisplayable(icon != null);
+ iconImageView.setVisible(icon != null);
iconImageView.setImage(icon);
}
@@ -802,11 +799,6 @@
updateMaximizedState();
}
- @Override
- public void displayableChanged(Component component) {
- // No-op
- }
-
public void menuBarChanged(Frame frame, MenuBar previousMenuBar) {
invalidateComponent();
}
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarSkin.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarSkin.java Mon Aug 10 13:56:06 2009
@@ -84,7 +84,7 @@
}
MenuBar.Item item = items.get(i);
- if (item.isDisplayable()) {
+ if (item.isVisible()) {
preferredWidth += item.getPreferredWidth(height);
j++;
}
@@ -101,7 +101,7 @@
for (int i = 0, n = items.getLength(); i < n; i++) {
MenuBar.Item item = items.get(i);
- if (item.isDisplayable()) {
+ if (item.isVisible()) {
preferredHeight = Math.max(item.getPreferredHeight(width), preferredHeight);
}
}
@@ -123,7 +123,7 @@
}
MenuBar.Item item = items.get(i);
- if (item.isDisplayable()) {
+ if (item.isVisible()) {
preferredWidth += item.getPreferredWidth(-1);
preferredHeight = Math.max(item.getPreferredHeight(-1), preferredHeight);
}
@@ -139,7 +139,7 @@
int itemX = 0;
for (MenuBar.Item item : menuBar.getItems()) {
- if (item.isDisplayable()) {
+ if (item.isVisible()) {
item.setVisible(true);
item.setSize(item.getPreferredWidth(height), height);
item.setLocation(itemX, 0);
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuSkin.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraMenuSkin.java Mon Aug 10 13:56:06 2009
@@ -100,7 +100,7 @@
Menu.Section section = sections.get(i);
for (Menu.Item item : section) {
- if (item.isDisplayable()) {
+ if (item.isVisible()) {
preferredWidth = Math.max(item.getPreferredWidth(-1),
preferredWidth);
}
@@ -120,7 +120,7 @@
Menu.Section section = sections.get(i);
for (Menu.Item item : section) {
- if (item.isDisplayable()) {
+ if (item.isVisible()) {
preferredHeight += item.getPreferredHeight(width);
}
}
@@ -144,7 +144,7 @@
Menu.Section section = sections.get(i);
for (Menu.Item item : section) {
- if (item.isDisplayable()) {
+ if (item.isVisible()) {
preferredWidth = Math.max(item.getPreferredWidth(),
preferredWidth);
preferredHeight += item.getPreferredHeight();
@@ -170,7 +170,7 @@
Menu.Section section = sections.get(i);
for (Menu.Item item : section) {
- if (item.isDisplayable()) {
+ if (item.isVisible()) {
item.setVisible(true);
item.setSize(width, item.getPreferredHeight(width));
item.setLocation(0, itemY);
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java Mon Aug 10 13:56:06 2009
@@ -100,8 +100,9 @@
private Insets padding = new Insets(4);
private WindowListener ownerListener = new WindowListener.Adapter() {
- public void activeChanged(Window window) {
- getComponent().setDisplayable(window.isActive());
+ public void activeChanged(Window owner) {
+ Window window = (Window)getComponent();
+ window.setVisible(owner.isActive());
}
};
@@ -207,8 +208,7 @@
Dimensions preferredTitleBarSize = titleBarTablePane.getPreferredSize();
preferredWidth = preferredTitleBarSize.width;
- if (content != null
- && content.isDisplayable()) {
+ if (content != null) {
if (height != -1) {
height = Math.max(height - preferredTitleBarSize.height - 4 -
padding.top - padding.bottom, 0);
@@ -235,8 +235,7 @@
preferredHeight = titleBarTablePane.getPreferredHeight(width);
- if (content != null
- && content.isDisplayable()) {
+ if (content != null) {
if (width != -1) {
width = Math.max(width - padding.left - padding.right, 0);
}
@@ -261,8 +260,7 @@
preferredWidth = preferredTitleBarSize.width;
preferredHeight = preferredTitleBarSize.height;
- if (content != null
- && content.isDisplayable()) {
+ if (content != null) {
Dimensions preferredContentSize = content.getPreferredSize();
preferredWidth = Math.max(preferredWidth, preferredContentSize.width);
@@ -290,20 +288,16 @@
Component content = palette.getContent();
if (content != null) {
- if (content.isDisplayable()) {
- content.setVisible(true);
+ content.setVisible(true);
- content.setLocation(padding.left + 1,
- titleBarTablePane.getHeight() + padding.top + 3);
+ content.setLocation(padding.left + 1,
+ titleBarTablePane.getHeight() + padding.top + 3);
- int contentWidth = Math.max(width - (padding.left + padding.right + 2), 0);
- int contentHeight = Math.max(height - (titleBarTablePane.getHeight()
- + padding.top + padding.bottom + 4), 0);
-
- content.setSize(contentWidth, contentHeight);
- } else {
- content.setVisible(false);
- }
+ int contentWidth = Math.max(width - (padding.left + padding.right + 2), 0);
+ int contentHeight = Math.max(height - (titleBarTablePane.getHeight()
+ + padding.top + padding.bottom + 4), 0);
+
+ content.setSize(contentWidth, contentHeight);
}
}
@@ -459,7 +453,7 @@
super.titleChanged(window, previousTitle);
String title = window.getTitle();
- titleLabel.setDisplayable(title != null);
+ titleLabel.setVisible(title != null);
titleLabel.setText(title);
}
}
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java Mon Aug 10 13:56:06 2009
@@ -134,8 +134,7 @@
Sheet sheet = (Sheet)getComponent();
Component content = sheet.getContent();
- if (content != null
- && content.isDisplayable()) {
+ if (content != null) {
if (height != -1) {
height = Math.max(height - (padding.top + padding.bottom + 2), 0);
}
@@ -155,8 +154,7 @@
Sheet sheet = (Sheet)getComponent();
Component content = sheet.getContent();
- if (content != null
- && content.isDisplayable()) {
+ if (content != null) {
if (width != -1) {
width = Math.max(width - (padding.left + padding.right + 2), 0);
}
@@ -178,8 +176,7 @@
Sheet sheet = (Sheet)getComponent();
Component content = sheet.getContent();
- if (content != null
- && content.isDisplayable()) {
+ if (content != null) {
Dimensions preferredContentSize = content.getPreferredSize();
preferredWidth = preferredContentSize.width;
preferredHeight = preferredContentSize.height;
@@ -220,18 +217,12 @@
Component content = sheet.getContent();
if (content != null) {
- if (content.isDisplayable()) {
- content.setVisible(true);
+ content.setLocation(padding.left + 1, padding.top + 1);
- content.setLocation(padding.left + 1, padding.top + 1);
+ int contentWidth = Math.max(width - (padding.left + padding.right + 2), 0);
+ int contentHeight = Math.max(height - (padding.top + padding.bottom + 2), 0);
- int contentWidth = Math.max(width - (padding.left + padding.right + 2), 0);
- int contentHeight = Math.max(height - (padding.top + padding.bottom + 2), 0);
-
- content.setSize(contentWidth, contentHeight);
- } else {
- content.setVisible(false);
- }
+ content.setSize(contentWidth, contentHeight);
}
}
Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java Mon Aug 10 13:56:06 2009
@@ -471,8 +471,7 @@
switch (tabOrientation) {
case HORIZONTAL: {
if (height != -1) {
- if (corner != null
- && corner.isDisplayable()) {
+ if (corner != null) {
height = Math.max(height - Math.max(corner.getPreferredHeight(-1),
Math.max(buttonPanorama.getPreferredHeight(-1) - 1, 0)), 0);
} else {
@@ -485,8 +484,7 @@
preferredWidth = getPreferredTabWidth(height) + (padding.left + padding.right + 2);
int buttonAreaPreferredWidth = buttonPanorama.getPreferredWidth(-1);
- if (corner != null
- && corner.isDisplayable()) {
+ if (corner != null) {
buttonAreaPreferredWidth += corner.getPreferredWidth(-1);
}
@@ -514,8 +512,7 @@
preferredWidth += 2;
}
- if (corner != null
- && corner.isDisplayable()) {
+ if (corner != null) {
preferredWidth += Math.max(corner.getPreferredWidth(-1),
Math.max(buttonPanorama.getPreferredWidth(-1) - 1, 0));
} else {
@@ -557,8 +554,7 @@
preferredHeight += 2;
}
- if (corner != null
- && corner.isDisplayable()) {
+ if (corner != null) {
preferredHeight += Math.max(corner.getPreferredHeight(-1),
Math.max(buttonPanorama.getPreferredHeight(-1) - 1, 0));
} else {
@@ -570,8 +566,7 @@
case VERTICAL: {
if (width != -1) {
- if (corner != null
- && corner.isDisplayable()) {
+ if (corner != null) {
width = Math.max(width - Math.max(corner.getPreferredWidth(-1),
Math.max(buttonPanorama.getPreferredWidth(-1) - 1, 0)), 0);
} else {
@@ -584,8 +579,7 @@
preferredHeight = getPreferredTabHeight(width) + (padding.top + padding.bottom + 2);
int buttonAreaPreferredHeight = buttonPanorama.getPreferredHeight(-1);
- if (corner != null
- && corner.isDisplayable()) {
+ if (corner != null) {
buttonAreaPreferredHeight += corner.getPreferredHeight(-1);
}
@@ -627,8 +621,7 @@
}
int buttonAreaPreferredWidth = buttonPanorama.getPreferredWidth(-1);
- if (corner != null
- && corner.isDisplayable()) {
+ if (corner != null) {
buttonAreaPreferredWidth += corner.getPreferredWidth(-1);
preferredHeight += Math.max(corner.getPreferredHeight(-1),
Math.max(buttonPanorama.getPreferredHeight(-1) - 1, 0));
@@ -661,8 +654,7 @@
}
int buttonAreaPreferredHeight = buttonPanorama.getPreferredHeight(-1);
- if (corner != null
- && corner.isDisplayable()) {
+ if (corner != null) {
preferredWidth += Math.max(corner.getPreferredWidth(-1),
Math.max(buttonPanorama.getPreferredWidth(-1) - 1, 0));
buttonAreaPreferredHeight += corner.getPreferredHeight(-1);
@@ -742,20 +734,16 @@
int buttonPanoramaY = 0;
if (corner != null) {
- if (corner.isDisplayable()) {
- int cornerWidth = width - buttonPanoramaWidth;
- int cornerHeight = Math.max(corner.getPreferredHeight(-1), buttonPanoramaSize.height - 1);
- int cornerX = buttonPanoramaWidth;
- int cornerY = Math.max(buttonPanoramaHeight - cornerHeight - 1, 0);
-
- buttonPanoramaY = Math.max(cornerHeight - buttonPanoramaHeight + 1, 0);
-
- corner.setVisible(true);
- corner.setLocation(cornerX, cornerY);
- corner.setSize(cornerWidth, cornerHeight);
- } else {
- corner.setVisible(false);
- }
+ int cornerWidth = width - buttonPanoramaWidth;
+ int cornerHeight = Math.max(corner.getPreferredHeight(-1), buttonPanoramaSize.height - 1);
+ int cornerX = buttonPanoramaWidth;
+ int cornerY = Math.max(buttonPanoramaHeight - cornerHeight - 1, 0);
+
+ buttonPanoramaY = Math.max(cornerHeight - buttonPanoramaHeight + 1, 0);
+
+ corner.setVisible(true);
+ corner.setLocation(cornerX, cornerY);
+ corner.setSize(cornerWidth, cornerHeight);
}
buttonPanorama.setLocation(buttonPanoramaX, buttonPanoramaY);
@@ -778,20 +766,16 @@
int buttonPanoramaY = 0;
if (corner != null) {
- if (corner.isDisplayable()) {
- int cornerWidth = corner.getPreferredWidth(-1);
- int cornerHeight = height - buttonPanoramaHeight;
- int cornerX = Math.max(buttonPanoramaWidth - cornerWidth - 1, 0);
- int cornerY = buttonPanoramaHeight;
-
- buttonPanoramaX = Math.max(cornerWidth - buttonPanoramaWidth + 1, 0);
-
- corner.setVisible(true);
- corner.setLocation(cornerX, cornerY);
- corner.setSize(cornerWidth, cornerHeight);
- } else {
- corner.setVisible(false);
- }
+ int cornerWidth = corner.getPreferredWidth(-1);
+ int cornerHeight = height - buttonPanoramaHeight;
+ int cornerX = Math.max(buttonPanoramaWidth - cornerWidth - 1, 0);
+ int cornerY = buttonPanoramaHeight;
+
+ buttonPanoramaX = Math.max(cornerWidth - buttonPanoramaWidth + 1, 0);
+
+ corner.setVisible(true);
+ corner.setLocation(cornerX, cornerY);
+ corner.setSize(cornerWidth, cornerHeight);
}
buttonPanorama.setLocation(buttonPanoramaX, buttonPanoramaY);
Modified: incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/test/flow_pane_test.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/test/flow_pane_test.wtkx?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/test/flow_pane_test.wtkx (original)
+++ incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/test/flow_pane_test.wtkx Mon Aug 10 13:56:06 2009
@@ -24,7 +24,7 @@
<FlowPane styles="{alignment:'left', backgroundColor:'#ff0000', padding:4}">
<PushButton buttonData="0" styles="{minimumPreferredAspectRatio:15}"/>
<PushButton buttonData="1" styles="{minimumPreferredAspectRatio:1.5}"/>
- <PushButton buttonData="2" displayable="false" styles="{minimumPreferredAspectRatio:1.5}"/>
+ <PushButton buttonData="2" visible="false" styles="{minimumPreferredAspectRatio:1.5}"/>
<PushButton buttonData="3" styles="{minimumPreferredAspectRatio:1.5}"/>
<PushButton buttonData="4" styles="{minimumPreferredAspectRatio:1.5}"/>
<PushButton buttonData="5" styles="{minimumPreferredAspectRatio:1.5}"/>
@@ -34,7 +34,7 @@
<PushButton buttonData="9" preferredHeight="60" styles="{minimumPreferredAspectRatio:1.5}"/>
<PushButton buttonData="0" styles="{minimumPreferredAspectRatio:1.5}"/>
<PushButton buttonData="A" styles="{minimumPreferredAspectRatio:1.5}"/>
- <PushButton buttonData="B" displayable="false" styles="{minimumPreferredAspectRatio:1.5}"/>
+ <PushButton buttonData="B" visible="false" styles="{minimumPreferredAspectRatio:1.5}"/>
<PushButton buttonData="C" styles="{minimumPreferredAspectRatio:1.5}"/>
<PushButton buttonData="D" styles="{minimumPreferredAspectRatio:1.5}"/>
<PushButton buttonData="E" styles="{minimumPreferredAspectRatio:1.5}"/>
Modified: incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/test/table_pane_test.wtkx
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/test/table_pane_test.wtkx?rev=802796&r1=802795&r2=802796&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/test/table_pane_test.wtkx (original)
+++ incubator/pivot/trunk/wtk/test/org/apache/pivot/wtk/test/table_pane_test.wtkx Mon Aug 10 13:56:06 2009
@@ -32,7 +32,7 @@
<TablePane.Filler preferredHeight="60"/>
</TablePane.Row>
<TablePane.Row height="-1">
- <PushButton buttonData="Three" displayable="false"/>
+ <PushButton buttonData="Three" visible="false"/>
</TablePane.Row>
<TablePane.Row height="-1">
<PushButton buttonData="Four"/>