jdk/src/java.desktop/share/classes/javax/swing/plaf/metal/MetalScrollButton.java
changeset 40434 49d6193f196f
parent 25859 3317bb8137f4
equal deleted inserted replaced
40433:d0e7204495dc 40434:49d6193f196f
   126                 // Draw the arrow
   126                 // Draw the arrow
   127                 g.setColor( arrowColor );
   127                 g.setColor( arrowColor );
   128                 int startY = ((h+1) - arrowHeight) / 2;
   128                 int startY = ((h+1) - arrowHeight) / 2;
   129                 int startX = (w / 2);
   129                 int startX = (w / 2);
   130 
   130 
   131                 for (int line = 0; line < arrowHeight; line++) {
   131                 g.translate(startX, startY);
   132                     g.drawLine( startX-line, startY+line, startX +line+1, startY+line);
   132                 g.fillPolygon(new int[]{0, 1, arrowHeight + 1, -arrowHeight},
   133                 }
   133                               new int[]{0, 0, arrowHeight, arrowHeight}, 4);
       
   134                 g.translate(-startX, -startY);
   134 
   135 
   135                 if (isEnabled) {
   136                 if (isEnabled) {
   136                     g.setColor( highlightColor );
   137                     g.setColor( highlightColor );
   137 
   138 
   138                     if ( !isPressed )
   139                     if ( !isPressed )
   172                 // Draw the arrow
   173                 // Draw the arrow
   173                 g.setColor( arrowColor );
   174                 g.setColor( arrowColor );
   174 
   175 
   175                 int startY = (((h+1) - arrowHeight) / 2)+ arrowHeight-1;
   176                 int startY = (((h+1) - arrowHeight) / 2)+ arrowHeight-1;
   176                 int startX = (w / 2);
   177                 int startX = (w / 2);
   177 
   178                 g.translate(startX, startY);
   178                 for (int line = 0; line < arrowHeight; line++) {
   179                 g.fillPolygon(new int[]{0, 1, arrowHeight + 1, -arrowHeight},
   179                     g.drawLine( startX-line, startY-line, startX +line+1, startY-line);
   180                               new int[]{0, 0, -arrowHeight, -arrowHeight}, 4);
   180                 }
   181                 g.translate(-startX, -startY);
   181 
   182 
   182                 if (isEnabled) {
   183                 if (isEnabled) {
   183                     g.setColor( highlightColor );
   184                     g.setColor( highlightColor );
   184 
   185 
   185                     if ( !isPressed )
   186                     if ( !isPressed )
   218                 g.setColor( arrowColor );
   219                 g.setColor( arrowColor );
   219 
   220 
   220                 int startX = (((w+1) - arrowHeight) / 2) + arrowHeight-1;
   221                 int startX = (((w+1) - arrowHeight) / 2) + arrowHeight-1;
   221                 int startY = (h / 2);
   222                 int startY = (h / 2);
   222 
   223 
   223                 for (int line = 0; line < arrowHeight; line++) {
   224                 g.translate(startX, startY);
   224                     g.drawLine( startX-line, startY-line, startX -line, startY+line+1);
   225                 g.fillPolygon(new int[]{0, 0, -arrowHeight, -arrowHeight},
   225                 }
   226                               new int[]{0, 1, arrowHeight + 1, -arrowHeight}, 4);
       
   227                 g.translate(-startX, -startY);
   226 
   228 
   227                 if (isEnabled) {
   229                 if (isEnabled) {
   228                     g.setColor( highlightColor );
   230                     g.setColor( highlightColor );
   229 
   231 
   230                     if ( !isPressed )
   232                     if ( !isPressed )
   260                 g.setColor( arrowColor );
   262                 g.setColor( arrowColor );
   261 
   263 
   262                 int startX = (((w+1) - arrowHeight) / 2);
   264                 int startX = (((w+1) - arrowHeight) / 2);
   263                 int startY = (h / 2);
   265                 int startY = (h / 2);
   264 
   266 
   265 
   267                 g.translate(startX, startY);
   266                 for (int line = 0; line < arrowHeight; line++) {
   268                 g.fillPolygon(new int[]{0, 0, arrowHeight, arrowHeight},
   267                     g.drawLine( startX+line, startY-line, startX +line, startY+line+1);
   269                               new int[]{0, 1, arrowHeight + 1, -arrowHeight}, 4);
   268                 }
   270                 g.translate(-startX, -startY);
   269 
   271 
   270                 if (isEnabled) {
   272                 if (isEnabled) {
   271                     g.setColor( highlightColor );
   273                     g.setColor( highlightColor );
   272 
   274 
   273 
   275