Author: rwhitcomb Date: Fri Jan 19 17:41:44 2018 New Revision: 1821689 URL: http://svn.apache.org/viewvc?rev=1821689&view=rev Log: PIVOT-1011: A lot more work moving the ListenerList implementations for listeners into the Listener interfaces themselves; implementing default methods in the interface, and deprecating the "xxx.Adapter" classes. This submission finishes up the Component-related listeners and several others.
Modified: pivot/trunk/demos/src/org/apache/pivot/demos/rss/RSSFeedDemo.java pivot/trunk/tests/src/org/apache/pivot/tests/ListViewSelectionTest.java pivot/trunk/tests/src/org/apache/pivot/tests/TextInputValidatorTest.java pivot/trunk/tests/src/org/apache/pivot/tests/WindowTest.java pivot/trunk/tests/src/org/apache/pivot/tests/issues/Pivot811.java pivot/trunk/tests/src/org/apache/pivot/tests/issues/Pivot951.java pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/BXMLExplorerDocument.java pivot/trunk/tutorials/src/org/apache/pivot/tutorials/explorer/ComponentExplorerWindow.java pivot/trunk/tutorials/src/org/apache/pivot/tutorials/explorer/tools/ComponentInspectorSkin.java pivot/trunk/tutorials/src/org/apache/pivot/tutorials/layout/SimpleTablePanes.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraAccordionSkin.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/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/TerraPaletteSkin.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraRollupSkin.java pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.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/ColorChooserBindingListener.java pivot/trunk/wtk/src/org/apache/pivot/wtk/ColorChooserButtonBindingListener.java pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentClassListener.java pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentDataListener.java pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentDecoratorListener.java pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentListener.java pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentMouseButtonListener.java pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentMouseListener.java pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentMouseWheelListener.java pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentStateListener.java pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentStyleListener.java pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentTooltipListener.java pivot/trunk/wtk/src/org/apache/pivot/wtk/ListView.java pivot/trunk/wtk/src/org/apache/pivot/wtk/ListViewListener.java pivot/trunk/wtk/src/org/apache/pivot/wtk/ListViewSelectionListener.java pivot/trunk/wtk/src/org/apache/pivot/wtk/RulerListener.java pivot/trunk/wtk/src/org/apache/pivot/wtk/ScrollPaneListener.java pivot/trunk/wtk/src/org/apache/pivot/wtk/TextInputBindingListener.java pivot/trunk/wtk/src/org/apache/pivot/wtk/TextInputListener.java pivot/trunk/wtk/src/org/apache/pivot/wtk/TextInputSelectionListener.java pivot/trunk/wtk/src/org/apache/pivot/wtk/TextPane.java pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/CalendarButtonSkin.java pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ColorChooserButtonSkin.java pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ListButtonSkin.java pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/TextPaneSkinComponentNodeView.java pivot/trunk/wtk/src/org/apache/pivot/wtk/text/Node.java pivot/trunk/wtk/src/org/apache/pivot/wtk/text/NodeListener.java Modified: pivot/trunk/demos/src/org/apache/pivot/demos/rss/RSSFeedDemo.java URL: http://svn.apache.org/viewvc/pivot/trunk/demos/src/org/apache/pivot/demos/rss/RSSFeedDemo.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/demos/src/org/apache/pivot/demos/rss/RSSFeedDemo.java (original) +++ pivot/trunk/demos/src/org/apache/pivot/demos/rss/RSSFeedDemo.java Fri Jan 19 17:41:44 2018 @@ -52,7 +52,7 @@ public class RSSFeedDemo extends Window statusLabel = (Label) namespace.get("statusLabel"); feedListView.getComponentMouseButtonListeners().add( - new ComponentMouseButtonListener.Adapter() { + new ComponentMouseButtonListener() { private int index = -1; @Override Modified: pivot/trunk/tests/src/org/apache/pivot/tests/ListViewSelectionTest.java URL: http://svn.apache.org/viewvc/pivot/trunk/tests/src/org/apache/pivot/tests/ListViewSelectionTest.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/tests/src/org/apache/pivot/tests/ListViewSelectionTest.java (original) +++ pivot/trunk/tests/src/org/apache/pivot/tests/ListViewSelectionTest.java Fri Jan 19 17:41:44 2018 @@ -117,7 +117,7 @@ public class ListViewSelectionTest imple dumpSelection(); verifySelection(4); - listView.getListViewSelectionListeners().add(new ListViewSelectionListener.Adapter() { + listView.getListViewSelectionListeners().add(new ListViewSelectionListener() { @Override public void selectedRangesChanged(ListView listViewArgument, Sequence<Span> previousSelectedRanges) { Modified: pivot/trunk/tests/src/org/apache/pivot/tests/TextInputValidatorTest.java URL: http://svn.apache.org/viewvc/pivot/trunk/tests/src/org/apache/pivot/tests/TextInputValidatorTest.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/tests/src/org/apache/pivot/tests/TextInputValidatorTest.java (original) +++ pivot/trunk/tests/src/org/apache/pivot/tests/TextInputValidatorTest.java Fri Jan 19 17:41:44 2018 @@ -115,7 +115,7 @@ public class TextInputValidatorTest impl bdCompRange.setAutoTrim(true); // enable auto-trim of input string, before validating System.out.println("ComparableRangeValidator: enable auto-trim of input string, before validating"); textinputComparableRange.setValidator(bdCompRange); - textinputComparableRange.getTextInputListeners().add(new TextInputListener.Adapter() { + textinputComparableRange.getTextInputListeners().add(new TextInputListener() { @Override public void textValidChanged(TextInput textInput) { invalidComparableRangeLabel.setText(textInput.isTextValid() ? "valid" : "invalid"); @@ -145,7 +145,7 @@ public class TextInputValidatorTest impl textinputFloatRange.setValidator(new FloatRangeValidator(2.0f, 123456789f)); // test the listener by updating a label - textinputFloatRange.getTextInputListeners().add(new TextInputListener.Adapter() { + textinputFloatRange.getTextInputListeners().add(new TextInputListener() { @Override public void textValidChanged(TextInput textInput) { invalidLabel.setText(textInput.isTextValid() ? "valid" : "invalid"); Modified: pivot/trunk/tests/src/org/apache/pivot/tests/WindowTest.java URL: http://svn.apache.org/viewvc/pivot/trunk/tests/src/org/apache/pivot/tests/WindowTest.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/tests/src/org/apache/pivot/tests/WindowTest.java (original) +++ pivot/trunk/tests/src/org/apache/pivot/tests/WindowTest.java Fri Jan 19 17:41:44 2018 @@ -47,7 +47,7 @@ public class WindowTest implements Appli window1.setMinimumWidth(320); window1.setMinimumHeight(240); - window1.getComponentListeners().add(new ComponentListener.Adapter() { + window1.getComponentListeners().add(new ComponentListener() { @Override public void sizeChanged(Component component, int previousWidth, int previousHeight) { window1.align(window1.getDisplay().getBounds(), HorizontalAlignment.CENTER, Modified: pivot/trunk/tests/src/org/apache/pivot/tests/issues/Pivot811.java URL: http://svn.apache.org/viewvc/pivot/trunk/tests/src/org/apache/pivot/tests/issues/Pivot811.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/tests/src/org/apache/pivot/tests/issues/Pivot811.java (original) +++ pivot/trunk/tests/src/org/apache/pivot/tests/issues/Pivot811.java Fri Jan 19 17:41:44 2018 @@ -74,14 +74,14 @@ public class Pivot811 implements Applica listView.setListData(listData); scrollPane.setView(listView); - listView.getListViewSelectionListeners().add(new ListViewSelectionListener.Adapter() { + listView.getListViewSelectionListeners().add(new ListViewSelectionListener() { @Override public void selectedItemChanged(ListView listViewArgument, Object previousSelectedItem) { System.out.println("selectedItemChanged : " + listViewArgument.getSelectedItem()); } }); - listView.getComponentMouseButtonListeners().add(new ComponentMouseButtonListener.Adapter() { + listView.getComponentMouseButtonListeners().add(new ComponentMouseButtonListener() { @Override public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) { Modified: pivot/trunk/tests/src/org/apache/pivot/tests/issues/Pivot951.java URL: http://svn.apache.org/viewvc/pivot/trunk/tests/src/org/apache/pivot/tests/issues/Pivot951.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/tests/src/org/apache/pivot/tests/issues/Pivot951.java (original) +++ pivot/trunk/tests/src/org/apache/pivot/tests/issues/Pivot951.java Fri Jan 19 17:41:44 2018 @@ -34,7 +34,7 @@ public class Pivot951 implements Applica window = new Window(); Border brd = new Border(); - brd.getComponentMouseButtonListeners().add(new ComponentMouseButtonListener.Adapter() { + brd.getComponentMouseButtonListeners().add(new ComponentMouseButtonListener() { @Override public boolean mouseClick(Component component, Button button, int x, int y, int count) { if (count == 1) { Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java (original) +++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java Fri Jan 19 17:41:44 2018 @@ -761,7 +761,7 @@ public class KitchenSink implements Appl }); this.customTableView.getComponentMouseButtonListeners().add( - new ComponentMouseButtonListener.Adapter() { + new ComponentMouseButtonListener() { @Override public boolean mouseClick(Component comp, Mouse.Button button, int x, int y, int count) { Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/BXMLExplorerDocument.java URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/BXMLExplorerDocument.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/BXMLExplorerDocument.java (original) +++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/bxmlexplorer/BXMLExplorerDocument.java Fri Jan 19 17:41:44 2018 @@ -137,7 +137,7 @@ public class BXMLExplorerDocument extend }); playgroundCardPane.getComponentMouseButtonListeners().add( - new ComponentMouseButtonListener.Adapter() { + new ComponentMouseButtonListener() { @Override public boolean mouseClick(Component component, Button button, int x, int y, int count) { Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/explorer/ComponentExplorerWindow.java URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/explorer/ComponentExplorerWindow.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/explorer/ComponentExplorerWindow.java (original) +++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/explorer/ComponentExplorerWindow.java Fri Jan 19 17:41:44 2018 @@ -175,7 +175,7 @@ public class ComponentExplorerWindow ext } }); - treeView.getComponentMouseButtonListeners().add(new ComponentMouseButtonListener.Adapter() { + treeView.getComponentMouseButtonListeners().add(new ComponentMouseButtonListener() { @Override public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) { 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=1821689&r1=1821688&r2=1821689&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 Fri Jan 19 17:41:44 2018 @@ -257,7 +257,7 @@ abstract class ComponentInspectorSkin ex section.add(textInput); Form.setLabel(textInput, key); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -297,7 +297,7 @@ abstract class ComponentInspectorSkin ex section.add(textInput); Form.setLabel(textInput, key); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -337,7 +337,7 @@ abstract class ComponentInspectorSkin ex section.add(textInput); Form.setLabel(textInput, key); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -375,7 +375,7 @@ abstract class ComponentInspectorSkin ex section.add(textInput); Form.setLabel(textInput, key); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -474,7 +474,7 @@ abstract class ComponentInspectorSkin ex textInput.setText(String.valueOf(point.x)); flowPane.add(textInput); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -508,7 +508,7 @@ abstract class ComponentInspectorSkin ex textInput.setText(String.valueOf(point.y)); flowPane.add(textInput); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -567,7 +567,7 @@ abstract class ComponentInspectorSkin ex textInput.setText(String.valueOf(dimensions.width)); flowPane.add(textInput); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -601,7 +601,7 @@ abstract class ComponentInspectorSkin ex textInput.setText(String.valueOf(dimensions.height)); flowPane.add(textInput); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -660,7 +660,7 @@ abstract class ComponentInspectorSkin ex textInput.setText(String.valueOf(limits.minimum)); flowPane.add(textInput); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -694,7 +694,7 @@ abstract class ComponentInspectorSkin ex textInput.setText(String.valueOf(limits.maximum)); flowPane.add(textInput); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -753,7 +753,7 @@ abstract class ComponentInspectorSkin ex textInput.setText(String.valueOf(insets.top)); flowPane.add(textInput); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -788,7 +788,7 @@ abstract class ComponentInspectorSkin ex textInput.setText(String.valueOf(insets.left)); flowPane.add(textInput); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -823,7 +823,7 @@ abstract class ComponentInspectorSkin ex textInput.setText(String.valueOf(insets.bottom)); flowPane.add(textInput); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -858,7 +858,7 @@ abstract class ComponentInspectorSkin ex textInput.setText(String.valueOf(insets.right)); flowPane.add(textInput); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -904,7 +904,7 @@ abstract class ComponentInspectorSkin ex textInput.setText(span == null ? "" : String.valueOf(span.start)); flowPane.add(textInput); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -940,7 +940,7 @@ abstract class ComponentInspectorSkin ex textInput.setText(span == null ? "" : String.valueOf(span.end)); flowPane.add(textInput); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -1001,7 +1001,7 @@ abstract class ComponentInspectorSkin ex textInput.setText(String.valueOf(cornerRadii.topLeft)); flowPane.add(textInput); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -1036,7 +1036,7 @@ abstract class ComponentInspectorSkin ex textInput.setText(String.valueOf(cornerRadii.topRight)); flowPane.add(textInput); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -1071,7 +1071,7 @@ abstract class ComponentInspectorSkin ex textInput.setText(String.valueOf(cornerRadii.bottomLeft)); flowPane.add(textInput); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -1106,7 +1106,7 @@ abstract class ComponentInspectorSkin ex textInput.setText(String.valueOf(cornerRadii.bottomRight)); flowPane.add(textInput); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -1152,7 +1152,7 @@ abstract class ComponentInspectorSkin ex textInput.setText(scope == null ? "" : String.valueOf(scope.start)); flowPane.add(textInput); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -1188,7 +1188,7 @@ abstract class ComponentInspectorSkin ex textInput.setText(scope == null ? "" : String.valueOf(scope.end)); flowPane.add(textInput); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { @@ -1224,7 +1224,7 @@ abstract class ComponentInspectorSkin ex textInput.setText(scope == null ? "" : String.valueOf(scope.extent)); flowPane.add(textInput); - textInput.getComponentStateListeners().add(new ComponentStateListener.Adapter() { + textInput.getComponentStateListeners().add(new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { if (!component.isFocused()) { Modified: pivot/trunk/tutorials/src/org/apache/pivot/tutorials/layout/SimpleTablePanes.java URL: http://svn.apache.org/viewvc/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/layout/SimpleTablePanes.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/tutorials/src/org/apache/pivot/tutorials/layout/SimpleTablePanes.java (original) +++ pivot/trunk/tutorials/src/org/apache/pivot/tutorials/layout/SimpleTablePanes.java Fri Jan 19 17:41:44 2018 @@ -40,7 +40,7 @@ public class SimpleTablePanes extends Wi tablePane = (TablePane) namespace.get("tablePane"); tablePane.getComponentMouseButtonListeners().add( - new ComponentMouseButtonListener.Adapter() { + new ComponentMouseButtonListener() { @Override public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) { Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraAccordionSkin.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraAccordionSkin.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraAccordionSkin.java (original) +++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraAccordionSkin.java Fri Jan 19 17:41:44 2018 @@ -310,7 +310,7 @@ public class TerraAccordionSkin extends private ClipDecorator previousSelectedPanelClipDecorator = new ClipDecorator(); private ClipDecorator selectedPanelClipDecorator = new ClipDecorator(); - private ComponentStateListener panelStateListener = new ComponentStateListener.Adapter() { + private ComponentStateListener panelStateListener = new ComponentStateListener() { @Override public void enabledChanged(Component component) { Accordion accordion = (Accordion) getComponent(); 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=1821689&r1=1821688&r2=1821689&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 Fri Jan 19 17:41:44 2018 @@ -448,7 +448,7 @@ public class TerraCalendarSkin extends C }); // Attach a listener to consume mouse clicks - ComponentMouseButtonListener spinnerMouseButtonListener = new ComponentMouseButtonListener.Adapter() { + ComponentMouseButtonListener spinnerMouseButtonListener = new ComponentMouseButtonListener() { @Override public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) { 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=1821689&r1=1821688&r2=1821689&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 Fri Jan 19 17:41:44 2018 @@ -215,7 +215,7 @@ public class TerraExpanderSkin extends E private ExpandTransition expandTransition = null; private ClipDecorator clipDecorator = new ClipDecorator(); - private ComponentMouseButtonListener titleBarMouseListener = new ComponentMouseButtonListener.Adapter() { + private ComponentMouseButtonListener titleBarMouseListener = new ComponentMouseButtonListener() { @Override public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) { boolean consumed = false; 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=1821689&r1=1821688&r2=1821689&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 Fri Jan 19 17:41:44 2018 @@ -178,13 +178,13 @@ public class TerraFileBrowserSheetSkin e }); fileBrowser.getComponentMouseButtonListeners().add( - new ComponentMouseButtonListener.Adapter() { + new ComponentMouseButtonListener() { private File file = null; @Override public boolean mouseClick(Component componentArgument, Mouse.Button button, int x, int y, int count) { - boolean consumed = super.mouseClick(componentArgument, button, x, y, count); + boolean consumed = false; FileBrowserSheet.Mode mode = fileBrowserSheet.getMode(); 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=1821689&r1=1821688&r2=1821689&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 Fri Jan 19 17:41:44 2018 @@ -899,13 +899,13 @@ public class TerraFileBrowserSkin extend }); fileTableView.getComponentMouseButtonListeners().add( - new ComponentMouseButtonListener.Adapter() { + new ComponentMouseButtonListener() { private int index = -1; @Override public boolean mouseClick(Component componentArgument, Mouse.Button button, int x, int y, int count) { - boolean consumed = super.mouseClick(componentArgument, button, x, y, count); + boolean consumed = false; if (count == 1) { index = fileTableView.getRowAt(y); 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=1821689&r1=1821688&r2=1821689&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 Fri Jan 19 17:41:44 2018 @@ -206,7 +206,7 @@ public class TerraPaletteSkin extends Wi buttonBoxPane.add(closeButton); closeButton.getComponentMouseButtonListeners().add( - new ComponentMouseButtonListener.Adapter() { + new ComponentMouseButtonListener() { @Override public boolean mouseDown(Component component, Mouse.Button button, int x, int y) { // Consume the event so we don't process it as a click on Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraRollupSkin.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraRollupSkin.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraRollupSkin.java (original) +++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraRollupSkin.java Fri Jan 19 17:41:44 2018 @@ -183,7 +183,7 @@ public class TerraRollupSkin extends Rol private ExpandTransition expandTransition = null; - private ComponentMouseButtonListener headingMouseButtonListener = new ComponentMouseButtonListener.Adapter() { + private ComponentMouseButtonListener headingMouseButtonListener = new ComponentMouseButtonListener() { @Override public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) { boolean consumed = false; Modified: pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java (original) +++ pivot/trunk/wtk-terra/src/org/apache/pivot/wtk/skin/terra/TerraSheetSkin.java Fri Jan 19 17:41:44 2018 @@ -185,7 +185,7 @@ public class TerraSheetSkin extends Wind private boolean closingResult; private boolean doingFinalClose = false; - private ComponentListener ownerListener = new ComponentListener.Adapter() { + private ComponentListener ownerListener = new ComponentListener() { @Override public void locationChanged(Component component, int previousX, int previousY) { alignToOwner(); 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=1821689&r1=1821688&r2=1821689&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 Fri Jan 19 17:41:44 2018 @@ -93,7 +93,7 @@ public class TerraSuggestionPopupSkin ex } }; - private ComponentStateListener textInputStateListener = new ComponentStateListener.Adapter() { + private ComponentStateListener textInputStateListener = new ComponentStateListener() { @Override public void focusedChanged(Component component, Component obverseComponent) { SuggestionPopup suggestionPopup = (SuggestionPopup) getComponent(); @@ -134,7 +134,7 @@ public class TerraSuggestionPopupSkin ex } }; - private ListViewSelectionListener listViewSelectionListener = new ListViewSelectionListener.Adapter() { + private ListViewSelectionListener listViewSelectionListener = new ListViewSelectionListener() { @Override public void selectedItemChanged(ListView listViewArgument, Object previousSelectedItem) { int index = listViewArgument.getSelectedIndex(); 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=1821689&r1=1821688&r2=1821689&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 Fri Jan 19 17:41:44 2018 @@ -570,7 +570,7 @@ public class TerraTabPaneSkin extends Ta private SelectionChangeTransition selectionChangeTransition = null; private ClipDecorator clipDecorator = new ClipDecorator(); - private ComponentStateListener tabStateListener = new ComponentStateListener.Adapter() { + private ComponentStateListener tabStateListener = new ComponentStateListener() { @Override public void enabledChanged(Component component) { TabPane tabPane = (TabPane) getComponent(); 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=1821689&r1=1821688&r2=1821689&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 Fri Jan 19 17:41:44 2018 @@ -251,13 +251,13 @@ public class TerraVFSBrowserSheetSkin ex }); fileBrowser.getComponentMouseButtonListeners().add( - new ComponentMouseButtonListener.Adapter() { + new ComponentMouseButtonListener() { private FileObject file = null; @Override public boolean mouseClick(Component componentArgument, Mouse.Button button, int x, int y, int count) { - boolean consumed = super.mouseClick(componentArgument, button, x, y, count); + boolean consumed = false; VFSBrowserSheet.Mode mode = fileBrowserSheet.getMode(); 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=1821689&r1=1821688&r2=1821689&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 Fri Jan 19 17:41:44 2018 @@ -1048,13 +1048,13 @@ public class TerraVFSBrowserSkin extends }); fileTableView.getComponentMouseButtonListeners().add( - new ComponentMouseButtonListener.Adapter() { + new ComponentMouseButtonListener() { private int index = -1; @Override public boolean mouseClick(Component componentArgument, Mouse.Button button, int x, int y, int count) { - boolean consumed = super.mouseClick(componentArgument, button, x, y, count); + boolean consumed = false; if (count == 1) { index = fileTableView.getRowAt(y); Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/ColorChooserBindingListener.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/ColorChooserBindingListener.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/wtk/src/org/apache/pivot/wtk/ColorChooserBindingListener.java (original) +++ pivot/trunk/wtk/src/org/apache/pivot/wtk/ColorChooserBindingListener.java Fri Jan 19 17:41:44 2018 @@ -25,7 +25,9 @@ import org.apache.pivot.util.ListenerLis public interface ColorChooserBindingListener { /** * Color chooser binding listener adapter. + * @deprecated Since 2.1 and Java 8 the interface itself has default implementations. */ + @Deprecated public static class Adapter implements ColorChooserBindingListener { @Override public void selectedColorKeyChanged(ColorChooser colorChooser, @@ -77,7 +79,8 @@ public interface ColorChooserBindingList * @param colorChooser The color chooser that has changed. * @param previousSelectedColorKey The previous value of the selected color binding key. */ - public void selectedColorKeyChanged(ColorChooser colorChooser, String previousSelectedColorKey); + default public void selectedColorKeyChanged(ColorChooser colorChooser, String previousSelectedColorKey) { + } /** * Called when a color chooser's selected color bind type has changed. @@ -85,8 +88,9 @@ public interface ColorChooserBindingList * @param colorChooser The color chooser that has changed. * @param previousSelectedColorBindType The previous value of the selected color bind type. */ - public void selectedColorBindTypeChanged(ColorChooser colorChooser, - BindType previousSelectedColorBindType); + default public void selectedColorBindTypeChanged(ColorChooser colorChooser, + BindType previousSelectedColorBindType) { + } /** * Called when a color chooser's selected color bind mapping has changed. @@ -94,6 +98,7 @@ public interface ColorChooserBindingList * @param colorChooser The color chooser that has changed. * @param previousSelectedColorBindMapping The previous bind mapping for the selected color. */ - public void selectedColorBindMappingChanged(ColorChooser colorChooser, - ColorChooser.SelectedColorBindMapping previousSelectedColorBindMapping); + default public void selectedColorBindMappingChanged(ColorChooser colorChooser, + ColorChooser.SelectedColorBindMapping previousSelectedColorBindMapping) { + } } Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/ColorChooserButtonBindingListener.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/ColorChooserButtonBindingListener.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/wtk/src/org/apache/pivot/wtk/ColorChooserButtonBindingListener.java (original) +++ pivot/trunk/wtk/src/org/apache/pivot/wtk/ColorChooserButtonBindingListener.java Fri Jan 19 17:41:44 2018 @@ -25,7 +25,9 @@ import org.apache.pivot.util.ListenerLis public interface ColorChooserButtonBindingListener { /** * Color chooser button binding listener adapter. + * @deprecated Since 2.1 and Java 8 the interface itself has default implementations. */ + @Deprecated public static class Adapter implements ColorChooserButtonBindingListener { @Override public void selectedColorKeyChanged(ColorChooserButton colorChooserButton, @@ -78,8 +80,9 @@ public interface ColorChooserButtonBindi * @param colorChooserButton The color chooser button that has changed. * @param previousSelectedColorKey The previous binding key for the selected color. */ - public void selectedColorKeyChanged(ColorChooserButton colorChooserButton, - String previousSelectedColorKey); + default public void selectedColorKeyChanged(ColorChooserButton colorChooserButton, + String previousSelectedColorKey) { + } /** * Called when a color chooser button's selected color bind type has @@ -88,8 +91,9 @@ public interface ColorChooserButtonBindi * @param colorChooserButton The color chooser button that has changed. * @param previousSelectedColorBindType The previous bind type for the selected color. */ - public void selectedColorBindTypeChanged(ColorChooserButton colorChooserButton, - BindType previousSelectedColorBindType); + default public void selectedColorBindTypeChanged(ColorChooserButton colorChooserButton, + BindType previousSelectedColorBindType) { + } /** * Called when a color chooser button's selected color bind mapping has @@ -98,6 +102,7 @@ public interface ColorChooserButtonBindi * @param colorChooserButton The color chooser button that has changed. * @param previousSelectedColorBindMapping The previous bind mapping for the selected color. */ - public void selectedColorBindMappingChanged(ColorChooserButton colorChooserButton, - ColorChooser.SelectedColorBindMapping previousSelectedColorBindMapping); + default public void selectedColorBindMappingChanged(ColorChooserButton colorChooserButton, + ColorChooser.SelectedColorBindMapping previousSelectedColorBindMapping) { + } } Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java (original) +++ pivot/trunk/wtk/src/org/apache/pivot/wtk/Component.java Fri Jan 19 17:41:44 2018 @@ -326,223 +326,6 @@ public abstract class Component implemen } } - private static class ComponentListenerList extends ListenerList<ComponentListener> implements - ComponentListener { - @Override - public void parentChanged(Component component, Container previousParent) { - forEach(listener -> listener.parentChanged(component, previousParent)); - } - - @Override - public void sizeChanged(Component component, int previousWidth, int previousHeight) { - forEach(listener -> listener.sizeChanged(component, previousWidth, previousHeight)); - } - - @Override - public void preferredSizeChanged(Component component, int previousPreferredWidth, - int previousPreferredHeight) { - forEach(listener -> listener.preferredSizeChanged(component, previousPreferredWidth, - previousPreferredHeight)); - } - - @Override - public void widthLimitsChanged(Component component, int previousMinimumWidth, - int previousMaximumWidth) { - forEach(listener -> listener.widthLimitsChanged(component, previousMinimumWidth, previousMaximumWidth)); - } - - @Override - public void heightLimitsChanged(Component component, int previousMinimumHeight, - int previousMaximumHeight) { - forEach(listener -> listener.heightLimitsChanged(component, previousMinimumHeight, - previousMaximumHeight)); - } - - @Override - public void locationChanged(Component component, int previousX, int previousY) { - forEach(listener -> listener.locationChanged(component, previousX, previousY)); - } - - @Override - public void visibleChanged(Component component) { - forEach(listener -> listener.visibleChanged(component)); - } - - @Override - public void cursorChanged(Component component, Cursor previousCursor) { - forEach(listener -> listener.cursorChanged(component, previousCursor)); - } - - @Override - public void tooltipTextChanged(Component component, String previousTooltipText) { - forEach(listener -> listener.tooltipTextChanged(component, previousTooltipText)); - } - - @Override - public void tooltipDelayChanged(Component component, int previousTooltipDelay) { - forEach(listener -> listener.tooltipDelayChanged(component, previousTooltipDelay)); - } - - @Override - public void dragSourceChanged(Component component, DragSource previousDragSource) { - forEach(listener -> listener.dragSourceChanged(component, previousDragSource)); - } - - @Override - public void dropTargetChanged(Component component, DropTarget previousDropTarget) { - forEach(listener -> listener.dropTargetChanged(component, previousDropTarget)); - } - - @Override - public void menuHandlerChanged(Component component, MenuHandler previousMenuHandler) { - forEach(listener -> listener.menuHandlerChanged(component, previousMenuHandler)); - } - - @Override - public void nameChanged(Component component, String previousName) { - forEach(listener -> listener.nameChanged(component, previousName)); - } - } - - private static class ComponentStateListenerList extends ListenerList<ComponentStateListener> - implements ComponentStateListener { - @Override - public void enabledChanged(Component component) { - forEach(listener -> listener.enabledChanged(component)); - } - - @Override - public void focusedChanged(Component component, Component obverseComponent) { - forEach(listener -> listener.focusedChanged(component, obverseComponent)); - } - } - - private static class ComponentDecoratorListenerList extends - ListenerList<ComponentDecoratorListener> implements ComponentDecoratorListener { - @Override - public void decoratorInserted(Component component, int index) { - forEach(listener -> listener.decoratorInserted(component, index)); - } - - @Override - public void decoratorUpdated(Component component, int index, Decorator previousDecorator) { - forEach(listener -> listener.decoratorUpdated(component, index, previousDecorator)); - } - - @Override - public void decoratorsRemoved(Component component, int index, Sequence<Decorator> decorators) { - forEach(listener -> listener.decoratorsRemoved(component, index, decorators)); - } - } - - private static class ComponentStyleListenerList extends ListenerList<ComponentStyleListener> - implements ComponentStyleListener { - @Override - public void styleUpdated(Component component, String styleKey, Object previousValue) { - forEach(listener -> listener.styleUpdated(component, styleKey, previousValue)); - } - } - - private static class ComponentMouseListenerList extends ListenerList<ComponentMouseListener> - implements ComponentMouseListener { - @Override - public boolean mouseMove(Component component, int x, int y) { - BooleanResult consumed = new BooleanResult(); - - forEach(listener -> consumed.or(listener.mouseMove(component, x, y))); - - return consumed.get(); - } - - @Override - public void mouseOver(Component component) { - forEach(listener -> listener.mouseOver(component)); - } - - @Override - public void mouseOut(Component component) { - forEach(listener -> listener.mouseOut(component)); - } - } - - private static class ComponentMouseButtonListenerList extends - ListenerList<ComponentMouseButtonListener> implements ComponentMouseButtonListener { - @Override - public boolean mouseDown(Component component, Mouse.Button button, int x, int y) { - BooleanResult consumed = new BooleanResult(); - - forEach(listener -> consumed.or(listener.mouseDown(component, button, x, y))); - - return consumed.get(); - } - - @Override - public boolean mouseUp(Component component, Mouse.Button button, int x, int y) { - BooleanResult consumed = new BooleanResult(); - - forEach(listener -> consumed.or(listener.mouseUp(component, button, x, y))); - - return consumed.get(); - } - - @Override - public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) { - BooleanResult consumed = new BooleanResult(); - - forEach(listener -> consumed.or(listener.mouseClick(component, button, x, y, count))); - - return consumed.get(); - } - } - - private static class ComponentMouseWheelListenerList extends - ListenerList<ComponentMouseWheelListener> implements ComponentMouseWheelListener { - @Override - public boolean mouseWheel(Component component, Mouse.ScrollType scrollType, - int scrollAmount, int wheelRotation, int x, int y) { - BooleanResult consumed = new BooleanResult(); - - forEach(listener -> consumed.or(listener.mouseWheel(component, scrollType, scrollAmount, wheelRotation, - x, y))); - - return consumed.get(); - } - } - - private static class ComponentTooltipListenerList extends - ListenerList<ComponentTooltipListener> implements ComponentTooltipListener { - @Override - public void tooltipTriggered(Component component, int x, int y) { - forEach(listener -> listener.tooltipTriggered(component, x, y)); - } - } - - private static class ComponentDataListenerList extends ListenerList<ComponentDataListener> - implements ComponentDataListener { - @Override - public void valueAdded(Component component, String key) { - forEach(listener -> listener.valueAdded(component, key)); - } - - @Override - public void valueUpdated(Component component, String key, Object previousValue) { - forEach(listener -> listener.valueUpdated(component, key, previousValue)); - } - - @Override - public void valueRemoved(Component component, String key, Object value) { - forEach(listener -> listener.valueRemoved(component, key, value)); - } - } - - private static class ComponentClassListenerList extends ListenerList<ComponentClassListener> - implements ComponentClassListener { - @Override - public void focusedComponentChanged(Component previousFocusedComponent) { - forEach(listener -> listener.focusedComponentChanged(previousFocusedComponent)); - } - } - // The currently installed skin, or null if no skin is installed private Skin skin = null; @@ -622,16 +405,16 @@ public abstract class Component implemen private String automationID; // Event listener lists - private ComponentListenerList componentListeners = new ComponentListenerList(); - private ComponentStateListenerList componentStateListeners = new ComponentStateListenerList(); - private ComponentDecoratorListenerList componentDecoratorListeners = new ComponentDecoratorListenerList(); - private ComponentStyleListenerList componentStyleListeners = new ComponentStyleListenerList(); - private ComponentMouseListenerList componentMouseListeners = new ComponentMouseListenerList(); - private ComponentMouseButtonListenerList componentMouseButtonListeners = new ComponentMouseButtonListenerList(); - private ComponentMouseWheelListenerList componentMouseWheelListeners = new ComponentMouseWheelListenerList(); + private ComponentListener.Listeners componentListeners = new ComponentListener.Listeners(); + private ComponentStateListener.Listeners componentStateListeners = new ComponentStateListener.Listeners(); + private ComponentDecoratorListener.Listeners componentDecoratorListeners = new ComponentDecoratorListener.Listeners(); + private ComponentStyleListener.Listeners componentStyleListeners = new ComponentStyleListener.Listeners(); + private ComponentMouseListener.Listeners componentMouseListeners = new ComponentMouseListener.Listeners(); + private ComponentMouseButtonListener.Listeners componentMouseButtonListeners = new ComponentMouseButtonListener.Listeners(); + private ComponentMouseWheelListener.Listeners componentMouseWheelListeners = new ComponentMouseWheelListener.Listeners(); private ComponentKeyListener.Listeners componentKeyListeners = new ComponentKeyListener.Listeners(); - private ComponentTooltipListenerList componentTooltipListeners = new ComponentTooltipListenerList(); - private ComponentDataListenerList componentDataListeners = new ComponentDataListenerList(); + private ComponentTooltipListener.Listeners componentTooltipListeners = new ComponentTooltipListener.Listeners(); + private ComponentDataListener.Listeners componentDataListeners = new ComponentDataListener.Listeners(); // The component that currently has the focus private static Component focusedComponent = null; @@ -641,7 +424,7 @@ public abstract class Component implemen private static HashMap<String, Map<String, ?>> namedStyles = new HashMap<>(); // Class event listeners - private static ComponentClassListenerList componentClassListeners = new ComponentClassListenerList(); + private static ComponentClassListener.Listeners componentClassListeners = new ComponentClassListener.Listeners(); /** * Returns the component's automation ID. Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentClassListener.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentClassListener.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentClassListener.java (original) +++ pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentClassListener.java Fri Jan 19 17:41:44 2018 @@ -16,11 +16,24 @@ */ package org.apache.pivot.wtk; +import org.apache.pivot.util.ListenerList; + /** * Component class listener interface. */ public interface ComponentClassListener { /** + * Component class listeners. + */ + public static class Listeners extends ListenerList<ComponentClassListener> + implements ComponentClassListener { + @Override + public void focusedComponentChanged(Component previousFocusedComponent) { + forEach(listener -> listener.focusedComponentChanged(previousFocusedComponent)); + } + } + + /** * Called when the focused component changes. * * @param previousFocusedComponent The component that previously had the focus (can be {@code null}). Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentDataListener.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentDataListener.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentDataListener.java (original) +++ pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentDataListener.java Fri Jan 19 17:41:44 2018 @@ -16,13 +16,38 @@ */ package org.apache.pivot.wtk; +import org.apache.pivot.util.ListenerList; + /** * Component data listener interface. */ public interface ComponentDataListener { /** + * Component data listeners. + */ + public static class Listeners extends ListenerList<ComponentDataListener> + implements ComponentDataListener { + @Override + public void valueAdded(Component component, String key) { + forEach(listener -> listener.valueAdded(component, key)); + } + + @Override + public void valueUpdated(Component component, String key, Object previousValue) { + forEach(listener -> listener.valueUpdated(component, key, previousValue)); + } + + @Override + public void valueRemoved(Component component, String key, Object value) { + forEach(listener -> listener.valueRemoved(component, key, value)); + } + } + + /** * Component data listener adapter. + * @deprecated Since 2.1 and Java 8 the interface itself has default implementations. */ + @Deprecated public static class Adapter implements ComponentDataListener { @Override public void valueAdded(Component component, String key) { @@ -46,7 +71,8 @@ public interface ComponentDataListener { * @param component The component that has changed. * @param key The key for the key/value pair that was added to this component's data dictionary. */ - public void valueAdded(Component component, String key); + default public void valueAdded(Component component, String key) { + } /** * Called when a value has been updated in a component's user data @@ -56,7 +82,8 @@ public interface ComponentDataListener { * @param key The key for the value that has been updated. * @param previousValue The previous value for this key. */ - public void valueUpdated(Component component, String key, Object previousValue); + default public void valueUpdated(Component component, String key, Object previousValue) { + } /** * Called when a value has been removed from a component's user data @@ -66,5 +93,6 @@ public interface ComponentDataListener { * @param key The key for the key/value pair that has been removed. * @param value The corresponding value that was removed. */ - public void valueRemoved(Component component, String key, Object value); + default public void valueRemoved(Component component, String key, Object value) { + } } Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentDecoratorListener.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentDecoratorListener.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentDecoratorListener.java (original) +++ pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentDecoratorListener.java Fri Jan 19 17:41:44 2018 @@ -17,6 +17,7 @@ package org.apache.pivot.wtk; import org.apache.pivot.collections.Sequence; +import org.apache.pivot.util.ListenerList; import org.apache.pivot.wtk.effects.Decorator; /** @@ -24,8 +25,31 @@ import org.apache.pivot.wtk.effects.Deco */ public interface ComponentDecoratorListener { /** + * Component decorator listeners. + */ + public static class Listeners extends ListenerList<ComponentDecoratorListener> + implements ComponentDecoratorListener { + @Override + public void decoratorInserted(Component component, int index) { + forEach(listener -> listener.decoratorInserted(component, index)); + } + + @Override + public void decoratorUpdated(Component component, int index, Decorator previousDecorator) { + forEach(listener -> listener.decoratorUpdated(component, index, previousDecorator)); + } + + @Override + public void decoratorsRemoved(Component component, int index, Sequence<Decorator> decorators) { + forEach(listener -> listener.decoratorsRemoved(component, index, decorators)); + } + } + + /** * Component decorator list adapter. + * @deprecated Since 2.1 and Java 8 the interface itself has default implementations. */ + @Deprecated public static class Adapter implements ComponentDecoratorListener { @Override public void decoratorInserted(Component component, int index) { @@ -50,7 +74,8 @@ public interface ComponentDecoratorListe * @param component The component that has changed. * @param index The starting index of the decorator that has been inserted. */ - public void decoratorInserted(Component component, int index); + default public void decoratorInserted(Component component, int index) { + } /** * Called when a decorator has been updated in a component's decorator @@ -60,7 +85,8 @@ public interface ComponentDecoratorListe * @param index The index of the decorator that has been updated. * @param previousDecorator The previous decorator at that index. */ - public void decoratorUpdated(Component component, int index, Decorator previousDecorator); + default public void decoratorUpdated(Component component, int index, Decorator previousDecorator) { + } /** * Called when decorators have been removed from a component's decorator @@ -70,5 +96,6 @@ public interface ComponentDecoratorListe * @param index The starting index where decorators were removed. * @param decorators The complete sequence of decorators that were removed. */ - public void decoratorsRemoved(Component component, int index, Sequence<Decorator> decorators); + default public void decoratorsRemoved(Component component, int index, Sequence<Decorator> decorators) { + } } Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentListener.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentListener.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentListener.java (original) +++ pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentListener.java Fri Jan 19 17:41:44 2018 @@ -16,13 +16,98 @@ */ package org.apache.pivot.wtk; +import org.apache.pivot.util.ListenerList; + /** * Component listener interface. */ public interface ComponentListener { /** + * Component listeners. + */ + public static class Listeners extends ListenerList<ComponentListener> implements + ComponentListener { + @Override + public void parentChanged(Component component, Container previousParent) { + forEach(listener -> listener.parentChanged(component, previousParent)); + } + + @Override + public void sizeChanged(Component component, int previousWidth, int previousHeight) { + forEach(listener -> listener.sizeChanged(component, previousWidth, previousHeight)); + } + + @Override + public void preferredSizeChanged(Component component, int previousPreferredWidth, + int previousPreferredHeight) { + forEach(listener -> listener.preferredSizeChanged(component, previousPreferredWidth, + previousPreferredHeight)); + } + + @Override + public void widthLimitsChanged(Component component, int previousMinimumWidth, + int previousMaximumWidth) { + forEach(listener -> listener.widthLimitsChanged(component, previousMinimumWidth, previousMaximumWidth)); + } + + @Override + public void heightLimitsChanged(Component component, int previousMinimumHeight, + int previousMaximumHeight) { + forEach(listener -> listener.heightLimitsChanged(component, previousMinimumHeight, + previousMaximumHeight)); + } + + @Override + public void locationChanged(Component component, int previousX, int previousY) { + forEach(listener -> listener.locationChanged(component, previousX, previousY)); + } + + @Override + public void visibleChanged(Component component) { + forEach(listener -> listener.visibleChanged(component)); + } + + @Override + public void cursorChanged(Component component, Cursor previousCursor) { + forEach(listener -> listener.cursorChanged(component, previousCursor)); + } + + @Override + public void tooltipTextChanged(Component component, String previousTooltipText) { + forEach(listener -> listener.tooltipTextChanged(component, previousTooltipText)); + } + + @Override + public void tooltipDelayChanged(Component component, int previousTooltipDelay) { + forEach(listener -> listener.tooltipDelayChanged(component, previousTooltipDelay)); + } + + @Override + public void dragSourceChanged(Component component, DragSource previousDragSource) { + forEach(listener -> listener.dragSourceChanged(component, previousDragSource)); + } + + @Override + public void dropTargetChanged(Component component, DropTarget previousDropTarget) { + forEach(listener -> listener.dropTargetChanged(component, previousDropTarget)); + } + + @Override + public void menuHandlerChanged(Component component, MenuHandler previousMenuHandler) { + forEach(listener -> listener.menuHandlerChanged(component, previousMenuHandler)); + } + + @Override + public void nameChanged(Component component, String previousName) { + forEach(listener -> listener.nameChanged(component, previousName)); + } + } + + /** * Component listener adapter. + * @deprecated Since 2.1 and Java 8 the interface itself has default implementations. */ + @Deprecated public static class Adapter implements ComponentListener { @Override public void parentChanged(Component component, Container previousParent) { @@ -105,7 +190,8 @@ public interface ComponentListener { * @param component The component whose parent changed. * @param previousParent Previous parent of this component. */ - public void parentChanged(Component component, Container previousParent); + default public void parentChanged(Component component, Container previousParent) { + } /** * Called when a component's size has changed. @@ -114,7 +200,8 @@ public interface ComponentListener { * @param previousWidth Previous width of this component. * @param previousHeight Previous height of this component. */ - public void sizeChanged(Component component, int previousWidth, int previousHeight); + default public void sizeChanged(Component component, int previousWidth, int previousHeight) { + } /** * Called when a component's preferred size has changed. @@ -123,8 +210,9 @@ public interface ComponentListener { * @param previousPreferredWidth Previous value of the preferred width for this component. * @param previousPreferredHeight Previous preferred height for this component. */ - public void preferredSizeChanged(Component component, int previousPreferredWidth, - int previousPreferredHeight); + default public void preferredSizeChanged(Component component, int previousPreferredWidth, + int previousPreferredHeight) { + } /** * Called when a component's preferred width limits have changed. @@ -133,8 +221,9 @@ public interface ComponentListener { * @param previousMinimumWidth Previously specified preferred minimum width. * @param previousMaximumWidth Previous value of the preferred maximum width. */ - public void widthLimitsChanged(Component component, int previousMinimumWidth, - int previousMaximumWidth); + default public void widthLimitsChanged(Component component, int previousMinimumWidth, + int previousMaximumWidth) { + } /** * Called when a component's preferred height limits have changed. @@ -143,8 +232,9 @@ public interface ComponentListener { * @param previousMinimumHeight Previously given minimum height value. * @param previousMaximumHeight Previous maximum height value. */ - public void heightLimitsChanged(Component component, int previousMinimumHeight, - int previousMaximumHeight); + default public void heightLimitsChanged(Component component, int previousMinimumHeight, + int previousMaximumHeight) { + } /** * Called when a component's location has changed. @@ -153,14 +243,16 @@ public interface ComponentListener { * @param previousX The previous X position of the component. * @param previousY The previous Y position. */ - public void locationChanged(Component component, int previousX, int previousY); + default public void locationChanged(Component component, int previousX, int previousY) { + } /** * Called when a component's visible flag has changed. * * @param component Component that has changed visibility. */ - public void visibleChanged(Component component); + default public void visibleChanged(Component component) { + } /** * Called when a component's cursor has changed. @@ -168,7 +260,8 @@ public interface ComponentListener { * @param component Component whose cursor has changed. * @param previousCursor Previous cursor for this component. */ - public void cursorChanged(Component component, Cursor previousCursor); + default public void cursorChanged(Component component, Cursor previousCursor) { + } /** * Called when a component's tooltip text has changed. @@ -176,7 +269,8 @@ public interface ComponentListener { * @param component Component that changed. * @param previousTooltipText Previous value of this component's tooltip text. */ - public void tooltipTextChanged(Component component, String previousTooltipText); + default public void tooltipTextChanged(Component component, String previousTooltipText) { + } /** * Called when a component's tooltip delay has changed. @@ -184,7 +278,8 @@ public interface ComponentListener { * @param component The component we're dealing with. * @param previousTooltipDelay The previous tooltip delay for this component. */ - public void tooltipDelayChanged(Component component, int previousTooltipDelay); + default public void tooltipDelayChanged(Component component, int previousTooltipDelay) { + } /** * Called when a component's drag source has changed. @@ -192,7 +287,8 @@ public interface ComponentListener { * @param component The component in question. * @param previousDragSource The previous value of the {@link DragSource} for this component. */ - public void dragSourceChanged(Component component, DragSource previousDragSource); + default public void dragSourceChanged(Component component, DragSource previousDragSource) { + } /** * Called when a component's drop target has changed. @@ -200,7 +296,8 @@ public interface ComponentListener { * @param component The component that is changing. * @param previousDropTarget The previous value of the {@link DropTarget} for this component. */ - public void dropTargetChanged(Component component, DropTarget previousDropTarget); + default public void dropTargetChanged(Component component, DropTarget previousDropTarget) { + } /** * Called when a component's context menu handler has changed. @@ -208,7 +305,8 @@ public interface ComponentListener { * @param component The component that has changed. * @param previousMenuHandler The previous menu handler object for this component. */ - public void menuHandlerChanged(Component component, MenuHandler previousMenuHandler); + default public void menuHandlerChanged(Component component, MenuHandler previousMenuHandler) { + } /** * Called when a component's name has changed. @@ -216,5 +314,6 @@ public interface ComponentListener { * @param component Component whose name changed. * @param previousName Previous name for this component. */ - public void nameChanged(Component component, String previousName); + default public void nameChanged(Component component, String previousName) { + } } Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentMouseButtonListener.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentMouseButtonListener.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentMouseButtonListener.java (original) +++ pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentMouseButtonListener.java Fri Jan 19 17:41:44 2018 @@ -16,13 +16,51 @@ */ package org.apache.pivot.wtk; +import org.apache.pivot.util.BooleanResult; +import org.apache.pivot.util.ListenerList; + /** * Component mouse button listener interface. */ public interface ComponentMouseButtonListener { /** + * Component mouse button listeners. + */ + public static class Listeners extends ListenerList<ComponentMouseButtonListener> + implements ComponentMouseButtonListener { + @Override + public boolean mouseDown(Component component, Mouse.Button button, int x, int y) { + BooleanResult consumed = new BooleanResult(); + + forEach(listener -> consumed.or(listener.mouseDown(component, button, x, y))); + + return consumed.get(); + } + + @Override + public boolean mouseUp(Component component, Mouse.Button button, int x, int y) { + BooleanResult consumed = new BooleanResult(); + + forEach(listener -> consumed.or(listener.mouseUp(component, button, x, y))); + + return consumed.get(); + } + + @Override + public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) { + BooleanResult consumed = new BooleanResult(); + + forEach(listener -> consumed.or(listener.mouseClick(component, button, x, y, count))); + + return consumed.get(); + } + } + + /** * Component mouse button listener adapter. + * @deprecated Since 2.1 and Java 8 the interface itself has default implementations. */ + @Deprecated public static class Adapter implements ComponentMouseButtonListener { @Override public boolean mouseDown(Component component, Mouse.Button button, int x, int y) { @@ -48,9 +86,11 @@ public interface ComponentMouseButtonLis * @param x X position of the mouse. * @param y Y position of the mouse. * @return <tt>true</tt> to consume the event; <tt>false</tt> to allow it to - * propagate. + * propagate (default). */ - public boolean mouseDown(Component component, Mouse.Button button, int x, int y); + default public boolean mouseDown(Component component, Mouse.Button button, int x, int y) { + return false; + } /** * Called when a mouse button is released over a component. @@ -60,9 +100,11 @@ public interface ComponentMouseButtonLis * @param x X position of the mouse. * @param y Y position of the mouse. * @return <tt>true</tt> to consume the event; <tt>false</tt> to allow it to - * propagate. + * propagate (default). */ - public boolean mouseUp(Component component, Mouse.Button button, int x, int y); + default public boolean mouseUp(Component component, Mouse.Button button, int x, int y) { + return false; + } /** * Called when a mouse button is clicked over a component. @@ -73,7 +115,9 @@ public interface ComponentMouseButtonLis * @param y Y position of the mouse. * @param count Number of clicks (1 = single click, 2 = double click, etc.). * @return <tt>true</tt> to consume the event; <tt>false</tt> to allow it to - * propagate. + * propagate (default). */ - public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count); + default public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) { + return false; + } } Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentMouseListener.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentMouseListener.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentMouseListener.java (original) +++ pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentMouseListener.java Fri Jan 19 17:41:44 2018 @@ -16,12 +16,40 @@ */ package org.apache.pivot.wtk; +import org.apache.pivot.util.BooleanResult; +import org.apache.pivot.util.ListenerList; + /** * Component mouse listener interface. Component mouse events are "bubbling" and * are fired as the event propagates up the component hierarchy. */ public interface ComponentMouseListener { /** + * Component mouse listeners. + */ + public static class Listeners extends ListenerList<ComponentMouseListener> + implements ComponentMouseListener { + @Override + public boolean mouseMove(Component component, int x, int y) { + BooleanResult consumed = new BooleanResult(); + + forEach(listener -> consumed.or(listener.mouseMove(component, x, y))); + + return consumed.get(); + } + + @Override + public void mouseOver(Component component) { + forEach(listener -> listener.mouseOver(component)); + } + + @Override + public void mouseOut(Component component) { + forEach(listener -> listener.mouseOut(component)); + } + } + + /** * Component mouse button listener adapter. * @deprecated Since 2.1 and Java 8 the interface itself has default implementations. */ Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentMouseWheelListener.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentMouseWheelListener.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentMouseWheelListener.java (original) +++ pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentMouseWheelListener.java Fri Jan 19 17:41:44 2018 @@ -16,11 +16,31 @@ */ package org.apache.pivot.wtk; +import org.apache.pivot.util.BooleanResult; +import org.apache.pivot.util.ListenerList; + /** * Component mouse wheel listener interface. */ public interface ComponentMouseWheelListener { /** + * Mouse wheel listeners. + */ + public static class Listeners extends ListenerList<ComponentMouseWheelListener> + implements ComponentMouseWheelListener { + @Override + public boolean mouseWheel(Component component, Mouse.ScrollType scrollType, + int scrollAmount, int wheelRotation, int x, int y) { + BooleanResult consumed = new BooleanResult(); + + forEach(listener -> consumed.or(listener.mouseWheel(component, scrollType, scrollAmount, wheelRotation, + x, y))); + + return consumed.get(); + } + } + + /** * Called when the mouse wheel is scrolled over a component. * * @param component Component under the mouse pointer. Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentStateListener.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentStateListener.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentStateListener.java (original) +++ pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentStateListener.java Fri Jan 19 17:41:44 2018 @@ -16,13 +16,33 @@ */ package org.apache.pivot.wtk; +import org.apache.pivot.util.ListenerList; + /** * Component state listener interface. */ public interface ComponentStateListener { /** + * Component state listeners. + */ + public static class Listeners extends ListenerList<ComponentStateListener> + implements ComponentStateListener { + @Override + public void enabledChanged(Component component) { + forEach(listener -> listener.enabledChanged(component)); + } + + @Override + public void focusedChanged(Component component, Component obverseComponent) { + forEach(listener -> listener.focusedChanged(component, obverseComponent)); + } + } + + /** * Component state listener adapter. + * @deprecated Since 2.1 and Java 8 the interface itself has default implementations. */ + @Deprecated public static class Adapter implements ComponentStateListener { @Override public void enabledChanged(Component component) { @@ -44,7 +64,8 @@ public interface ComponentStateListener * * @param component The component whose enabled state is changing. */ - public void enabledChanged(Component component); + default public void enabledChanged(Component component) { + } /** * Called when a component's focused state has changed. <p> This will be @@ -59,5 +80,6 @@ public interface ComponentStateListener * component that is losing focus. If the component is losing focus this is * the component that is gaining the focus instead. */ - public void focusedChanged(Component component, Component obverseComponent); + default public void focusedChanged(Component component, Component obverseComponent) { + } } Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentStyleListener.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentStyleListener.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentStyleListener.java (original) +++ pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentStyleListener.java Fri Jan 19 17:41:44 2018 @@ -16,11 +16,24 @@ */ package org.apache.pivot.wtk; +import org.apache.pivot.util.ListenerList; + /** * Component style listener interface. */ public interface ComponentStyleListener { /** + * Component style listeners. + */ + public static class Listeners extends ListenerList<ComponentStyleListener> + implements ComponentStyleListener { + @Override + public void styleUpdated(Component component, String styleKey, Object previousValue) { + forEach(listener -> listener.styleUpdated(component, styleKey, previousValue)); + } + } + + /** * Called when a component style has been updated. * * @param component Component the style belongs to Modified: pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentTooltipListener.java URL: http://svn.apache.org/viewvc/pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentTooltipListener.java?rev=1821689&r1=1821688&r2=1821689&view=diff ============================================================================== --- pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentTooltipListener.java (original) +++ pivot/trunk/wtk/src/org/apache/pivot/wtk/ComponentTooltipListener.java Fri Jan 19 17:41:44 2018 @@ -16,11 +16,24 @@ */ package org.apache.pivot.wtk; +import org.apache.pivot.util.ListenerList; + /** * Component tooltip listener interface. */ public interface ComponentTooltipListener { /** + * Component tooltip listeners. + */ + public static class Listeners extends ListenerList<ComponentTooltipListener> + implements ComponentTooltipListener { + @Override + public void tooltipTriggered(Component component, int x, int y) { + forEach(listener -> listener.tooltipTriggered(component, x, y)); + } + } + + /** * Called when a tooltip has been triggered over a component. * * @param component The component in question.