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 [16/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-terra/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java Fri Oct 4 23:45:40 2013
@@ -110,7 +110,7 @@ public class TerraFrameSkin extends Wind
protected class MinimizeImage extends ButtonImage {
@Override
public void paint(Graphics2D graphics) {
- Frame frame = (Frame)getComponent();
+ Frame frame = (Frame) getComponent();
graphics.setPaint(frame.isActive() ? titleBarColor : inactiveTitleBarColor);
graphics.fillRect(0, 6, 8, 2);
}
@@ -122,11 +122,12 @@ public class TerraFrameSkin extends Wind
protected class MaximizeImage extends ButtonImage {
@Override
public void paint(Graphics2D graphics) {
- Frame frame = (Frame)getComponent();
+ Frame frame = (Frame) getComponent();
graphics.setPaint(frame.isActive() ? titleBarColor : inactiveTitleBarColor);
graphics.fillRect(0, 0, 8, 8);
- graphics.setPaint(frame.isActive() ? titleBarBackgroundColor : inactiveTitleBarBackgroundColor);
+ graphics.setPaint(frame.isActive() ? titleBarBackgroundColor
+ : inactiveTitleBarBackgroundColor);
graphics.fillRect(2, 2, 4, 4);
}
}
@@ -137,13 +138,12 @@ public class TerraFrameSkin extends Wind
protected class RestoreImage extends ButtonImage {
@Override
public void paint(Graphics2D graphics) {
- Frame frame = (Frame)getComponent();
- graphics.setPaint(frame.isActive() ?
- titleBarColor : inactiveTitleBarColor);
+ Frame frame = (Frame) getComponent();
+ graphics.setPaint(frame.isActive() ? titleBarColor : inactiveTitleBarColor);
graphics.fillRect(1, 1, 6, 6);
- graphics.setPaint(frame.isActive() ?
- titleBarBackgroundColor : inactiveTitleBarBackgroundColor);
+ graphics.setPaint(frame.isActive() ? titleBarBackgroundColor
+ : inactiveTitleBarBackgroundColor);
graphics.fillRect(3, 3, 2, 2);
}
}
@@ -154,9 +154,8 @@ public class TerraFrameSkin extends Wind
protected class CloseImage extends ButtonImage {
@Override
public void paint(Graphics2D graphics) {
- Frame frame = (Frame)getComponent();
- graphics.setPaint(frame.isActive() ?
- titleBarColor : inactiveTitleBarColor);
+ Frame frame = (Frame) getComponent();
+ graphics.setPaint(frame.isActive() ? titleBarColor : inactiveTitleBarColor);
graphics.setStroke(new BasicStroke(2));
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
@@ -190,9 +189,8 @@ public class TerraFrameSkin extends Wind
graphics.fillRect(0, 3, 2, 1);
graphics.fillRect(3, 3, 2, 1);
- graphics.setPaint(new Color(contentBorderColor.getRed(),
- contentBorderColor.getGreen(), contentBorderColor.getBlue(),
- ALPHA));
+ graphics.setPaint(new Color(contentBorderColor.getRed(), contentBorderColor.getGreen(),
+ contentBorderColor.getBlue(), ALPHA));
graphics.fillRect(3, 1, 2, 1);
graphics.fillRect(0, 4, 2, 1);
graphics.fillRect(3, 4, 2, 1);
@@ -241,7 +239,7 @@ public class TerraFrameSkin extends Wind
private static final float INACTIVE_ICON_OPACITY = 0.5f;
public TerraFrameSkin() {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setBackgroundColor(theme.getColor(10));
titleBarColor = theme.getColor(4);
@@ -294,7 +292,7 @@ public class TerraFrameSkin extends Wind
public void install(Component component) {
super.install(component);
- Frame frame = (Frame)getComponent();
+ Frame frame = (Frame) getComponent();
// Attach the drop-shadow decorator
dropShadowDecorator = new DropShadowDecorator();
@@ -314,7 +312,7 @@ public class TerraFrameSkin extends Wind
ButtonPressListener buttonPressListener = new ButtonPressListener() {
@Override
public void buttonPressed(Button button) {
- Frame frameLocal = (Frame)getComponent();
+ Frame frameLocal = (Frame) getComponent();
if (button == minimizeButton) {
frameLocal.setVisible(false);
@@ -345,7 +343,7 @@ public class TerraFrameSkin extends Wind
public int getPreferredWidth(int height) {
int preferredWidth = 0;
- Frame frame = (Frame)getComponent();
+ Frame frame = (Frame) getComponent();
// Include title bar width plus left/right title bar borders
Dimensions titleBarSize = titleBarTablePane.getPreferredSize();
@@ -372,7 +370,8 @@ public class TerraFrameSkin extends Wind
Component content = frame.getContent();
if (content != null) {
if (height != -1) {
- // Subtract padding, top/bottom content borders, and content bevel
+ // Subtract padding, top/bottom content borders, and content
+ // bevel
// from height constraint
height -= (padding.top + padding.bottom) + (showContentBevel ? 1 : 0) + 2;
@@ -392,7 +391,7 @@ public class TerraFrameSkin extends Wind
public int getPreferredHeight(int width) {
int preferredHeight = 0;
- Frame frame = (Frame)getComponent();
+ Frame frame = (Frame) getComponent();
// Include title bar height plus top/bottom title bar borders
preferredHeight += titleBarTablePane.getPreferredHeight() + 2;
@@ -406,7 +405,8 @@ public class TerraFrameSkin extends Wind
Component content = frame.getContent();
if (content != null) {
if (width != -1) {
- // Subtract padding and left/right content borders from constraint
+ // Subtract padding and left/right content borders from
+ // constraint
width -= (padding.left + padding.right) + 2;
width = Math.max(width, 0);
@@ -426,7 +426,7 @@ public class TerraFrameSkin extends Wind
int preferredWidth = 0;
int preferredHeight = 0;
- Frame frame = (Frame)getComponent();
+ Frame frame = (Frame) getComponent();
// Include title bar width plus left/right title bar borders
Dimensions titleBarSize = titleBarTablePane.getPreferredSize();
@@ -461,15 +461,14 @@ public class TerraFrameSkin extends Wind
@Override
public void layout() {
- Frame frame = (Frame)getComponent();
+ Frame frame = (Frame) getComponent();
int width = getWidth();
int height = getHeight();
boolean maximized = frame.isMaximized();
- if (!maximized
- || getShowWindowControls()) {
+ if (!maximized || getShowWindowControls()) {
int clientX = 1;
int clientY = 1;
int clientWidth = Math.max(width - 2, 0);
@@ -480,22 +479,20 @@ public class TerraFrameSkin extends Wind
titleBarTablePane.setSize(clientWidth, titleBarTablePane.getPreferredHeight());
titleBarTablePane.setVisible(true);
- // Add bottom title bar border, top content border, and content bevel
+ // Add bottom title bar border, top content border, and content
+ // bevel
clientY += titleBarTablePane.getHeight() + (showContentBevel ? 1 : 0) + 2;
// Size/position resize handle
resizeHandle.setSize(resizeHandle.getPreferredSize());
- resizeHandle.setLocation(clientWidth - resizeHandle.getWidth(),
- clientHeight - resizeHandle.getHeight());
- resizeHandle.setVisible(resizable
- && !maximized
- && (frame.isPreferredWidthSet()
- || frame.isPreferredHeightSet()));
+ resizeHandle.setLocation(clientWidth - resizeHandle.getWidth(), clientHeight
+ - resizeHandle.getHeight());
+ resizeHandle.setVisible(resizable && !maximized
+ && (frame.isPreferredWidthSet() || frame.isPreferredHeightSet()));
// Size/position menu bar
MenuBar menuBar = frame.getMenuBar();
- if (menuBar != null
- && menuBar.isVisible()) {
+ if (menuBar != null && menuBar.isVisible()) {
menuBar.setLocation(clientX, clientY);
menuBar.setSize(clientWidth, menuBar.getPreferredHeight());
@@ -508,7 +505,8 @@ public class TerraFrameSkin extends Wind
int contentX = clientX + padding.left;
int contentY = clientY + padding.top;
int contentWidth = Math.max(clientWidth - (padding.left + padding.right), 0);
- int contentHeight = Math.max(clientHeight - (clientY + padding.top + padding.bottom) + (showContentBevel ? 1 : 0), 0);
+ int contentHeight = Math.max(clientHeight
+ - (clientY + padding.top + padding.bottom) + (showContentBevel ? 1 : 0), 0);
content.setLocation(contentX, contentY);
content.setSize(contentWidth, contentHeight);
@@ -520,8 +518,7 @@ public class TerraFrameSkin extends Wind
// Size/position menu bar
int clientY = 0;
MenuBar menuBar = frame.getMenuBar();
- if (menuBar != null
- && menuBar.isVisible()) {
+ if (menuBar != null && menuBar.isVisible()) {
menuBar.setLocation(0, clientY);
menuBar.setSize(width, menuBar.getPreferredHeight());
@@ -542,27 +539,26 @@ public class TerraFrameSkin extends Wind
// Call the base class to paint the background
super.paint(graphics);
- Frame frame = (Frame)getComponent();
+ Frame frame = (Frame) getComponent();
int width = getWidth();
int height = getHeight();
boolean maximized = frame.isMaximized();
- if (!maximized
- || getShowWindowControls()) {
+ if (!maximized || getShowWindowControls()) {
int titleBarHeight = titleBarTablePane.getHeight();
// Draw the title area
- Color titleBarBackgroundColorLocal = frame.isActive() ?
- this.titleBarBackgroundColor : inactiveTitleBarBackgroundColor;
- Color titleBarBorderColorLocal = frame.isActive() ?
- this.titleBarBorderColor : inactiveTitleBarBorderColor;
- Color titleBarBevelColorLocal = frame.isActive() ?
- this.titleBarBevelColor : inactiveTitleBarBevelColor;
+ Color titleBarBackgroundColorLocal = frame.isActive() ? this.titleBarBackgroundColor
+ : inactiveTitleBarBackgroundColor;
+ Color titleBarBorderColorLocal = frame.isActive() ? this.titleBarBorderColor
+ : inactiveTitleBarBorderColor;
+ Color titleBarBevelColorLocal = frame.isActive() ? this.titleBarBevelColor
+ : inactiveTitleBarBevelColor;
- graphics.setPaint(new GradientPaint(width / 2f, 0, titleBarBevelColorLocal,
- width / 2f, titleBarHeight + 1, titleBarBackgroundColorLocal));
+ graphics.setPaint(new GradientPaint(width / 2f, 0, titleBarBevelColorLocal, width / 2f,
+ titleBarHeight + 1, titleBarBackgroundColorLocal));
graphics.fillRect(0, 0, width, titleBarHeight + 1);
// Draw the border
@@ -570,8 +566,8 @@ public class TerraFrameSkin extends Wind
GraphicsUtilities.drawRect(graphics, 0, 0, width, titleBarHeight + 2);
// Draw the content area
- Bounds contentAreaRectangle = new Bounds(0, titleBarHeight + 2,
- width, height - (titleBarHeight + 2));
+ Bounds contentAreaRectangle = new Bounds(0, titleBarHeight + 2, width, height
+ - (titleBarHeight + 2));
graphics.setPaint(contentBorderColor);
GraphicsUtilities.drawRect(graphics, contentAreaRectangle.x, contentAreaRectangle.y,
contentAreaRectangle.width, contentAreaRectangle.height);
@@ -579,7 +575,8 @@ public class TerraFrameSkin extends Wind
if (showContentBevel) {
graphics.setPaint(contentBevelColor);
GraphicsUtilities.drawLine(graphics, contentAreaRectangle.x + 1,
- contentAreaRectangle.y + 1, contentAreaRectangle.width - 2, Orientation.HORIZONTAL);
+ contentAreaRectangle.y + 1, contentAreaRectangle.width - 2,
+ Orientation.HORIZONTAL);
}
}
}
@@ -590,12 +587,11 @@ public class TerraFrameSkin extends Wind
int height = getHeight();
int titleBarHeight = titleBarTablePane.getHeight();
- Frame frame = (Frame)getComponent();
+ Frame frame = (Frame) getComponent();
boolean maximized = frame.isMaximized();
Bounds clientArea;
- if (maximized
- && !getShowWindowControls()) {
+ if (maximized && !getShowWindowControls()) {
clientArea = new Bounds(0, 0, width, height);
} else {
clientArea = new Bounds(0, titleBarHeight + 2, width, height - (titleBarHeight + 2));
@@ -611,7 +607,7 @@ public class TerraFrameSkin extends Wind
}
public final void setBackgroundColor(int color) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setBackgroundColor(theme.getColor(color));
}
@@ -640,9 +636,7 @@ public class TerraFrameSkin extends Wind
}
public boolean getShowWindowControls() {
- return (getShowMinimizeButton()
- || getShowMaximizeButton()
- || getShowCloseButton());
+ return (getShowMinimizeButton() || getShowMaximizeButton() || getShowCloseButton());
}
public void setShowWindowControls(boolean showWindowControls) {
@@ -715,7 +709,7 @@ public class TerraFrameSkin extends Wind
boolean consumed = super.mouseMove(component, x, y);
if (Mouse.getCapturer() == component) {
- Frame frame = (Frame)getComponent();
+ Frame frame = (Frame) getComponent();
Display display = frame.getDisplay();
Point location = frame.mapPointToAncestor(display, x, y);
@@ -742,7 +736,8 @@ public class TerraFrameSkin extends Wind
if (frame.isPreferredHeightSet()) {
preferredHeight = Math.max(location.y - frame.getY() + resizeOffset.y,
- titleBarTablePane.getHeight() + resizeHandle.getHeight() + (showContentBevel ? 1 : 0) + 6);
+ titleBarTablePane.getHeight() + resizeHandle.getHeight()
+ + (showContentBevel ? 1 : 0) + 6);
preferredHeight = Math.min(preferredHeight, frame.getMaximumHeight());
preferredHeight = Math.max(preferredHeight, frame.getMinimumHeight());
}
@@ -752,14 +747,11 @@ public class TerraFrameSkin extends Wind
}
} else {
Cursor cursor = null;
- if (resizeHandle.isVisible()
- && x > resizeHandle.getX()
- && y > resizeHandle.getY()) {
+ if (resizeHandle.isVisible() && x > resizeHandle.getX() && y > resizeHandle.getY()) {
boolean preferredWidthSet = component.isPreferredWidthSet();
boolean preferredHeightSet = component.isPreferredHeightSet();
- if (preferredWidthSet
- && preferredHeightSet) {
+ if (preferredWidthSet && preferredHeightSet) {
cursor = Cursor.RESIZE_SOUTH_EAST;
} else if (preferredWidthSet) {
cursor = Cursor.RESIZE_EAST;
@@ -778,11 +770,10 @@ public class TerraFrameSkin extends Wind
public boolean mouseDown(Component component, Mouse.Button button, int x, int y) {
boolean consumed = super.mouseDown(component, button, x, y);
- Frame frame = (Frame)getComponent();
+ Frame frame = (Frame) getComponent();
boolean maximized = frame.isMaximized();
- if (button == Mouse.Button.LEFT
- && !maximized) {
+ if (button == Mouse.Button.LEFT && !maximized) {
Bounds titleBarBounds = titleBarTablePane.getBounds();
if (titleBarBounds.contains(x, y)) {
@@ -816,17 +807,15 @@ public class TerraFrameSkin extends Wind
public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation) {
boolean consumed = super.keyPressed(component, keyCode, keyLocation);
- Frame frame = (Frame)component;
+ Frame frame = (Frame) component;
MenuBar menuBar = frame.getMenuBar();
- if (menuBar != null
- && keyCode == Keyboard.KeyCode.SPACE
+ if (menuBar != null && keyCode == Keyboard.KeyCode.SPACE
&& Keyboard.isPressed(Keyboard.Modifier.ALT)) {
MenuBar.Item activeItem = menuBar.getActiveItem();
MenuBar.ItemSequence items = menuBar.getItems();
- if (activeItem == null
- && items.getLength() > 0) {
+ if (activeItem == null && items.getLength() > 0) {
items.get(0).setActive(true);
consumed = true;
@@ -850,7 +839,7 @@ public class TerraFrameSkin extends Wind
iconImageView.setImage(window.getIcons().get(0));
} else {
iconImageView.setVisible(false);
- iconImageView.setImage((Image)null);
+ iconImageView.setImage((Image) null);
}
}
@@ -861,7 +850,7 @@ public class TerraFrameSkin extends Wind
iconImageView.setImage(window.getIcons().get(0));
} else {
iconImageView.setVisible(false);
- iconImageView.setImage((Image)null);
+ iconImageView.setImage((Image) null);
}
}
@@ -869,10 +858,8 @@ public class TerraFrameSkin extends Wind
public void activeChanged(Window window, Window obverseWindow) {
boolean active = window.isActive();
- titleLabel.getStyles().put("color", active ?
- titleBarColor : inactiveTitleBarColor);
- iconImageView.getStyles().put("opacity", active ?
- 1.0f : INACTIVE_ICON_OPACITY);
+ titleLabel.getStyles().put("color", active ? titleBarColor : inactiveTitleBarColor);
+ iconImageView.getStyles().put("opacity", active ? 1.0f : INACTIVE_ICON_OPACITY);
updateButtonStyles(minimizeButton, active);
updateButtonStyles(maximizeButton, active);
@@ -893,11 +880,10 @@ public class TerraFrameSkin extends Wind
}
private void updateButtonStyles(FrameButton frameButton, boolean active) {
- frameButton.getStyles().put("color", active ?
- titleBarColor : inactiveTitleBarColor);
- frameButton.getStyles().put("backgroundColor", active ?
- titleBarBackgroundColor : inactiveTitleBarBackgroundColor);
- frameButton.getStyles().put("borderColor", active ?
- titleBarBorderColor : inactiveTitleBarBorderColor);
+ frameButton.getStyles().put("color", active ? titleBarColor : inactiveTitleBarColor);
+ frameButton.getStyles().put("backgroundColor",
+ active ? titleBarBackgroundColor : inactiveTitleBarBackgroundColor);
+ frameButton.getStyles().put("borderColor",
+ active ? titleBarBorderColor : inactiveTitleBarBorderColor);
}
}
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraGridPaneSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraGridPaneSkin.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraGridPaneSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraGridPaneSkin.java Fri Oct 4 23:45:40 2013
@@ -29,17 +29,17 @@ public class TerraGridPaneSkin extends G
}
public final void setBackgroundColor(int backgroundColor) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setBackgroundColor(theme.getColor(backgroundColor));
}
public final void setHorizontalGridColor(int horizontalGridColor) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setHorizontalGridColor(theme.getColor(horizontalGridColor));
}
public final void setVerticalGridColor(int verticalGridColor) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setVerticalGridColor(theme.getColor(verticalGridColor));
}
}
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraLabelSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraLabelSkin.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraLabelSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraLabelSkin.java Fri Oct 4 23:45:40 2013
@@ -29,17 +29,17 @@ public class TerraLabelSkin extends Labe
}
public final void setColor(int color) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setColor(theme.getColor(color));
}
public final void setDisabledColor(int color) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setDisabledColor(theme.getColor(color));
}
public final void setBackgroundColor(int backgroundColor) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setBackgroundColor(theme.getColor(backgroundColor));
}
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraLinkButtonSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraLinkButtonSkin.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraLinkButtonSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraLinkButtonSkin.java Fri Oct 4 23:45:40 2013
@@ -28,7 +28,6 @@ import org.apache.pivot.wtk.LinkButton;
import org.apache.pivot.wtk.Theme;
import org.apache.pivot.wtk.skin.LinkButtonSkin;
-
/**
* Terra link button skin.
*/
@@ -38,7 +37,7 @@ public class TerraLinkButtonSkin extends
private Color disabledColor;
public TerraLinkButtonSkin() {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
font = theme.getFont();
color = theme.getColor(12);
disabledColor = theme.getColor(7);
@@ -46,7 +45,7 @@ public class TerraLinkButtonSkin extends
@Override
public int getPreferredWidth(int height) {
- LinkButton linkButton = (LinkButton)getComponent();
+ LinkButton linkButton = (LinkButton) getComponent();
Button.DataRenderer dataRenderer = linkButton.getDataRenderer();
dataRenderer.render(linkButton.getButtonData(), linkButton, false);
@@ -56,7 +55,7 @@ public class TerraLinkButtonSkin extends
@Override
public int getPreferredHeight(int width) {
- LinkButton linkButton = (LinkButton)getComponent();
+ LinkButton linkButton = (LinkButton) getComponent();
Button.DataRenderer dataRenderer = linkButton.getDataRenderer();
dataRenderer.render(linkButton.getButtonData(), linkButton, false);
@@ -66,7 +65,7 @@ public class TerraLinkButtonSkin extends
@Override
public Dimensions getPreferredSize() {
- LinkButton linkButton = (LinkButton)getComponent();
+ LinkButton linkButton = (LinkButton) getComponent();
Button.DataRenderer dataRenderer = linkButton.getDataRenderer();
dataRenderer.render(linkButton.getButtonData(), linkButton, false);
@@ -76,7 +75,7 @@ public class TerraLinkButtonSkin extends
@Override
public int getBaseline(int width, int height) {
- LinkButton linkButton = (LinkButton)getComponent();
+ LinkButton linkButton = (LinkButton) getComponent();
Button.DataRenderer dataRenderer = linkButton.getDataRenderer();
dataRenderer.render(linkButton.getButtonData(), linkButton, false);
@@ -86,7 +85,7 @@ public class TerraLinkButtonSkin extends
@Override
public void paint(Graphics2D graphics) {
- LinkButton linkButton = (LinkButton)getComponent();
+ LinkButton linkButton = (LinkButton) getComponent();
int width = getWidth();
int height = getHeight();
@@ -148,7 +147,7 @@ public class TerraLinkButtonSkin extends
}
public final void setColor(int color) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setColor(theme.getColor(color));
}
@@ -174,7 +173,7 @@ public class TerraLinkButtonSkin extends
}
public final void setDisabledColor(int disabledColor) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setDisabledColor(theme.getColor(disabledColor));
}
}
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraListButtonSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraListButtonSkin.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraListButtonSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraListButtonSkin.java Fri Oct 4 23:45:40 2013
@@ -58,7 +58,7 @@ public class TerraListButtonSkin extends
@Override
public void windowOpened(Window window) {
// Adjust for list size
- ListButton listButton = (ListButton)getComponent();
+ ListButton listButton = (ListButton) getComponent();
int listSize = listButton.getListSize();
if (listSize == -1) {
@@ -94,8 +94,7 @@ public class TerraListButtonSkin extends
window.setMaximumHeight(Integer.MAX_VALUE);
int popupHeight = window.getPreferredHeight();
int maximumHeight = displaySize.height - window.getY();
- if (popupHeight > maximumHeight
- && buttonLocation.y > maximumHeight) {
+ if (popupHeight > maximumHeight && buttonLocation.y > maximumHeight) {
window.setMaximumHeight(buttonLocation.y);
window.setY(buttonLocation.y - window.getPreferredHeight() + 1);
} else {
@@ -122,9 +121,8 @@ public class TerraListButtonSkin extends
Vote vote = Vote.APPROVE;
if (closeTransition == null) {
- closeTransition = new FadeWindowTransition(window,
- closeTransitionDuration, closeTransitionRate,
- dropShadowDecorator);
+ closeTransition = new FadeWindowTransition(window, closeTransitionDuration,
+ closeTransitionRate, dropShadowDecorator);
closeTransition.start(new TransitionListener() {
@Override
@@ -143,8 +141,7 @@ public class TerraListButtonSkin extends
@Override
public void windowCloseVetoed(Window window, Vote reason) {
- if (reason == Vote.DENY
- && closeTransition != null) {
+ if (reason == Vote.DENY && closeTransition != null) {
closeTransition.stop();
closeTransition = null;
}
@@ -188,7 +185,7 @@ public class TerraListButtonSkin extends
private static final int DEFAULT_CLOSE_TRANSITION_RATE = 30;
public TerraListButtonSkin() {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
font = theme.getFont();
color = theme.getColor(1);
@@ -226,7 +223,7 @@ public class TerraListButtonSkin extends
@Override
public int getPreferredWidth(int height) {
- ListButton listButton = (ListButton)getComponent();
+ ListButton listButton = (ListButton) getComponent();
Button.DataRenderer dataRenderer = listButton.getDataRenderer();
// Determine the preferred width of the current button data
@@ -248,20 +245,20 @@ public class TerraListButtonSkin extends
@Override
public int getPreferredHeight(int width) {
- ListButton listButton = (ListButton)getComponent();
+ ListButton listButton = (ListButton) getComponent();
Button.DataRenderer dataRenderer = listButton.getDataRenderer();
dataRenderer.render(listButton.getButtonData(), listButton, false);
- int preferredHeight = dataRenderer.getPreferredHeight(-1)
- + padding.top + padding.bottom + 2;
+ int preferredHeight = dataRenderer.getPreferredHeight(-1) + padding.top + padding.bottom
+ + 2;
return preferredHeight;
}
@Override
public Dimensions getPreferredSize() {
- ListButton listButton = (ListButton)getComponent();
+ ListButton listButton = (ListButton) getComponent();
Button.DataRenderer dataRenderer = listButton.getDataRenderer();
// Determine the preferred width and height of the current button data
@@ -285,7 +282,7 @@ public class TerraListButtonSkin extends
@Override
public int getBaseline(int width, int height) {
- ListButton listButton = (ListButton)getComponent();
+ ListButton listButton = (ListButton) getComponent();
Button.DataRenderer dataRenderer = listButton.getDataRenderer();
dataRenderer.render(listButton.getButtonData(), listButton, false);
@@ -309,7 +306,7 @@ public class TerraListButtonSkin extends
@Override
public void paint(Graphics2D graphics) {
- ListButton listButton = (ListButton)getComponent();
+ ListButton listButton = (ListButton) getComponent();
int width = getWidth();
int height = getHeight();
@@ -322,8 +319,8 @@ public class TerraListButtonSkin extends
if (listButton.isEnabled()) {
colorLocal = this.color;
backgroundColorLocal = this.backgroundColor;
- bevelColorLocal = (pressed || (listViewPopup.isOpen() && !listViewPopup.isClosing())) ?
- pressedBevelColor : this.bevelColor;
+ bevelColorLocal = (pressed || (listViewPopup.isOpen() && !listViewPopup.isClosing())) ? pressedBevelColor
+ : this.bevelColor;
borderColorLocal = this.borderColor;
} else {
colorLocal = disabledColor;
@@ -338,23 +335,24 @@ public class TerraListButtonSkin extends
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
- graphics.setPaint(new GradientPaint(width / 2f, 0, bevelColorLocal,
- width / 2f, height / 2f, backgroundColorLocal));
- graphics.fill(new RoundRectangle2D.Double(0.5, 0.5, width - 1, height - 1,
- CORNER_RADIUS, CORNER_RADIUS));
+ graphics.setPaint(new GradientPaint(width / 2f, 0, bevelColorLocal, width / 2f,
+ height / 2f, backgroundColorLocal));
+ graphics.fill(new RoundRectangle2D.Double(0.5, 0.5, width - 1, height - 1, CORNER_RADIUS,
+ CORNER_RADIUS));
// Paint the content
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_OFF);
- Bounds contentBounds = new Bounds(0, 0,
- Math.max(width - TRIGGER_WIDTH - 1, 0), Math.max(height - 1, 0));
+ Bounds contentBounds = new Bounds(0, 0, Math.max(width - TRIGGER_WIDTH - 1, 0), Math.max(
+ height - 1, 0));
Button.DataRenderer dataRenderer = listButton.getDataRenderer();
dataRenderer.render(listButton.getButtonData(), listButton, false);
- dataRenderer.setSize(Math.max(contentBounds.width - (padding.left + padding.right + 2) + 1, 0),
+ dataRenderer.setSize(
+ Math.max(contentBounds.width - (padding.left + padding.right + 2) + 1, 0),
Math.max(contentBounds.height - (padding.top + padding.bottom + 2) + 1, 0));
- Graphics2D contentGraphics = (Graphics2D)graphics.create();
+ Graphics2D contentGraphics = (Graphics2D) graphics.create();
contentGraphics.translate(padding.left + 1, padding.top + 1);
contentGraphics.clipRect(0, 0, dataRenderer.getWidth(), dataRenderer.getHeight());
dataRenderer.paint(contentGraphics);
@@ -366,21 +364,22 @@ public class TerraListButtonSkin extends
// Paint the border
graphics.setPaint(borderColorLocal);
graphics.setStroke(new BasicStroke(1));
- graphics.draw(new RoundRectangle2D.Double(0.5, 0.5, width - 1, height - 1,
- CORNER_RADIUS, CORNER_RADIUS));
- graphics.draw(new Line2D.Double(contentBounds.x + contentBounds.width, 0.5,
- contentBounds.x + contentBounds.width, contentBounds.height));
+ graphics.draw(new RoundRectangle2D.Double(0.5, 0.5, width - 1, height - 1, CORNER_RADIUS,
+ CORNER_RADIUS));
+ graphics.draw(new Line2D.Double(contentBounds.x + contentBounds.width, 0.5, contentBounds.x
+ + contentBounds.width, contentBounds.height));
// Paint the focus state
if (listButton.isFocused()) {
BasicStroke dashStroke = new BasicStroke(1.0f, BasicStroke.CAP_ROUND,
- BasicStroke.JOIN_ROUND, 1.0f, new float[] {0.0f, 2.0f}, 0.0f);
+ BasicStroke.JOIN_ROUND, 1.0f, new float[] { 0.0f, 2.0f }, 0.0f);
graphics.setStroke(dashStroke);
graphics.setColor(borderColorLocal);
- graphics.draw(new RoundRectangle2D.Double(2.5, 2.5, Math.max(contentBounds.width - 4, 0),
- Math.max(contentBounds.height - 4, 0), CORNER_RADIUS / 2, CORNER_RADIUS / 2));
+ graphics.draw(new RoundRectangle2D.Double(2.5, 2.5,
+ Math.max(contentBounds.width - 4, 0), Math.max(contentBounds.height - 4, 0),
+ CORNER_RADIUS / 2, CORNER_RADIUS / 2));
}
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
@@ -393,15 +392,15 @@ public class TerraListButtonSkin extends
triggerIconShape.lineTo(6, 0);
triggerIconShape.closePath();
- Graphics2D triggerGraphics = (Graphics2D)graphics.create();
+ Graphics2D triggerGraphics = (Graphics2D) graphics.create();
triggerGraphics.setStroke(new BasicStroke(0));
triggerGraphics.setPaint(colorLocal);
Bounds triggerBounds = getTriggerBounds();
- int tx = triggerBounds.x + Math.round((triggerBounds.width
- - triggerIconShape.getBounds().width) / 2f) - 1;
- int ty = triggerBounds.y + Math.round((triggerBounds.height
- - triggerIconShape.getBounds().height) / 2f) - 1;
+ int tx = triggerBounds.x
+ + Math.round((triggerBounds.width - triggerIconShape.getBounds().width) / 2f) - 1;
+ int ty = triggerBounds.y
+ + Math.round((triggerBounds.height - triggerIconShape.getBounds().height) / 2f) - 1;
triggerGraphics.translate(tx, ty);
triggerGraphics.draw(triggerIconShape);
@@ -438,8 +437,8 @@ public class TerraListButtonSkin extends
public Bounds getTriggerBounds() {
int width = getWidth();
int height = getHeight();
- return new Bounds(Math.max(width - (TRIGGER_WIDTH + 1), 0), 0,
- TRIGGER_WIDTH + 1, Math.max(height, 0));
+ return new Bounds(Math.max(width - (TRIGGER_WIDTH + 1), 0), 0, TRIGGER_WIDTH + 1, Math.max(
+ height, 0));
}
public Font getFont() {
@@ -493,7 +492,7 @@ public class TerraListButtonSkin extends
}
public final void setColor(int color) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setColor(theme.getColor(color));
}
@@ -519,7 +518,7 @@ public class TerraListButtonSkin extends
}
public final void setDisabledColor(int disabledColor) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setDisabledColor(theme.getColor(disabledColor));
}
@@ -547,7 +546,7 @@ public class TerraListButtonSkin extends
}
public final void setBackgroundColor(int backgroundColor) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setBackgroundColor(theme.getColor(backgroundColor));
}
@@ -574,7 +573,7 @@ public class TerraListButtonSkin extends
}
public final void setDisabledBackgroundColor(int disabledBackgroundColor) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setDisabledBackgroundColor(theme.getColor(disabledBackgroundColor));
}
@@ -601,7 +600,7 @@ public class TerraListButtonSkin extends
}
public final void setBorderColor(int borderColor) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setBorderColor(theme.getColor(borderColor));
}
@@ -627,7 +626,7 @@ public class TerraListButtonSkin extends
}
public final void setDisabledBorderColor(int disabledBorderColor) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setDisabledBorderColor(theme.getColor(disabledBorderColor));
}
@@ -750,7 +749,8 @@ public class TerraListButtonSkin extends
}
public void setListInactiveSelectionBackgroundColor(Object listInactiveSelectionBackgroundColor) {
- listView.getStyles().put("inactiveSelectionBackgroundColor", listInactiveSelectionBackgroundColor);
+ listView.getStyles().put("inactiveSelectionBackgroundColor",
+ listInactiveSelectionBackgroundColor);
}
public Object getListHighlightColor() {
@@ -773,7 +773,7 @@ public class TerraListButtonSkin extends
public boolean mouseMove(Component component, int x, int y) {
boolean consumed = super.mouseMove(component, x, y);
- ListButton listButton = (ListButton)component;
+ ListButton listButton = (ListButton) component;
if (listButton.isRepeatable()) {
repaintComponent();
}
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraListViewSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraListViewSkin.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraListViewSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraListViewSkin.java Fri Oct 4 23:45:40 2013
@@ -50,9 +50,8 @@ import org.apache.pivot.wtk.skin.Compone
/**
* List view skin.
*/
-public class TerraListViewSkin extends ComponentSkin implements ListView.Skin,
- ListViewListener, ListViewItemListener, ListViewItemStateListener,
- ListViewSelectionListener {
+public class TerraListViewSkin extends ComponentSkin implements ListView.Skin, ListViewListener,
+ ListViewItemListener, ListViewItemStateListener, ListViewSelectionListener {
private Font font;
private Color color;
private Color disabledColor;
@@ -83,7 +82,7 @@ public class TerraListViewSkin extends C
}
public TerraListViewSkin() {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
font = theme.getFont();
color = theme.getColor(1);
disabledColor = theme.getColor(7);
@@ -102,7 +101,7 @@ public class TerraListViewSkin extends C
public void install(Component component) {
super.install(component);
- ListView listView = (ListView)component;
+ ListView listView = (ListView) component;
listView.getListViewListeners().add(this);
listView.getListViewItemListeners().add(this);
listView.getListViewItemStateListeners().add(this);
@@ -113,9 +112,9 @@ public class TerraListViewSkin extends C
public int getPreferredWidth(int height) {
int preferredWidth = 0;
- ListView listView = (ListView)getComponent();
+ ListView listView = (ListView) getComponent();
@SuppressWarnings("unchecked")
- List<Object> listData = (List<Object>)listView.getListData();
+ List<Object> listData = (List<Object>) listView.getListData();
ListView.ItemRenderer itemRenderer = listView.getItemRenderer();
@@ -126,8 +125,7 @@ public class TerraListViewSkin extends C
}
if (listView.getCheckmarksEnabled()) {
- preferredWidth += CHECKBOX.getWidth() + (checkboxPadding.left
- + checkboxPadding.right);
+ preferredWidth += CHECKBOX.getWidth() + (checkboxPadding.left + checkboxPadding.right);
}
return preferredWidth;
@@ -137,16 +135,16 @@ public class TerraListViewSkin extends C
public int getPreferredHeight(int width) {
int preferredHeight = 0;
- ListView listView = (ListView)getComponent();
+ ListView listView = (ListView) getComponent();
@SuppressWarnings("unchecked")
- List<Object> listData = (List<Object>)listView.getListData();
+ List<Object> listData = (List<Object>) listView.getListData();
ListView.ItemRenderer itemRenderer = listView.getItemRenderer();
if (variableItemHeight) {
int clientWidth = width;
if (listView.getCheckmarksEnabled()) {
- clientWidth = Math.max(clientWidth - (CHECKBOX.getWidth() + (checkboxPadding.left
- + checkboxPadding.right)), 0);
+ clientWidth = Math.max(clientWidth
+ - (CHECKBOX.getWidth() + (checkboxPadding.left + checkboxPadding.right)), 0);
}
int index = 0;
@@ -159,8 +157,8 @@ public class TerraListViewSkin extends C
int fixedItemHeightLocal = itemRenderer.getPreferredHeight(-1);
if (listView.getCheckmarksEnabled()) {
- fixedItemHeightLocal = Math.max(CHECKBOX.getHeight() + (checkboxPadding.top
- + checkboxPadding.bottom), fixedItemHeightLocal);
+ fixedItemHeightLocal = Math.max(CHECKBOX.getHeight()
+ + (checkboxPadding.top + checkboxPadding.bottom), fixedItemHeightLocal);
}
preferredHeight = listData.getLength() * fixedItemHeightLocal;
@@ -171,25 +169,25 @@ public class TerraListViewSkin extends C
@Override
public int getBaseline(int width, int height) {
- ListView listView = (ListView)getComponent();
+ ListView listView = (ListView) getComponent();
int baseline = -1;
int clientWidth = width;
if (listView.getCheckmarksEnabled()) {
- clientWidth = Math.max(clientWidth - (CHECKBOX.getWidth() + (checkboxPadding.left
- + checkboxPadding.right)), 0);
+ clientWidth = Math.max(clientWidth
+ - (CHECKBOX.getWidth() + (checkboxPadding.left + checkboxPadding.right)), 0);
}
ListView.ItemRenderer itemRenderer = listView.getItemRenderer();
@SuppressWarnings("unchecked")
- List<Object> listData = (List<Object>)listView.getListData();
+ List<Object> listData = (List<Object>) listView.getListData();
if (variableItemHeight && listData.getLength() > 0) {
itemRenderer.render(listData.get(0), 0, listView, false, false, false, false);
int itemHeight = itemRenderer.getPreferredHeight(clientWidth);
if (listView.getCheckmarksEnabled()) {
- itemHeight = Math.max(CHECKBOX.getHeight() + (checkboxPadding.top
- + checkboxPadding.bottom), itemHeight);
+ itemHeight = Math.max(CHECKBOX.getHeight()
+ + (checkboxPadding.top + checkboxPadding.bottom), itemHeight);
}
baseline = itemRenderer.getBaseline(clientWidth, itemHeight);
@@ -198,8 +196,8 @@ public class TerraListViewSkin extends C
int fixedItemHeightLocal = itemRenderer.getPreferredHeight(-1);
if (listView.getCheckmarksEnabled()) {
- fixedItemHeightLocal = Math.max(CHECKBOX.getHeight() + (checkboxPadding.top
- + checkboxPadding.bottom), fixedItemHeightLocal);
+ fixedItemHeightLocal = Math.max(CHECKBOX.getHeight()
+ + (checkboxPadding.top + checkboxPadding.bottom), fixedItemHeightLocal);
}
baseline = itemRenderer.getBaseline(clientWidth, fixedItemHeightLocal);
@@ -210,9 +208,9 @@ public class TerraListViewSkin extends C
@Override
public void layout() {
- ListView listView = (ListView)getComponent();
+ ListView listView = (ListView) getComponent();
@SuppressWarnings("unchecked")
- List<Object> listData = (List<Object>)listView.getListData();
+ List<Object> listData = (List<Object>) listView.getListData();
ListView.ItemRenderer itemRenderer = listView.getItemRenderer();
if (variableItemHeight) {
@@ -220,8 +218,8 @@ public class TerraListViewSkin extends C
int checkboxHeight = 0;
if (listView.getCheckmarksEnabled()) {
- checkboxHeight = CHECKBOX.getHeight() + (checkboxPadding.top
- + checkboxPadding.bottom);
+ checkboxHeight = CHECKBOX.getHeight()
+ + (checkboxPadding.top + checkboxPadding.bottom);
}
int n = listData.getLength();
@@ -256,8 +254,8 @@ public class TerraListViewSkin extends C
fixedItemHeight = itemRenderer.getPreferredHeight(-1);
if (listView.getCheckmarksEnabled()) {
- fixedItemHeight = Math.max(CHECKBOX.getHeight() + (checkboxPadding.top
- + checkboxPadding.bottom), fixedItemHeight);
+ fixedItemHeight = Math.max(CHECKBOX.getHeight()
+ + (checkboxPadding.top + checkboxPadding.bottom), fixedItemHeight);
}
}
@@ -285,9 +283,9 @@ public class TerraListViewSkin extends C
@Override
public void paint(Graphics2D graphics) {
- ListView listView = (ListView)getComponent();
+ ListView listView = (ListView) getComponent();
@SuppressWarnings("unchecked")
- List<Object> listData = (List<Object>)listView.getListData();
+ List<Object> listData = (List<Object>) listView.getListData();
ListView.ItemRenderer itemRenderer = listView.getItemRenderer();
int width = getWidth();
@@ -318,10 +316,11 @@ public class TerraListViewSkin extends C
itemEnd = getItemAt(clipBottom);
}
} else {
- itemStart = Math.max(itemStart, (int)Math.floor(clipBounds.y
- / (double)fixedItemHeight));
- itemEnd = Math.min(itemEnd, (int)Math.ceil((clipBounds.y
- + clipBounds.height) / (double)fixedItemHeight) - 1);
+ itemStart = Math.max(itemStart,
+ (int) Math.floor(clipBounds.y / (double) fixedItemHeight));
+ itemEnd = Math.min(
+ itemEnd,
+ (int) Math.ceil((clipBounds.y + clipBounds.height) / (double) fixedItemHeight) - 1);
}
}
@@ -340,8 +339,7 @@ public class TerraListViewSkin extends C
// Paint the item content
for (int itemIndex = itemStart; itemIndex <= itemEnd; itemIndex++) {
Object item = listData.get(itemIndex);
- boolean highlighted = (itemIndex == highlightIndex
- && listView.getSelectMode() != ListView.SelectMode.NONE);
+ boolean highlighted = (itemIndex == highlightIndex && listView.getSelectMode() != ListView.SelectMode.NONE);
boolean selected = listView.isItemSelected(itemIndex);
boolean disabled = listView.isItemDisabled(itemIndex);
int itemY = getItemY(itemIndex);
@@ -349,8 +347,8 @@ public class TerraListViewSkin extends C
Color itemBackgroundColor = null;
if (selected) {
- itemBackgroundColor = (listView.isFocused())
- ? this.selectionBackgroundColor : inactiveSelectionBackgroundColor;
+ itemBackgroundColor = (listView.isFocused()) ? this.selectionBackgroundColor
+ : inactiveSelectionBackgroundColor;
} else {
if (highlighted && showHighlight && !disabled) {
itemBackgroundColor = highlightBackgroundColor;
@@ -370,7 +368,7 @@ public class TerraListViewSkin extends C
checked = listView.isItemChecked(itemIndex);
int checkboxY = (itemHeight - CHECKBOX.getHeight()) / 2;
- Graphics2D checkboxGraphics = (Graphics2D)graphics.create(checkboxPadding.left,
+ Graphics2D checkboxGraphics = (Graphics2D) graphics.create(checkboxPadding.left,
itemY + checkboxY, CHECKBOX.getWidth(), CHECKBOX.getHeight());
CHECKBOX.setSelected(checked);
@@ -378,15 +376,14 @@ public class TerraListViewSkin extends C
CHECKBOX.paint(checkboxGraphics);
checkboxGraphics.dispose();
- itemX = CHECKBOX.getWidth() + (checkboxPadding.left
- + checkboxPadding.right);
+ itemX = CHECKBOX.getWidth() + (checkboxPadding.left + checkboxPadding.right);
itemWidth -= itemX;
}
// Paint the data
- Graphics2D rendererGraphics = (Graphics2D)graphics.create(itemX, itemY,
- itemWidth, itemHeight);
+ Graphics2D rendererGraphics = (Graphics2D) graphics.create(itemX, itemY, itemWidth,
+ itemHeight);
itemRenderer.render(item, itemIndex, listView, selected, checked, highlighted, disabled);
itemRenderer.setSize(itemWidth, itemHeight);
@@ -404,7 +401,7 @@ public class TerraListViewSkin extends C
throw new IllegalArgumentException("y is negative");
}
- ListView listView = (ListView)getComponent();
+ ListView listView = (ListView) getComponent();
int index;
if (variableItemHeight) {
@@ -420,7 +417,7 @@ public class TerraListViewSkin extends C
index = (y / fixedItemHeight);
@SuppressWarnings("unchecked")
- List<Object> listData = (List<Object>)listView.getListData();
+ List<Object> listData = (List<Object>) listView.getListData();
if (index >= listData.getLength()) {
index = -1;
}
@@ -438,7 +435,7 @@ public class TerraListViewSkin extends C
public int getItemIndent() {
int itemIndent = 0;
- ListView listView = (ListView)getComponent();
+ ListView listView = (ListView) getComponent();
if (listView.getCheckmarksEnabled()) {
itemIndent = CHECKBOX.getWidth() + checkboxPadding.left + checkboxPadding.right;
}
@@ -480,14 +477,13 @@ public class TerraListViewSkin extends C
@Override
public boolean isFocusable() {
- ListView listView = (ListView)getComponent();
+ ListView listView = (ListView) getComponent();
return (listView.getSelectMode() != ListView.SelectMode.NONE);
}
@Override
public boolean isOpaque() {
- return (backgroundColor != null
- && backgroundColor.getTransparency() == Transparency.OPAQUE);
+ return (backgroundColor != null && backgroundColor.getTransparency() == Transparency.OPAQUE);
}
public Font getFont() {
@@ -541,7 +537,7 @@ public class TerraListViewSkin extends C
}
public final void setColor(int color) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setColor(theme.getColor(color));
}
@@ -567,7 +563,7 @@ public class TerraListViewSkin extends C
}
public final void setDisabledColor(int disabledColor) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setDisabledColor(theme.getColor(disabledColor));
}
@@ -589,7 +585,7 @@ public class TerraListViewSkin extends C
}
public final void setBackgroundColor(int backgroundColor) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setBackgroundColor(theme.getColor(backgroundColor));
}
@@ -615,7 +611,7 @@ public class TerraListViewSkin extends C
}
public final void setSelectionColor(int selectionColor) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setSelectionColor(theme.getColor(selectionColor));
}
@@ -641,7 +637,7 @@ public class TerraListViewSkin extends C
}
public final void setSelectionBackgroundColor(int selectionBackgroundColor) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setSelectionBackgroundColor(theme.getColor(selectionBackgroundColor));
}
@@ -667,7 +663,7 @@ public class TerraListViewSkin extends C
}
public final void setInactiveSelectionColor(int inactiveSelectionColor) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setInactiveSelectionColor(theme.getColor(inactiveSelectionColor));
}
@@ -693,7 +689,7 @@ public class TerraListViewSkin extends C
}
public final void setInactiveSelectionBackgroundColor(int inactiveSelectionBackgroundColor) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setInactiveSelectionBackgroundColor(theme.getColor(inactiveSelectionBackgroundColor));
}
@@ -719,7 +715,7 @@ public class TerraListViewSkin extends C
}
public final void setHighlightBackgroundColor(int highlightBackgroundColor) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setHighlightBackgroundColor(theme.getColor(highlightBackgroundColor));
}
@@ -741,7 +737,7 @@ public class TerraListViewSkin extends C
}
public final void setAlternateItemColor(int alternateItemBackgroundColor) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setAlternateItemBackgroundColor(theme.getColor(alternateItemBackgroundColor));
}
@@ -816,14 +812,13 @@ public class TerraListViewSkin extends C
public boolean mouseMove(Component component, int x, int y) {
boolean consumed = super.mouseMove(component, x, y);
- ListView listView = (ListView)getComponent();
+ ListView listView = (ListView) getComponent();
int previousHighlightIndex = this.highlightIndex;
highlightIndex = getItemAt(y);
if (previousHighlightIndex != highlightIndex
- && listView.getSelectMode() != ListView.SelectMode.NONE
- && showHighlight) {
+ && listView.getSelectMode() != ListView.SelectMode.NONE && showHighlight) {
if (previousHighlightIndex != -1) {
repaintComponent(getItemBounds(previousHighlightIndex));
}
@@ -840,10 +835,9 @@ public class TerraListViewSkin extends C
public void mouseOut(Component component) {
super.mouseOut(component);
- ListView listView = (ListView)getComponent();
+ ListView listView = (ListView) getComponent();
- if (highlightIndex != -1
- && listView.getSelectMode() != ListView.SelectMode.NONE
+ if (highlightIndex != -1 && listView.getSelectMode() != ListView.SelectMode.NONE
&& showHighlight) {
Bounds itemBounds = getItemBounds(highlightIndex);
repaintComponent(itemBounds.x, itemBounds.y, itemBounds.width, itemBounds.height);
@@ -857,13 +851,11 @@ public class TerraListViewSkin extends C
public boolean mouseDown(Component component, Mouse.Button button, int x, int y) {
boolean consumed = super.mouseDown(component, button, x, y);
- ListView listView = (ListView)getComponent();
+ ListView listView = (ListView) getComponent();
int itemIndex = getItemAt(y);
- if (itemIndex != -1
- && !listView.isItemDisabled(itemIndex)) {
- if (!listView.getCheckmarksEnabled()
- || listView.isCheckmarkDisabled(itemIndex)
+ if (itemIndex != -1 && !listView.isItemDisabled(itemIndex)) {
+ if (!listView.getCheckmarksEnabled() || listView.isCheckmarkDisabled(itemIndex)
|| !getCheckboxBounds(itemIndex).contains(x, y)) {
ListView.SelectMode selectMode = listView.getSelectMode();
@@ -880,8 +872,8 @@ public class TerraListViewSkin extends C
int startIndex = listView.getFirstSelectedIndex();
int endIndex = listView.getLastSelectedIndex();
- Span selectedRange = (itemIndex > startIndex) ?
- new Span(startIndex, itemIndex) : new Span(itemIndex, endIndex);
+ Span selectedRange = (itemIndex > startIndex) ? new Span(startIndex,
+ itemIndex) : new Span(itemIndex, endIndex);
selectedRanges.add(selectedRange);
listView.setSelectedRanges(selectedRanges);
@@ -924,7 +916,7 @@ public class TerraListViewSkin extends C
public boolean mouseUp(Component component, Mouse.Button button, int x, int y) {
boolean consumed = super.mouseUp(component, button, x, y);
- ListView listView = (ListView)getComponent();
+ ListView listView = (ListView) getComponent();
if (selectIndex != -1
&& listView.getFirstSelectedIndex() != listView.getLastSelectedIndex()) {
listView.setSelectedIndex(selectIndex);
@@ -938,19 +930,15 @@ public class TerraListViewSkin extends C
public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) {
boolean consumed = super.mouseClick(component, button, x, y, count);
- ListView listView = (ListView)getComponent();
+ ListView listView = (ListView) getComponent();
int itemIndex = getItemAt(y);
- if (itemIndex != -1
- && !listView.isItemDisabled(itemIndex)) {
- if (listView.getCheckmarksEnabled()
- && !listView.isCheckmarkDisabled(itemIndex)
+ if (itemIndex != -1 && !listView.isItemDisabled(itemIndex)) {
+ if (listView.getCheckmarksEnabled() && !listView.isCheckmarkDisabled(itemIndex)
&& getCheckboxBounds(itemIndex).contains(x, y)) {
listView.setItemChecked(itemIndex, !listView.isItemChecked(itemIndex));
} else {
- if (selectIndex != -1
- && count == 1
- && button == Mouse.Button.LEFT) {
+ if (selectIndex != -1 && count == 1 && button == Mouse.Button.LEFT) {
ListView.ItemEditor itemEditor = listView.getItemEditor();
if (itemEditor != null) {
@@ -973,26 +961,23 @@ public class TerraListViewSkin extends C
Bounds itemBounds = getItemBounds(itemIndex);
int checkboxHeight = CHECKBOX.getHeight();
- return new Bounds(checkboxPadding.left,
- itemBounds.y + (itemBounds.height - checkboxHeight) / 2,
- CHECKBOX.getWidth(),
- checkboxHeight);
+ return new Bounds(checkboxPadding.left, itemBounds.y + (itemBounds.height - checkboxHeight)
+ / 2, CHECKBOX.getWidth(), checkboxHeight);
}
@Override
public boolean mouseWheel(Component component, Mouse.ScrollType scrollType, int scrollAmount,
int wheelRotation, int x, int y) {
- ListView listView = (ListView)getComponent();
+ ListView listView = (ListView) getComponent();
if (highlightIndex != -1) {
Bounds itemBounds = getItemBounds(highlightIndex);
highlightIndex = -1;
- if (listView.getSelectMode() != ListView.SelectMode.NONE
- && showHighlight) {
- repaintComponent(itemBounds.x, itemBounds.y, itemBounds.width,
- itemBounds.height, true);
+ if (listView.getSelectMode() != ListView.SelectMode.NONE && showHighlight) {
+ repaintComponent(itemBounds.x, itemBounds.y, itemBounds.width, itemBounds.height,
+ true);
}
}
@@ -1001,21 +986,20 @@ public class TerraListViewSkin extends C
/**
* {@link KeyCode#UP UP} Selects the previous enabled list item when select
- * mode is not {@link SelectMode#NONE}<br>
- * {@link KeyCode#DOWN DOWN} Selects the next enabled list item when select
- * mode is not {@link SelectMode#NONE}<p>
- * {@link Modifier#SHIFT SHIFT} + {@link KeyCode#UP UP} Increases the
- * selection size by including the previous enabled list item when select
- * mode is {@link SelectMode#MULTI}<br>
- * {@link Modifier#SHIFT SHIFT} + {@link KeyCode#DOWN DOWN} Increases the
- * selection size by including the next enabled list item when select mode
- * is {@link SelectMode#MULTI}
+ * mode is not {@link SelectMode#NONE}<br> {@link KeyCode#DOWN DOWN} Selects
+ * the next enabled list item when select mode is not
+ * {@link SelectMode#NONE}<p> {@link Modifier#SHIFT SHIFT} +
+ * {@link KeyCode#UP UP} Increases the selection size by including the
+ * previous enabled list item when select mode is {@link SelectMode#MULTI}
+ * <br> {@link Modifier#SHIFT SHIFT} + {@link KeyCode#DOWN DOWN} Increases
+ * the selection size by including the next enabled list item when select
+ * mode is {@link SelectMode#MULTI}
*/
@Override
public boolean keyPressed(Component component, int keyCode, Keyboard.KeyLocation keyLocation) {
boolean consumed = super.keyPressed(component, keyCode, keyLocation);
- ListView listView = (ListView)getComponent();
+ ListView listView = (ListView) getComponent();
ListView.SelectMode selectMode = listView.getSelectMode();
switch (keyCode) {
@@ -1026,8 +1010,7 @@ public class TerraListViewSkin extends C
do {
index--;
- } while (index >= 0
- && listView.isItemDisabled(index));
+ } while (index >= 0 && listView.isItemDisabled(index));
if (index >= 0) {
if (Keyboard.isPressed(Keyboard.Modifier.SHIFT)
@@ -1036,12 +1019,13 @@ public class TerraListViewSkin extends C
} else {
listView.setSelectedIndex(index);
}
- } else if (!Keyboard.isPressed(Keyboard.Modifier.SHIFT) && listView.getSelectMode() == ListView.SelectMode.MULTI && count == listView.getSelectedItems().getLength()) {
+ } else if (!Keyboard.isPressed(Keyboard.Modifier.SHIFT)
+ && listView.getSelectMode() == ListView.SelectMode.MULTI
+ && count == listView.getSelectedItems().getLength()) {
index = listView.getLastSelectedIndex();
do {
index--;
- } while (index >= 0 &&
- listView.isItemDisabled(index));
+ } while (index >= 0 && listView.isItemDisabled(index));
listView.setSelectedIndex(Math.max(0, index));
}
@@ -1059,8 +1043,7 @@ public class TerraListViewSkin extends C
do {
index++;
- } while (index < count
- && listView.isItemDisabled(index));
+ } while (index < count && listView.isItemDisabled(index));
if (index < count) {
if (Keyboard.isPressed(Keyboard.Modifier.SHIFT)
@@ -1069,12 +1052,13 @@ public class TerraListViewSkin extends C
} else {
listView.setSelectedIndex(index);
}
- } else if (!Keyboard.isPressed(Keyboard.Modifier.SHIFT) && listView.getSelectMode() == ListView.SelectMode.MULTI && count == listView.getSelectedItems().getLength()) {
+ } else if (!Keyboard.isPressed(Keyboard.Modifier.SHIFT)
+ && listView.getSelectMode() == ListView.SelectMode.MULTI
+ && count == listView.getSelectedItems().getLength()) {
index = 0;
do {
index++;
- } while (index < count &&
- listView.isItemDisabled(index));
+ } while (index < count && listView.isItemDisabled(index));
listView.setSelectedIndex(Math.min(count - 1, index));
}
@@ -1091,10 +1075,8 @@ public class TerraListViewSkin extends C
}
// Clear the highlight
- if (highlightIndex != -1
- && listView.getSelectMode() != ListView.SelectMode.NONE
- && showHighlight
- && consumed) {
+ if (highlightIndex != -1 && listView.getSelectMode() != ListView.SelectMode.NONE
+ && showHighlight && consumed) {
repaintComponent(getItemBounds(highlightIndex));
}
@@ -1104,14 +1086,14 @@ public class TerraListViewSkin extends C
}
/**
- * {@link KeyCode#SPACE SPACE} Toggles check mark selection when select
- * mode is {@link SelectMode#SINGLE}
+ * {@link KeyCode#SPACE SPACE} Toggles check mark selection when select mode
+ * is {@link SelectMode#SINGLE}
*/
@Override
public boolean keyReleased(Component component, int keyCode, Keyboard.KeyLocation keyLocation) {
boolean consumed = super.keyReleased(component, keyCode, keyLocation);
- ListView listView = (ListView)getComponent();
+ ListView listView = (ListView) getComponent();
switch (keyCode) {
case Keyboard.KeyCode.SPACE: {
@@ -1145,7 +1127,7 @@ public class TerraListViewSkin extends C
public boolean keyTyped(Component component, char character) {
boolean consumed = super.keyTyped(component, character);
- ListView listView = (ListView)getComponent();
+ ListView listView = (ListView) getComponent();
List<?> listData = listView.getListData();
ListView.ItemRenderer itemRenderer = listView.getItemRenderer();
@@ -1155,8 +1137,7 @@ public class TerraListViewSkin extends C
if (!listView.isItemDisabled(i)) {
String string = itemRenderer.toString(listData.get(i));
- if (string != null
- && string.length() > 0) {
+ if (string != null && string.length() > 0) {
char first = Character.toUpperCase(string.charAt(0));
if (first == characterUpper) {
@@ -1168,14 +1149,12 @@ public class TerraListViewSkin extends C
}
}
- if (!consumed
- && wrapSelectNext) {
+ if (!consumed && wrapSelectNext) {
for (int i = 0, n = listData.getLength(); i < n; i++) {
if (!listView.isItemDisabled(i)) {
String string = itemRenderer.toString(listData.get(i));
- if (string != null
- && string.length() > 0) {
+ if (string != null && string.length() > 0) {
char first = Character.toUpperCase(string.charAt(0));
if (first == characterUpper) {
@@ -1337,7 +1316,8 @@ public class TerraListViewSkin extends C
Bounds visibleSelectionBounds = listView.getVisibleArea(selectionBounds);
if (visibleSelectionBounds != null
&& visibleSelectionBounds.height < selectionBounds.height) {
- // Repainting the entire component is a workaround for PIVOT-490
+ // Repainting the entire component is a workaround for
+ // PIVOT-490
repaintComponent();
listView.scrollAreaToVisible(selectionBounds);
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarItemSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarItemSkin.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarItemSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarItemSkin.java Fri Oct 4 23:45:40 2013
@@ -27,7 +27,6 @@ import org.apache.pivot.wtk.Dimensions;
import org.apache.pivot.wtk.MenuBar;
import org.apache.pivot.wtk.skin.MenuBarItemSkin;
-
/**
* Terra menu bar item skin.
*/
@@ -36,13 +35,13 @@ public class TerraMenuBarItemSkin extend
public void install(Component component) {
super.install(component);
- MenuBar.Item menuBarItem = (MenuBar.Item)component;
+ MenuBar.Item menuBarItem = (MenuBar.Item) component;
menuBarItem.setCursor(Cursor.DEFAULT);
}
@Override
public int getPreferredWidth(int height) {
- MenuBar.Item menuBarItem = (MenuBar.Item)getComponent();
+ MenuBar.Item menuBarItem = (MenuBar.Item) getComponent();
Button.DataRenderer dataRenderer = menuBarItem.getDataRenderer();
dataRenderer.render(menuBarItem.getButtonData(), menuBarItem, false);
@@ -52,7 +51,7 @@ public class TerraMenuBarItemSkin extend
@Override
public int getPreferredHeight(int width) {
- MenuBar.Item menuBarItem = (MenuBar.Item)getComponent();
+ MenuBar.Item menuBarItem = (MenuBar.Item) getComponent();
Button.DataRenderer dataRenderer = menuBarItem.getDataRenderer();
dataRenderer.render(menuBarItem.getButtonData(), menuBarItem, false);
@@ -62,7 +61,7 @@ public class TerraMenuBarItemSkin extend
@Override
public Dimensions getPreferredSize() {
- MenuBar.Item menuBarItem = (MenuBar.Item)getComponent();
+ MenuBar.Item menuBarItem = (MenuBar.Item) getComponent();
Button.DataRenderer dataRenderer = menuBarItem.getDataRenderer();
dataRenderer.render(menuBarItem.getButtonData(), menuBarItem, false);
@@ -77,7 +76,7 @@ public class TerraMenuBarItemSkin extend
@Override
public void paint(Graphics2D graphics) {
- MenuBar.Item menuBarItem = (MenuBar.Item)getComponent();
+ MenuBar.Item menuBarItem = (MenuBar.Item) getComponent();
int width = getWidth();
int height = getHeight();
@@ -86,8 +85,8 @@ public class TerraMenuBarItemSkin extend
// Paint highlight state
if (highlight) {
- MenuBar menuBar = (MenuBar)menuBarItem.getParent();
- Color activeBackgroundColor = (Color)menuBar.getStyles().get("activeBackgroundColor");
+ MenuBar menuBar = (MenuBar) menuBarItem.getParent();
+ Color activeBackgroundColor = (Color) menuBar.getStyles().get("activeBackgroundColor");
graphics.setColor(activeBackgroundColor);
graphics.fillRect(0, 0, width, height);
}
@@ -104,11 +103,11 @@ public class TerraMenuBarItemSkin extend
public boolean isOpaque() {
boolean opaque = false;
- MenuBar.Item menuBarItem = (MenuBar.Item)getComponent();
+ MenuBar.Item menuBarItem = (MenuBar.Item) getComponent();
if (menuBarItem.isActive()) {
- MenuBar menuBar = (MenuBar)menuBarItem.getParent();
- Color activeBackgroundColor = (Color)menuBar.getStyles().get("activeBackgroundColor");
+ MenuBar menuBar = (MenuBar) menuBarItem.getParent();
+ Color activeBackgroundColor = (Color) menuBar.getStyles().get("activeBackgroundColor");
opaque = (activeBackgroundColor.getTransparency() == Transparency.OPAQUE);
}
@@ -116,7 +115,7 @@ public class TerraMenuBarItemSkin extend
}
public Color getPopupBorderColor() {
- return (Color)menuPopup.getStyles().get("borderColor");
+ return (Color) menuPopup.getStyles().get("borderColor");
}
public void setPopupBorderColor(Color popupBorderColor) {
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarSkin.java?rev=1529349&r1=1529348&r2=1529349&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarSkin.java Fri Oct 4 23:45:40 2013
@@ -41,7 +41,7 @@ public class TerraMenuBarSkin extends Co
private int spacing;
public TerraMenuBarSkin() {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
font = theme.getFont().deriveFont(Font.BOLD);
color = theme.getColor(1);
@@ -55,7 +55,7 @@ public class TerraMenuBarSkin extends Co
public void install(Component component) {
super.install(component);
- MenuBar menuBar = (MenuBar)component;
+ MenuBar menuBar = (MenuBar) component;
menuBar.getMenuBarListeners().add(this);
}
@@ -63,7 +63,7 @@ public class TerraMenuBarSkin extends Co
public int getPreferredWidth(int height) {
int preferredWidth = 0;
- MenuBar menuBar = (MenuBar)getComponent();
+ MenuBar menuBar = (MenuBar) getComponent();
MenuBar.ItemSequence items = menuBar.getItems();
int j = 0;
@@ -86,7 +86,7 @@ public class TerraMenuBarSkin extends Co
public int getPreferredHeight(int width) {
int preferredHeight = 0;
- MenuBar menuBar = (MenuBar)getComponent();
+ MenuBar menuBar = (MenuBar) getComponent();
MenuBar.ItemSequence items = menuBar.getItems();
for (int i = 0, n = items.getLength(); i < n; i++) {
@@ -104,7 +104,7 @@ public class TerraMenuBarSkin extends Co
int preferredWidth = 0;
int preferredHeight = 0;
- MenuBar menuBar = (MenuBar)getComponent();
+ MenuBar menuBar = (MenuBar) getComponent();
MenuBar.ItemSequence items = menuBar.getItems();
int j = 0;
@@ -125,7 +125,7 @@ public class TerraMenuBarSkin extends Co
@Override
public void layout() {
- MenuBar menuBar = (MenuBar)getComponent();
+ MenuBar menuBar = (MenuBar) getComponent();
int height = getHeight();
int itemX = 0;
@@ -141,7 +141,7 @@ public class TerraMenuBarSkin extends Co
}
public final void setBackgroundColor(int color) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setBackgroundColor(theme.getColor(color));
}
@@ -196,7 +196,7 @@ public class TerraMenuBarSkin extends Co
}
public final void setColor(int color) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setColor(theme.getColor(color));
}
@@ -222,7 +222,7 @@ public class TerraMenuBarSkin extends Co
}
public final void setDisabledColor(int color) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setDisabledColor(theme.getColor(color));
}
@@ -248,7 +248,7 @@ public class TerraMenuBarSkin extends Co
}
public final void setActiveColor(int color) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setActiveColor(theme.getColor(color));
}
@@ -274,7 +274,7 @@ public class TerraMenuBarSkin extends Co
}
public final void setActiveBackgroundColor(int color) {
- TerraTheme theme = (TerraTheme)Theme.getTheme();
+ TerraTheme theme = (TerraTheme) Theme.getTheme();
setActiveBackgroundColor(theme.getColor(color));
}