You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by sm...@apache.org on 2013/10/05 01:45:53 UTC
svn commit: r1529349 [41/44] - in /pivot/trunk:
charts/src/org/apache/pivot/charts/
charts/src/org/apache/pivot/charts/skin/ core/src/org/apache/pivot/beans/
core/src/org/apache/pivot/collections/
core/src/org/apache/pivot/collections/adapter/ core/src...
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/MovieViewSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/MovieViewSkin.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/MovieViewSkin.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/MovieViewSkin.java Fri Oct 4 23:45:40 2013
@@ -30,7 +30,6 @@ import org.apache.pivot.wtk.VerticalAlig
import org.apache.pivot.wtk.media.Movie;
import org.apache.pivot.wtk.media.MovieListener;
-
/**
* Movie view skin.
*/
@@ -51,10 +50,9 @@ public class MovieViewSkin extends Compo
@Override
public void regionUpdated(Movie movie, int x, int y, int width, int height) {
- repaintComponent(movieX + (int)Math.floor(x * scale),
- movieY + (int)Math.floor(y * scale),
- (int)Math.ceil(width * scale) + 1,
- (int)Math.ceil(height * scale) + 1);
+ repaintComponent(movieX + (int) Math.floor(x * scale),
+ movieY + (int) Math.floor(y * scale), (int) Math.ceil(width * scale) + 1,
+ (int) Math.ceil(height * scale) + 1);
}
};
@@ -62,7 +60,7 @@ public class MovieViewSkin extends Compo
public void install(Component component) {
super.install(component);
- MovieView movieView = (MovieView)component;
+ MovieView movieView = (MovieView) component;
movieView.getMovieViewListeners().add(this);
Movie movie = movieView.getMovie();
@@ -73,7 +71,7 @@ public class MovieViewSkin extends Compo
@Override
public int getPreferredWidth(int height) {
- MovieView movieView = (MovieView)getComponent();
+ MovieView movieView = (MovieView) getComponent();
Movie movie = movieView.getMovie();
return (movie == null) ? 0 : Math.round(movie.getWidth() * scale);
@@ -81,7 +79,7 @@ public class MovieViewSkin extends Compo
@Override
public int getPreferredHeight(int width) {
- MovieView movieView = (MovieView)getComponent();
+ MovieView movieView = (MovieView) getComponent();
Movie movie = movieView.getMovie();
return (movie == null) ? 0 : Math.round(movie.getHeight() * scale);
@@ -89,17 +87,16 @@ public class MovieViewSkin extends Compo
@Override
public Dimensions getPreferredSize() {
- MovieView movieView = (MovieView)getComponent();
+ MovieView movieView = (MovieView) getComponent();
Movie movie = movieView.getMovie();
- return (movie == null) ? new Dimensions(0, 0) :
- new Dimensions(Math.round(movie.getWidth() * scale),
- Math.round(movie.getHeight() * scale));
+ return (movie == null) ? new Dimensions(0, 0) : new Dimensions(Math.round(movie.getWidth()
+ * scale), Math.round(movie.getHeight() * scale));
}
@Override
public void layout() {
- MovieView movieView = (MovieView)getComponent();
+ MovieView movieView = (MovieView) getComponent();
Movie movie = movieView.getMovie();
if (movie != null) {
@@ -110,34 +107,34 @@ public class MovieViewSkin extends Compo
int movieHeight = movie.getHeight();
switch (horizontalAlignment) {
- case CENTER:
- movieX = (width - movieWidth) / 2;
- break;
- case RIGHT:
- movieX = width - movieWidth;
- break;
- default:
- movieX = 0;
- break;
+ case CENTER:
+ movieX = (width - movieWidth) / 2;
+ break;
+ case RIGHT:
+ movieX = width - movieWidth;
+ break;
+ default:
+ movieX = 0;
+ break;
}
switch (verticalAlignment) {
- case CENTER:
- movieY = (height - movieHeight) / 2;
- break;
- case BOTTOM:
- movieY = height - movieHeight;
- break;
- default:
- movieY = 0;
- break;
+ case CENTER:
+ movieY = (height - movieHeight) / 2;
+ break;
+ case BOTTOM:
+ movieY = height - movieHeight;
+ break;
+ default:
+ movieY = 0;
+ break;
}
}
}
@Override
public void paint(Graphics2D graphics) {
- MovieView movieView = (MovieView)getComponent();
+ MovieView movieView = (MovieView) getComponent();
Movie movie = movieView.getMovie();
int width = getWidth();
@@ -159,8 +156,7 @@ public class MovieViewSkin extends Compo
}
/**
- * @return
- * <tt>false</tt>; movie views are not focusable.
+ * @return <tt>false</tt>; movie views are not focusable.
*/
@Override
public boolean isFocusable() {
@@ -169,8 +165,7 @@ public class MovieViewSkin extends Compo
@Override
public boolean isOpaque() {
- return (backgroundColor != null
- && backgroundColor.getTransparency() == Transparency.OPAQUE);
+ return (backgroundColor != null && backgroundColor.getTransparency() == Transparency.OPAQUE);
}
public Color getBackgroundColor() {
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/PushButtonSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/PushButtonSkin.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/PushButtonSkin.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/PushButtonSkin.java Fri Oct 4 23:45:40 2013
@@ -18,9 +18,9 @@ package org.apache.pivot.wtk.skin;
import org.apache.pivot.wtk.Component;
import org.apache.pivot.wtk.Keyboard;
+import org.apache.pivot.wtk.Keyboard.KeyCode;
import org.apache.pivot.wtk.Mouse;
import org.apache.pivot.wtk.PushButton;
-import org.apache.pivot.wtk.Keyboard.KeyCode;
/**
* Abstract base class for push button skins.
@@ -73,7 +73,7 @@ public abstract class PushButtonSkin ext
public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) {
boolean consumed = super.mouseClick(component, button, x, y, count);
- PushButton pushButton = (PushButton)getComponent();
+ PushButton pushButton = (PushButton) getComponent();
pushButton.press();
return consumed;
@@ -82,7 +82,7 @@ public abstract class PushButtonSkin ext
/**
* {@link KeyCode#SPACE SPACE} Repaints the component to reflect the pressed
* state.
- *
+ *
* @see #keyReleased(Component, int,
* org.apache.pivot.wtk.Keyboard.KeyLocation)
*/
@@ -107,7 +107,7 @@ public abstract class PushButtonSkin ext
public boolean keyReleased(Component component, int keyCode, Keyboard.KeyLocation keyLocation) {
boolean consumed = false;
- PushButton pushButton = (PushButton)getComponent();
+ PushButton pushButton = (PushButton) getComponent();
if (keyCode == Keyboard.KeyCode.SPACE) {
pressed = false;
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/RadioButtonSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/RadioButtonSkin.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/RadioButtonSkin.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/RadioButtonSkin.java Fri Oct 4 23:45:40 2013
@@ -18,9 +18,9 @@ package org.apache.pivot.wtk.skin;
import org.apache.pivot.wtk.Component;
import org.apache.pivot.wtk.Keyboard;
+import org.apache.pivot.wtk.Keyboard.KeyCode;
import org.apache.pivot.wtk.Mouse;
import org.apache.pivot.wtk.RadioButton;
-import org.apache.pivot.wtk.Keyboard.KeyCode;
/**
* Abstract base class for radio button skins.
@@ -35,7 +35,7 @@ public abstract class RadioButtonSkin ex
public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) {
boolean consumed = super.mouseClick(component, button, x, y, count);
- RadioButton radioButton = (RadioButton)getComponent();
+ RadioButton radioButton = (RadioButton) getComponent();
radioButton.requestFocus();
radioButton.press();
@@ -50,7 +50,7 @@ public abstract class RadioButtonSkin ex
public boolean keyReleased(Component component, int keyCode, Keyboard.KeyLocation keyLocation) {
boolean consumed = false;
- RadioButton radioButton = (RadioButton)getComponent();
+ RadioButton radioButton = (RadioButton) getComponent();
if (keyCode == Keyboard.KeyCode.SPACE) {
radioButton.press();
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/RollupSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/RollupSkin.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/RollupSkin.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/RollupSkin.java Fri Oct 4 23:45:40 2013
@@ -25,13 +25,13 @@ import org.apache.pivot.wtk.RollupStateL
/**
* Abstract base class for rollup skins.
*/
-public abstract class RollupSkin extends ContainerSkin
- implements RollupListener, RollupStateListener {
+public abstract class RollupSkin extends ContainerSkin implements RollupListener,
+ RollupStateListener {
@Override
public void install(Component component) {
super.install(component);
- Rollup rollup = (Rollup)component;
+ Rollup rollup = (Rollup) component;
rollup.getRollupListeners().add(this);
rollup.getRollupStateListeners().add(this);
}
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ScrollPaneSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ScrollPaneSkin.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ScrollPaneSkin.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ScrollPaneSkin.java Fri Oct 4 23:45:40 2013
@@ -42,9 +42,8 @@ import org.apache.pivot.wtk.ViewportList
/**
* Scroll pane skin.
*/
-public class ScrollPaneSkin extends ContainerSkin
- implements Viewport.Skin, ScrollPaneListener, ViewportListener,
- ScrollBarValueListener {
+public class ScrollPaneSkin extends ContainerSkin implements Viewport.Skin, ScrollPaneListener,
+ ViewportListener, ScrollBarValueListener {
private ScrollBar horizontalScrollBar = new ScrollBar(Orientation.HORIZONTAL);
private ScrollBar verticalScrollBar = new ScrollBar(Orientation.VERTICAL);
@@ -76,7 +75,7 @@ public class ScrollPaneSkin extends Cont
public void install(Component component) {
super.install(component);
- ScrollPane scrollPane = (ScrollPane)component;
+ ScrollPane scrollPane = (ScrollPane) component;
scrollPane.getViewportListeners().add(this);
scrollPane.getScrollPaneListeners().add(this);
@@ -96,7 +95,7 @@ public class ScrollPaneSkin extends Cont
public int getPreferredWidth(int height) {
int preferredWidth = 0;
- ScrollPane scrollPane = (ScrollPane)getComponent();
+ ScrollPane scrollPane = (ScrollPane) getComponent();
Component view = scrollPane.getView();
if (view != null) {
@@ -127,8 +126,8 @@ public class ScrollPaneSkin extends Cont
if (height < 0) {
verticalPolicy = ScrollBarPolicy.AUTO;
} else {
- int preferredHeight = preferredViewSize.height +
- preferredColumnHeaderHeight;
+ int preferredHeight = preferredViewSize.height
+ + preferredColumnHeaderHeight;
if (preferredHeight < height) {
verticalPolicy = ScrollBarPolicy.FILL;
@@ -147,17 +146,15 @@ public class ScrollPaneSkin extends Cont
if (verticalPolicy == ScrollBarPolicy.ALWAYS
|| verticalPolicy == ScrollBarPolicy.NEVER
|| verticalPolicy == ScrollBarPolicy.AUTO) {
- preferredWidth = preferredViewSize.width +
- preferredRowHeaderWidth;
+ preferredWidth = preferredViewSize.width + preferredRowHeaderWidth;
// If the sum of the preferred heights of the view and the
// column header is greater than the height constraint,
// include the preferred width of the scroll bar in the
// preferred width calculation
if (verticalPolicy == ScrollBarPolicy.ALWAYS
- || (verticalPolicy == ScrollBarPolicy.AUTO
- && height > 0
- && preferredViewSize.height + preferredColumnHeaderHeight > height)) {
+ || (verticalPolicy == ScrollBarPolicy.AUTO && height > 0 && preferredViewSize.height
+ + preferredColumnHeaderHeight > height)) {
preferredWidth += verticalScrollBar.getPreferredWidth(-1);
}
}
@@ -174,8 +171,7 @@ public class ScrollPaneSkin extends Cont
heightUpdated = Math.max(heightUpdated - preferredColumnHeaderHeight, 0);
}
- preferredWidth = view.getPreferredWidth(heightUpdated) +
- preferredRowHeaderWidth;
+ preferredWidth = view.getPreferredWidth(heightUpdated) + preferredRowHeaderWidth;
}
}
@@ -186,7 +182,7 @@ public class ScrollPaneSkin extends Cont
public int getPreferredHeight(int width) {
int preferredHeight = 0;
- ScrollPane scrollPane = (ScrollPane)getComponent();
+ ScrollPane scrollPane = (ScrollPane) getComponent();
Component view = scrollPane.getView();
if (view != null) {
@@ -217,8 +213,7 @@ public class ScrollPaneSkin extends Cont
if (width < 0) {
horizontalPolicy = ScrollBarPolicy.AUTO;
} else {
- int preferredWidth = preferredViewSize.width +
- preferredRowHeaderWidth;
+ int preferredWidth = preferredViewSize.width + preferredRowHeaderWidth;
if (preferredWidth < width) {
horizontalPolicy = ScrollBarPolicy.FILL;
@@ -237,35 +232,36 @@ public class ScrollPaneSkin extends Cont
if (horizontalPolicy == ScrollBarPolicy.ALWAYS
|| horizontalPolicy == ScrollBarPolicy.NEVER
|| horizontalPolicy == ScrollBarPolicy.AUTO) {
- preferredHeight = preferredViewSize.height +
- preferredColumnHeaderHeight;
+ preferredHeight = preferredViewSize.height + preferredColumnHeaderHeight;
// If the sum of the preferred widths of the view and the
// row header is greater than the width constraint, include
// the preferred height of the scroll bar in the preferred
// height calculation
if (horizontalPolicy == ScrollBarPolicy.ALWAYS
- || (horizontalPolicy == ScrollBarPolicy.AUTO
- && width > 0
- && preferredViewSize.width + preferredRowHeaderWidth > width)) {
+ || (horizontalPolicy == ScrollBarPolicy.AUTO && width > 0 && preferredViewSize.width
+ + preferredRowHeaderWidth > width)) {
preferredHeight += horizontalScrollBar.getPreferredHeight(-1);
}
}
}
if (horizontalPolicy == ScrollBarPolicy.FILL) {
- // Preferred height is the sum of the constrained preferred height
- // of the view and the unconstrained preferred height of the column
+ // Preferred height is the sum of the constrained preferred
+ // height
+ // of the view and the unconstrained preferred height of the
+ // column
// header
int widthUpdated = width;
if (widthUpdated >= 0) {
- // Subtract the unconstrained preferred width of the row header
+ // Subtract the unconstrained preferred width of the row
+ // header
// from the width constraint
widthUpdated = Math.max(widthUpdated - preferredRowHeaderWidth, 0);
}
- preferredHeight = view.getPreferredHeight(widthUpdated) +
- preferredColumnHeaderHeight;
+ preferredHeight = view.getPreferredHeight(widthUpdated)
+ + preferredColumnHeaderHeight;
}
}
@@ -274,7 +270,7 @@ public class ScrollPaneSkin extends Cont
@Override
public Dimensions getPreferredSize() {
- ScrollPane scrollPane = (ScrollPane)getComponent();
+ ScrollPane scrollPane = (ScrollPane) getComponent();
int preferredWidth = 0;
int preferredHeight = 0;
@@ -310,7 +306,7 @@ public class ScrollPaneSkin extends Cont
@Override
public int getBaseline(int width, int height) {
- ScrollPane scrollPane = (ScrollPane)getComponent();
+ ScrollPane scrollPane = (ScrollPane) getComponent();
Component view = scrollPane.getView();
Component rowHeader = scrollPane.getRowHeader();
@@ -335,8 +331,7 @@ public class ScrollPaneSkin extends Cont
baseline = columnHeader.getBaseline(clientWidth, columnHeaderHeight);
}
- if (baseline == -1
- && rowHeader != null) {
+ if (baseline == -1 && rowHeader != null) {
baseline = rowHeader.getBaseline(rowHeaderWidth, clientHeight);
if (baseline != -1) {
@@ -344,8 +339,7 @@ public class ScrollPaneSkin extends Cont
}
}
- if (baseline == -1
- && view != null) {
+ if (baseline == -1 && view != null) {
baseline = view.getBaseline(clientWidth, clientHeight);
if (baseline != -1) {
@@ -361,7 +355,7 @@ public class ScrollPaneSkin extends Cont
int wheelRotation, int x, int y) {
boolean consumed = false;
- ScrollPane scrollPane = (ScrollPane)getComponent();
+ ScrollPane scrollPane = (ScrollPane) getComponent();
Component view = scrollPane.getView();
if (view != null) {
@@ -370,8 +364,8 @@ public class ScrollPaneSkin extends Cont
if (Keyboard.isPressed(Keyboard.Modifier.SHIFT)) {
// Treat the mouse wheel as a horizontal scroll event
int previousScrollLeft = scrollPane.getScrollLeft();
- int newScrollLeft = previousScrollLeft + (scrollAmount * wheelRotation *
- horizontalScrollBar.getUnitIncrement());
+ int newScrollLeft = previousScrollLeft
+ + (scrollAmount * wheelRotation * horizontalScrollBar.getUnitIncrement());
if (wheelRotation > 0) {
int maxScrollLeft = getMaxScrollLeft();
@@ -392,8 +386,8 @@ public class ScrollPaneSkin extends Cont
} else {
// Treat the mouse wheel as a vertical scroll event
int previousScrollTop = scrollPane.getScrollTop();
- int newScrollTop = previousScrollTop + (scrollAmount * wheelRotation *
- verticalScrollBar.getUnitIncrement());
+ int newScrollTop = previousScrollTop
+ + (scrollAmount * wheelRotation * verticalScrollBar.getUnitIncrement());
if (wheelRotation > 0) {
int maxScrollTop = getMaxScrollTop();
@@ -425,7 +419,7 @@ public class ScrollPaneSkin extends Cont
* {@link KeyCode#RIGHT RIGHT} Scroll right a single scroll unit.<br>
* {@link KeyCode#PAGE_UP PAGE_UP} Scroll up a single scroll block.<br>
* {@link KeyCode#PAGE_DOWN PAGE_DOWN} Scroll down a single scroll block.
- *
+ *
* @see ScrollBar#getBlockIncrement()
* @see ScrollBar#getUnitIncrement()
*/
@@ -434,35 +428,33 @@ public class ScrollPaneSkin extends Cont
boolean consumed = super.keyPressed(component, keyCode, keyLocation);
if (!consumed) {
- ScrollPane scrollPane = (ScrollPane)getComponent();
+ ScrollPane scrollPane = (ScrollPane) getComponent();
int scrollTop = scrollPane.getScrollTop();
int scrollLeft = scrollPane.getScrollLeft();
if (keyCode == Keyboard.KeyCode.UP) {
- int newScrollTop = Math.max(scrollTop -
- verticalScrollBar.getUnitIncrement(), 0);
+ int newScrollTop = Math.max(scrollTop - verticalScrollBar.getUnitIncrement(), 0);
scrollPane.setScrollTop(newScrollTop);
consumed = (newScrollTop != scrollTop);
} else if (keyCode == Keyboard.KeyCode.DOWN) {
- int newScrollTop = Math.min(scrollTop +
- verticalScrollBar.getUnitIncrement(), getMaxScrollTop());
+ int newScrollTop = Math.min(scrollTop + verticalScrollBar.getUnitIncrement(),
+ getMaxScrollTop());
scrollPane.setScrollTop(newScrollTop);
consumed = (newScrollTop != scrollTop);
} else if (keyCode == Keyboard.KeyCode.LEFT) {
- int newScrollLeft = Math.max(scrollLeft -
- horizontalScrollBar.getUnitIncrement(), 0);
+ int newScrollLeft = Math.max(scrollLeft - horizontalScrollBar.getUnitIncrement(), 0);
scrollPane.setScrollLeft(newScrollLeft);
consumed = (newScrollLeft != scrollLeft);
} else if (keyCode == Keyboard.KeyCode.RIGHT) {
- int newScrollLeft = Math.min(scrollLeft +
- horizontalScrollBar.getUnitIncrement(), getMaxScrollLeft());
+ int newScrollLeft = Math.min(scrollLeft + horizontalScrollBar.getUnitIncrement(),
+ getMaxScrollLeft());
scrollPane.setScrollLeft(newScrollLeft);
@@ -491,14 +483,13 @@ public class ScrollPaneSkin extends Cont
* Gets the maximum legal <tt>scrollTop</tt> value this this skin imposes.
* This is the largest value possible that still shows as much of the view
* component as it can.
- *
- * @return
- * The maximum scrollTop value
+ *
+ * @return The maximum scrollTop value
*/
private int getMaxScrollTop() {
int maxScrollTop = 0;
- ScrollPane scrollPane = (ScrollPane)getComponent();
+ ScrollPane scrollPane = (ScrollPane) getComponent();
Component view = scrollPane.getView();
if (view != null) {
@@ -516,8 +507,8 @@ public class ScrollPaneSkin extends Cont
horizontalScrollBarHeight = horizontalScrollBar.getHeight();
}
- maxScrollTop = Math.max(viewHeight + columnHeaderHeight +
- horizontalScrollBarHeight - height, 0);
+ maxScrollTop = Math.max(viewHeight + columnHeaderHeight + horizontalScrollBarHeight
+ - height, 0);
}
return maxScrollTop;
@@ -527,14 +518,13 @@ public class ScrollPaneSkin extends Cont
* Gets the maximum legal <tt>scrollLeft</tt> value this this skin imposes.
* This is the largest value possible that still shows as much of the view
* component as it can.
- *
- * @return
- * The maximum scrollLeft value
+ *
+ * @return The maximum scrollLeft value
*/
private int getMaxScrollLeft() {
int maxScrollLeft = 0;
- ScrollPane scrollPane = (ScrollPane)getComponent();
+ ScrollPane scrollPane = (ScrollPane) getComponent();
Component view = scrollPane.getView();
if (view != null) {
@@ -552,8 +542,7 @@ public class ScrollPaneSkin extends Cont
verticalScrollBarWidth = verticalScrollBar.getWidth();
}
- maxScrollLeft = Math.max(viewWidth + rowHeaderWidth +
- verticalScrollBarWidth - width, 0);
+ maxScrollLeft = Math.max(viewWidth + rowHeaderWidth + verticalScrollBarWidth - width, 0);
}
return maxScrollLeft;
@@ -561,7 +550,7 @@ public class ScrollPaneSkin extends Cont
@Override
public void layout() {
- ScrollPane scrollPane = (ScrollPane)getComponent();
+ ScrollPane scrollPane = (ScrollPane) getComponent();
ScrollBarPolicy horizontalPolicy = scrollPane.getHorizontalScrollBarPolicy();
ScrollBarPolicy verticalPolicy = scrollPane.getVerticalScrollBarPolicy();
@@ -594,8 +583,8 @@ public class ScrollPaneSkin extends Cont
Component rowHeader = scrollPane.getRowHeader();
int rowHeaderWidth = rowHeader != null ? rowHeader.getWidth() : 0;
- int verticalScrollBarWidth = verticalScrollBar.isVisible() ?
- verticalScrollBar.getWidth() : 0;
+ int verticalScrollBarWidth = verticalScrollBar.isVisible() ? verticalScrollBar.getWidth()
+ : 0;
int minViewWidth = getWidth() - rowHeaderWidth - verticalScrollBarWidth;
if (view.getWidth() < minViewWidth) {
@@ -606,13 +595,11 @@ public class ScrollPaneSkin extends Cont
if (fillHeightToCapacity) {
Component columnHeader = scrollPane.getColumnHeader();
- int columnHeaderHeight = columnHeader != null ?
- columnHeader.getHeight() : 0;
+ int columnHeaderHeight = columnHeader != null ? columnHeader.getHeight() : 0;
- int horizontalScrollBarHeight = horizontalScrollBar.isVisible() ?
- horizontalScrollBar.getHeight() : 0;
- int minViewHeight = getHeight() - columnHeaderHeight -
- horizontalScrollBarHeight;
+ int horizontalScrollBarHeight = horizontalScrollBar.isVisible() ? horizontalScrollBar.getHeight()
+ : 0;
+ int minViewHeight = getHeight() - columnHeaderHeight - horizontalScrollBarHeight;
if (view.getHeight() < minViewHeight) {
verticalPolicy = ScrollBarPolicy.FILL;
@@ -632,16 +619,14 @@ public class ScrollPaneSkin extends Cont
/**
* Layout helper method that assumes that the <tt>FILL_TO_CAPACITY</tt>
* scroll policy doesn't exist.
- *
- * @param horizontalPolicy
- * The assumed horizontal scroll policy; musn't be <tt>FILL_TO_CAPACITY</tt>
- *
- * @param verticalPolicy
- * The assumed vertical scroll policy; musn't be <tt>FILL_TO_CAPACITY</tt>
+ *
+ * @param horizontalPolicy The assumed horizontal scroll policy; musn't be
+ * <tt>FILL_TO_CAPACITY</tt>
+ * @param verticalPolicy The assumed vertical scroll policy; musn't be
+ * <tt>FILL_TO_CAPACITY</tt>
*/
- private void layoutHelper(ScrollBarPolicy horizontalPolicy,
- ScrollBarPolicy verticalPolicy) {
- ScrollPane scrollPane = (ScrollPane)getComponent();
+ private void layoutHelper(ScrollBarPolicy horizontalPolicy, ScrollBarPolicy verticalPolicy) {
+ ScrollPane scrollPane = (ScrollPane) getComponent();
int width = getWidth();
int height = getHeight();
@@ -678,17 +663,15 @@ public class ScrollPaneSkin extends Cont
if (view != null) {
if (constrainWidth && constrainHeight) {
- viewWidth = Math.max
- (width - rowHeaderWidth - verticalScrollBarWidth, 0);
- viewHeight = Math.max
- (height - columnHeaderHeight - horizontalScrollBarHeight, 0);
+ viewWidth = Math.max(width - rowHeaderWidth - verticalScrollBarWidth, 0);
+ viewHeight = Math.max(height - columnHeaderHeight - horizontalScrollBarHeight,
+ 0);
} else if (constrainWidth) {
- viewWidth = Math.max
- (width - rowHeaderWidth - verticalScrollBarWidth, 0);
+ viewWidth = Math.max(width - rowHeaderWidth - verticalScrollBarWidth, 0);
viewHeight = view.getPreferredHeight(viewWidth);
} else if (constrainHeight) {
- viewHeight = Math.max
- (height - columnHeaderHeight - horizontalScrollBarHeight, 0);
+ viewHeight = Math.max(height - columnHeaderHeight - horizontalScrollBarHeight,
+ 0);
viewWidth = view.getPreferredWidth(viewHeight);
} else {
Dimensions viewPreferredSize = view.getPreferredSize();
@@ -698,16 +681,16 @@ public class ScrollPaneSkin extends Cont
}
if (horizontalPolicy == ScrollBarPolicy.ALWAYS
- || (horizontalPolicy == ScrollBarPolicy.AUTO
- && viewWidth > width - rowHeaderWidth - verticalScrollBarWidth)) {
+ || (horizontalPolicy == ScrollBarPolicy.AUTO && viewWidth > width - rowHeaderWidth
+ - verticalScrollBarWidth)) {
horizontalScrollBarHeight = horizontalScrollBar.getPreferredHeight(-1);
} else {
horizontalScrollBarHeight = 0;
}
if (verticalPolicy == ScrollBarPolicy.ALWAYS
- || (verticalPolicy == ScrollBarPolicy.AUTO
- && viewHeight > height - columnHeaderHeight - horizontalScrollBarHeight)) {
+ || (verticalPolicy == ScrollBarPolicy.AUTO && viewHeight > height
+ - columnHeaderHeight - horizontalScrollBarHeight)) {
verticalScrollBarWidth = verticalScrollBar.getPreferredWidth(-1);
} else {
verticalScrollBarWidth = 0;
@@ -718,8 +701,7 @@ public class ScrollPaneSkin extends Cont
System.err.println("Breaking out of potential infinite loop");
break;
}
- } while (viewWidth != previousViewWidth
- || viewHeight != previousViewHeight
+ } while (viewWidth != previousViewWidth || viewHeight != previousViewHeight
|| horizontalScrollBarHeight != previousHorizontalScrollBarHeight
|| verticalScrollBarWidth != previousVerticalScrollBarWidth);
@@ -744,12 +726,10 @@ public class ScrollPaneSkin extends Cont
if (horizontalScrollBarHeight > 0) {
horizontalScrollBar.setVisible(true);
- int horizontalScrollBarWidth = Math.max
- (width - rowHeaderWidth - verticalScrollBarWidth, 0);
- horizontalScrollBar.setSize(horizontalScrollBarWidth,
- horizontalScrollBarHeight);
- horizontalScrollBar.setLocation(rowHeaderWidth,
- height - horizontalScrollBarHeight);
+ int horizontalScrollBarWidth = Math.max(
+ width - rowHeaderWidth - verticalScrollBarWidth, 0);
+ horizontalScrollBar.setSize(horizontalScrollBarWidth, horizontalScrollBarHeight);
+ horizontalScrollBar.setLocation(rowHeaderWidth, height - horizontalScrollBarHeight);
} else {
horizontalScrollBar.setVisible(false);
}
@@ -757,20 +737,17 @@ public class ScrollPaneSkin extends Cont
if (verticalScrollBarWidth > 0) {
verticalScrollBar.setVisible(true);
- int verticalScrollBarHeight = Math.max
- (height - columnHeaderHeight - horizontalScrollBarHeight, 0);
- verticalScrollBar.setSize(verticalScrollBarWidth,
- verticalScrollBarHeight);
- verticalScrollBar.setLocation(width - verticalScrollBarWidth,
- columnHeaderHeight);
+ int verticalScrollBarHeight = Math.max(height - columnHeaderHeight
+ - horizontalScrollBarHeight, 0);
+ verticalScrollBar.setSize(verticalScrollBarWidth, verticalScrollBarHeight);
+ verticalScrollBar.setLocation(width - verticalScrollBarWidth, columnHeaderHeight);
} else {
verticalScrollBar.setVisible(false);
}
// Handle corner components
- if (columnHeaderHeight > 0
- && rowHeaderWidth > 0) {
+ if (columnHeaderHeight > 0 && rowHeaderWidth > 0) {
if (corner != null) {
corner.setVisible(true);
corner.setSize(rowHeaderWidth, columnHeaderHeight);
@@ -790,8 +767,7 @@ public class ScrollPaneSkin extends Cont
topLeftCorner.setVisible(false);
}
- if (rowHeaderWidth > 0
- && horizontalScrollBarHeight > 0) {
+ if (rowHeaderWidth > 0 && horizontalScrollBarHeight > 0) {
bottomLeftCorner.setVisible(true);
bottomLeftCorner.setSize(rowHeaderWidth, horizontalScrollBarHeight);
bottomLeftCorner.setLocation(0, height - horizontalScrollBarHeight);
@@ -799,18 +775,16 @@ public class ScrollPaneSkin extends Cont
bottomLeftCorner.setVisible(false);
}
- if (verticalScrollBarWidth > 0
- && horizontalScrollBarHeight > 0) {
+ if (verticalScrollBarWidth > 0 && horizontalScrollBarHeight > 0) {
bottomRightCorner.setVisible(true);
bottomRightCorner.setSize(verticalScrollBarWidth, horizontalScrollBarHeight);
- bottomRightCorner.setLocation(width - verticalScrollBarWidth,
- height - horizontalScrollBarHeight);
+ bottomRightCorner.setLocation(width - verticalScrollBarWidth, height
+ - horizontalScrollBarHeight);
} else {
bottomRightCorner.setVisible(false);
}
- if (columnHeaderHeight > 0
- && verticalScrollBarWidth > 0) {
+ if (columnHeaderHeight > 0 && verticalScrollBarWidth > 0) {
topRightCorner.setVisible(true);
topRightCorner.setSize(verticalScrollBarWidth, columnHeaderHeight);
topRightCorner.setLocation(width - verticalScrollBarWidth, 0);
@@ -850,8 +824,7 @@ public class ScrollPaneSkin extends Cont
public void setBackgroundPaint(Paint backgroundPaint) {
super.setBackgroundPaint(backgroundPaint);
- optimizeScrolling = (backgroundPaint != null
- && backgroundPaint.getTransparency() == Transparency.OPAQUE);
+ optimizeScrolling = (backgroundPaint != null && backgroundPaint.getTransparency() == Transparency.OPAQUE);
}
public int getHorizontalIncrement() {
@@ -897,12 +870,10 @@ public class ScrollPaneSkin extends Cont
// host is obscured. For a full description of why this is the case,
// see http://people.apache.org/~tvolkert/tests/scrolling/
- ScrollPane scrollPane = (ScrollPane)getComponent();
+ ScrollPane scrollPane = (ScrollPane) getComponent();
ApplicationContext.DisplayHost displayHost = scrollPane.getDisplay().getDisplayHost();
- optimizeScrollingLocal = (displayHost.getScale() == 1
- && (DesktopApplicationContext.isActive()
- && displayHost.isDisplayable()));
+ optimizeScrollingLocal = (displayHost.getScale() == 1 && (DesktopApplicationContext.isActive() && displayHost.isDisplayable()));
}
return optimizeScrollingLocal;
@@ -917,7 +888,7 @@ public class ScrollPaneSkin extends Cont
int width = getWidth();
int height = getHeight();
- ScrollPane scrollPane = (ScrollPane)getComponent();
+ ScrollPane scrollPane = (ScrollPane) getComponent();
Component rowHeader = scrollPane.getRowHeader();
if (rowHeader != null) {
@@ -982,7 +953,7 @@ public class ScrollPaneSkin extends Cont
// NOTE we don't invalidate the component here because we need only
// reposition the view and row header. Invalidating would yield
// the correct positioning, but it would do much more work than needed.
- ScrollPane scrollPane = (ScrollPane)viewport;
+ ScrollPane scrollPane = (ScrollPane) viewport;
Component view = scrollPane.getView();
Component rowHeader = scrollPane.getRowHeader();
@@ -995,9 +966,7 @@ public class ScrollPaneSkin extends Cont
int scrollTop = scrollPane.getScrollTop();
- if (view != null
- && view.isShowing()
- && isOptimizeScrolling()) {
+ if (view != null && view.isShowing() && isOptimizeScrolling()) {
Bounds blitArea = view.getVisibleArea();
int blitX = blitArea.x + view.getX();
@@ -1033,12 +1002,12 @@ public class ScrollPaneSkin extends Cont
boolean repaintAllViewport = scrollPane.isRepaintAllViewport();
if (!repaintAllViewport) {
- scrollPane.repaint(blitX, (columnHeaderHeight + (deltaScrollTop > 0 ? blitHeight : 0)),
- blitWidth, Math.abs(deltaScrollTop), true);
+ scrollPane.repaint(blitX, (columnHeaderHeight + (deltaScrollTop > 0 ? blitHeight
+ : 0)), blitWidth, Math.abs(deltaScrollTop), true);
} else {
Bounds viewportBounds = getViewportBounds();
- scrollPane.repaint(viewportBounds.x, viewportBounds.y,
- viewportBounds.width, viewportBounds.height, true);
+ scrollPane.repaint(viewportBounds.x, viewportBounds.y, viewportBounds.width,
+ viewportBounds.height, true);
}
} else {
@@ -1061,7 +1030,7 @@ public class ScrollPaneSkin extends Cont
// NOTE we don't invalidate the component here because we need only
// reposition the view and column header. Invalidating would yield
// the correct positioning, but it would do much more work than needed.
- ScrollPane scrollPane = (ScrollPane)viewport;
+ ScrollPane scrollPane = (ScrollPane) viewport;
Component view = scrollPane.getView();
Component rowHeader = scrollPane.getRowHeader();
@@ -1074,9 +1043,7 @@ public class ScrollPaneSkin extends Cont
int scrollLeft = scrollPane.getScrollLeft();
- if (view != null
- && view.isShowing()
- && isOptimizeScrolling()) {
+ if (view != null && view.isShowing() && isOptimizeScrolling()) {
Bounds blitArea = view.getVisibleArea();
int blitX = blitArea.x + view.getX();
@@ -1115,8 +1082,8 @@ public class ScrollPaneSkin extends Cont
Math.abs(deltaScrollLeft), blitHeight, true);
} else {
Bounds viewportBounds = getViewportBounds();
- scrollPane.repaint(viewportBounds.x, viewportBounds.y,
- viewportBounds.width, viewportBounds.height, true);
+ scrollPane.repaint(viewportBounds.x, viewportBounds.y, viewportBounds.width,
+ viewportBounds.height, true);
}
} else {
if (view != null) {
@@ -1142,7 +1109,7 @@ public class ScrollPaneSkin extends Cont
@Override
public void valueChanged(ScrollBar scrollBar, int previousValue) {
- ScrollPane scrollPane = (ScrollPane)getComponent();
+ ScrollPane scrollPane = (ScrollPane) getComponent();
int value = scrollBar.getValue();
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/SeparatorSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/SeparatorSkin.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/SeparatorSkin.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/SeparatorSkin.java Fri Oct 4 23:45:40 2013
@@ -36,7 +36,6 @@ import org.apache.pivot.wtk.Separator;
import org.apache.pivot.wtk.SeparatorListener;
import org.apache.pivot.wtk.Theme;
-
/**
* Separator skin.
*/
@@ -60,7 +59,7 @@ public class SeparatorSkin extends Compo
public void install(Component component) {
super.install(component);
- Separator separator = (Separator)component;
+ Separator separator = (Separator) component;
separator.getSeparatorListeners().add(this);
}
@@ -68,14 +67,13 @@ public class SeparatorSkin extends Compo
public int getPreferredWidth(int height) {
int preferredWidth = 0;
- Separator separator = (Separator)getComponent();
+ Separator separator = (Separator) getComponent();
String heading = separator.getHeading();
- if (heading != null
- && heading.length() > 0) {
+ if (heading != null && heading.length() > 0) {
FontRenderContext fontRenderContext = Platform.getFontRenderContext();
Rectangle2D headingBounds = font.getStringBounds(heading, fontRenderContext);
- preferredWidth = (int)Math.ceil(headingBounds.getWidth())
+ preferredWidth = (int) Math.ceil(headingBounds.getWidth())
+ (padding.left + padding.right);
}
@@ -86,15 +84,15 @@ public class SeparatorSkin extends Compo
public int getPreferredHeight(int width) {
int preferredHeight = thickness;
- Separator separator = (Separator)getComponent();
+ Separator separator = (Separator) getComponent();
String heading = separator.getHeading();
- if (heading != null
- && heading.length() > 0) {
+ if (heading != null && heading.length() > 0) {
FontRenderContext fontRenderContext = Platform.getFontRenderContext();
LineMetrics lm = font.getLineMetrics(heading, fontRenderContext);
- preferredHeight = Math.max((int)Math.ceil(lm.getAscent() + lm.getDescent()
- + lm.getLeading()), preferredHeight);
+ preferredHeight = Math.max(
+ (int) Math.ceil(lm.getAscent() + lm.getDescent() + lm.getLeading()),
+ preferredHeight);
}
preferredHeight += (padding.top + padding.bottom);
@@ -107,17 +105,17 @@ public class SeparatorSkin extends Compo
int preferredWidth = 0;
int preferredHeight = thickness;
- Separator separator = (Separator)getComponent();
+ Separator separator = (Separator) getComponent();
String heading = separator.getHeading();
- if (heading != null
- && heading.length() > 0) {
+ if (heading != null && heading.length() > 0) {
FontRenderContext fontRenderContext = Platform.getFontRenderContext();
Rectangle2D headingBounds = font.getStringBounds(heading, fontRenderContext);
LineMetrics lm = font.getLineMetrics(heading, fontRenderContext);
- preferredWidth = (int)Math.ceil(headingBounds.getWidth());
- preferredHeight = Math.max((int)Math.ceil(lm.getAscent() + lm.getDescent()
- + lm.getLeading()), preferredHeight);
+ preferredWidth = (int) Math.ceil(headingBounds.getWidth());
+ preferredHeight = Math.max(
+ (int) Math.ceil(lm.getAscent() + lm.getDescent() + lm.getLeading()),
+ preferredHeight);
}
preferredHeight += (padding.top + padding.bottom);
@@ -133,14 +131,13 @@ public class SeparatorSkin extends Compo
@Override
public void paint(Graphics2D graphics) {
- Separator separator = (Separator)getComponent();
+ Separator separator = (Separator) getComponent();
int width = getWidth();
int separatorY = padding.top;
String heading = separator.getHeading();
- if (heading != null
- && heading.length() > 0) {
+ if (heading != null && heading.length() > 0) {
FontRenderContext fontRenderContext = Platform.getFontRenderContext();
LineMetrics lm = font.getLineMetrics(heading, fontRenderContext);
@@ -169,8 +166,7 @@ public class SeparatorSkin extends Compo
}
/**
- * @return
- * <tt>false</tt>; spacers are not focusable.
+ * @return <tt>false</tt>; spacers are not focusable.
*/
@Override
public boolean isFocusable() {
@@ -198,6 +194,7 @@ public class SeparatorSkin extends Compo
/**
* Sets the font used in rendering the Separator's heading
+ *
* @param font A {@link ComponentSkin#decodeFont(String) font specification}
*/
public final void setFont(String font) {
@@ -210,6 +207,7 @@ public class SeparatorSkin extends Compo
/**
* Sets the font used in rendering the Separator's heading
+ *
* @param font A dictionary {@link Theme#deriveFont describing a font}
*/
public final void setFont(Dictionary<String, ?> font) {
@@ -241,7 +239,9 @@ public class SeparatorSkin extends Compo
/**
* Sets the color of the Separator's horizontal rule
- * @param color Any of the {@linkplain GraphicsUtilities#decodeColor color values recognized by Pivot}.
+ *
+ * @param color Any of the {@linkplain GraphicsUtilities#decodeColor color
+ * values recognized by Pivot}.
*/
public final void setColor(String color) {
if (color == null) {
@@ -272,7 +272,9 @@ public class SeparatorSkin extends Compo
/**
* Sets the color of the text in the heading
- * @param headingColor Any of the {@linkplain GraphicsUtilities#decodeColor color values recognized by Pivot}.
+ *
+ * @param headingColor Any of the {@linkplain GraphicsUtilities#decodeColor
+ * color values recognized by Pivot}.
*/
public final void setHeadingColor(String headingColor) {
if (headingColor == null) {
@@ -312,16 +314,16 @@ public class SeparatorSkin extends Compo
}
/**
- * Returns the amount of space surrounding (left/right) the Separator's heading,
- * and above and below the entire component.
+ * Returns the amount of space surrounding (left/right) the Separator's
+ * heading, and above and below the entire component.
*/
public Insets getPadding() {
return padding;
}
/**
- * Sets the amount of space to leave around the Separator's heading,
- * and above and below the entire component.
+ * Sets the amount of space to leave around the Separator's heading, and
+ * above and below the entire component.
*/
public void setPadding(Insets padding) {
if (padding == null) {
@@ -333,9 +335,11 @@ public class SeparatorSkin extends Compo
}
/**
- * Sets the amount of space to leave around the Separator's heading,
- * and above and below the entire component.
- * @param padding A dictionary with keys in the set {left, top, bottom, right}.
+ * Sets the amount of space to leave around the Separator's heading, and
+ * above and below the entire component.
+ *
+ * @param padding A dictionary with keys in the set {left, top, bottom,
+ * right}.
*/
public final void setPadding(Dictionary<String, ?> padding) {
if (padding == null) {
@@ -346,16 +350,16 @@ public class SeparatorSkin extends Compo
}
/**
- * Sets the amount of space to leave around the Separator's heading,
- * and above and below the entire component.
+ * Sets the amount of space to leave around the Separator's heading, and
+ * above and below the entire component.
*/
public final void setPadding(int padding) {
setPadding(new Insets(padding));
}
/**
- * Sets the amount of space to leave around the Separator's heading,
- * and above and below the entire component.
+ * Sets the amount of space to leave around the Separator's heading, and
+ * above and below the entire component.
*/
public final void setPadding(Number padding) {
if (padding == null) {
@@ -366,10 +370,11 @@ public class SeparatorSkin extends Compo
}
/**
- * Sets the amount of space to leave around the Separator's heading,
- * and above and below the entire component.
- * @param padding A string containing an integer or a JSON dictionary with keys
- * left, top, bottom, and/or right.
+ * Sets the amount of space to leave around the Separator's heading, and
+ * above and below the entire component.
+ *
+ * @param padding A string containing an integer or a JSON dictionary with
+ * keys left, top, bottom, and/or right.
*/
public final void setPadding(String padding) {
if (padding == null) {
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/SliderSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/SliderSkin.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/SliderSkin.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/SliderSkin.java Fri Oct 4 23:45:40 2013
@@ -24,13 +24,13 @@ import org.apache.pivot.wtk.SliderValueL
/**
* Abstract base class for slider skins.
*/
-public abstract class SliderSkin extends ContainerSkin
- implements SliderListener, SliderValueListener {
+public abstract class SliderSkin extends ContainerSkin implements SliderListener,
+ SliderValueListener {
@Override
public void install(Component component) {
super.install(component);
- Slider slider = (Slider)component;
+ Slider slider = (Slider) component;
slider.getSliderListeners().add(this);
slider.getSliderValueListeners().add(this);
}
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/StackPaneSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/StackPaneSkin.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/StackPaneSkin.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/StackPaneSkin.java Fri Oct 4 23:45:40 2013
@@ -31,11 +31,10 @@ public class StackPaneSkin extends Conta
@Override
public int getPreferredWidth(int height) {
int preferredWidth = 0;
- StackPane stackPane = (StackPane)getComponent();
+ StackPane stackPane = (StackPane) getComponent();
for (Component component : stackPane) {
- preferredWidth = Math.max(preferredWidth,
- component.getPreferredWidth(height));
+ preferredWidth = Math.max(preferredWidth, component.getPreferredWidth(height));
}
preferredWidth += (padding.left + padding.right);
@@ -46,11 +45,10 @@ public class StackPaneSkin extends Conta
@Override
public int getPreferredHeight(int width) {
int preferredHeight = 0;
- StackPane stackPane = (StackPane)getComponent();
+ StackPane stackPane = (StackPane) getComponent();
for (Component component : stackPane) {
- preferredHeight = Math.max(preferredHeight,
- component.getPreferredHeight(width));
+ preferredHeight = Math.max(preferredHeight, component.getPreferredHeight(width));
}
preferredHeight += (padding.top + padding.bottom);
@@ -63,16 +61,14 @@ public class StackPaneSkin extends Conta
int preferredWidth = 0;
int preferredHeight = 0;
- StackPane stackPane = (StackPane)getComponent();
+ StackPane stackPane = (StackPane) getComponent();
for (Component component : stackPane) {
Dimensions preferredCardSize = component.getPreferredSize();
- preferredWidth = Math.max(preferredWidth,
- preferredCardSize.width);
+ preferredWidth = Math.max(preferredWidth, preferredCardSize.width);
- preferredHeight = Math.max(preferredHeight,
- preferredCardSize.height);
+ preferredHeight = Math.max(preferredHeight, preferredCardSize.height);
}
preferredWidth += (padding.left + padding.right);
@@ -90,7 +86,7 @@ public class StackPaneSkin extends Conta
public void layout() {
// Set the size of all components to match the size of the stack pane,
// minus padding
- StackPane stackPane = (StackPane)getComponent();
+ StackPane stackPane = (StackPane) getComponent();
int width = Math.max(getWidth() - (padding.left + padding.right), 0);
int height = Math.max(getHeight() - (padding.top + padding.bottom), 0);
@@ -102,14 +98,16 @@ public class StackPaneSkin extends Conta
}
/**
- * Returns the amount of space between the edge of the StackPane and its components.
+ * Returns the amount of space between the edge of the StackPane and its
+ * components.
*/
public Insets getPadding() {
return padding;
}
/**
- * Sets the amount of space to leave between the edge of the StackPane and its components.
+ * Sets the amount of space to leave between the edge of the StackPane and
+ * its components.
*/
public void setPadding(Insets padding) {
if (padding == null) {
@@ -121,9 +119,11 @@ public class StackPaneSkin extends Conta
}
/**
- * Sets the amount of space to leave between the edge of the StackPane and its components.
- *
- * @param padding A dictionary with keys in the set {left, top, bottom, right}.
+ * Sets the amount of space to leave between the edge of the StackPane and
+ * its components.
+ *
+ * @param padding A dictionary with keys in the set {left, top, bottom,
+ * right}.
*/
public final void setPadding(Dictionary<String, ?> padding) {
if (padding == null) {
@@ -134,16 +134,16 @@ public class StackPaneSkin extends Conta
}
/**
- * Sets the amount of space to leave between the edge of the StackPane and its components,
- * uniformly on all four edges.
+ * Sets the amount of space to leave between the edge of the StackPane and
+ * its components, uniformly on all four edges.
*/
public final void setPadding(int padding) {
setPadding(new Insets(padding));
}
/**
- * Sets the amount of space to leave between the edge of the StackPane and its components,
- * uniformly on all four edges.
+ * Sets the amount of space to leave between the edge of the StackPane and
+ * its components, uniformly on all four edges.
*/
public final void setPadding(Number padding) {
if (padding == null) {
@@ -154,10 +154,11 @@ public class StackPaneSkin extends Conta
}
/**
- * Sets the amount of space to leave between the edge of the StackPane and its components.
- *
- * @param padding A string containing an integer or a JSON dictionary with keys
- * left, top, bottom, and/or right.
+ * Sets the amount of space to leave between the edge of the StackPane and
+ * its components.
+ *
+ * @param padding A string containing an integer or a JSON dictionary with
+ * keys left, top, bottom, and/or right.
*/
public final void setPadding(String padding) {
if (padding == null) {