Author: rwhitcomb Date: Wed Feb 7 23:04:23 2018 New Revision: 1823528 URL: http://svn.apache.org/viewvc?rev=1823528&view=rev Log: PIVOT-1020: A few more Style values. Finish off all the rest of the Style enum changes in "wtk" and "wtk-terra". Tweak a few demos, tests, and tutorials too. Changes include some places where "Integer.valueOf" didn't seem necessary because of autoboxing, and similar tweaks.
Modified: pivot/trunk/core/test/org/apache/pivot/functional/monad/test/OptionTest.java pivot/trunk/demos/src/org/apache/pivot/demos/styles/ColorSchemeBuilderWindow.java pivot/trunk/demos/src/org/apache/pivot/demos/text/TextPaneDemo.java pivot/trunk/tutorials/src/org/apache/pivot/tutorials/explorer/tools/ComponentInspectorSkin.java pivot/trunk/web-server/src/org/apache/pivot/web/server/QueryServlet.java pivot/trunk/web/src/org/apache/pivot/web/PutQuery.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraAlertSkin.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraCalendarButtonSkin.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraCalendarSkin.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraColorChooserButtonSkin.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraColorChooserSkin.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraListButtonSkin.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuBarItemSkin.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuButtonSkin.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuItemSkin.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuPopupSkin.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSuggestionPopupSkin.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraVFSBrowserSheetSkin.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraVFSBrowserSkin.java pivot/trunk/wtk/src/org/apache/pivot/wtk/Button.java pivot/trunk/wtk/src/org/apache/pivot/wtk/Checkbox.java pivot/trunk/wtk/src/org/apache/pivot/wtk/DesktopApplicationContext.java pivot/trunk/wtk/src/org/apache/pivot/wtk/Form.java pivot/trunk/wtk/src/org/apache/pivot/wtk/MenuButton.java pivot/trunk/wtk/src/org/apache/pivot/wtk/RadioButton.java pivot/trunk/wtk/src/org/apache/pivot/wtk/Style.java pivot/trunk/wtk/src/org/apache/pivot/wtk/content/CalendarButtonDataRenderer.java pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ColorItem.java pivot/trunk/wtk/src/org/apache/pivot/wtk/content/LinkButtonDataRenderer.java pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemEditor.java pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemRenderer.java pivot/trunk/wtk/src/org/apache/pivot/wtk/content/MenuItemDataRenderer.java pivot/trunk/wtk/src/org/apache/pivot/wtk/content/SpinnerItemRenderer.java pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCellRenderer.java pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCheckboxCellRenderer.java pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewFileSizeCellRenderer.java pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewImageCellRenderer.java pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewNumberCellRenderer.java pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewTextAreaCellRenderer.java pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeEditor.java pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeRenderer.java pivot/trunk/wtk/src/org/apache/pivot/wtk/effects/WatermarkDecorator.java pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ScrollPaneSkin.java Modified: pivot/trunk/core/test/org/apache/pivot/functional/monad/test/OptionTest.java URL: http://svn.apache.org/viewvc/pivot/trunk/core/test/org/apache/pivot/functional/monad/test/OptionTest.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/core/test/org/apache/pivot/functional/monad/test/OptionTest.java (original) +++ pivot/trunk/core/test/org/apache/pivot/functional/monad/test/OptionTest.java Wed Feb 7 23:04:23 2018 @@ -84,7 +84,7 @@ public class OptionTest { OptionCompanion<Number> o = OptionCompanion.getInstance(); assertNotNull(o); - Option<Number> on = o.fromValue(new Double(3.14149)); + Option<Number> on = o.fromValue(new Double(3.141592653589793)); assertNotNull(on); assertTrue(on instanceof Some); assertTrue(on.hasValue() == true); Modified: pivot/trunk/demos/src/org/apache/pivot/demos/styles/ColorSchemeBuilderWindow.java URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/styles/ColorSchemeBuilderWindow.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/demos/src/org/apache/pivot/demos/styles/ColorSchemeBuilderWindow.java (original) +++ pivot/trunk/demos/src/org/apache/pivot/demos/styles/ColorSchemeBuilderWindow.java Wed Feb 7 23:04:23 2018 @@ -120,9 +120,9 @@ public class ColorSchemeBuilderWindow ex public void selectedColorChanged(ColorChooserButton colorChooserButtonArgument, Color previousSelectedColor) { Color selectedColor = colorChooserButtonArgument.getSelectedColor(); - redSpinner.setSelectedItem(Integer.valueOf(selectedColor.getRed())); - greenSpinner.setSelectedItem(Integer.valueOf(selectedColor.getGreen())); - blueSpinner.setSelectedItem(Integer.valueOf(selectedColor.getBlue())); + redSpinner.setSelectedItem(selectedColor.getRed()); + greenSpinner.setSelectedItem(selectedColor.getGreen()); + blueSpinner.setSelectedItem(selectedColor.getBlue()); // Update the theme Theme themeLocal = Theme.getTheme(); Modified: pivot/trunk/demos/src/org/apache/pivot/demos/text/TextPaneDemo.java URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/text/TextPaneDemo.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/demos/src/org/apache/pivot/demos/text/TextPaneDemo.java (original) +++ pivot/trunk/demos/src/org/apache/pivot/demos/text/TextPaneDemo.java Wed Feb 7 23:04:23 2018 @@ -139,7 +139,7 @@ public class TextPaneDemo implements App }); fontSizeListButton.setListData(new NumericSpinnerData(12, 30, 1)); - fontSizeListButton.setSelectedItem(new Integer(12)); + fontSizeListButton.setSelectedItem(12); openFileButton.getButtonPressListeners().add(new ButtonPressListener() { @Override Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/explorer/tools/ComponentInspectorSkin.java URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/explorer/tools/ComponentInspectorSkin.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/explorer/tools/ComponentInspectorSkin.java (original) +++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/explorer/tools/ComponentInspectorSkin.java Wed Feb 7 23:04:23 2018 @@ -208,7 +208,7 @@ abstract class ComponentInspectorSkin ex private Component addBooleanControl(final Dictionary<String, Object> dictionary, final String key, Form.Section section) { - boolean value = (Boolean) dictionary.get(key); + boolean value = dictionary.getBoolean(key); Checkbox checkbox = new Checkbox(); checkbox.setSelected(value); @@ -241,7 +241,7 @@ abstract class ComponentInspectorSkin ex Checkbox checkbox = (Checkbox) controls.get(key); if (checkbox != null) { - boolean value = (Boolean) dictionary.get(key); + boolean value = dictionary.getBoolean(key); checkbox.setSelected(value); } } Modified: pivot/trunk/web-server/src/org/apache/pivot/web/server/QueryServlet.java URL: http://svn.apache.org/viewvc/pivot/trunk/web-server/src/org/apache/pivot/web/server/QueryServlet.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/web-server/src/org/apache/pivot/web/server/QueryServlet.java (original) +++ pivot/trunk/web-server/src/org/apache/pivot/web/server/QueryServlet.java Wed Feb 7 23:04:23 2018 @@ -340,10 +340,10 @@ public abstract class QueryServlet exten try { URL url = new URL(request.getRequestURL().toString()); hostname.set(url.getHost()); - port.set(new Integer(request.getLocalPort())); + port.set(Integer.valueOf(request.getLocalPort())); contextPath.set(request.getContextPath()); servletPath.set(request.getServletPath()); - secure.set(new Boolean(url.getProtocol().equalsIgnoreCase(HTTPS_PROTOCOL))); + secure.set(Boolean.valueOf(url.getProtocol().equalsIgnoreCase(HTTPS_PROTOCOL))); } catch (MalformedURLException exception) { throw new ServletException(exception); } Modified: pivot/trunk/web/src/org/apache/pivot/web/PutQuery.java URL: http://svn.apache.org/viewvc/pivot/trunk/web/src/org/apache/pivot/web/PutQuery.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/web/src/org/apache/pivot/web/PutQuery.java (original) +++ pivot/trunk/web/src/org/apache/pivot/web/PutQuery.java Wed Feb 7 23:04:23 2018 @@ -72,6 +72,6 @@ public class PutQuery extends Query<Bool public Boolean execute() throws QueryException { execute(METHOD, value); - return new Boolean(getStatus() == Status.CREATED); + return Boolean.valueOf(getStatus() == Status.CREATED); } } Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraAlertSkin.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraAlertSkin.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraAlertSkin.java (original) +++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraAlertSkin.java Wed Feb 7 23:04:23 2018 @@ -35,6 +35,7 @@ import org.apache.pivot.wtk.ImageView; import org.apache.pivot.wtk.Label; import org.apache.pivot.wtk.MessageType; import org.apache.pivot.wtk.PushButton; +import org.apache.pivot.wtk.Style; import org.apache.pivot.wtk.Theme; import org.apache.pivot.wtk.Window; import org.apache.pivot.wtk.util.ColorUtilities; @@ -210,7 +211,7 @@ public class TerraAlertSkin extends Terr this.borderBackgroundColor = borderBackgroundColor; if (messageBorder != null){ - messageBorder.getStyles().put("backgroundColor", borderBackgroundColor); + messageBorder.getStyles().put(Style.backgroundColor, borderBackgroundColor); } } @@ -234,7 +235,7 @@ public class TerraAlertSkin extends Terr this.borderColor = borderColor; if (messageBorder != null){ - messageBorder.getStyles().put("color", borderColor); + messageBorder.getStyles().put(Style.color, borderColor); } } Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraCalendarButtonSkin.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraCalendarButtonSkin.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraCalendarButtonSkin.java (original) +++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraCalendarButtonSkin.java Wed Feb 7 23:04:23 2018 @@ -40,6 +40,7 @@ import org.apache.pivot.wtk.Display; import org.apache.pivot.wtk.GraphicsUtilities; import org.apache.pivot.wtk.Insets; import org.apache.pivot.wtk.Point; +import org.apache.pivot.wtk.Style; import org.apache.pivot.wtk.Theme; import org.apache.pivot.wtk.Window; import org.apache.pivot.wtk.WindowStateListener; @@ -169,8 +170,8 @@ public class TerraCalendarButtonSkin ext // Create the border calendarBorder = new Border(calendar); - calendarBorder.getStyles().put("padding", Integer.valueOf(0)); - calendarBorder.getStyles().put("color", borderColor); + calendarBorder.getStyles().put(Style.padding, Insets.NONE); + calendarBorder.getStyles().put(Style.color, borderColor); // Set the popup content calendarPopup.setContent(calendarBorder); @@ -458,7 +459,7 @@ public class TerraCalendarButtonSkin ext Utils.checkNull(borderColor, "borderColor"); this.borderColor = borderColor; - calendarBorder.getStyles().put("color", borderColor); + calendarBorder.getStyles().put(Style.color, borderColor); repaintComponent(); } Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraCalendarSkin.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraCalendarSkin.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraCalendarSkin.java (original) +++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraCalendarSkin.java Wed Feb 7 23:04:23 2018 @@ -51,6 +51,7 @@ import org.apache.pivot.wtk.Mouse; import org.apache.pivot.wtk.Orientation; import org.apache.pivot.wtk.Spinner; import org.apache.pivot.wtk.SpinnerSelectionListener; +import org.apache.pivot.wtk.Style; import org.apache.pivot.wtk.TablePane; import org.apache.pivot.wtk.Theme; import org.apache.pivot.wtk.content.ButtonDataRenderer; @@ -369,7 +370,7 @@ public class TerraCalendarSkin extends C super.render(Integer.valueOf(date.day + 1), button, highlighted); if (button.isSelected()) { - label.getStyles().put("color", button.getStyles().get("selectionColor")); + label.getStyles().put(Style.color, button.getStyles().get(Style.selectionColor)); } } } @@ -416,7 +417,7 @@ public class TerraCalendarSkin extends C // Create the table pane calendarTablePane = new TablePane(); for (int i = 0; i < 7; i++) { - new TablePane.Column(calendarTablePane, 1, true); // note: this is useful, even if not used directly + new TablePane.Column(calendarTablePane, 1, true); } // Month spinner @@ -424,7 +425,7 @@ public class TerraCalendarSkin extends C monthSpinner.setSpinnerData(new NumericSpinnerData(0, 11)); monthSpinner.setItemRenderer(new MonthSpinnerItemRenderer()); monthSpinner.setCircular(true); - monthSpinner.getStyles().put("sizeToContent", new Boolean(true)); + monthSpinner.getStyles().put(Style.sizeToContent, true); monthSpinner.getSpinnerSelectionListeners().add(new SpinnerSelectionListener() { @Override @@ -461,11 +462,11 @@ public class TerraCalendarSkin extends C // Add the month/year table pane TablePane monthYearTablePane = new TablePane(); - monthYearTablePane.getStyles().put("padding", Integer.valueOf(3)); - monthYearTablePane.getStyles().put("horizontalSpacing", Integer.valueOf(4)); + monthYearTablePane.getStyles().put(Style.padding, 3); + monthYearTablePane.getStyles().put(Style.horizontalSpacing, 4); - new TablePane.Column(monthYearTablePane, 1, true); // note: this is useful, even if not used directly - new TablePane.Column(monthYearTablePane, -1); // note: this is useful, even if not used directly + new TablePane.Column(monthYearTablePane, 1, true); + new TablePane.Column(monthYearTablePane, -1); TablePane.Row monthYearRow = new TablePane.Row(monthYearTablePane, -1); monthYearRow.add(monthSpinner); @@ -484,9 +485,9 @@ public class TerraCalendarSkin extends C for (int i = 0; i < 7; i++) { Label label = new Label(); - label.getStyles().put("font", labelFont); - label.getStyles().put("padding", new Insets(2, 2, 4, 2)); - label.getStyles().put("horizontalAlignment", HorizontalAlignment.CENTER); + label.getStyles().put(Style.font, labelFont); + label.getStyles().put(Style.padding, new Insets(2, 2, 4, 2)); + label.getStyles().put(Style.horizontalAlignment, HorizontalAlignment.CENTER); calendarRow.add(label); } @@ -737,13 +738,13 @@ public class TerraCalendarSkin extends C this.font = font; - monthSpinner.getStyles().put("font", font); - yearSpinner.getStyles().put("font", font); + monthSpinner.getStyles().put(Style.font, font); + yearSpinner.getStyles().put(Style.font, font); TablePane.Row row = calendarTablePane.getRows().get(1); for (int i = 0; i < 7; i++) { Label label = (Label) row.get(i); - label.getStyles().put("font", font); + label.getStyles().put(Style.font, font); } invalidateComponent(); Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraColorChooserButtonSkin.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraColorChooserButtonSkin.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraColorChooserButtonSkin.java (original) +++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraColorChooserButtonSkin.java Wed Feb 7 23:04:23 2018 @@ -39,6 +39,7 @@ import org.apache.pivot.wtk.Display; import org.apache.pivot.wtk.GraphicsUtilities; import org.apache.pivot.wtk.Insets; import org.apache.pivot.wtk.Point; +import org.apache.pivot.wtk.Style; import org.apache.pivot.wtk.Theme; import org.apache.pivot.wtk.Window; import org.apache.pivot.wtk.WindowStateListener; @@ -169,8 +170,8 @@ public class TerraColorChooserButtonSkin // Create the border colorChooserBorder = new Border(colorChooser); - colorChooserBorder.getStyles().put("color", borderColor); - colorChooserBorder.getStyles().put("padding", Integer.valueOf(2)); + colorChooserBorder.getStyles().put(Style.color, borderColor); + colorChooserBorder.getStyles().put(Style.padding, 2); // Set the popup content colorChooserPopup.setContent(colorChooserBorder); @@ -439,7 +440,7 @@ public class TerraColorChooserButtonSkin Utils.checkNull(borderColor, "borderColor"); this.borderColor = borderColor; - colorChooserBorder.getStyles().put("color", borderColor); + colorChooserBorder.getStyles().put(Style.color, borderColor); repaintComponent(); } Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraColorChooserSkin.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraColorChooserSkin.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraColorChooserSkin.java (original) +++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraColorChooserSkin.java Wed Feb 7 23:04:23 2018 @@ -25,6 +25,7 @@ import org.apache.pivot.wtk.ColorChooser import org.apache.pivot.wtk.Component; import org.apache.pivot.wtk.Dimensions; import org.apache.pivot.wtk.Mouse; +import org.apache.pivot.wtk.Style; import org.apache.pivot.wtk.TablePane; import org.apache.pivot.wtk.skin.ColorChooserSkin; import org.apache.pivot.wtk.skin.ComponentSkin; @@ -343,8 +344,8 @@ public class TerraColorChooserSkin exten @SuppressWarnings("unused") public TerraColorChooserSkin() { setSpacing(6); - new TablePane.Column(tablePane, 31, true); // note: this is useful, even if not used directly - new TablePane.Column(tablePane, 4, true); // note: this is useful, even if not used directly + new TablePane.Column(tablePane, 31, true); + new TablePane.Column(tablePane, 4, true); TablePane.Row row = new TablePane.Row(tablePane, 1, true); @@ -387,19 +388,19 @@ public class TerraColorChooserSkin exten } public int getSpacing() { - return tablePane.getStyles().getInt("horizontalSpacing"); + return tablePane.getStyles().getInt(Style.horizontalSpacing); } public void setSpacing(int spacing) { Utils.checkNonNegative(spacing, "spacing"); - tablePane.getStyles().put("horizontalSpacing", spacing); + tablePane.getStyles().put(Style.horizontalSpacing, spacing); } public final void setSpacing(Number spacing) { Utils.checkNull(spacing, "spacing"); - tablePane.getStyles().put("horizontalSpacing", spacing); + tablePane.getStyles().put(Style.horizontalSpacing, spacing); } @Override Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java (original) +++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraExpanderSkin.java Wed Feb 7 23:04:23 2018 @@ -41,6 +41,7 @@ import org.apache.pivot.wtk.Label; import org.apache.pivot.wtk.LinkButton; import org.apache.pivot.wtk.Mouse; import org.apache.pivot.wtk.Orientation; +import org.apache.pivot.wtk.Style; import org.apache.pivot.wtk.TablePane; import org.apache.pivot.wtk.Theme; import org.apache.pivot.wtk.VerticalAlignment; @@ -239,27 +240,27 @@ public class TerraExpanderSkin extends E public TerraExpanderSkin() { // Create the title bar components titleBarTablePane = new TablePane(); - new TablePane.Column(titleBarTablePane, 1, true); // note: this is useful, even if not used directly - new TablePane.Column(titleBarTablePane, -1); // note: this is useful, even if not used directly + new TablePane.Column(titleBarTablePane, 1, true); + new TablePane.Column(titleBarTablePane, -1); - titleBarTablePane.getStyles().put("padding", new Insets(3)); - titleBarTablePane.getStyles().put("horizontalSpacing", Integer.valueOf(3)); + titleBarTablePane.getStyles().put(Style.padding, new Insets(3)); + titleBarTablePane.getStyles().put(Style.horizontalSpacing, 3); TablePane.Row titleRow = new TablePane.Row(titleBarTablePane, -1); titleBoxPane = new BoxPane(Orientation.HORIZONTAL); - titleBoxPane.getStyles().put("horizontalAlignment", HorizontalAlignment.LEFT); + titleBoxPane.getStyles().put(Style.horizontalAlignment, HorizontalAlignment.LEFT); buttonBoxPane = new BoxPane(Orientation.HORIZONTAL); - buttonBoxPane.getStyles().put("horizontalAlignment", HorizontalAlignment.RIGHT); - buttonBoxPane.getStyles().put("verticalAlignment", VerticalAlignment.CENTER); + buttonBoxPane.getStyles().put(Style.horizontalAlignment, HorizontalAlignment.RIGHT); + buttonBoxPane.getStyles().put(Style.verticalAlignment, VerticalAlignment.CENTER); titleRow.add(titleBoxPane); titleRow.add(buttonBoxPane); Theme theme = currentTheme(); Font titleFont = theme.getFont().deriveFont(Font.BOLD); - titleLabel.getStyles().put("font", titleFont); + titleLabel.getStyles().put(Style.font, titleFont); titleBoxPane.add(titleLabel); // Listen for click events on the title bar @@ -463,11 +464,11 @@ public class TerraExpanderSkin extends E } public Font getTitleBarFont() { - return (Font) titleLabel.getStyles().get("font"); + return titleLabel.getStyles().getFont(Style.font); } public void setTitleBarFont(Font titleBarFont) { - titleLabel.getStyles().put("font", titleBarFont); + titleLabel.getStyles().put(Style.font, titleBarFont); } public final void setTitleBarFont(String titleBarFont) { @@ -484,7 +485,7 @@ public class TerraExpanderSkin extends E public void setTitleBarColor(Color titleBarColor) { this.titleBarColor = titleBarColor; - titleLabel.getStyles().put("color", titleBarColor); + titleLabel.getStyles().put(Style.color, titleBarColor); } public final void setTitleBarColor(String titleBarColor) { @@ -659,9 +660,9 @@ public class TerraExpanderSkin extends E @Override public void enabledChanged(Component component) { if (component.isEnabled()) { - titleLabel.getStyles().put("color", titleBarColor); + titleLabel.getStyles().put(Style.color, titleBarColor); } else { - titleLabel.getStyles().put("color", disabledShadeButtonColor); + titleLabel.getStyles().put(Style.color, disabledShadeButtonColor); } } Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.java (original) +++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSheetSkin.java Wed Feb 7 23:04:23 2018 @@ -40,6 +40,7 @@ import org.apache.pivot.wtk.Form; import org.apache.pivot.wtk.Mouse; import org.apache.pivot.wtk.PushButton; import org.apache.pivot.wtk.Sheet; +import org.apache.pivot.wtk.Style; import org.apache.pivot.wtk.TablePane; import org.apache.pivot.wtk.TextInput; import org.apache.pivot.wtk.TextInputContentListener; @@ -63,18 +64,12 @@ public class TerraFileBrowserSheetSkin e } } - @BXML - private TablePane tablePane = null; - @BXML - private BoxPane saveAsBoxPane = null; - @BXML - private TextInput saveAsTextInput = null; - @BXML - private FileBrowser fileBrowser = null; - @BXML - private PushButton okButton = null; - @BXML - private PushButton cancelButton = null; + @BXML private TablePane tablePane = null; + @BXML private BoxPane saveAsBoxPane = null; + @BXML private TextInput saveAsTextInput = null; + @BXML private FileBrowser fileBrowser = null; + @BXML private PushButton okButton = null; + @BXML private PushButton cancelButton = null; private boolean updatingSelection = false; private int selectedDirectoryCount = 0; @@ -232,19 +227,19 @@ public class TerraFileBrowserSheetSkin e } public boolean isHideDisabledFiles() { - return (Boolean) fileBrowser.getStyles().get("hideDisabledFiles"); + return fileBrowser.getStyles().getBoolean(Style.hideDisabledFiles); } public void setHideDisabledFiles(boolean hideDisabledFiles) { - fileBrowser.getStyles().put("hideDisabledFiles", hideDisabledFiles); + fileBrowser.getStyles().put(Style.hideDisabledFiles, hideDisabledFiles); } public boolean isShowHiddenFiles() { - return (Boolean) fileBrowser.getStyles().get("showHiddenFiles"); + return fileBrowser.getStyles().getBoolean(Style.showHiddenFiles); } public void setShowHiddenFiles(boolean showHiddenFiles) { - fileBrowser.getStyles().put("showHiddenFiles", showHiddenFiles); + fileBrowser.getStyles().put(Style.showHiddenFiles, showHiddenFiles); } public boolean getShowOKButtonFirst() { @@ -299,12 +294,10 @@ public class TerraFileBrowserSheetSkin e String fileName = saveAsTextInput.getText(); // Contents of the entry field could be: // 1. Just a new file name in the current root directory - // 2. A relative or absolute path that is an existing - // directory - // to navigate to - // 3. A relative or absolute path including the new file - // name - // in an existing directory + // 2. A relative or absolute path that is an existing directory + // to navigate to + // 3. A relative or absolute path including the new file name + // in an existing directory // So, first make it an absolute path File selectedFile = new File(fileName); if (!selectedFile.isAbsolute() && !fileName.startsWith(File.separator)) { @@ -367,7 +360,7 @@ public class TerraFileBrowserSheetSkin e public void modeChanged(FileBrowserSheet fileBrowserSheet, FileBrowserSheet.Mode previousMode) { FileBrowserSheet.Mode mode = fileBrowserSheet.getMode(); - fileBrowser.getStyles().put("keyboardFolderTraversalEnabled", + fileBrowser.getStyles().put(Style.keyboardFolderTraversalEnabled, (mode != FileBrowserSheet.Mode.SAVE_TO)); switch (mode) { Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java (original) +++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFileBrowserSkin.java Wed Feb 7 23:04:23 2018 @@ -70,6 +70,7 @@ import org.apache.pivot.wtk.PushButton; import org.apache.pivot.wtk.ScrollPane; import org.apache.pivot.wtk.SortDirection; import org.apache.pivot.wtk.Span; +import org.apache.pivot.wtk.Style; import org.apache.pivot.wtk.TableView; import org.apache.pivot.wtk.TableViewSelectionListener; import org.apache.pivot.wtk.TableViewSortListener; @@ -114,13 +115,13 @@ public class TerraFileBrowserSkin extend } public FileRenderer() { - getStyles().put("verticalAlignment", VerticalAlignment.CENTER); + getStyles().put(Style.verticalAlignment, VerticalAlignment.CENTER); add(imageView); add(label); imageView.setPreferredSize(ICON_WIDTH, ICON_HEIGHT); - imageView.getStyles().put("backgroundColor", null); + imageView.getStyles().put(Style.backgroundColor, null); } @Override @@ -154,7 +155,7 @@ public class TerraFileBrowserSkin extend */ public static class ListButtonFileRenderer extends FileRenderer implements Button.DataRenderer { public ListButtonFileRenderer() { - getStyles().put("horizontalAlignment", HorizontalAlignment.LEFT); + getStyles().put(Style.horizontalAlignment, HorizontalAlignment.LEFT); } @Override @@ -165,7 +166,7 @@ public class TerraFileBrowserSkin extend // Update the image view imageView.setImage(getIcon(file)); - imageView.getStyles().put("opacity", button.isEnabled() && !hidden ? 1.0f : 0.5f); + imageView.getStyles().put(Style.opacity, button.isEnabled() && !hidden ? 1.0f : 0.5f); // Update the label String text = file.getName(); @@ -177,12 +178,12 @@ public class TerraFileBrowserSkin extend Object color = null; if (button.isEnabled() && !hidden) { - color = button.getStyles().get("color"); + color = button.getStyles().get(Style.color); } else { - color = button.getStyles().get("disabledColor"); + color = button.getStyles().get(Style.disabledColor); } - label.getStyles().put("color", color); + label.getStyles().put(Style.color, color); } } @@ -203,8 +204,8 @@ public class TerraFileBrowserSkin extend */ public static class ListViewFileRenderer extends FileRenderer implements ListView.ItemRenderer { public ListViewFileRenderer() { - getStyles().put("horizontalAlignment", HorizontalAlignment.LEFT); - getStyles().put("padding", new Insets(2, 3, 2, 3)); + getStyles().put(Style.horizontalAlignment, HorizontalAlignment.LEFT); + getStyles().put(Style.padding, new Insets(2, 3, 2, 3)); } @Override @@ -212,7 +213,7 @@ public class TerraFileBrowserSkin extend Button.State state, boolean highlighted, boolean disabled) { boolean hidden = false; - label.getStyles().put("font", listView.getStyles().get("font")); + label.getStyles().copy(Style.font, listView.getStyles()); if (item != null) { File file = (File) item; @@ -220,7 +221,7 @@ public class TerraFileBrowserSkin extend // Update the image view imageView.setImage(getIcon(file)); - imageView.getStyles().put("opacity", + imageView.getStyles().put(Style.opacity, (listView.isEnabled() && !disabled && !hidden) ? 1.0f : 0.5f); // Update the label @@ -236,18 +237,18 @@ public class TerraFileBrowserSkin extend if (listView.isEnabled() && !disabled && !hidden) { if (selected) { if (listView.isFocused()) { - color = listView.getStyles().get("selectionColor"); + color = listView.getStyles().get(Style.selectionColor); } else { - color = listView.getStyles().get("inactiveSelectionColor"); + color = listView.getStyles().get(Style.inactiveSelectionColor); } } else { - color = listView.getStyles().get("color"); + color = listView.getStyles().get(Style.color); } } else { - color = listView.getStyles().get("disabledColor"); + color = listView.getStyles().get(Style.disabledColor); } - label.getStyles().put("color", color); + label.getStyles().put(Style.color, color); } @Override @@ -272,8 +273,8 @@ public class TerraFileBrowserSkin extend public static final String LAST_MODIFIED_KEY = "lastModified"; public TableViewFileRenderer() { - getStyles().put("horizontalAlignment", HorizontalAlignment.CENTER); - getStyles().put("padding", new Insets(2)); + getStyles().put(Style.horizontalAlignment, HorizontalAlignment.CENTER); + getStyles().put(Style.padding, new Insets(2)); } @Override @@ -291,16 +292,16 @@ public class TerraFileBrowserSkin extend if (columnName.equals(NAME_KEY)) { text = file.getName(); icon = getIcon(file); - getStyles().put("horizontalAlignment", HorizontalAlignment.LEFT); + getStyles().put(Style.horizontalAlignment, HorizontalAlignment.LEFT); } else if (columnName.equals(SIZE_KEY)) { long length = file.length(); text = FileSizeFormat.getInstance().format(length); - getStyles().put("horizontalAlignment", HorizontalAlignment.RIGHT); + getStyles().put(Style.horizontalAlignment, HorizontalAlignment.RIGHT); } else if (columnName.equals(LAST_MODIFIED_KEY)) { long lastModified = file.lastModified(); Date lastModifiedDate = new Date(lastModified); text = DATE_FORMAT.format(lastModifiedDate); - getStyles().put("horizontalAlignment", HorizontalAlignment.RIGHT); + getStyles().put(Style.horizontalAlignment, HorizontalAlignment.RIGHT); } else { System.err.println("Unexpected column name in " + getClass().getName() + ": " + columnName); @@ -309,29 +310,28 @@ public class TerraFileBrowserSkin extend label.setText(text); imageView.setImage(icon); - imageView.getStyles().put("opacity", + imageView.getStyles().put(Style.opacity, (tableView.isEnabled() && !disabled && !hidden) ? 1.0f : 0.5f); } - Font font = (Font) tableView.getStyles().get("font"); - label.getStyles().put("font", font); + label.getStyles().copy(Style.font, tableView.getStyles()); Color color; if (tableView.isEnabled() && !disabled && !hidden) { if (selected) { if (tableView.isFocused()) { - color = (Color) tableView.getStyles().get("selectionColor"); + color = tableView.getStyles().getColor(Style.selectionColor); } else { - color = (Color) tableView.getStyles().get("inactiveSelectionColor"); + color = tableView.getStyles().getColor(Style.inactiveSelectionColor); } } else { - color = (Color) tableView.getStyles().get("color"); + color = tableView.getStyles().getColor(Style.color); } } else { - color = (Color) tableView.getStyles().get("disabledColor"); + color = tableView.getStyles().getColor(Style.disabledColor); } - label.getStyles().put("color", color); + label.getStyles().put(Style.color, color); } @Override @@ -379,13 +379,13 @@ public class TerraFileBrowserSkin extend } public DriveRenderer() { - getStyles().put("verticalAlignment", VerticalAlignment.CENTER); + getStyles().put(Style.verticalAlignment, VerticalAlignment.CENTER); add(imageView); add(label); imageView.setPreferredSize(ICON_WIDTH, ICON_HEIGHT); - imageView.getStyles().put("backgroundColor", null); + imageView.getStyles().put(Style.backgroundColor, null); } @Override @@ -404,7 +404,7 @@ public class TerraFileBrowserSkin extend public static class ListButtonDriveRenderer extends DriveRenderer implements Button.DataRenderer { public ListButtonDriveRenderer() { - getStyles().put("horizontalAlignment", HorizontalAlignment.LEFT); + getStyles().put(Style.horizontalAlignment, HorizontalAlignment.LEFT); } @Override @@ -414,7 +414,7 @@ public class TerraFileBrowserSkin extend // Update the image view imageView.setImage(DRIVE_IMAGE); - imageView.getStyles().put("opacity", button.isEnabled() ? 1.0f : 0.5f); + imageView.getStyles().put(Style.opacity, button.isEnabled() ? 1.0f : 0.5f); // Update the label label.setText(file.toString()); @@ -433,38 +433,38 @@ public class TerraFileBrowserSkin extend public static class ListViewDriveRenderer extends DriveRenderer implements ListView.ItemRenderer { public ListViewDriveRenderer() { - getStyles().put("horizontalAlignment", HorizontalAlignment.LEFT); - getStyles().put("padding", new Insets(2, 3, 2, 3)); + getStyles().put(Style.horizontalAlignment, HorizontalAlignment.LEFT); + getStyles().put(Style.padding, new Insets(2, 3, 2, 3)); } @Override public void render(Object item, int index, ListView listView, boolean selected, Button.State state, boolean highlighted, boolean disabled) { - label.getStyles().put("font", listView.getStyles().get("font")); + label.getStyles().copy(Style.font, listView.getStyles()); Object color = null; if (listView.isEnabled() && !disabled) { if (selected) { if (listView.isFocused()) { - color = listView.getStyles().get("selectionColor"); + color = listView.getStyles().get(Style.selectionColor); } else { - color = listView.getStyles().get("inactiveSelectionColor"); + color = listView.getStyles().get(Style.inactiveSelectionColor); } } else { - color = listView.getStyles().get("color"); + color = listView.getStyles().get(Style.color); } } else { - color = listView.getStyles().get("disabledColor"); + color = listView.getStyles().get(Style.disabledColor); } - label.getStyles().put("color", color); + label.getStyles().put(Style.color, color); if (item != null) { File file = (File) item; // Update the image view imageView.setImage(DRIVE_IMAGE); - imageView.getStyles().put("opacity", + imageView.getStyles().put(Style.opacity, (listView.isEnabled() && !disabled) ? 1.0f : 0.5f); // Update the label @@ -976,8 +976,8 @@ public class TerraFileBrowserSkin extend TextArea toolTipTextArea = new TextArea(); toolTipTextArea.setText(text); - toolTipTextArea.getStyles().put("wrapText", true); - toolTipTextArea.getStyles().put("backgroundColor", null); + toolTipTextArea.getStyles().put(Style.wrapText, true); + toolTipTextArea.getStyles().put(Style.backgroundColor, null); tooltip.setContent(toolTipTextArea); Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java (original) +++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFormSkin.java Wed Feb 7 23:04:23 2018 @@ -43,6 +43,7 @@ import org.apache.pivot.wtk.Label; import org.apache.pivot.wtk.MessageType; import org.apache.pivot.wtk.Point; import org.apache.pivot.wtk.Separator; +import org.apache.pivot.wtk.Style; import org.apache.pivot.wtk.Theme; import org.apache.pivot.wtk.Window; import org.apache.pivot.wtk.WindowStateListener; @@ -74,11 +75,10 @@ public class TerraFormSkin extends Conta arrow.lineTo(POPUP_FIELD_INDICATOR_OFFSET + POPUP_FIELD_INDICATOR_WIDTH, 0); arrow.closePath(); - graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, - RenderingHints.VALUE_ANTIALIAS_ON); + GraphicsUtilities.setAntialiasingOn(graphics); graphics.setStroke(new BasicStroke(0)); - graphics.setColor((Color) flagMessageWindow.getStyles().get("backgroundColor")); + graphics.setColor(flagMessageWindow.getStyles().getColor(Style.backgroundColor)); graphics.draw(arrow); graphics.fill(arrow); @@ -162,8 +162,8 @@ public class TerraFormSkin extends Conta flagMessageLabel.setText(message); flagMessageLabel.setSize(flagMessageLabel.getPreferredSize()); flagMessageLabel.validate(); - flagMessageLabel.getStyles().put("color", messageColor); - flagMessageLabel.getStyles().put("backgroundColor", + flagMessageLabel.getStyles().put(Style.color, messageColor); + flagMessageLabel.getStyles().put(Style.backgroundColor, messageBackgroundColor); int flagMessageX = field.getX() + field.getWidth() @@ -293,8 +293,8 @@ public class TerraFormSkin extends Conta } } - flagMessageLabel.getStyles().put("color", color); - flagMessageWindow.getStyles().put("backgroundColor", backgroundColor); + flagMessageLabel.getStyles().put(Style.color, color); + flagMessageWindow.getStyles().put(Style.backgroundColor, backgroundColor); // Open the window Point location = component.mapPointToAncestor(component.getDisplay(), 0, @@ -374,7 +374,7 @@ public class TerraFormSkin extends Conta maximumFlagImageWidth = Math.max(maximumFlagImageWidth, infoIcon.getWidth()); // Create the flag message popup - flagMessageLabel.getStyles().put("padding", new Insets(3, 4, 3, 4)); + flagMessageLabel.getStyles().put(Style.padding, new Insets(3, 4, 3, 4)); if (!themeIsFlat()) { flagMessageWindow.getDecorators().add(new DropShadowDecorator()); @@ -1065,7 +1065,7 @@ public class TerraFormSkin extends Conta this.separatorColor = separatorColor; for (Separator separator : separators) { - separator.getStyles().put("color", separatorColor); + separator.getStyles().put(Style.color, separatorColor); } } @@ -1081,7 +1081,7 @@ public class TerraFormSkin extends Conta this.separatorHeadingColor = separatorHeadingColor; for (Separator separator : separators) { - separator.getStyles().put("headingColor", separatorHeadingColor); + separator.getStyles().put(Style.headingColor, separatorHeadingColor); } } @@ -1142,8 +1142,8 @@ public class TerraFormSkin extends Conta // Insert separator Separator separator = new Separator(section.getHeading()); - separator.getStyles().put("color", separatorColor); - separator.getStyles().put("headingColor", separatorHeadingColor); + separator.getStyles().put(Style.color, separatorColor); + separator.getStyles().put(Style.headingColor, separatorHeadingColor); separators.insert(separator, index); form.add(separator); 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=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java (original) +++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraFrameSkin.java Wed Feb 7 23:04:23 2018 @@ -48,6 +48,7 @@ import org.apache.pivot.wtk.Mouse; import org.apache.pivot.wtk.Orientation; import org.apache.pivot.wtk.Point; import org.apache.pivot.wtk.PushButton; +import org.apache.pivot.wtk.Style; import org.apache.pivot.wtk.TablePane; import org.apache.pivot.wtk.Theme; import org.apache.pivot.wtk.VerticalAlignment; @@ -262,32 +263,32 @@ public class TerraFrameSkin extends Wind // The title bar table pane contains two nested box panes: one for // the title contents and the other for the buttons - new TablePane.Column(titleBarTablePane, 1, true); // note: this is useful, even if not used directly - new TablePane.Column(titleBarTablePane, -1); // note: this is useful, even if not used directly + new TablePane.Column(titleBarTablePane, 1, true); + new TablePane.Column(titleBarTablePane, -1); TablePane.Row titleRow = new TablePane.Row(titleBarTablePane, -1); titleRow.add(titleBoxPane); titleRow.add(buttonBoxPane); - titleBarTablePane.getStyles().put("padding", new Insets(2)); + titleBarTablePane.getStyles().put(Style.padding, new Insets(2)); // Initialize the title box pane titleBoxPane.add(iconImageView); titleBoxPane.add(titleLabel); - titleBoxPane.getStyles().put("verticalAlignment", VerticalAlignment.CENTER); - titleBoxPane.getStyles().put("padding", new Insets(0, 0, 0, 2)); + titleBoxPane.getStyles().put(Style.verticalAlignment, VerticalAlignment.CENTER); + titleBoxPane.getStyles().put(Style.padding, new Insets(0, 0, 0, 2)); Font titleFont = theme.getFont().deriveFont(Font.BOLD); - titleLabel.getStyles().put("font", titleFont); + titleLabel.getStyles().put(Style.font, titleFont); iconImageView.setPreferredSize(16, 16); - iconImageView.getStyles().put("fill", new Boolean(true)); - iconImageView.getStyles().put("backgroundColor", null); + iconImageView.getStyles().put(Style.fill, true); + iconImageView.getStyles().put(Style.backgroundColor, null); // Initialize the button box pane - buttonBoxPane.getStyles().put("horizontalAlignment", HorizontalAlignment.RIGHT); - buttonBoxPane.getStyles().put("verticalAlignment", VerticalAlignment.CENTER); + buttonBoxPane.getStyles().put(Style.horizontalAlignment, HorizontalAlignment.RIGHT); + buttonBoxPane.getStyles().put(Style.verticalAlignment, VerticalAlignment.CENTER); } @Override @@ -849,8 +850,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 ? new Float(1.0f) : new Float(INACTIVE_ICON_OPACITY)); + titleLabel.getStyles().put(Style.color, active ? titleBarColor : inactiveTitleBarColor); + iconImageView.getStyles().put(Style.opacity, active ? new Float(1.0f) : new Float(INACTIVE_ICON_OPACITY)); updateButtonStyles(minimizeButton, active); updateButtonStyles(maximizeButton, active); @@ -871,10 +872,10 @@ public class TerraFrameSkin extends Wind } private void updateButtonStyles(FrameButton frameButton, boolean active) { - frameButton.getStyles().put("color", active ? titleBarColor : inactiveTitleBarColor); - frameButton.getStyles().put("backgroundColor", + frameButton.getStyles().put(Style.color, active ? titleBarColor : inactiveTitleBarColor); + frameButton.getStyles().put(Style.backgroundColor, active ? titleBarBackgroundColor : inactiveTitleBarBackgroundColor); - frameButton.getStyles().put("borderColor", + frameButton.getStyles().put(Style.borderColor, active ? titleBarBorderColor : inactiveTitleBarBorderColor); } } 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=1823528&r1=1823527&r2=1823528&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 Wed Feb 7 23:04:23 2018 @@ -45,6 +45,7 @@ import org.apache.pivot.wtk.ListButton; import org.apache.pivot.wtk.ListView; import org.apache.pivot.wtk.Panorama; import org.apache.pivot.wtk.Point; +import org.apache.pivot.wtk.Style; import org.apache.pivot.wtk.Theme; import org.apache.pivot.wtk.Window; import org.apache.pivot.wtk.WindowStateListener; @@ -205,13 +206,13 @@ public class TerraListButtonSkin extends // Create the panorama and border listViewPanorama = new Panorama(listView); - listViewPanorama.getStyles().put("buttonBackgroundColor", - listView.getStyles().get("backgroundColor")); - listViewPanorama.getStyles().put("alwaysShowScrollButtons", new Boolean(true)); + listViewPanorama.getStyles().put(Style.buttonBackgroundColor, + listView.getStyles().get(Style.backgroundColor)); + listViewPanorama.getStyles().put(Style.alwaysShowScrollButtons, true); listViewBorder = new Border(listViewPanorama); - listViewBorder.getStyles().put("padding", Integer.valueOf(0)); - listViewBorder.getStyles().put("color", borderColor); + listViewBorder.getStyles().put(Style.padding, 0); + listViewBorder.getStyles().put(Style.color, borderColor); // Set the popup content listViewPopup.setContent(listViewBorder); @@ -553,7 +554,7 @@ public class TerraListButtonSkin extends Utils.checkNull(borderColor, "borderColor"); this.borderColor = borderColor; - listViewBorder.getStyles().put("color", borderColor); + listViewBorder.getStyles().put(Style.color, borderColor); repaintComponent(); } @@ -635,85 +636,85 @@ public class TerraListButtonSkin extends } public Object getListFont() { - return listView.getStyles().get("font"); + return listView.getStyles().get(Style.font); } public void setListFont(Object listFont) { - listView.getStyles().put("font", listFont); + listView.getStyles().put(Style.font, listFont); } public Object getListColor() { - return listView.getStyles().get("color"); + return listView.getStyles().get(Style.color); } public void setListColor(Object listColor) { - listView.getStyles().put("color", listColor); + listView.getStyles().put(Style.color, listColor); } public Object getListDisabledColor() { - return listView.getStyles().get("disabledColor"); + return listView.getStyles().get(Style.disabledColor); } public void setListDisabledColor(Object listDisabledColor) { - listView.getStyles().put("disabledColor", listDisabledColor); + listView.getStyles().put(Style.disabledColor, listDisabledColor); } public Object getListBackgroundColor() { - return listView.getStyles().get("backgroundColor"); + return listView.getStyles().get(Style.backgroundColor); } public void setListBackgroundColor(Object listBackgroundColor) { - listView.getStyles().put("backgroundColor", listBackgroundColor); - listViewPanorama.getStyles().put("buttonBackgroundColor", listBackgroundColor); + listView.getStyles().put(Style.backgroundColor, listBackgroundColor); + listViewPanorama.getStyles().put(Style.buttonBackgroundColor, listBackgroundColor); } public Object getListSelectionColor() { - return listView.getStyles().get("selectionColor"); + return listView.getStyles().get(Style.selectionColor); } public void setListSelectionColor(Object listSelectionColor) { - listView.getStyles().put("selectionColor", listSelectionColor); + listView.getStyles().put(Style.selectionColor, listSelectionColor); } public Object getListSelectionBackgroundColor() { - return listView.getStyles().get("selectionBackgroundColor"); + return listView.getStyles().get(Style.selectionBackgroundColor); } public void setListSelectionBackgroundColor(Object listSelectionBackgroundColor) { - listView.getStyles().put("selectionBackgroundColor", listSelectionBackgroundColor); + listView.getStyles().put(Style.selectionBackgroundColor, listSelectionBackgroundColor); } public Object getListInactiveSelectionColor() { - return listView.getStyles().get("inactiveSelectionColor"); + return listView.getStyles().get(Style.inactiveSelectionColor); } public void setListInactiveSelectionColor(Object listInactiveSelectionColor) { - listView.getStyles().put("inactiveSelectionColor", listInactiveSelectionColor); + listView.getStyles().put(Style.inactiveSelectionColor, listInactiveSelectionColor); } public Object getListInactiveSelectionBackgroundColor() { - return listView.getStyles().get("inactiveSelectionBackgroundColor"); + return listView.getStyles().get(Style.inactiveSelectionBackgroundColor); } public void setListInactiveSelectionBackgroundColor(Object listInactiveSelectionBackgroundColor) { - listView.getStyles().put("inactiveSelectionBackgroundColor", + listView.getStyles().put(Style.inactiveSelectionBackgroundColor, listInactiveSelectionBackgroundColor); } public Object getListHighlightColor() { - return listView.getStyles().get("highlightColor"); + return listView.getStyles().get(Style.highlightColor); } public void setListHighlightColor(Object listHighlightColor) { - listView.getStyles().put("highlightColor", listHighlightColor); + listView.getStyles().put(Style.highlightColor, listHighlightColor); } public Object getListHighlightBackgroundColor() { - return listView.getStyles().get("highlightBackgroundColor"); + return listView.getStyles().get(Style.highlightBackgroundColor); } public void setListHighlightBackgroundColor(Object listHighlightBackgroundColor) { - listView.getStyles().put("highlightBackgroundColor", listHighlightBackgroundColor); + listView.getStyles().put(Style.highlightBackgroundColor, listHighlightBackgroundColor); } @Override 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=1823528&r1=1823527&r2=1823528&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 Wed Feb 7 23:04:23 2018 @@ -25,6 +25,7 @@ import org.apache.pivot.wtk.Component; import org.apache.pivot.wtk.Cursor; import org.apache.pivot.wtk.Dimensions; import org.apache.pivot.wtk.MenuBar; +import org.apache.pivot.wtk.Style; import org.apache.pivot.wtk.skin.MenuBarItemSkin; /** @@ -86,7 +87,7 @@ public class TerraMenuBarItemSkin extend // Paint highlight state if (highlight) { MenuBar menuBar = (MenuBar) menuBarItem.getParent(); - Color activeBackgroundColor = (Color) menuBar.getStyles().get("activeBackgroundColor"); + Color activeBackgroundColor = menuBar.getStyles().getColor(Style.activeBackgroundColor); graphics.setColor(activeBackgroundColor); graphics.fillRect(0, 0, width, height); } @@ -107,7 +108,7 @@ public class TerraMenuBarItemSkin extend if (menuBarItem.isActive()) { MenuBar menuBar = (MenuBar) menuBarItem.getParent(); - Color activeBackgroundColor = (Color) menuBar.getStyles().get("activeBackgroundColor"); + Color activeBackgroundColor = menuBar.getStyles().getColor(Style.activeBackgroundColor); opaque = (activeBackgroundColor.getTransparency() == Transparency.OPAQUE); } @@ -115,14 +116,14 @@ public class TerraMenuBarItemSkin extend } public Color getPopupBorderColor() { - return (Color) menuPopup.getStyles().get("borderColor"); + return menuPopup.getStyles().getColor(Style.borderColor); } public void setPopupBorderColor(Color popupBorderColor) { - menuPopup.getStyles().put("borderColor", popupBorderColor); + menuPopup.getStyles().put(Style.borderColor, popupBorderColor); } public void setPopupBorderColor(String popupBorderColor) { - menuPopup.getStyles().put("borderColor", popupBorderColor); + menuPopup.getStyles().put(Style.borderColor, popupBorderColor); } } Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuButtonSkin.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuButtonSkin.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuButtonSkin.java (original) +++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuButtonSkin.java Wed Feb 7 23:04:23 2018 @@ -39,6 +39,7 @@ import org.apache.pivot.wtk.Insets; import org.apache.pivot.wtk.MenuButton; import org.apache.pivot.wtk.Mouse; import org.apache.pivot.wtk.Point; +import org.apache.pivot.wtk.Style; import org.apache.pivot.wtk.Theme; import org.apache.pivot.wtk.Window; import org.apache.pivot.wtk.WindowStateListener; @@ -454,7 +455,7 @@ public class TerraMenuButtonSkin extends Utils.checkNull(borderColor, "borderColor"); this.borderColor = borderColor; - menuPopup.getStyles().put("borderColor", borderColor); + menuPopup.getStyles().put(Style.borderColor, borderColor); repaintComponent(); } @@ -590,21 +591,21 @@ public class TerraMenuButtonSkin extends } public int getCloseTransitionDuration() { - return menuPopup.getStyles().getInt("closeTransitionDuration"); + return menuPopup.getStyles().getInt(Style.closeTransitionDuration); } public void setCloseTransitionDuration(int closeTransitionDuration) { - menuPopup.getStyles().put("closeTransitionDuration", closeTransitionDuration); + menuPopup.getStyles().put(Style.closeTransitionDuration, closeTransitionDuration); MenuButton menuButton = (MenuButton) getComponent(); menuButton.setQueuedActionDelay(closeTransitionDuration + 50); } public int getCloseTransitionRate() { - return menuPopup.getStyles().getInt("closeTransitionRate"); + return menuPopup.getStyles().getInt(Style.closeTransitionRate); } public void setCloseTransitionRate(int closeTransitionRate) { - menuPopup.getStyles().put("closeTransitionRate", closeTransitionRate); + menuPopup.getStyles().put(Style.closeTransitionRate, closeTransitionRate); } @Override Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuItemSkin.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuItemSkin.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuItemSkin.java (original) +++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuItemSkin.java Wed Feb 7 23:04:23 2018 @@ -30,6 +30,7 @@ import org.apache.pivot.wtk.Cursor; import org.apache.pivot.wtk.Dimensions; import org.apache.pivot.wtk.GraphicsUtilities; import org.apache.pivot.wtk.Menu; +import org.apache.pivot.wtk.Style; import org.apache.pivot.wtk.media.Image; import org.apache.pivot.wtk.skin.MenuItemSkin; @@ -56,12 +57,11 @@ public class TerraMenuItemSkin extends M Menu.Item menuItem = (Menu.Item) getComponent(); Menu menu = (Menu) menuItem.getParent(); - Color color = (Color) menu.getStyles().get("color"); + Color color = menu.getStyles().getColor(Style.color); graphics.setColor(color); graphics.setStroke(new BasicStroke(2.5f)); - graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, - RenderingHints.VALUE_ANTIALIAS_ON); + GraphicsUtilities.setAntialiasingOn(graphics); // Draw a checkmark int n = CHECKMARK_SIZE / 2; @@ -139,7 +139,7 @@ public class TerraMenuItemSkin extends M // Paint highlight state if (highlight) { - Color activeBackgroundColor = (Color) menu.getStyles().get("activeBackgroundColor"); + Color activeBackgroundColor = menu.getStyles().getColor(Style.activeBackgroundColor); graphics.setPaint(new GradientPaint(width / 2f, 0, TerraTheme.brighten(activeBackgroundColor), width / 2f, height, activeBackgroundColor)); @@ -154,13 +154,11 @@ public class TerraMenuItemSkin extends M // Paint the expander if (menuItem.getMenu() != null) { - Color color = (Color) (highlight ? menu.getStyles().get("activeColor") - : menu.getStyles().get("color")); + Color color = menu.getStyles().getColor(highlight ? Style.activeColor : Style.color); graphics.setColor(color); graphics.setStroke(new BasicStroke(0)); - graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, - RenderingHints.VALUE_ANTIALIAS_ON); + GraphicsUtilities.setAntialiasingOn(graphics); graphics.translate(dataRenderer.getWidth() + (EXPANDER_SIZE - EXPANDER_ICON_SIZE) / 2, (height - EXPANDER_ICON_SIZE) / 2); @@ -180,7 +178,7 @@ public class TerraMenuItemSkin extends M if (menuItem.isActive()) { Menu menu = (Menu) menuItem.getParent(); - Color activeBackgroundColor = (Color) menu.getStyles().get("activeBackgroundColor"); + Color activeBackgroundColor = menu.getStyles().getColor(Style.activeBackgroundColor); opaque = (activeBackgroundColor.getTransparency() == Transparency.OPAQUE); } @@ -192,11 +190,11 @@ public class TerraMenuItemSkin extends M } public Color getPopupBorderColor() { - return (Color) menuPopup.getStyles().get("borderColor"); + return menuPopup.getStyles().getColor(Style.borderColor); } public void setPopupBorderColor(Color popupBorderColor) { - menuPopup.getStyles().put("borderColor", popupBorderColor); + menuPopup.getStyles().put(Style.borderColor, popupBorderColor); } public void setPopupBorderColor(String popupBorderColor) { Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuPopupSkin.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuPopupSkin.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuPopupSkin.java (original) +++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraMenuPopupSkin.java Wed Feb 7 23:04:23 2018 @@ -36,6 +36,7 @@ import org.apache.pivot.wtk.MenuPopupSta import org.apache.pivot.wtk.Mouse; import org.apache.pivot.wtk.Panorama; import org.apache.pivot.wtk.Point; +import org.apache.pivot.wtk.Style; import org.apache.pivot.wtk.Theme; import org.apache.pivot.wtk.Window; import org.apache.pivot.wtk.effects.DropShadowDecorator; @@ -140,12 +141,12 @@ public class TerraMenuPopupSkin extends setBackgroundColor((Color) null); panorama = new Panorama(); - panorama.getStyles().put("buttonBackgroundColor", defaultBackgroundColor()); + panorama.getStyles().put(Style.buttonBackgroundColor, defaultBackgroundColor()); border = new Border(panorama); - border.getStyles().put("color", theme.getColor(7)); - border.getStyles().put("backgroundColor", null); - border.getStyles().put("padding", Integer.valueOf(0)); + border.getStyles().put(Style.color, theme.getColor(7)); + border.getStyles().put(Style.backgroundColor, null); + border.getStyles().put(Style.padding, 0); } @Override @@ -172,15 +173,15 @@ public class TerraMenuPopupSkin extends } public Color getBorderColor() { - return (Color) border.getStyles().get("color"); + return border.getStyles().getColor(Style.color); } public void setBorderColor(Color borderColor) { - border.getStyles().put("color", borderColor); + border.getStyles().put(Style.color, borderColor); } public void setBorderColor(String borderColor) { - border.getStyles().put("color", borderColor); + border.getStyles().put(Style.color, borderColor); } public int getCloseTransitionDuration() { Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java (original) +++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraPaletteSkin.java Wed Feb 7 23:04:23 2018 @@ -46,6 +46,7 @@ import org.apache.pivot.wtk.Mouse; import org.apache.pivot.wtk.Orientation; import org.apache.pivot.wtk.Palette; import org.apache.pivot.wtk.Point; +import org.apache.pivot.wtk.Style; import org.apache.pivot.wtk.TablePane; import org.apache.pivot.wtk.Theme; import org.apache.pivot.wtk.VerticalAlignment; @@ -79,8 +80,7 @@ public class TerraPaletteSkin extends Wi graphics.setPaint(titleBarColor); graphics.setStroke(new BasicStroke(2)); - graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, - RenderingHints.VALUE_ANTIALIAS_ON); + GraphicsUtilities.setAntialiasingOn(graphics); graphics.draw(new Line2D.Double(0.5, 0.5, 5.5, 5.5)); graphics.draw(new Line2D.Double(0.5, 5.5, 5.5, 0.5)); @@ -179,30 +179,30 @@ public class TerraPaletteSkin extends Wi // The title bar table pane contains two nested box panes: one for // the title contents and the other for the buttons - new TablePane.Column(titleBarTablePane, 1, true); // note: this is useful, even if not used directly - new TablePane.Column(titleBarTablePane, -1); // note: this is useful, even if not used directly + new TablePane.Column(titleBarTablePane, 1, true); + new TablePane.Column(titleBarTablePane, -1); TablePane.Row titleRow = new TablePane.Row(titleBarTablePane, -1); titleRow.add(titleBoxPane); titleRow.add(buttonBoxPane); - titleBarTablePane.getStyles().put("padding", new Insets(2, 3, 2, 3)); + titleBarTablePane.getStyles().put(Style.padding, new Insets(2, 3, 2, 3)); // Initialize the title box pane - titleBoxPane.getStyles().put("verticalAlignment", VerticalAlignment.CENTER); + titleBoxPane.getStyles().put(Style.verticalAlignment, VerticalAlignment.CENTER); titleBoxPane.add(titleLabel); - titleBoxPane.getStyles().put("padding", new Insets(0, 0, 0, 3)); + titleBoxPane.getStyles().put(Style.padding, new Insets(0, 0, 0, 3)); Font titleFont = theme.getFont(); titleFont = titleFont.deriveFont(Font.BOLD, Math.round(titleFont.getSize2D() * titleFontScale)); - titleLabel.getStyles().put("font", titleFont); - titleLabel.getStyles().put("color", titleBarColor); + titleLabel.getStyles().put(Style.font, titleFont); + titleLabel.getStyles().put(Style.color, titleBarColor); // Initialize the button box pane - buttonBoxPane.getStyles().put("horizontalAlignment", HorizontalAlignment.RIGHT); - buttonBoxPane.getStyles().put("verticalAlignment", VerticalAlignment.CENTER); + buttonBoxPane.getStyles().put(Style.horizontalAlignment, HorizontalAlignment.RIGHT); + buttonBoxPane.getStyles().put(Style.verticalAlignment, VerticalAlignment.CENTER); buttonBoxPane.add(closeButton); closeButton.getComponentMouseButtonListeners().add( @@ -455,7 +455,7 @@ public class TerraPaletteSkin extends Wi * specification} */ public final void setTitleFont(String font) { - titleLabel.getStyles().put("font", decodeFont(font)); + titleLabel.getStyles().put(Style.font, decodeFont(font)); } /** @@ -464,7 +464,7 @@ public class TerraPaletteSkin extends Wi * @param font A dictionary {@link Theme#deriveFont describing a font} */ public final void setTitleFont(Dictionary<String, ?> font) { - titleLabel.getStyles().put("font", Theme.deriveFont(font)); + titleLabel.getStyles().put(Style.font, Theme.deriveFont(font)); } public final float getTitleFontScale() { @@ -477,7 +477,7 @@ public class TerraPaletteSkin extends Wi Theme theme = currentTheme(); Font titleFont = theme.getFont(); titleFont = titleFont.deriveFont(Font.BOLD, Math.round(titleFont.getSize2D() * scale)); - titleLabel.getStyles().put("font", titleFont); + titleLabel.getStyles().put(Style.font, titleFont); invalidateComponent(); } Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSuggestionPopupSkin.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSuggestionPopupSkin.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSuggestionPopupSkin.java (original) +++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSuggestionPopupSkin.java Wed Feb 7 23:04:23 2018 @@ -40,6 +40,7 @@ import org.apache.pivot.wtk.ListViewSele import org.apache.pivot.wtk.Mouse; import org.apache.pivot.wtk.Panorama; import org.apache.pivot.wtk.Point; +import org.apache.pivot.wtk.Style; import org.apache.pivot.wtk.SuggestionPopup; import org.apache.pivot.wtk.SuggestionPopupListener; import org.apache.pivot.wtk.SuggestionPopupSelectionListener; @@ -182,14 +183,14 @@ public class TerraSuggestionPopupSkin ex private static final int DEFAULT_CLOSE_TRANSITION_RATE = 30; public TerraSuggestionPopupSkin() { - listView.getStyles().put("variableItemHeight", true); + listView.getStyles().put(Style.variableItemHeight, true); listView.getListViewSelectionListeners().add(listViewSelectionListener); listView.getComponentKeyListeners().add(listViewKeyListener); listViewPanorama = new Panorama(listView); - listViewPanorama.getStyles().put("buttonBackgroundColor", - listView.getStyles().getColor("backgroundColor")); - listViewPanorama.getStyles().put("alwaysShowScrollButtons", true); + listViewPanorama.getStyles().put(Style.buttonBackgroundColor, + listView.getStyles().getColor(Style.backgroundColor)); + listViewPanorama.getStyles().put(Style.alwaysShowScrollButtons, true); listViewBorder = new Border(listViewPanorama); } @@ -216,11 +217,11 @@ public class TerraSuggestionPopupSkin ex } public Font getFont() { - return (Font) listView.getStyles().get("font"); + return listView.getStyles().getFont(Style.font); } public void setFont(Font font) { - listView.getStyles().put("font", font); + listView.getStyles().put(Style.font, font); } public final void setFont(String font) { @@ -232,11 +233,11 @@ public class TerraSuggestionPopupSkin ex } public Color getColor() { - return listView.getStyles().getColor("color"); + return listView.getStyles().getColor(Style.color); } public void setColor(Color color) { - listView.getStyles().put("color", color); + listView.getStyles().put(Style.color, color); } public final void setColor(String color) { @@ -244,11 +245,11 @@ public class TerraSuggestionPopupSkin ex } public Color getBorderColor() { - return listViewBorder.getStyles().getColor("color"); + return listViewBorder.getStyles().getColor(Style.color); } public void setBorderColor(Color borderColor) { - listViewBorder.getStyles().put("color", borderColor); + listViewBorder.getStyles().put(Style.color, borderColor); } public final void setBorderColor(String borderColor) { Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java (original) +++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraTabPaneSkin.java Wed Feb 7 23:04:23 2018 @@ -602,10 +602,10 @@ public class TerraTabPaneSkin extends Ta activeButtonBevelColor = TerraTheme.brighten(activeTabColor); inactiveButtonBevelColor = TerraTheme.brighten(inactiveTabColor); - tabButtonBoxPane.getStyles().put(Style.fill, new Boolean(true)); + tabButtonBoxPane.getStyles().put(Style.fill, true); - tabButtonPanorama.getStyles().put("buttonBackgroundColor", borderColor); - tabButtonPanorama.getStyles().put("buttonPadding", 6); + tabButtonPanorama.getStyles().put(Style.buttonBackgroundColor, borderColor); + tabButtonPanorama.getStyles().put(Style.buttonPadding, 6); tabButtonPanorama.setView(tabButtonBoxPane); tabButtonGroup.getButtonGroupListeners().add(new ButtonGroupListener() { @@ -1201,7 +1201,7 @@ public class TerraTabPaneSkin extends Ta Utils.checkNull(borderColor, "borderColor"); this.borderColor = borderColor; - tabButtonPanorama.getStyles().put("buttonBackgroundColor", borderColor); + tabButtonPanorama.getStyles().put(Style.buttonBackgroundColor, borderColor); repaintComponent(); } @@ -1322,14 +1322,16 @@ public class TerraTabPaneSkin extends Ta setButtonPadding(new Insets(padding)); } + public final void setButtonPadding(Sequence<?> padding) { + setButtonPadding(new Insets(padding)); + } + public final void setButtonPadding(int buttonPadding) { setButtonPadding(new Insets(buttonPadding)); } public final void setButtonPadding(Number padding) { - Utils.checkNull(padding, "padding"); - - setButtonPadding(padding.intValue()); + setButtonPadding(new Insets(padding)); } public final void setButtonPadding(String padding) { @@ -1337,11 +1339,11 @@ public class TerraTabPaneSkin extends Ta } public int getButtonSpacing() { - return tabButtonBoxPane.getStyles().getInt("spacing"); + return tabButtonBoxPane.getStyles().getInt(Style.spacing); } public void setButtonSpacing(int buttonSpacing) { - tabButtonBoxPane.getStyles().put("spacing", buttonSpacing); + tabButtonBoxPane.getStyles().put(Style.spacing, buttonSpacing); } public final void setButtonCornerRadius(int buttonCornerRadius) { Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraVFSBrowserSheetSkin.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraVFSBrowserSheetSkin.java?rev=1823528&r1=1823527&r2=1823528&view=diff ============================================================================== --- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraVFSBrowserSheetSkin.java (original) +++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraVFSBrowserSheetSkin.java Wed Feb 7 23:04:23 2018 @@ -44,6 +44,7 @@ import org.apache.pivot.wtk.Label; import org.apache.pivot.wtk.Mouse; import org.apache.pivot.wtk.PushButton; import org.apache.pivot.wtk.Sheet; +import org.apache.pivot.wtk.Style; import org.apache.pivot.wtk.TablePane; import org.apache.pivot.wtk.TextInput; import org.apache.pivot.wtk.TextInputContentListener; @@ -71,22 +72,14 @@ public class TerraVFSBrowserSheetSkin ex } } - @BXML - private TablePane tablePane = null; - @BXML - private BoxPane hostNameBoxPane = null; - @BXML - private Label hostNameLabel = null; - @BXML - private BoxPane saveAsBoxPane = null; - @BXML - private TextInput saveAsTextInput = null; - @BXML - private VFSBrowser fileBrowser = null; - @BXML - private PushButton okButton = null; - @BXML - private PushButton cancelButton = null; + @BXML private TablePane tablePane = null; + @BXML private BoxPane hostNameBoxPane = null; + @BXML private Label hostNameLabel = null; + @BXML private BoxPane saveAsBoxPane = null; + @BXML private TextInput saveAsTextInput = null; + @BXML private VFSBrowser fileBrowser = null; + @BXML private PushButton okButton = null; + @BXML private PushButton cancelButton = null; private FileSystem fileSystem = null; private boolean updatingSelection = false; @@ -306,19 +299,19 @@ public class TerraVFSBrowserSheetSkin ex } public boolean isHideDisabledFiles() { - return (Boolean) fileBrowser.getStyles().get("hideDisabledFiles"); + return fileBrowser.getStyles().getBoolean(Style.hideDisabledFiles); } public void setHideDisabledFiles(boolean hideDisabledFiles) { - fileBrowser.getStyles().put("hideDisabledFiles", hideDisabledFiles); + fileBrowser.getStyles().put(Style.hideDisabledFiles, hideDisabledFiles); } public boolean isShowHiddenFiles() { - return (Boolean) fileBrowser.getStyles().get("showHiddenFiles"); + return fileBrowser.getStyles().getBoolean(Style.showHiddenFiles); } public void setShowHiddenFiles(boolean showHiddenFiles) { - fileBrowser.getStyles().put("showHiddenFiles", showHiddenFiles); + fileBrowser.getStyles().put(Style.showHiddenFiles, showHiddenFiles); } public boolean getShowOKButtonFirst() { @@ -457,7 +450,7 @@ public class TerraVFSBrowserSheetSkin ex public void modeChanged(VFSBrowserSheet fileBrowserSheet, VFSBrowserSheet.Mode previousMode) { VFSBrowserSheet.Mode mode = fileBrowserSheet.getMode(); - fileBrowser.getStyles().put("keyboardFolderTraversalEnabled", + fileBrowser.getStyles().put(Style.keyboardFolderTraversalEnabled, (mode != VFSBrowserSheet.Mode.SAVE_TO)); switch (mode) {