I re-indented some part of TitledBorder.

2006-05-15  Roman Kennke <[EMAIL PROTECTED]>

        * javax/swing/border/TitledBorder.java
        (paintBorderWithTitle): Fixed indentation.

/Roman

-- 
“Improvement makes straight roads, but the crooked roads, without
Improvement, are roads of Genius.” - William Blake
Index: javax/swing/border/TitledBorder.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/border/TitledBorder.java,v
retrieving revision 1.15
diff -u -1 -0 -r1.15 TitledBorder.java
--- javax/swing/border/TitledBorder.java	15 May 2006 18:59:17 -0000	1.15
+++ javax/swing/border/TitledBorder.java	15 May 2006 19:15:45 -0000
@@ -33,21 +33,20 @@
 or based on this library.  If you modify this library, you may extend
 this exception to your version of the library, but you are not
 obligated to do so.  If you do not wish to do so, delete this
 exception statement from your version. */
 
 
 package javax.swing.border;
 
 import java.awt.Color;
 import java.awt.Component;
-import java.awt.ComponentOrientation;
 import java.awt.Dimension;
 import java.awt.Font;
 import java.awt.FontMetrics;
 import java.awt.Graphics;
 import java.awt.Insets;
 import java.awt.Point;
 import java.awt.Rectangle;
 
 import javax.swing.SwingUtilities;
 import javax.swing.UIManager;
@@ -610,98 +609,98 @@
                                     int width, int height,
                                     Rectangle borderRect, Point textLoc,
                                     FontMetrics fm)
   {
     Border b = getBorder();
     int fontDescent = fm.getDescent();
     int fontAscent = fm.getAscent();
     int titleWidth = fm.stringWidth(getTitle());
 
     if (b != null)
-	      {
-	        // Paint border in segments, when the title is painted above the
-	        // border.
-	        if (((titlePosition == TOP || titlePosition == DEFAULT_POSITION)
-	             && (borderRect.y > textLoc.y - fontAscent))
-	            || (titlePosition == BOTTOM
-	                && borderRect.y + borderRect.height < textLoc.y + fontDescent))
-	          {
-	            Rectangle clip = new Rectangle();
-	            Rectangle saved = g.getClipBounds();
-
-	            // Paint border left from the text.
-	            clip.setBounds(saved);
-	            SwingUtilities.computeIntersection(x, y, textLoc.x - x - 1,
-	                                               height, clip);
-	            if (! clip.isEmpty())
-	              {
-	                g.setClip(clip);
-	                b.paintBorder(c, g, borderRect.x, borderRect.y,
-	                              borderRect.width,
-	                              borderRect.height);
-	              }
-	            // Paint border right from the text.
-	            clip.setBounds(saved);
-	            SwingUtilities.computeIntersection(textLoc.x + titleWidth + 1, y,
-	                                      x + width - (textLoc.x + titleWidth +1),
-	                                      height, clip);
-	            if (! clip.isEmpty())
-	              {
-	                g.setClip(clip);
-	                b.paintBorder(c, g, borderRect.x, borderRect.y,
-	                              borderRect.width,
-	                              borderRect.height);
-	              }
-
-	            if (titlePosition == TOP || titlePosition == DEFAULT_POSITION)
-	              {
-	                // Paint border below the text.
-	                clip.setBounds(saved);
-	                SwingUtilities.computeIntersection(textLoc.x - 1,
-	                                                   textLoc.y + fontDescent,
-	                                                   titleWidth + 2,
-	                                       y + height - textLoc.y - fontDescent,
-	                                       clip);
-	                if (! clip.isEmpty())
-	                  {
-	                    g.setClip(clip);
-	                    b.paintBorder(c, g, borderRect.x, borderRect.y,
-	                                  borderRect.width,
-	                                  borderRect.height);
-	                  }
+      {
+        // Paint border in segments, when the title is painted above the
+        // border.
+        if (((titlePosition == TOP || titlePosition == DEFAULT_POSITION)
+            && (borderRect.y > textLoc.y - fontAscent))
+            || (titlePosition == BOTTOM
+                && borderRect.y + borderRect.height < textLoc.y + fontDescent))
+          {
+            Rectangle clip = new Rectangle();
+            Rectangle saved = g.getClipBounds();
+
+            // Paint border left from the text.
+            clip.setBounds(saved);
+            SwingUtilities.computeIntersection(x, y, textLoc.x - x - 1,
+                                               height, clip);
+            if (! clip.isEmpty())
+              {
+                g.setClip(clip);
+                b.paintBorder(c, g, borderRect.x, borderRect.y,
+                              borderRect.width,
+                              borderRect.height);
+              }
+            // Paint border right from the text.
+            clip.setBounds(saved);
+            SwingUtilities.computeIntersection(textLoc.x + titleWidth + 1, y,
+                                               x + width - (textLoc.x + titleWidth +1),
+                                               height, clip);
+            if (! clip.isEmpty())
+              {
+                g.setClip(clip);
+                b.paintBorder(c, g, borderRect.x, borderRect.y,
+                              borderRect.width,
+                              borderRect.height);
+              }
+
+            if (titlePosition == TOP || titlePosition == DEFAULT_POSITION)
+              {
+                // Paint border below the text.
+                clip.setBounds(saved);
+                SwingUtilities.computeIntersection(textLoc.x - 1,
+                                                   textLoc.y + fontDescent,
+                                                   titleWidth + 2,
+                                                   y + height - textLoc.y - fontDescent,
+                                                   clip);
+                if (! clip.isEmpty())
+                  {
+                    g.setClip(clip);
+                    b.paintBorder(c, g, borderRect.x, borderRect.y,
+                                  borderRect.width,
+                                  borderRect.height);
+                  }
 	                
-	              }
-	            else
-	              {
-	                // Paint border above the text.
-	                clip.setBounds(saved);
-	                SwingUtilities.computeIntersection(textLoc.x - 1, y,
-	                                                   titleWidth + 2,
-	                                       textLoc.y - fontDescent -y,
-	                                       clip);
-	                if (! clip.isEmpty())
-	                  {
-	                    g.setClip(clip);
-	                    b.paintBorder(c, g, borderRect.x, borderRect.y,
-	                                  borderRect.width,
-	                                  borderRect.height);
-	                  }
+              }
+            else
+              {
+                // Paint border above the text.
+                clip.setBounds(saved);
+                SwingUtilities.computeIntersection(textLoc.x - 1, y,
+                                                   titleWidth + 2,
+                                                   textLoc.y - fontDescent -y,
+                                                   clip);
+                if (! clip.isEmpty())
+                  {
+                    g.setClip(clip);
+                    b.paintBorder(c, g, borderRect.x, borderRect.y,
+                                  borderRect.width,
+                                  borderRect.height);
+                  }
 	                
-	              }
-	            g.setClip(saved);
-	          }
-	        else
-	          {
-	            b.paintBorder(c, g, borderRect.x, borderRect.y, borderRect.width,
-	                          borderRect.height);
-	          }
-	      }
+              }
+            g.setClip(saved);
+          }
+        else
+          {
+            b.paintBorder(c, g, borderRect.x, borderRect.y, borderRect.width,
+                          borderRect.height);
+          }
+      }
   }
 
   /**
    * Measures the width of this border.
    *
    * @param c the component whose border is to be measured.
    *
    * @return an Insets object whose <code>left</code>, <code>right</code>,
    *         <code>top</code> and <code>bottom</code> fields indicate the
    *         width of the border at the respective edge.

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

Reply via email to