You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by rw...@apache.org on 2018/02/07 23:04:24 UTC
svn commit: r1823528 [2/2] - in /pivot/trunk:
core/test/org/apache/pivot/functional/monad/test/
demos/src/org/apache/pivot/demos/styles/
demos/src/org/apache/pivot/demos/text/
tutorials/src/org/apache/pivot/tutorials/explorer/tools/
web-server/src/org/...
Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraVFSBrowserSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraVFSBrowserSkin.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraVFSBrowserSkin.java (original)
+++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraVFSBrowserSkin.java Wed Feb 7 23:04:23 2018
@@ -76,6 +76,7 @@ import org.apache.pivot.wtk.ScrollPane;
import org.apache.pivot.wtk.SortDirection;
import org.apache.pivot.wtk.Span;
import org.apache.pivot.wtk.StackPane;
+import org.apache.pivot.wtk.Style;
import org.apache.pivot.wtk.TableView;
import org.apache.pivot.wtk.TableViewSelectionListener;
import org.apache.pivot.wtk.TableViewSortListener;
@@ -120,13 +121,13 @@ public class TerraVFSBrowserSkin extends
}
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
@@ -179,7 +180,7 @@ public class TerraVFSBrowserSkin extends
*/
public static class ListButtonFileRenderer extends FileRenderer implements Button.DataRenderer {
public ListButtonFileRenderer() {
- getStyles().put("horizontalAlignment", HorizontalAlignment.LEFT);
+ getStyles().put(Style.horizontalAlignment, HorizontalAlignment.LEFT);
}
@Override
@@ -190,7 +191,7 @@ public class TerraVFSBrowserSkin extends
// 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().getBaseName();
@@ -202,12 +203,12 @@ public class TerraVFSBrowserSkin extends
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);
}
}
@@ -228,8 +229,8 @@ public class TerraVFSBrowserSkin extends
*/
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
@@ -237,7 +238,7 @@ public class TerraVFSBrowserSkin extends
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) {
FileObject file = (FileObject) item;
@@ -245,7 +246,7 @@ public class TerraVFSBrowserSkin extends
// 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
@@ -261,18 +262,18 @@ public class TerraVFSBrowserSkin extends
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
@@ -298,8 +299,8 @@ public class TerraVFSBrowserSkin extends
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
@@ -320,7 +321,7 @@ public class TerraVFSBrowserSkin extends
if (columnName.equals(NAME_KEY)) {
text = file.getName().getBaseName();
icon = getIcon(file);
- getStyles().put("horizontalAlignment", HorizontalAlignment.LEFT);
+ getStyles().put(Style.horizontalAlignment, HorizontalAlignment.LEFT);
} else if (columnName.equals(SIZE_KEY)) {
if (type == FileType.FOLDER || type == FileType.IMAGINARY) {
text = "";
@@ -328,7 +329,7 @@ public class TerraVFSBrowserSkin extends
long length = file.getContent().getSize();
text = FileSizeFormat.getInstance().format(length);
}
- getStyles().put("horizontalAlignment", HorizontalAlignment.RIGHT);
+ getStyles().put(Style.horizontalAlignment, HorizontalAlignment.RIGHT);
} else if (columnName.equals(LAST_MODIFIED_KEY)) {
if (type == FileType.FOLDER || type == FileType.IMAGINARY) {
text = "";
@@ -336,7 +337,7 @@ public class TerraVFSBrowserSkin extends
long lastModified = file.getContent().getLastModifiedTime();
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()
@@ -349,29 +350,28 @@ public class TerraVFSBrowserSkin extends
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
@@ -432,13 +432,13 @@ public class TerraVFSBrowserSkin extends
}
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
@@ -457,7 +457,7 @@ public class TerraVFSBrowserSkin extends
public static class ListButtonDriveRenderer extends DriveRenderer implements
Button.DataRenderer {
public ListButtonDriveRenderer() {
- getStyles().put("horizontalAlignment", HorizontalAlignment.LEFT);
+ getStyles().put(Style.horizontalAlignment, HorizontalAlignment.LEFT);
}
@Override
@@ -467,7 +467,7 @@ public class TerraVFSBrowserSkin extends
// 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());
@@ -486,38 +486,38 @@ public class TerraVFSBrowserSkin extends
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) {
FileObject file = (FileObject) 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
@@ -1129,8 +1129,8 @@ public class TerraVFSBrowserSkin extends
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/src/org/apache/pivot/wtk/Button.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/Button.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/Button.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/Button.java Wed Feb 7 23:04:23 2018
@@ -705,7 +705,7 @@ public abstract class Button extends Com
// Bind using selected key
if (selectedKey != null && selectedBindType != BindType.LOAD) {
JSON.put(context, selectedKey, (selectedBindMapping == null) ?
- new Boolean(isSelected()) : selectedBindMapping.valueOf(isSelected()));
+ Boolean.valueOf(isSelected()) : selectedBindMapping.valueOf(isSelected()));
}
}
}
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/Checkbox.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/Checkbox.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/Checkbox.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/Checkbox.java Wed Feb 7 23:04:23 2018
@@ -16,7 +16,9 @@
*/
package org.apache.pivot.wtk;
+import org.apache.pivot.annotations.UnsupportedOperation;
import org.apache.pivot.beans.DefaultProperty;
+import org.apache.pivot.wtk.Style;
import org.apache.pivot.wtk.content.ButtonDataRenderer;
/**
@@ -24,10 +26,10 @@ import org.apache.pivot.wtk.content.Butt
*/
@DefaultProperty("buttonData")
public class Checkbox extends Button {
- private static final Button.DataRenderer DEFAULT_DATA_RENDERER = new ButtonDataRenderer();
+ private static final ButtonDataRenderer DEFAULT_DATA_RENDERER = new ButtonDataRenderer();
static {
- DEFAULT_DATA_RENDERER.getStyles().put("horizontalAlignment", HorizontalAlignment.LEFT);
+ DEFAULT_DATA_RENDERER.getStyles().put(Style.horizontalAlignment, HorizontalAlignment.LEFT);
}
public Checkbox() {
@@ -58,12 +60,24 @@ public class Checkbox extends Button {
super.press();
}
+ /**
+ * This operation is not supported for checkboxes
+ *
+ * @throws UnsupportedOperationException always since this is unsupported.
+ */
@Override
+ @UnsupportedOperation
public void setToggleButton(boolean toggleButton) {
throw new UnsupportedOperationException("Checkboxes are always toggle buttons.");
}
+ /**
+ * This operation is not supported for checkboxes
+ *
+ * @throws UnsupportedOperationException always since this is unsupported.
+ */
@Override
+ @UnsupportedOperation
public void setButtonGroup(ButtonGroup buttonGroup) {
throw new UnsupportedOperationException("Checkboxes can't be added to a group.");
}
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/DesktopApplicationContext.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/DesktopApplicationContext.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/DesktopApplicationContext.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/DesktopApplicationContext.java Wed Feb 7 23:04:23 2018
@@ -726,7 +726,7 @@ public final class DesktopApplicationCon
}
// Invoke setHandled()
- setHandledMethod.invoke(args[0], new Object[] { new Boolean(handled) });
+ setHandledMethod.invoke(args[0], new Object[] { Boolean.valueOf(handled) });
return null;
}
@@ -735,7 +735,7 @@ public final class DesktopApplicationCon
Object eawtApplication = eawtApplicationClass.newInstance();
setEnabledAboutMenuMethod.invoke(eawtApplication,
- new Boolean(application instanceof Application.AboutHandler));
+ Boolean.valueOf(application instanceof Application.AboutHandler));
Object eawtApplicationListener = Proxy.newProxyInstance(
DesktopApplicationContext.class.getClassLoader(),
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/Form.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/Form.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/Form.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/Form.java Wed Feb 7 23:04:23 2018
@@ -522,7 +522,7 @@ public class Form extends Container {
}
public static void setRequired(Component component, boolean required) {
- Boolean previousValue = (Boolean) component.setAttribute(Attribute.REQUIRED, new Boolean(required));
+ Boolean previousValue = (Boolean) component.setAttribute(Attribute.REQUIRED, Boolean.valueOf(required));
boolean previousRequired = (previousValue == null) ? false : previousValue.booleanValue();
if (previousRequired != required) {
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/MenuButton.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/MenuButton.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/MenuButton.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/MenuButton.java Wed Feb 7 23:04:23 2018
@@ -18,6 +18,7 @@ package org.apache.pivot.wtk;
import org.apache.pivot.beans.DefaultProperty;
import org.apache.pivot.util.ListenerList;
+import org.apache.pivot.wtk.Style;
import org.apache.pivot.wtk.content.ButtonDataRenderer;
/**
@@ -50,7 +51,7 @@ public class MenuButton extends Button {
setDataRenderer(DEFAULT_DATA_RENDERER);
installSkin(MenuButton.class);
setQueuedAction(true);
- setQueuedActionDelay(getStyles().getInt("closeTransitionDuration") + 50);
+ setQueuedActionDelay(getStyles().getInt(Style.closeTransitionDuration) + 50);
}
@Override
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/RadioButton.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/RadioButton.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/RadioButton.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/RadioButton.java Wed Feb 7 23:04:23 2018
@@ -17,6 +17,7 @@
package org.apache.pivot.wtk;
import org.apache.pivot.beans.DefaultProperty;
+import org.apache.pivot.wtk.Style;
import org.apache.pivot.wtk.content.ButtonDataRenderer;
/**
@@ -24,10 +25,10 @@ import org.apache.pivot.wtk.content.Butt
*/
@DefaultProperty("buttonData")
public class RadioButton extends Button {
- private static final Button.DataRenderer DEFAULT_DATA_RENDERER = new ButtonDataRenderer();
+ private static final ButtonDataRenderer DEFAULT_DATA_RENDERER = new ButtonDataRenderer();
static {
- DEFAULT_DATA_RENDERER.getStyles().put("horizontalAlignment", HorizontalAlignment.LEFT);
+ DEFAULT_DATA_RENDERER.getStyles().put(Style.horizontalAlignment, HorizontalAlignment.LEFT);
}
public RadioButton() {
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/Style.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/Style.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/Style.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/Style.java Wed Feb 7 23:04:23 2018
@@ -57,7 +57,9 @@ public enum Style {
padding,
resizable,
selectionBackgroundColor,
+ selectionChangeDuration,
selectionChangeEffect,
+ selectionChangeRate,
selectionColor,
showEmptyBranchControls,
showHiddenFiles,
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/CalendarButtonDataRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/CalendarButtonDataRenderer.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/CalendarButtonDataRenderer.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/CalendarButtonDataRenderer.java Wed Feb 7 23:04:23 2018
@@ -23,13 +23,14 @@ import org.apache.pivot.util.CalendarDat
import org.apache.pivot.wtk.Button;
import org.apache.pivot.wtk.CalendarButton;
import org.apache.pivot.wtk.HorizontalAlignment;
+import org.apache.pivot.wtk.Style;
/**
* Default calendar button data renderer.
*/
public class CalendarButtonDataRenderer extends ButtonDataRenderer {
public CalendarButtonDataRenderer() {
- getStyles().put("horizontalAlignment", HorizontalAlignment.LEFT);
+ getStyles().put(Style.horizontalAlignment, HorizontalAlignment.LEFT);
}
@Override
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ColorItem.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ColorItem.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ColorItem.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ColorItem.java Wed Feb 7 23:04:23 2018
@@ -75,9 +75,7 @@ public class ColorItem {
public void setName(String name) {
if (name == null) {
this.name = String.format("#%02X%02X%02X",
- Integer.valueOf(color.getRed()),
- Integer.valueOf(color.getGreen()),
- Integer.valueOf(color.getBlue()));
+ color.getRed(), color.getGreen(), color.getBlue());
} else {
this.name = name;
}
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/LinkButtonDataRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/LinkButtonDataRenderer.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/LinkButtonDataRenderer.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/LinkButtonDataRenderer.java Wed Feb 7 23:04:23 2018
@@ -38,8 +38,8 @@ public class LinkButtonDataRenderer exte
public LinkButtonDataRenderer() {
getStyles().put(Style.horizontalSpacing, 4);
- new TablePane.Column(this); // note: this is useful, even if not used directly
- new TablePane.Column(this, 1, true); // note: this is useful, even if not used directly
+ new TablePane.Column(this);
+ new TablePane.Column(this, 1, true);
TablePane.Row row = new TablePane.Row(this);
row.add(imageView);
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemEditor.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemEditor.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemEditor.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemEditor.java Wed Feb 7 23:04:23 2018
@@ -27,6 +27,7 @@ import org.apache.pivot.wtk.Keyboard;
import org.apache.pivot.wtk.ListView;
import org.apache.pivot.wtk.Mouse;
import org.apache.pivot.wtk.Point;
+import org.apache.pivot.wtk.Style;
import org.apache.pivot.wtk.TextInput;
import org.apache.pivot.wtk.Window;
@@ -107,7 +108,7 @@ public class ListViewItemEditor extends
Bounds textBounds = itemRenderer.getTextBounds();
// Calculate the bounds of what is being edited
- Insets padding = (Insets) textInput.getStyles().get("padding");
+ Insets padding = (Insets) textInput.getStyles().get(Style.padding);
Bounds editBounds = new Bounds(itemBounds.x + textBounds.x - (padding.left + 1),
itemBounds.y, itemBounds.width - textBounds.x + (padding.left + 1), itemBounds.height);
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemRenderer.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemRenderer.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemRenderer.java Wed Feb 7 23:04:23 2018
@@ -27,6 +27,7 @@ import org.apache.pivot.wtk.ImageView;
import org.apache.pivot.wtk.Insets;
import org.apache.pivot.wtk.Label;
import org.apache.pivot.wtk.ListView;
+import org.apache.pivot.wtk.Style;
import org.apache.pivot.wtk.VerticalAlignment;
import org.apache.pivot.wtk.media.Image;
@@ -42,9 +43,9 @@ public class ListViewItemRenderer extend
public static boolean DEFAULT_SHOW_ICON = false;
public ListViewItemRenderer() {
- getStyles().put("horizontalAlignment", HorizontalAlignment.LEFT);
- getStyles().put("verticalAlignment", VerticalAlignment.CENTER);
- getStyles().put("padding", new Insets(2, 3, 2, 3));
+ getStyles().put(Style.horizontalAlignment, HorizontalAlignment.LEFT);
+ getStyles().put(Style.verticalAlignment, VerticalAlignment.CENTER);
+ getStyles().put(Style.padding, new Insets(2, 3, 2, 3));
add(imageView);
add(label);
@@ -84,27 +85,26 @@ public class ListViewItemRenderer extend
protected void renderStyles(ListView listView, boolean selected, @SuppressWarnings("unused")
boolean highlighted, boolean disabled) {
- imageView.getStyles().put("opacity", listView.isEnabled() ? 1.0f : 0.5f);
+ imageView.getStyles().put(Style.opacity, listView.isEnabled() ? 1.0f : 0.5f);
- Font font = (Font) listView.getStyles().get("font");
- label.getStyles().put("font", font);
+ label.getStyles().copy(Style.font, listView.getStyles());
Color color;
if (listView.isEnabled() && !disabled) {
if (selected) {
if (listView.isFocused()) {
- color = (Color) listView.getStyles().get("selectionColor");
+ color = listView.getStyles().getColor(Style.selectionColor);
} else {
- color = (Color) listView.getStyles().get("inactiveSelectionColor");
+ color = listView.getStyles().getColor(Style.inactiveSelectionColor);
}
} else {
- color = (Color) listView.getStyles().get("color");
+ color = listView.getStyles().getColor(Style.color);
}
} else {
- color = (Color) listView.getStyles().get("disabledColor");
+ color = listView.getStyles().getColor(Style.disabledColor);
}
- label.getStyles().put("color", color);
+ label.getStyles().put(Style.color, color);
}
@Override
@@ -148,11 +148,11 @@ public class ListViewItemRenderer extend
}
public boolean getFillIcon() {
- return (Boolean) imageView.getStyles().get("fill");
+ return imageView.getStyles().getBoolean(Style.fill);
}
public void setFillIcon(boolean fillIcon) {
- imageView.getStyles().put("fill", fillIcon);
+ imageView.getStyles().put(Style.fill, fillIcon);
}
/**
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/MenuItemDataRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/MenuItemDataRenderer.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/MenuItemDataRenderer.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/MenuItemDataRenderer.java Wed Feb 7 23:04:23 2018
@@ -43,8 +43,8 @@ public class MenuItemDataRenderer extend
public MenuItemDataRenderer() {
getStyles().put(Style.padding, new Insets(2));
- new TablePane.Column(this, 1, true); // note: this is useful, even if not used directly
- new TablePane.Column(this); // note: this is useful, even if not used directly
+ new TablePane.Column(this, 1, true);
+ new TablePane.Column(this);
BoxPane boxPane = new BoxPane();
boxPane.add(imageView);
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/SpinnerItemRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/SpinnerItemRenderer.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/SpinnerItemRenderer.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/SpinnerItemRenderer.java Wed Feb 7 23:04:23 2018
@@ -22,6 +22,7 @@ import java.awt.Font;
import org.apache.pivot.wtk.Insets;
import org.apache.pivot.wtk.Label;
import org.apache.pivot.wtk.Spinner;
+import org.apache.pivot.wtk.Style;
import org.apache.pivot.wtk.VerticalAlignment;
/**
@@ -30,8 +31,8 @@ import org.apache.pivot.wtk.VerticalAlig
*/
public class SpinnerItemRenderer extends Label implements Spinner.ItemRenderer {
public SpinnerItemRenderer() {
- getStyles().put("verticalAlignment", VerticalAlignment.CENTER);
- getStyles().put("padding", new Insets(2));
+ getStyles().put(Style.verticalAlignment, VerticalAlignment.CENTER);
+ getStyles().put(Style.padding, new Insets(2));
}
@Override
@@ -52,17 +53,16 @@ public class SpinnerItemRenderer extends
}
protected void renderStyles(Spinner spinner) {
- Font font = (Font) spinner.getStyles().get("font");
- getStyles().put("font", font);
+ getStyles().copy(Style.font, spinner.getStyles());
Color color;
if (spinner.isEnabled()) {
- color = (Color) spinner.getStyles().get("color");
+ color = spinner.getStyles().getColor(Style.color);
} else {
- color = (Color) spinner.getStyles().get("disabledColor");
+ color = spinner.getStyles().getColor(Style.disabledColor);
}
- getStyles().put("color", color);
+ getStyles().put(Style.color, color);
}
@Override
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCellRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCellRenderer.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCellRenderer.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCellRenderer.java Wed Feb 7 23:04:23 2018
@@ -23,16 +23,17 @@ import org.apache.pivot.json.JSON;
import org.apache.pivot.wtk.Component;
import org.apache.pivot.wtk.Insets;
import org.apache.pivot.wtk.Label;
+import org.apache.pivot.wtk.Style;
import org.apache.pivot.wtk.TableView;
import org.apache.pivot.wtk.VerticalAlignment;
/**
- * Default table cell renderer. Renders cell contents as a string.
+ * Default table cell renderer. Renders cell contents as a string, vertically centered.
*/
public class TableViewCellRenderer extends Label implements TableView.CellRenderer {
public TableViewCellRenderer() {
- getStyles().put("verticalAlignment", VerticalAlignment.CENTER);
- getStyles().put("padding", new Insets(2));
+ getStyles().put(Style.verticalAlignment, VerticalAlignment.CENTER);
+ getStyles().put(Style.padding, new Insets(2));
}
@Override
@@ -61,25 +62,24 @@ public class TableViewCellRenderer exten
Component.StyleDictionary tableViewStyles = tableView.getStyles();
Component.StyleDictionary styles = getStyles();
- Font font = (Font) tableViewStyles.get("font");
- styles.put("font", font);
+ styles.copy(Style.font, tableViewStyles);
Color color;
if (tableView.isEnabled() && !rowDisabled) {
if (rowSelected) {
if (tableView.isFocused()) {
- color = (Color) tableViewStyles.get("selectionColor");
+ color = tableViewStyles.getColor(Style.selectionColor);
} else {
- color = (Color) tableViewStyles.get("inactiveSelectionColor");
+ color = tableViewStyles.getColor(Style.inactiveSelectionColor);
}
} else {
- color = (Color) tableViewStyles.get("color");
+ color = tableViewStyles.getColor(Style.color);
}
} else {
- color = (Color) tableViewStyles.get("disabledColor");
+ color = tableViewStyles.getColor(Style.disabledColor);
}
- styles.put("color", color);
+ styles.put(Style.color, color);
}
@Override
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCheckboxCellRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCheckboxCellRenderer.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCheckboxCellRenderer.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCheckboxCellRenderer.java Wed Feb 7 23:04:23 2018
@@ -20,6 +20,7 @@ import org.apache.pivot.wtk.BoxPane;
import org.apache.pivot.wtk.Button;
import org.apache.pivot.wtk.Checkbox;
import org.apache.pivot.wtk.HorizontalAlignment;
+import org.apache.pivot.wtk.Style;
import org.apache.pivot.wtk.TableView;
import org.apache.pivot.wtk.VerticalAlignment;
@@ -34,9 +35,9 @@ public class TableViewCheckboxCellRender
public TableViewCheckboxCellRenderer() {
add(checkbox);
- getStyles().put("padding", 3);
- getStyles().put("verticalAlignment", VerticalAlignment.CENTER);
- getStyles().put("horizontalAlignment", HorizontalAlignment.CENTER);
+ getStyles().put(Style.padding, 3);
+ getStyles().put(Style.verticalAlignment, VerticalAlignment.CENTER);
+ getStyles().put(Style.horizontalAlignment, HorizontalAlignment.CENTER);
}
@Override
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewFileSizeCellRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewFileSizeCellRenderer.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewFileSizeCellRenderer.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewFileSizeCellRenderer.java Wed Feb 7 23:04:23 2018
@@ -20,18 +20,19 @@ import org.apache.pivot.json.JSON;
import org.apache.pivot.text.FileSizeFormat;
import org.apache.pivot.wtk.HorizontalAlignment;
import org.apache.pivot.wtk.Insets;
+import org.apache.pivot.wtk.Style;
/**
* Default renderer for table view cells that contain file size data. Renders
- * cell contents as a formatted file size.
+ * cell contents as a formatted file size, right-justified in the cell.
*/
public class TableViewFileSizeCellRenderer extends TableViewCellRenderer {
public TableViewFileSizeCellRenderer() {
- getStyles().put("horizontalAlignment", HorizontalAlignment.RIGHT);
+ getStyles().put(Style.horizontalAlignment, HorizontalAlignment.RIGHT);
// Apply more padding on the right so the right-aligned cells don't
// appear to run into left-aligned cells in the next column
- getStyles().put("padding", new Insets(2, 2, 2, 6));
+ getStyles().put(Style.padding, new Insets(2, 2, 2, 6));
}
@Override
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewImageCellRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewImageCellRenderer.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewImageCellRenderer.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewImageCellRenderer.java Wed Feb 7 23:04:23 2018
@@ -18,6 +18,7 @@ package org.apache.pivot.wtk.content;
import org.apache.pivot.json.JSON;
import org.apache.pivot.wtk.ImageView;
+import org.apache.pivot.wtk.Style;
import org.apache.pivot.wtk.TableView;
import org.apache.pivot.wtk.TableView.CellRenderer;
import org.apache.pivot.wtk.media.Image;
@@ -78,7 +79,7 @@ public class TableViewImageCellRenderer
}
setImage(image);
- getStyles().put("opacity", disabled ? 0.5f : 1.0f);
+ getStyles().put(Style.opacity, disabled ? 0.5f : 1.0f);
}
}
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewNumberCellRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewNumberCellRenderer.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewNumberCellRenderer.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewNumberCellRenderer.java Wed Feb 7 23:04:23 2018
@@ -23,6 +23,7 @@ import org.apache.pivot.json.JSON;
import org.apache.pivot.util.Utils;
import org.apache.pivot.wtk.HorizontalAlignment;
import org.apache.pivot.wtk.Insets;
+import org.apache.pivot.wtk.Style;
/**
* Default renderer for table view cells that contain numeric data. Renders cell
@@ -34,11 +35,11 @@ public class TableViewNumberCellRenderer
public static final NumberFormat DEFAULT_NUMBER_FORMAT = NumberFormat.getNumberInstance();
public TableViewNumberCellRenderer() {
- getStyles().put("horizontalAlignment", HorizontalAlignment.RIGHT);
+ getStyles().put(Style.horizontalAlignment, HorizontalAlignment.RIGHT);
// Apply more padding on the right so the right-aligned cells don't
// appear to run into left-aligned cells in the next column
- getStyles().put("padding", new Insets(2, 2, 2, 6));
+ getStyles().put(Style.padding, new Insets(2, 2, 2, 6));
}
public NumberFormat getNumberFormat() {
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java Wed Feb 7 23:04:23 2018
@@ -34,6 +34,7 @@ import org.apache.pivot.wtk.Keyboard;
import org.apache.pivot.wtk.Mouse;
import org.apache.pivot.wtk.Point;
import org.apache.pivot.wtk.ScrollPane;
+import org.apache.pivot.wtk.Style;
import org.apache.pivot.wtk.TablePane;
import org.apache.pivot.wtk.TableView;
import org.apache.pivot.wtk.TextInput;
@@ -48,7 +49,7 @@ import org.apache.pivot.wtk.skin.CardPan
*/
public class TableViewRowEditor extends Window implements TableView.RowEditor {
private class RowImage extends Image {
- private Bounds bounds = new Bounds(0, 0, 0, 0);
+ private Bounds bounds = Bounds.EMPTY;
@Override
public int getWidth() {
@@ -139,7 +140,7 @@ public class TableViewRowEditor extends
}
});
- tablePane.getStyles().put("horizontalSpacing", new Integer(1));
+ tablePane.getStyles().put(Style.horizontalSpacing, 1);
tablePane.getRows().add(editorRow);
}
@@ -298,7 +299,7 @@ public class TableViewRowEditor extends
*/
public CardPaneSkin.SelectionChangeEffect getEditEffect() {
return (CardPaneSkin.SelectionChangeEffect) cardPane.getStyles().get(
- "selectionChangeEffect");
+ Style.selectionChangeEffect);
}
/**
@@ -307,7 +308,7 @@ public class TableViewRowEditor extends
* @param editEffect The edit effect, or <tt>null</tt> for no effect.
*/
public void setEditEffect(CardPaneSkin.SelectionChangeEffect editEffect) {
- cardPane.getStyles().put("selectionChangeEffect", editEffect);
+ cardPane.getStyles().put(Style.selectionChangeEffect, editEffect);
}
/**
@@ -316,7 +317,7 @@ public class TableViewRowEditor extends
* @return The effect duration in milliseconds.
*/
public int getEditEffectDuration() {
- return ((Integer) cardPane.getStyles().get("selectionChangeDuration")).intValue();
+ return cardPane.getStyles().getInt(Style.selectionChangeDuration);
}
/**
@@ -325,7 +326,7 @@ public class TableViewRowEditor extends
* @param effectDuration The effect duration in milliseconds.
*/
public void setEditEffectDuration(int effectDuration) {
- cardPane.getStyles().put("selectionChangeDuration", new Integer(effectDuration));
+ cardPane.getStyles().put(Style.selectionChangeDuration, effectDuration);
}
/**
@@ -334,7 +335,7 @@ public class TableViewRowEditor extends
* @return The effect rate.
*/
public int getEditEffectRate() {
- return ((Integer) cardPane.getStyles().get("selectionChangeRate")).intValue();
+ return cardPane.getStyles().getInt(Style.selectionChangeRate);
}
/**
@@ -343,7 +344,7 @@ public class TableViewRowEditor extends
* @param effectRate The effect rate.
*/
public void setEditEffectRate(int effectRate) {
- cardPane.getStyles().put("selectionChangeRate", new Integer(effectRate));
+ cardPane.getStyles().put(Style.selectionChangeRate, effectRate);
}
@Override
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewTextAreaCellRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewTextAreaCellRenderer.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewTextAreaCellRenderer.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewTextAreaCellRenderer.java Wed Feb 7 23:04:23 2018
@@ -22,6 +22,7 @@ import java.awt.Font;
import org.apache.pivot.json.JSON;
import org.apache.pivot.wtk.Component;
import org.apache.pivot.wtk.Insets;
+import org.apache.pivot.wtk.Style;
import org.apache.pivot.wtk.TableView;
import org.apache.pivot.wtk.TextArea;
@@ -31,7 +32,7 @@ import org.apache.pivot.wtk.TextArea;
*/
public class TableViewTextAreaCellRenderer extends TextArea implements TableView.CellRenderer {
public TableViewTextAreaCellRenderer() {
- getStyles().put("margin", new Insets(2));
+ getStyles().put(Style.margin, new Insets(2));
}
@Override
@@ -60,25 +61,24 @@ public class TableViewTextAreaCellRender
Component.StyleDictionary tableViewStyles = tableView.getStyles();
Component.StyleDictionary styles = getStyles();
- Font font = (Font) tableViewStyles.get("font");
- styles.put("font", font);
+ styles.copy(Style.font, tableViewStyles);
Color color;
if (tableView.isEnabled() && !rowDisabled) {
if (rowSelected) {
if (tableView.isFocused()) {
- color = tableViewStyles.getColor("selectionColor");
+ color = tableViewStyles.getColor(Style.selectionColor);
} else {
- color = tableViewStyles.getColor("inactiveSelectionColor");
+ color = tableViewStyles.getColor(Style.inactiveSelectionColor);
}
} else {
- color = tableViewStyles.getColor("color");
+ color = tableViewStyles.getColor(Style.color);
}
} else {
- color = tableViewStyles.getColor("disabledColor");
+ color = tableViewStyles.getColor(Style.disabledColor);
}
- styles.put("color", color);
+ styles.put(Style.color, color);
}
@Override
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeEditor.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeEditor.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeEditor.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeEditor.java Wed Feb 7 23:04:23 2018
@@ -27,6 +27,7 @@ import org.apache.pivot.wtk.Insets;
import org.apache.pivot.wtk.Keyboard;
import org.apache.pivot.wtk.Mouse;
import org.apache.pivot.wtk.Point;
+import org.apache.pivot.wtk.Style;
import org.apache.pivot.wtk.TextInput;
import org.apache.pivot.wtk.TreeView;
import org.apache.pivot.wtk.Window;
@@ -108,7 +109,7 @@ public class TreeViewNodeEditor extends
Bounds textBounds = nodeRenderer.getTextBounds();
// Calculate the bounds of what is being edited
- Insets padding = (Insets) textInput.getStyles().get("padding");
+ Insets padding = (Insets) textInput.getStyles().get(Style.padding);
Bounds editBounds = new Bounds(nodeBounds.x + textBounds.x - (padding.left + 1),
nodeBounds.y, nodeBounds.width - textBounds.x + (padding.left + 1), nodeBounds.height);
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeRenderer.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeRenderer.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeRenderer.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeRenderer.java Wed Feb 7 23:04:23 2018
@@ -174,7 +174,7 @@ public class TreeViewNodeRenderer extend
}
public boolean getFillIcon() {
- return (Boolean) imageView.getStyles().get(Style.fill);
+ return imageView.getStyles().getBoolean(Style.fill);
}
public void setFillIcon(boolean fillIcon) {
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/effects/WatermarkDecorator.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/effects/WatermarkDecorator.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/effects/WatermarkDecorator.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/effects/WatermarkDecorator.java Wed Feb 7 23:04:23 2018
@@ -91,10 +91,10 @@ public class WatermarkDecorator implemen
boxPane.add(label);
boxPane.getStyles().put(Style.verticalAlignment, VerticalAlignment.CENTER);
- imageView.getStyles().put("opacity", opacity);
+ imageView.getStyles().put(Style.opacity, opacity);
- Font font = (Font) label.getStyles().get("font");
- label.getStyles().put("font", font.deriveFont(Font.BOLD, 60));
+ Font font = label.getStyles().getFont(Style.font);
+ label.getStyles().put(Style.font, font.deriveFont(Font.BOLD, 60));
label.setText(text != null ? text : "");
imageView.setImage(image);
@@ -127,7 +127,7 @@ public class WatermarkDecorator implemen
* @return This decorator's font
*/
public Font getFont() {
- return (Font) label.getStyles().get("font");
+ return label.getStyles().getFont(Style.font);
}
/**
@@ -138,7 +138,7 @@ public class WatermarkDecorator implemen
public void setFont(Font font) {
Utils.checkNull(font, "font");
- label.getStyles().put("font", font);
+ label.getStyles().put(Style.font, font);
validate();
}
@@ -209,7 +209,7 @@ public class WatermarkDecorator implemen
*/
public void setOpacity(float opacity) {
this.opacity = opacity;
- imageView.getStyles().put("opacity", opacity);
+ imageView.getStyles().put(Style.opacity, opacity);
}
/**
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ComponentSkin.java Wed Feb 7 23:04:23 2018
@@ -48,6 +48,7 @@ import org.apache.pivot.wtk.MenuHandler;
import org.apache.pivot.wtk.Mouse;
import org.apache.pivot.wtk.Point;
import org.apache.pivot.wtk.Skin;
+import org.apache.pivot.wtk.Style;
import org.apache.pivot.wtk.TextInputMethodListener;
import org.apache.pivot.wtk.Theme;
import org.apache.pivot.wtk.Tooltip;
@@ -313,7 +314,7 @@ public abstract class ComponentSkin impl
if (tooltipText != null) {
Label tooltipLabel = new Label(tooltipText);
boolean tooltipWrapText = component.getTooltipWrapText();
- tooltipLabel.getStyles().put("wrapText", new Boolean(tooltipWrapText));
+ tooltipLabel.getStyles().put(Style.wrapText, tooltipWrapText);
Tooltip tooltip = new Tooltip(tooltipLabel);
Display display = component.getDisplay();
Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ScrollPaneSkin.java
URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ScrollPaneSkin.java?rev=1823528&r1=1823527&r2=1823528&view=diff
==============================================================================
--- pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ScrollPaneSkin.java (original)
+++ pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ScrollPaneSkin.java Wed Feb 7 23:04:23 2018
@@ -36,6 +36,7 @@ import org.apache.pivot.wtk.ScrollPane;
import org.apache.pivot.wtk.ScrollPane.Corner;
import org.apache.pivot.wtk.ScrollPane.ScrollBarPolicy;
import org.apache.pivot.wtk.ScrollPaneListener;
+import org.apache.pivot.wtk.Style;
import org.apache.pivot.wtk.Viewport;
import org.apache.pivot.wtk.ViewportListener;
@@ -754,7 +755,7 @@ public class ScrollPaneSkin extends Cont
topLeftCorner.setVisible(true);
topLeftCorner.setSize(rowHeaderWidth, columnHeaderHeight);
topLeftCorner.setLocation(0, 0);
- topLeftCorner.getStyles().put("backgroundColor", backColor);
+ topLeftCorner.getStyles().put(Style.backgroundColor, backColor);
}
} else {
if (corner != null) {
@@ -768,7 +769,7 @@ public class ScrollPaneSkin extends Cont
bottomLeftCorner.setVisible(true);
bottomLeftCorner.setSize(rowHeaderWidth, horizontalScrollBarHeight);
bottomLeftCorner.setLocation(0, height - horizontalScrollBarHeight);
- bottomLeftCorner.getStyles().put("backgroundColor", backColor);
+ bottomLeftCorner.getStyles().put(Style.backgroundColor, backColor);
} else {
bottomLeftCorner.setVisible(false);
}
@@ -778,7 +779,7 @@ public class ScrollPaneSkin extends Cont
bottomRightCorner.setSize(verticalScrollBarWidth, horizontalScrollBarHeight);
bottomRightCorner.setLocation(width - verticalScrollBarWidth, height
- horizontalScrollBarHeight);
- bottomRightCorner.getStyles().put("backgroundColor", backColor);
+ bottomRightCorner.getStyles().put(Style.backgroundColor, backColor);
} else {
bottomRightCorner.setVisible(false);
}
@@ -787,7 +788,7 @@ public class ScrollPaneSkin extends Cont
topRightCorner.setVisible(true);
topRightCorner.setSize(verticalScrollBarWidth, columnHeaderHeight);
topRightCorner.setLocation(width - verticalScrollBarWidth, 0);
- topRightCorner.getStyles().put("backgroundColor", backColor);
+ topRightCorner.getStyles().put(Style.backgroundColor, backColor);
} else {
topRightCorner.setVisible(false);
}