You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pivot.apache.org by gb...@apache.org on 2009/09/16 18:46:51 UTC

svn commit: r815872 - in /incubator/pivot/trunk: tutorials/src/org/apache/pivot/tutorials/ wtk/src/org/apache/pivot/wtk/ wtk/src/org/apache/pivot/wtk/content/ wtk/src/org/apache/pivot/wtk/skin/

Author: gbrown
Date: Wed Sep 16 16:46:50 2009
New Revision: 815872

URL: http://svn.apache.org/viewvc?rev=815872&view=rev
Log:
Eliminate "auxilliary" Window property.

Modified:
    incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Frame.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/MenuPopup.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Palette.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Sheet.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Tooltip.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemEditor.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCellEditor.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeEditor.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/CalendarButtonSkin.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/DisplaySkin.java
    incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ListButtonSkin.java

Modified: incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java?rev=815872&r1=815871&r2=815872&view=diff
==============================================================================
--- incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java (original)
+++ incubator/pivot/trunk/tutorials/src/org/apache/pivot/tutorials/KitchenSink.java Wed Sep 16 16:46:50 2009
@@ -827,7 +827,7 @@
                                 System.err.println(exception);
                             }
 
-                            final Alert alert = new Alert(MessageType.QUESTION, "Please select your favorite icon:",
+                            Alert alert = new Alert(MessageType.QUESTION, "Please select your favorite icon:",
                                 options, body);
                             alert.setTitle("Select Icon");
                             alert.setSelectedOption(0);
@@ -837,7 +837,7 @@
                             alert.open(window.getDisplay(), new DialogCloseListener() {
                                 @Override
                                 public void dialogClosed(Dialog dialog) {
-                                    alert.setOwner(null);
+                                    dialog.setOwner(null);
                                 }
                             });
                         } else {
@@ -875,7 +875,7 @@
                                 System.err.println(exception);
                             }
 
-                            final Prompt prompt = new Prompt(MessageType.QUESTION, "Please select your favorite icon:",
+                            Prompt prompt = new Prompt(MessageType.QUESTION, "Please select your favorite icon:",
                                 options, body);
                             prompt.setTitle("Select Icon");
                             prompt.setSelectedOption(0);
@@ -885,7 +885,7 @@
                             prompt.open(window.getDisplay(), new SheetCloseListener() {
                                 @Override
                                 public void sheetClosed(Sheet sheet) {
-                                    prompt.setOwner(null);
+                                    sheet.setOwner(null);
                                 }
                             });
                         } else {

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Frame.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Frame.java?rev=815872&r1=815871&r2=815872&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Frame.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Frame.java Wed Sep 16 16:46:50 2009
@@ -51,7 +51,7 @@
     }
 
     public Frame(String title, Component content) {
-        super(content, false);
+        super(content);
 
         setTitle(title);
         installSkin(Frame.class);
@@ -80,6 +80,12 @@
     }
 
     @Override
+    public void moveToFront() {
+        super.moveToFront();
+        requestActive();
+    }
+
+    @Override
     protected void descendantGainedFocus(Component descendant, Component previousFocusedComponent) {
         // If the focus descendant changed, walk down descendant hierarchy and
         // call configureMenuBar()

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/MenuPopup.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/MenuPopup.java?rev=815872&r1=815871&r2=815872&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/MenuPopup.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/MenuPopup.java Wed Sep 16 16:46:50 2009
@@ -74,8 +74,6 @@
     }
 
     public MenuPopup(Menu menu) {
-        super(true);
-
         setMenu(menu);
         installSkin(MenuPopup.class);
     }

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Palette.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Palette.java?rev=815872&r1=815871&r2=815872&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Palette.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Palette.java Wed Sep 16 16:46:50 2009
@@ -34,7 +34,7 @@
     }
 
     public Palette(String title, Component content) {
-        super(content, true);
+        super(content);
 
         setTitle(title);
         installSkin(Palette.class);

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Sheet.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Sheet.java?rev=815872&r1=815871&r2=815872&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Sheet.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Sheet.java Wed Sep 16 16:46:50 2009
@@ -73,7 +73,7 @@
      * The sheet's content component.
      */
     public Sheet(Component content) {
-        super(content, true);
+        super(content);
 
         installSkin(Sheet.class);
     }

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Tooltip.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Tooltip.java?rev=815872&r1=815871&r2=815872&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Tooltip.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Tooltip.java Wed Sep 16 16:46:50 2009
@@ -39,8 +39,6 @@
     private TooltipListenerList tooltipListeners = new TooltipListenerList();
 
     public Tooltip(String text) {
-        super(true);
-
         setText(text);
         installSkin(Tooltip.class);
     }

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java?rev=815872&r1=815871&r2=815872&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/Window.java Wed Sep 16 16:46:50 2009
@@ -372,8 +372,6 @@
         }
     }
 
-    private boolean auxilliary;
-
     private Window owner = null;
     private ArrayList<Window> ownedWindows = new ArrayList<Window>();
 
@@ -401,20 +399,10 @@
     private static Window activeWindow = null;
 
     public Window() {
-        this(null, false);
-    }
-
-    public Window(boolean auxilliary) {
-        this(null, auxilliary);
+        this(null);
     }
 
     public Window(Component content) {
-        this(content, false);
-    }
-
-    public Window(Component content, boolean auxilliary) {
-        this.auxilliary = auxilliary;
-
         setContent(content);
         installSkin(Window.class);
     }
@@ -494,10 +482,9 @@
 
     public void setOwner(Window owner) {
         if (owner != null
-            && !isAuxilliary()
-            && owner.isAuxilliary()) {
-            throw new IllegalArgumentException("Primary windows must have a"
-                + " primary owner.");
+            && isOpen()
+            && !owner.isOpen()) {
+            throw new IllegalArgumentException("Owner is not open.");
         }
 
         Window previousOwner = this.owner;
@@ -597,11 +584,6 @@
             throw new IllegalArgumentException("Owner is not open.");
         }
 
-        if (owner != null
-            && owner.getDisplay() != display) {
-            throw new IllegalArgumentException("Owner is opened on a different display.");
-        }
-
         if (!isOpen()) {
             opening = true;
             Vote vote = windowStateListeners.previewWindowOpen(this, display);
@@ -794,17 +776,6 @@
     }
 
     /**
-     * Returns the window's auxilliary flag. Auxilliary windows can't become
-     * active and can only own other auxilliary windows.
-     *
-     * @return
-     * <tt>true</tt> if this is an auxilliary window; <tt>false</tt>, otherwise.
-     */
-    public boolean isAuxilliary() {
-        return auxilliary;
-    }
-
-    /**
      * Returns the window's active state.
      *
      * @return
@@ -821,8 +792,7 @@
      * <tt>true</tt> if the window became active; <tt>false</tt>, otherwise.
      */
     public boolean requestActive() {
-        if (!isAuxilliary()
-            && isOpen()
+        if (isOpen()
             && isEnabled()) {
             setActiveWindow(this);
         }
@@ -971,13 +941,6 @@
         for (Window ownedWindow : sortedOwnedWindows) {
             ownedWindow.moveToFront();
         }
-
-        // Activate the window
-        if (isShowing()
-            && isEnabled()
-            && !isAuxilliary()) {
-            setActiveWindow(this);
-        }
     }
 
     /**

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemEditor.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemEditor.java?rev=815872&r1=815871&r2=815872&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemEditor.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/ListViewItemEditor.java Wed Sep 16 16:46:50 2009
@@ -200,7 +200,7 @@
         textInput.getComponentKeyListeners().add(textInputKeyHandler);
 
         // Create and open the popup
-        popup = new Window(textInput, true);
+        popup = new Window(textInput);
         popup.getWindowStateListeners().add(popupWindowStateHandler);
         popup.open(listView.getDisplay());
         reposition();

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCellEditor.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCellEditor.java?rev=815872&r1=815871&r2=815872&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCellEditor.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewCellEditor.java Wed Sep 16 16:46:50 2009
@@ -246,7 +246,7 @@
             textInput.getComponentKeyListeners().add(textInputKeyHandler);
 
             // Create and open the popup
-            popup = new Window(textInput, true);
+            popup = new Window(textInput);
             popup.getWindowStateListeners().add(popupWindowStateHandler);
             popup.open(tableView.getDisplay());
             reposition();

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java?rev=815872&r1=815871&r2=815872&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TableViewRowEditor.java Wed Sep 16 16:46:50 2009
@@ -117,8 +117,6 @@
 
         @SuppressWarnings("unchecked")
         public EditorPopup(TableView tableView, int rowIndex, int columnIndex) {
-            super(true);
-
             this.tableView = tableView;
             this.rowIndex = rowIndex;
             this.columnIndex = columnIndex;

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeEditor.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeEditor.java?rev=815872&r1=815871&r2=815872&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeEditor.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/content/TreeViewNodeEditor.java Wed Sep 16 16:46:50 2009
@@ -230,7 +230,7 @@
         textInput.setText(nodeData.getText());
         textInput.getComponentKeyListeners().add(textInputKeyHandler);
 
-        popup = new Window(textInput, true);
+        popup = new Window(textInput);
         popup.getWindowStateListeners().add(popupStateHandler);
         popup.open(treeView.getDisplay());
         reposition();

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/CalendarButtonSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/CalendarButtonSkin.java?rev=815872&r1=815871&r2=815872&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/CalendarButtonSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/CalendarButtonSkin.java Wed Sep 16 16:46:50 2009
@@ -148,7 +148,7 @@
     public CalendarButtonSkin() {
         calendar = new Calendar();
 
-        calendarPopup = new Window(true);
+        calendarPopup = new Window();
         calendarPopup.getComponentMouseButtonListeners().add(calendarPopupMouseButtonListener);
         calendarPopup.getComponentKeyListeners().add(calendarPopupKeyListener);
         calendarPopup.getWindowStateListeners().add(calendarPopupWindowStateListener);

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/DisplaySkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/DisplaySkin.java?rev=815872&r1=815871&r2=815872&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/DisplaySkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/DisplaySkin.java Wed Sep 16 16:46:50 2009
@@ -27,9 +27,6 @@
  * Display skin.
  */
 public class DisplaySkin extends ContainerSkin {
-    // Style properties
-    private boolean activeWindowFollowsMouse = false;
-
     public DisplaySkin() {
         super();
         setBackgroundColor(Color.LIGHT_GRAY);
@@ -67,31 +64,5 @@
             }
         }
     }
-
-    public boolean getActiveWindowFollowsMouse() {
-        return activeWindowFollowsMouse;
-    }
-
-    public void setActiveWindowFollowsMouse(boolean activeWindowFollowsMouse) {
-        this.activeWindowFollowsMouse = activeWindowFollowsMouse;
-    }
-
-    @Override
-    public boolean mouseMove(Component component, int x, int y) {
-        boolean consumed = super.mouseMove(component, x, y);
-
-        if (activeWindowFollowsMouse) {
-            Display display = (Display)getComponent();
-
-            Window window = (Window)display.getComponentAt(x, y);
-            if (window != null
-                && window.isEnabled()
-                && !window.isAuxilliary()) {
-                window.requestActive();
-            }
-        }
-
-        return consumed;
-    }
 }
 

Modified: incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ListButtonSkin.java
URL: http://svn.apache.org/viewvc/incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ListButtonSkin.java?rev=815872&r1=815871&r2=815872&view=diff
==============================================================================
--- incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ListButtonSkin.java (original)
+++ incubator/pivot/trunk/wtk/src/org/apache/pivot/wtk/skin/ListButtonSkin.java Wed Sep 16 16:46:50 2009
@@ -147,7 +147,7 @@
     public ListButtonSkin() {
         listView = new ListView();
 
-        listViewPopup = new Window(true);
+        listViewPopup = new Window();
         listViewPopup.getComponentMouseButtonListeners().add(listViewPopupMouseButtonListener);
         listViewPopup.getComponentKeyListeners().add(listViewPopupKeyListener);
         listViewPopup.getWindowStateListeners().add(listViewPopupWindowStateListener);