]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2005-04-22 Roman Kennke <roman@kennke.org>
authorRoman Kennke <roman@kennke.org>
Fri, 22 Apr 2005 18:31:30 +0000 (18:31 +0000)
committerMichael Koch <mkoch@gcc.gnu.org>
Fri, 22 Apr 2005 18:31:30 +0000 (18:31 +0000)
* javax/swing/plaf/basic/BasicLookAndFeel.java
(initComponentDefaults): Changed Button.border to be
BasicBorders.getButtonBorder as it should be.

2005-04-22  Roman Kennke  <roman@kennke.org>

* javax/swing/plaf/basic/BasicTabbedPaneUI.java:
(getMaximumSize): Return (Short.MAX_VALUE, Short.MAX_VALUE) as it
should according to a mauve testcase, instead of the preferred
size.

2005-04-22  Roman Kennke  <roman@kennke.org>

* javax/swing/JMenu.java
(add): add(Component) now calls PopupMenu.insert(..) instead of
PopupMenu.add(..). add(..) is not implemented for Component,
so JComponent.add(..) is called instead, adding the component
in the wrong place.

2005-04-22  Roman Kennke  <roman@kennke.org>

* javax/swing/plaf/basic/BasicButtonListener.java
(mousePressed): replaced query to getModifiersEx with getModifiers.
This method relied on faulty behaviour in getModifierEx.
(mouseReleased): replaced query to getModifiersEx with getModifiers.
This method relied on faulty behaviour in getModifierEx.

2005-04-22  Roman Kennke  <roman@kennke.org>

* javax/swing/plaf/metal/MetalLookAndFeel.java
(getDefaults): Call addCustomEntriesToTable on the theme.

2005-04-22  Roman Kennke  <roman@kennke.org>

* javax/swing/tree/DefaultTreeSelectionModel.java
(constructor): Added implementation.
(getRowMapper): Added implementation.
(setSelectionMode): Added implementation.
(getSelectionMode): Added implementation.
(getSelectionPath): Added implementation.
(getSelectionPaths): Added implementation.
(getSelectionCount): Added implementation.
(isSelectionEmpty): Added implementation.
(getSelectionRows): Added implementation.
(getMinSelectionRow): Added implementation.
(getMaxSelectionRow): Added implementation.
(getLeadSelectionRow): Added implementation.
(getLeadSelectionPath): Added implementation.

From-SVN: r98580

libjava/ChangeLog
libjava/javax/swing/JMenu.java
libjava/javax/swing/plaf/basic/BasicButtonListener.java
libjava/javax/swing/plaf/basic/BasicLookAndFeel.java
libjava/javax/swing/plaf/basic/BasicTabbedPaneUI.java
libjava/javax/swing/plaf/metal/MetalLookAndFeel.java
libjava/javax/swing/tree/DefaultTreeSelectionModel.java

index 4fa341c1ae0f1bf8b2d8f9f2a5a9d42bd7ce1d5d..30d61c18869f2553cc79b7b657e5cdac64522673 100644 (file)
@@ -1,3 +1,54 @@
+2005-04-22  Roman Kennke  <roman@kennke.org>
+
+       * javax/swing/plaf/basic/BasicLookAndFeel.java
+       (initComponentDefaults): Changed Button.border to be
+       BasicBorders.getButtonBorder as it should be.
+
+2005-04-22  Roman Kennke  <roman@kennke.org>
+
+       * javax/swing/plaf/basic/BasicTabbedPaneUI.java:
+       (getMaximumSize): Return (Short.MAX_VALUE, Short.MAX_VALUE) as it
+       should according to a mauve testcase, instead of the preferred
+       size.
+
+2005-04-22  Roman Kennke  <roman@kennke.org>
+
+       * javax/swing/JMenu.java
+       (add): add(Component) now calls PopupMenu.insert(..) instead of
+       PopupMenu.add(..). add(..) is not implemented for Component,
+       so JComponent.add(..) is called instead, adding the component
+       in the wrong place.
+
+2005-04-22  Roman Kennke  <roman@kennke.org>
+
+       * javax/swing/plaf/basic/BasicButtonListener.java
+       (mousePressed): replaced query to getModifiersEx with getModifiers.
+       This method relied on faulty behaviour in getModifierEx.
+       (mouseReleased): replaced query to getModifiersEx with getModifiers.
+       This method relied on faulty behaviour in getModifierEx.
+
+2005-04-22  Roman Kennke  <roman@kennke.org>
+
+       * javax/swing/plaf/metal/MetalLookAndFeel.java
+       (getDefaults): Call addCustomEntriesToTable on the theme.
+
+2005-04-22  Roman Kennke  <roman@kennke.org>
+
+       * javax/swing/tree/DefaultTreeSelectionModel.java
+       (constructor): Added implementation.
+       (getRowMapper): Added implementation.
+       (setSelectionMode): Added implementation.
+       (getSelectionMode): Added implementation.
+       (getSelectionPath): Added implementation.
+       (getSelectionPaths): Added implementation.
+       (getSelectionCount): Added implementation.
+       (isSelectionEmpty): Added implementation.
+       (getSelectionRows): Added implementation.
+       (getMinSelectionRow): Added implementation.
+       (getMaxSelectionRow): Added implementation.
+       (getLeadSelectionRow): Added implementation.
+       (getLeadSelectionPath): Added implementation.
+
 2005-04-22  Casey Marshall <csm@gnu.org>
 
        * gnu/java/security/der/DERValue.java
index d9ad317a7ef8bb96e2506d85a68db32d71a5bda5..6fdf266fd33febb25c23387017a755d462c61bc6 100644 (file)
@@ -162,7 +162,8 @@ public class JMenu extends JMenuItem implements Accessible, MenuElement
    */
   public Component add(Component component)
   {
-    return popupMenu.add(component);
+    popupMenu.insert(component, -1);
+    return component;
   }
 
   /**
index 48451c2373abbf843bd44953ed9cf127617102f2..350db3bedd886f7c7c7242cc27febdec519875fc 100644 (file)
@@ -157,7 +157,7 @@ public class BasicButtonListener
       {
         AbstractButton button = (AbstractButton) e.getSource();
         ButtonModel model = button.getModel();
-        if ((e.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) != 0)
+        if (e.getButton() == MouseEvent.BUTTON1)
           {
             // It is important that these transitions happen in this order.
             model.setArmed(true);
@@ -179,7 +179,7 @@ public class BasicButtonListener
       {
         AbstractButton button = (AbstractButton) e.getSource();
         ButtonModel model = button.getModel();
-        if ((e.getModifiersEx() & InputEvent.BUTTON1_DOWN_MASK) != 0)
+        if (e.getButton() == MouseEvent.BUTTON1)
           {
             // It is important that these transitions happen in this order.
             model.setPressed(false);
index 4a0f6d757288444ccd4c27b373953586cf8439cd..562f0011e58dbf126d65d7173aa5df07a04d513c 100644 (file)
@@ -244,7 +244,14 @@ public abstract class BasicLookAndFeel extends LookAndFeel
       "AbstractUndoableEdit.redoText", "Redo",
 
       "Button.background", new ColorUIResource(Color.lightGray),
-      "Button.border", BorderUIResource.getEtchedBorderUIResource(),
+      "Button.border",
+      new UIDefaults.LazyValue() 
+      {
+        public Object createValue(UIDefaults table)
+        {
+          return BasicBorders.getButtonBorder();
+        }
+      },
       "Button.darkShadow", new ColorUIResource(Color.darkGray),
       "Button.focusInputMap", new UIDefaults.LazyInputMap(new Object[] {
         "SPACE",  "pressed",
index a533f0820aa0c205943aa921958bee62a85de6b6..c2af60f118603133594ff86bcbd0f2fa678a454a 100644 (file)
@@ -1168,8 +1168,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
    * This is a helper class that implements UIResource so it is not added as a
    * tab when an object of this class is added to the JTabbedPane.
    */
-  private static class ScrollingButton extends BasicArrowButton
-    implements UIResource
+  private class ScrollingButton extends BasicArrowButton implements UIResource
   {
     /**
      * Creates a ScrollingButton given the direction.
@@ -1682,7 +1681,7 @@ public class BasicTabbedPaneUI extends TabbedPaneUI implements SwingConstants
    */
   public Dimension getMaximumSize(JComponent c)
   {
-    return getPreferredSize(c);
+    return new Dimension(Short.MAX_VALUE, Short.MAX_VALUE);
   }
 
   /**
index db48a7492b5bee5343f5ce75e8ba45c1ed2f82b9..a55bc1b98e098d4e65671fabb0192f2fd70e1d52 100644 (file)
@@ -92,6 +92,9 @@ public class MetalLookAndFeel extends BasicLookAndFeel
     if (LAF_defaults == null)
       LAF_defaults = super.getDefaults();
 
+    // add custom theme entries to the table
+    theme.addCustomEntriesToTable(LAF_defaults);
+    
     // Returns the default values for this look and feel. 
     return LAF_defaults;
   }
index 05b9741de178b39643ce3e7555e2513e445a8837..b329875f7f443c97844cc6d87e36e5eee5459562 100644 (file)
@@ -116,7 +116,7 @@ public class DefaultTreeSelectionModel
    */
   public DefaultTreeSelectionModel()
   {
-    // TODO
+    setSelectionMode(DISCONTIGUOUS_TREE_SELECTION);
   }
 
   /**
@@ -187,7 +187,7 @@ public class DefaultTreeSelectionModel
    */
   public RowMapper getRowMapper()
   {
-    return null; // TODO
+    return rowMapper;
   }
 
   /**
@@ -202,9 +202,9 @@ public class DefaultTreeSelectionModel
    * @see {@link #CONTIGUOUS_TREE_SELECTION}
    * @see {@link #DISCONTIGUOUS_TREE_SELECTION}
    */
-  public void setSelectionMode(int value0)
+  public void setSelectionMode(int mode)
   {
-    // TODO
+    selectionMode = mode;
   }
 
   /**
@@ -219,7 +219,7 @@ public class DefaultTreeSelectionModel
    */
   public int getSelectionMode()
   {
-    return 0; // TODO
+    return selectionMode;
   }
 
   /**
@@ -311,7 +311,10 @@ public class DefaultTreeSelectionModel
    */
   public TreePath getSelectionPath()
   {
-    return null; // TODO
+    if ((selection == null) || (selection.length == 0))
+      return null;
+    else
+      return selection[0];
   }
 
   /**
@@ -321,7 +324,7 @@ public class DefaultTreeSelectionModel
    */
   public TreePath[] getSelectionPaths()
   {
-    return null; // TODO
+    return selection;
   }
 
   /**
@@ -331,7 +334,10 @@ public class DefaultTreeSelectionModel
    */
   public int getSelectionCount()
   {
-    return 0; // TODO
+    if (selection == null)
+      return 0;
+    else
+      return selection.length;
   }
 
   /**
@@ -355,7 +361,7 @@ public class DefaultTreeSelectionModel
    */
   public boolean isSelectionEmpty()
   {
-    return false; // TODO
+    return ((selection == null) || (selection.length == 0));
   }
 
   /**
@@ -432,7 +438,10 @@ public class DefaultTreeSelectionModel
    */
   public int[] getSelectionRows()
   {
-    return null; // TODO
+    if (rowMapper == null)
+      return null;
+    else
+      return rowMapper.getRowsForPaths(selection);
   }
 
   /**
@@ -442,7 +451,15 @@ public class DefaultTreeSelectionModel
    */
   public int getMinSelectionRow()
   {
-    return 0; // TODO
+    if ((rowMapper == null) || (selection == null) || (selection.length == 0))
+      return -1;
+    else {
+      int[] rows = rowMapper.getRowsForPaths(selection);
+      int minRow = Integer.MAX_VALUE;
+      for (int index = 0; index < rows.length; index++)
+        minRow = Math.min(minRow, rows[index]);
+      return minRow;
+    }
   }
 
   /**
@@ -452,7 +469,15 @@ public class DefaultTreeSelectionModel
    */
   public int getMaxSelectionRow()
   {
-    return 0; // TODO
+    if ((rowMapper == null) || (selection == null) || (selection.length == 0))
+      return -1;
+    else {
+      int[] rows = rowMapper.getRowsForPaths(selection);
+      int maxRow = -1;
+      for (int index = 0; index < rows.length; index++)
+        maxRow = Math.max(maxRow, rows[index]);
+      return maxRow;
+    }
   }
 
   /**
@@ -482,7 +507,10 @@ public class DefaultTreeSelectionModel
    */
   public int getLeadSelectionRow()
   {
-    return 0; // TODO
+    if ((rowMapper == null) || (leadPath == null))
+      return -1;
+    else
+      return rowMapper.getRowsForPaths(new TreePath[]{ leadPath })[0];
   }
 
   /**
@@ -491,7 +519,7 @@ public class DefaultTreeSelectionModel
    */
   public TreePath getLeadSelectionPath()
   {
-    return null; // TODO
+    return leadPath;
   }
 
   /**