1 /*
   2  * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package javax.swing.colorchooser;
  27 
  28 import javax.swing.*;
  29 import javax.swing.border.*;
  30 import javax.swing.event.*;
  31 import java.awt.*;
  32 import java.awt.image.*;
  33 import java.awt.event.*;
  34 import java.beans.PropertyChangeEvent;
  35 import java.beans.PropertyChangeListener;
  36 import java.io.Serializable;
  37 import javax.accessibility.*;
  38 
  39 
  40 /**
  41  * The standard color swatch chooser.
  42  * <p>
  43  * <strong>Warning:</strong>
  44  * Serialized objects of this class will not be compatible with
  45  * future Swing releases. The current serialization support is
  46  * appropriate for short term storage or RMI between applications running
  47  * the same version of Swing.  As of 1.4, support for long term storage
  48  * of all JavaBeans&trade;
  49  * has been added to the <code>java.beans</code> package.
  50  * Please see {@link java.beans.XMLEncoder}.
  51  *
  52  * @author Steve Wilson
  53  */
  54 @SuppressWarnings("serial") // Same-version serialization only
  55 class DefaultSwatchChooserPanel extends AbstractColorChooserPanel {
  56 
  57     SwatchPanel swatchPanel;
  58     RecentSwatchPanel recentSwatchPanel;
  59     MouseListener mainSwatchListener;
  60     MouseListener recentSwatchListener;
  61     private KeyListener mainSwatchKeyListener;
  62     private KeyListener recentSwatchKeyListener;
  63 
  64     public DefaultSwatchChooserPanel() {
  65         super();
  66         setInheritsPopupMenu(true);
  67     }
  68 
  69     public String getDisplayName() {
  70         return UIManager.getString("ColorChooser.swatchesNameText", getLocale());
  71     }
  72 
  73     /**
  74      * Provides a hint to the look and feel as to the
  75      * <code>KeyEvent.VK</code> constant that can be used as a mnemonic to
  76      * access the panel. A return value <= 0 indicates there is no mnemonic.
  77      * <p>
  78      * The return value here is a hint, it is ultimately up to the look
  79      * and feel to honor the return value in some meaningful way.
  80      * <p>
  81      * This implementation looks up the value from the default
  82      * <code>ColorChooser.swatchesMnemonic</code>, or if it
  83      * isn't available (or not an <code>Integer</code>) returns -1.
  84      * The lookup for the default is done through the <code>UIManager</code>:
  85      * <code>UIManager.get("ColorChooser.swatchesMnemonic");</code>.
  86      *
  87      * @return KeyEvent.VK constant identifying the mnemonic; <= 0 for no
  88      *         mnemonic
  89      * @see #getDisplayedMnemonicIndex
  90      * @since 1.4
  91      */
  92     public int getMnemonic() {
  93         return getInt("ColorChooser.swatchesMnemonic", -1);
  94     }
  95 
  96     /**
  97      * Provides a hint to the look and feel as to the index of the character in
  98      * <code>getDisplayName</code> that should be visually identified as the
  99      * mnemonic. The look and feel should only use this if
 100      * <code>getMnemonic</code> returns a value > 0.
 101      * <p>
 102      * The return value here is a hint, it is ultimately up to the look
 103      * and feel to honor the return value in some meaningful way. For example,
 104      * a look and feel may wish to render each
 105      * <code>AbstractColorChooserPanel</code> in a <code>JTabbedPane</code>,
 106      * and further use this return value to underline a character in
 107      * the <code>getDisplayName</code>.
 108      * <p>
 109      * This implementation looks up the value from the default
 110      * <code>ColorChooser.rgbDisplayedMnemonicIndex</code>, or if it
 111      * isn't available (or not an <code>Integer</code>) returns -1.
 112      * The lookup for the default is done through the <code>UIManager</code>:
 113      * <code>UIManager.get("ColorChooser.swatchesDisplayedMnemonicIndex");</code>.
 114      *
 115      * @return Character index to render mnemonic for; -1 to provide no
 116      *                   visual identifier for this panel.
 117      * @see #getMnemonic
 118      * @since 1.4
 119      */
 120     public int getDisplayedMnemonicIndex() {
 121         return getInt("ColorChooser.swatchesDisplayedMnemonicIndex", -1);
 122     }
 123 
 124     public Icon getSmallDisplayIcon() {
 125         return null;
 126     }
 127 
 128     public Icon getLargeDisplayIcon() {
 129         return null;
 130     }
 131 
 132     /**
 133      * The background color, foreground color, and font are already set to the
 134      * defaults from the defaults table before this method is called.
 135      */
 136     public void installChooserPanel(JColorChooser enclosingChooser) {
 137         super.installChooserPanel(enclosingChooser);
 138     }
 139 
 140     protected void buildChooser() {
 141 
 142         String recentStr = UIManager.getString("ColorChooser.swatchesRecentText", getLocale());
 143 
 144         GridBagLayout gb = new GridBagLayout();
 145         GridBagConstraints gbc = new GridBagConstraints();
 146         JPanel superHolder = new JPanel(gb);
 147 
 148         swatchPanel =  new MainSwatchPanel();
 149         swatchPanel.putClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY,
 150                                       getDisplayName());
 151         swatchPanel.setInheritsPopupMenu(true);
 152 
 153         recentSwatchPanel = new RecentSwatchPanel();
 154         recentSwatchPanel.putClientProperty(AccessibleContext.ACCESSIBLE_NAME_PROPERTY,
 155                                             recentStr);
 156 
 157         mainSwatchKeyListener = new MainSwatchKeyListener();
 158         mainSwatchListener = new MainSwatchListener();
 159         swatchPanel.addMouseListener(mainSwatchListener);
 160         swatchPanel.addKeyListener(mainSwatchKeyListener);
 161         recentSwatchListener = new RecentSwatchListener();
 162         recentSwatchKeyListener = new RecentSwatchKeyListener();
 163         recentSwatchPanel.addMouseListener(recentSwatchListener);
 164         recentSwatchPanel.addKeyListener(recentSwatchKeyListener);
 165 
 166         JPanel mainHolder = new JPanel(new BorderLayout());
 167         Border border = new CompoundBorder( new LineBorder(Color.black),
 168                                             new LineBorder(Color.white) );
 169         mainHolder.setBorder(border);
 170         mainHolder.add(swatchPanel, BorderLayout.CENTER);
 171 
 172         gbc.anchor = GridBagConstraints.LAST_LINE_START;
 173         gbc.gridwidth = 1;
 174         gbc.gridheight = 2;
 175         Insets oldInsets = gbc.insets;
 176         gbc.insets = new Insets(0, 0, 0, 10);
 177         superHolder.add(mainHolder, gbc);
 178         gbc.insets = oldInsets;
 179 
 180         recentSwatchPanel.setInheritsPopupMenu(true);
 181         JPanel recentHolder = new JPanel( new BorderLayout() );
 182         recentHolder.setBorder(border);
 183         recentHolder.setInheritsPopupMenu(true);
 184         recentHolder.add(recentSwatchPanel, BorderLayout.CENTER);
 185 
 186         JLabel l = new JLabel(recentStr);
 187         l.setLabelFor(recentSwatchPanel);
 188 
 189         gbc.gridwidth = GridBagConstraints.REMAINDER;
 190         gbc.gridheight = 1;
 191         gbc.weighty = 1.0;
 192         superHolder.add(l, gbc);
 193 
 194         gbc.weighty = 0;
 195         gbc.gridheight = GridBagConstraints.REMAINDER;
 196         gbc.insets = new Insets(0, 0, 0, 2);
 197         superHolder.add(recentHolder, gbc);
 198         superHolder.setInheritsPopupMenu(true);
 199 
 200         add(superHolder);
 201     }
 202 
 203     public void uninstallChooserPanel(JColorChooser enclosingChooser) {
 204         super.uninstallChooserPanel(enclosingChooser);
 205         swatchPanel.removeMouseListener(mainSwatchListener);
 206         swatchPanel.removeKeyListener(mainSwatchKeyListener);
 207         recentSwatchPanel.removeMouseListener(recentSwatchListener);
 208         recentSwatchPanel.removeKeyListener(recentSwatchKeyListener);
 209 
 210         swatchPanel = null;
 211         recentSwatchPanel = null;
 212         mainSwatchListener = null;
 213         mainSwatchKeyListener = null;
 214         recentSwatchListener = null;
 215         recentSwatchKeyListener = null;
 216 
 217         removeAll();  // strip out all the sub-components
 218     }
 219 
 220     public void updateChooser() {
 221 
 222     }
 223 
 224 
 225     private class RecentSwatchKeyListener extends KeyAdapter {
 226         public void keyPressed(KeyEvent e) {
 227             if (KeyEvent.VK_SPACE == e.getKeyCode()) {
 228                 Color color = recentSwatchPanel.getSelectedColor();
 229                 setSelectedColor(color);
 230             }
 231         }
 232     }
 233 
 234     private class MainSwatchKeyListener extends KeyAdapter {
 235         public void keyPressed(KeyEvent e) {
 236             if (KeyEvent.VK_SPACE == e.getKeyCode()) {
 237                 Color color = swatchPanel.getSelectedColor();
 238                 setSelectedColor(color);
 239                 recentSwatchPanel.setMostRecentColor(color);
 240             }
 241         }
 242     }
 243 
 244     class RecentSwatchListener extends MouseAdapter implements Serializable {
 245         public void mousePressed(MouseEvent e) {
 246             if (isEnabled()) {
 247                 Color color = recentSwatchPanel.getColorForLocation(e.getX(), e.getY());
 248                 recentSwatchPanel.setSelectedColorFromLocation(e.getX(), e.getY());
 249                 setSelectedColor(color);
 250                 recentSwatchPanel.requestFocusInWindow();
 251             }
 252         }
 253     }
 254 
 255     class MainSwatchListener extends MouseAdapter implements Serializable {
 256         public void mousePressed(MouseEvent e) {
 257             if (isEnabled()) {
 258                 Color color = swatchPanel.getColorForLocation(e.getX(), e.getY());
 259                 setSelectedColor(color);
 260                 swatchPanel.setSelectedColorFromLocation(e.getX(), e.getY());
 261                 recentSwatchPanel.setMostRecentColor(color);
 262                 swatchPanel.requestFocusInWindow();
 263             }
 264         }
 265     }
 266 
 267 }
 268 
 269 
 270 
 271 class SwatchPanel extends JPanel {
 272 
 273     protected Color[] colors;
 274     protected Dimension swatchSize;
 275     protected Dimension numSwatches;
 276     protected Dimension gap;
 277 
 278     private int selRow;
 279     private int selCol;
 280 
 281     public SwatchPanel() {
 282         initValues();
 283         initColors();
 284         setToolTipText(""); // register for events
 285         setOpaque(true);
 286         setBackground(Color.white);
 287         setFocusable(true);
 288         setInheritsPopupMenu(true);
 289 
 290         addFocusListener(new FocusAdapter() {
 291             public void focusGained(FocusEvent e) {
 292                 repaint();
 293             }
 294 
 295             public void focusLost(FocusEvent e) {
 296                 repaint();
 297             }
 298         });
 299 
 300         addKeyListener(new KeyAdapter() {
 301             public void keyPressed(KeyEvent e) {
 302                 int typed = e.getKeyCode();
 303                 switch (typed) {
 304                     case KeyEvent.VK_UP:
 305                         if (selRow > 0) {
 306                             selRow--;
 307                             repaint();
 308                         }
 309                         break;
 310                     case KeyEvent.VK_DOWN:
 311                         if (selRow < numSwatches.height - 1) {
 312                             selRow++;
 313                             repaint();
 314                         }
 315                         break;
 316                     case KeyEvent.VK_LEFT:
 317                         if (selCol > 0 && SwatchPanel.this.getComponentOrientation().isLeftToRight()) {
 318                             selCol--;
 319                             repaint();
 320                         } else if (selCol < numSwatches.width - 1
 321                                 && !SwatchPanel.this.getComponentOrientation().isLeftToRight()) {
 322                             selCol++;
 323                             repaint();
 324                         }
 325                         break;
 326                     case KeyEvent.VK_RIGHT:
 327                         if (selCol < numSwatches.width - 1
 328                                 && SwatchPanel.this.getComponentOrientation().isLeftToRight()) {
 329                             selCol++;
 330                             repaint();
 331                         } else if (selCol > 0 && !SwatchPanel.this.getComponentOrientation().isLeftToRight()) {
 332                             selCol--;
 333                             repaint();
 334                         }
 335                         break;
 336                     case KeyEvent.VK_HOME:
 337                         selCol = 0;
 338                         selRow = 0;
 339                         repaint();
 340                         break;
 341                     case KeyEvent.VK_END:
 342                         selCol = numSwatches.width - 1;
 343                         selRow = numSwatches.height - 1;
 344                         repaint();
 345                         break;
 346                 }
 347             }
 348         });
 349     }
 350 
 351     public Color getSelectedColor() {
 352         return getColorForCell(selCol, selRow);
 353     }
 354 
 355     protected void initValues() {
 356 
 357     }
 358 
 359     public void paintComponent(Graphics g) {
 360          g.setColor(getBackground());
 361          g.fillRect(0,0,getWidth(), getHeight());
 362          for (int row = 0; row < numSwatches.height; row++) {
 363             int y = row * (swatchSize.height + gap.height);
 364             for (int column = 0; column < numSwatches.width; column++) {
 365                 Color c = getColorForCell(column, row);
 366                 g.setColor(c);
 367                 int x;
 368                 if (!this.getComponentOrientation().isLeftToRight()) {
 369                     x = (numSwatches.width - column - 1) * (swatchSize.width + gap.width);
 370                 } else {
 371                     x = column * (swatchSize.width + gap.width);
 372                 }
 373                 g.fillRect( x, y, swatchSize.width, swatchSize.height);
 374                 g.setColor(Color.black);
 375                 g.drawLine( x+swatchSize.width-1, y, x+swatchSize.width-1, y+swatchSize.height-1);
 376                 g.drawLine( x, y+swatchSize.height-1, x+swatchSize.width-1, y+swatchSize.height-1);
 377 
 378                 if (selRow == row && selCol == column && this.isFocusOwner()) {
 379                     Color c2 = new Color(c.getRed() < 125 ? 255 : 0,
 380                             c.getGreen() < 125 ? 255 : 0,
 381                             c.getBlue() < 125 ? 255 : 0);
 382                     g.setColor(c2);
 383 
 384                     g.drawLine(x, y, x + swatchSize.width - 1, y);
 385                     g.drawLine(x, y, x, y + swatchSize.height - 1);
 386                     g.drawLine(x + swatchSize.width - 1, y, x + swatchSize.width - 1, y + swatchSize.height - 1);
 387                     g.drawLine(x, y + swatchSize.height - 1, x + swatchSize.width - 1, y + swatchSize.height - 1);
 388                     g.drawLine(x, y, x + swatchSize.width - 1, y + swatchSize.height - 1);
 389                     g.drawLine(x, y + swatchSize.height - 1, x + swatchSize.width - 1, y);
 390                 }
 391             }
 392          }
 393     }
 394 
 395     public Dimension getPreferredSize() {
 396         int x = numSwatches.width * (swatchSize.width + gap.width) - 1;
 397         int y = numSwatches.height * (swatchSize.height + gap.height) - 1;
 398         return new Dimension( x, y );
 399     }
 400 
 401     protected void initColors() {
 402 
 403 
 404     }
 405 
 406     public String getToolTipText(MouseEvent e) {
 407         Color color = getColorForLocation(e.getX(), e.getY());
 408         return color.getRed()+", "+ color.getGreen() + ", " + color.getBlue();
 409     }
 410 
 411     public void setSelectedColorFromLocation(int x, int y) {
 412         if (!this.getComponentOrientation().isLeftToRight()) {
 413             selCol = numSwatches.width - x / (swatchSize.width + gap.width) - 1;
 414         } else {
 415             selCol = x / (swatchSize.width + gap.width);
 416         }
 417         selRow = y / (swatchSize.height + gap.height);
 418         repaint();
 419     }
 420 
 421     public Color getColorForLocation( int x, int y ) {
 422         int column;
 423         if (!this.getComponentOrientation().isLeftToRight()) {
 424             column = numSwatches.width - x / (swatchSize.width + gap.width) - 1;
 425         } else {
 426             column = x / (swatchSize.width + gap.width);
 427         }
 428         int row = y / (swatchSize.height + gap.height);
 429         return getColorForCell(column, row);
 430     }
 431 
 432     private Color getColorForCell( int column, int row) {
 433         return colors[ (row * numSwatches.width) + column ]; // (STEVE) - change data orientation here
 434     }
 435 
 436 
 437 
 438 
 439 }
 440 
 441 class RecentSwatchPanel extends SwatchPanel {
 442     protected void initValues() {
 443         swatchSize = UIManager.getDimension("ColorChooser.swatchesRecentSwatchSize", getLocale());
 444         numSwatches = new Dimension( 5, 7 );
 445         gap = new Dimension(1, 1);
 446     }
 447 
 448 
 449     protected void initColors() {
 450         Color defaultRecentColor = UIManager.getColor("ColorChooser.swatchesDefaultRecentColor", getLocale());
 451         int numColors = numSwatches.width * numSwatches.height;
 452 
 453         colors = new Color[numColors];
 454         for (int i = 0; i < numColors ; i++) {
 455             colors[i] = defaultRecentColor;
 456         }
 457     }
 458 
 459     public void setMostRecentColor(Color c) {
 460 
 461         System.arraycopy( colors, 0, colors, 1, colors.length-1);
 462         colors[0] = c;
 463         repaint();
 464     }
 465 
 466 }
 467 
 468 class MainSwatchPanel extends SwatchPanel {
 469 
 470 
 471     protected void initValues() {
 472         swatchSize = UIManager.getDimension("ColorChooser.swatchesSwatchSize", getLocale());
 473         numSwatches = new Dimension( 31, 9 );
 474         gap = new Dimension(1, 1);
 475     }
 476 
 477     protected void initColors() {
 478         int[] rawValues = initRawValues();
 479         int numColors = rawValues.length / 3;
 480 
 481         colors = new Color[numColors];
 482         for (int i = 0; i < numColors ; i++) {
 483             colors[i] = new Color( rawValues[(i*3)], rawValues[(i*3)+1], rawValues[(i*3)+2] );
 484         }
 485     }
 486 
 487     private int[] initRawValues() {
 488 
 489         int[] rawValues = {
 490 255, 255, 255, // first row.
 491 204, 255, 255,
 492 204, 204, 255,
 493 204, 204, 255,
 494 204, 204, 255,
 495 204, 204, 255,
 496 204, 204, 255,
 497 204, 204, 255,
 498 204, 204, 255,
 499 204, 204, 255,
 500 204, 204, 255,
 501 255, 204, 255,
 502 255, 204, 204,
 503 255, 204, 204,
 504 255, 204, 204,
 505 255, 204, 204,
 506 255, 204, 204,
 507 255, 204, 204,
 508 255, 204, 204,
 509 255, 204, 204,
 510 255, 204, 204,
 511 255, 255, 204,
 512 204, 255, 204,
 513 204, 255, 204,
 514 204, 255, 204,
 515 204, 255, 204,
 516 204, 255, 204,
 517 204, 255, 204,
 518 204, 255, 204,
 519 204, 255, 204,
 520 204, 255, 204,
 521 204, 204, 204,  // second row.
 522 153, 255, 255,
 523 153, 204, 255,
 524 153, 153, 255,
 525 153, 153, 255,
 526 153, 153, 255,
 527 153, 153, 255,
 528 153, 153, 255,
 529 153, 153, 255,
 530 153, 153, 255,
 531 204, 153, 255,
 532 255, 153, 255,
 533 255, 153, 204,
 534 255, 153, 153,
 535 255, 153, 153,
 536 255, 153, 153,
 537 255, 153, 153,
 538 255, 153, 153,
 539 255, 153, 153,
 540 255, 153, 153,
 541 255, 204, 153,
 542 255, 255, 153,
 543 204, 255, 153,
 544 153, 255, 153,
 545 153, 255, 153,
 546 153, 255, 153,
 547 153, 255, 153,
 548 153, 255, 153,
 549 153, 255, 153,
 550 153, 255, 153,
 551 153, 255, 204,
 552 204, 204, 204,  // third row
 553 102, 255, 255,
 554 102, 204, 255,
 555 102, 153, 255,
 556 102, 102, 255,
 557 102, 102, 255,
 558 102, 102, 255,
 559 102, 102, 255,
 560 102, 102, 255,
 561 153, 102, 255,
 562 204, 102, 255,
 563 255, 102, 255,
 564 255, 102, 204,
 565 255, 102, 153,
 566 255, 102, 102,
 567 255, 102, 102,
 568 255, 102, 102,
 569 255, 102, 102,
 570 255, 102, 102,
 571 255, 153, 102,
 572 255, 204, 102,
 573 255, 255, 102,
 574 204, 255, 102,
 575 153, 255, 102,
 576 102, 255, 102,
 577 102, 255, 102,
 578 102, 255, 102,
 579 102, 255, 102,
 580 102, 255, 102,
 581 102, 255, 153,
 582 102, 255, 204,
 583 153, 153, 153, // fourth row
 584 51, 255, 255,
 585 51, 204, 255,
 586 51, 153, 255,
 587 51, 102, 255,
 588 51, 51, 255,
 589 51, 51, 255,
 590 51, 51, 255,
 591 102, 51, 255,
 592 153, 51, 255,
 593 204, 51, 255,
 594 255, 51, 255,
 595 255, 51, 204,
 596 255, 51, 153,
 597 255, 51, 102,
 598 255, 51, 51,
 599 255, 51, 51,
 600 255, 51, 51,
 601 255, 102, 51,
 602 255, 153, 51,
 603 255, 204, 51,
 604 255, 255, 51,
 605 204, 255, 51,
 606 153, 255, 51,
 607 102, 255, 51,
 608 51, 255, 51,
 609 51, 255, 51,
 610 51, 255, 51,
 611 51, 255, 102,
 612 51, 255, 153,
 613 51, 255, 204,
 614 153, 153, 153, // Fifth row
 615 0, 255, 255,
 616 0, 204, 255,
 617 0, 153, 255,
 618 0, 102, 255,
 619 0, 51, 255,
 620 0, 0, 255,
 621 51, 0, 255,
 622 102, 0, 255,
 623 153, 0, 255,
 624 204, 0, 255,
 625 255, 0, 255,
 626 255, 0, 204,
 627 255, 0, 153,
 628 255, 0, 102,
 629 255, 0, 51,
 630 255, 0 , 0,
 631 255, 51, 0,
 632 255, 102, 0,
 633 255, 153, 0,
 634 255, 204, 0,
 635 255, 255, 0,
 636 204, 255, 0,
 637 153, 255, 0,
 638 102, 255, 0,
 639 51, 255, 0,
 640 0, 255, 0,
 641 0, 255, 51,
 642 0, 255, 102,
 643 0, 255, 153,
 644 0, 255, 204,
 645 102, 102, 102, // sixth row
 646 0, 204, 204,
 647 0, 204, 204,
 648 0, 153, 204,
 649 0, 102, 204,
 650 0, 51, 204,
 651 0, 0, 204,
 652 51, 0, 204,
 653 102, 0, 204,
 654 153, 0, 204,
 655 204, 0, 204,
 656 204, 0, 204,
 657 204, 0, 204,
 658 204, 0, 153,
 659 204, 0, 102,
 660 204, 0, 51,
 661 204, 0, 0,
 662 204, 51, 0,
 663 204, 102, 0,
 664 204, 153, 0,
 665 204, 204, 0,
 666 204, 204, 0,
 667 204, 204, 0,
 668 153, 204, 0,
 669 102, 204, 0,
 670 51, 204, 0,
 671 0, 204, 0,
 672 0, 204, 51,
 673 0, 204, 102,
 674 0, 204, 153,
 675 0, 204, 204,
 676 102, 102, 102, // seventh row
 677 0, 153, 153,
 678 0, 153, 153,
 679 0, 153, 153,
 680 0, 102, 153,
 681 0, 51, 153,
 682 0, 0, 153,
 683 51, 0, 153,
 684 102, 0, 153,
 685 153, 0, 153,
 686 153, 0, 153,
 687 153, 0, 153,
 688 153, 0, 153,
 689 153, 0, 153,
 690 153, 0, 102,
 691 153, 0, 51,
 692 153, 0, 0,
 693 153, 51, 0,
 694 153, 102, 0,
 695 153, 153, 0,
 696 153, 153, 0,
 697 153, 153, 0,
 698 153, 153, 0,
 699 153, 153, 0,
 700 102, 153, 0,
 701 51, 153, 0,
 702 0, 153, 0,
 703 0, 153, 51,
 704 0, 153, 102,
 705 0, 153, 153,
 706 0, 153, 153,
 707 51, 51, 51, // eigth row
 708 0, 102, 102,
 709 0, 102, 102,
 710 0, 102, 102,
 711 0, 102, 102,
 712 0, 51, 102,
 713 0, 0, 102,
 714 51, 0, 102,
 715 102, 0, 102,
 716 102, 0, 102,
 717 102, 0, 102,
 718 102, 0, 102,
 719 102, 0, 102,
 720 102, 0, 102,
 721 102, 0, 102,
 722 102, 0, 51,
 723 102, 0, 0,
 724 102, 51, 0,
 725 102, 102, 0,
 726 102, 102, 0,
 727 102, 102, 0,
 728 102, 102, 0,
 729 102, 102, 0,
 730 102, 102, 0,
 731 102, 102, 0,
 732 51, 102, 0,
 733 0, 102, 0,
 734 0, 102, 51,
 735 0, 102, 102,
 736 0, 102, 102,
 737 0, 102, 102,
 738 0, 0, 0, // ninth row
 739 0, 51, 51,
 740 0, 51, 51,
 741 0, 51, 51,
 742 0, 51, 51,
 743 0, 51, 51,
 744 0, 0, 51,
 745 51, 0, 51,
 746 51, 0, 51,
 747 51, 0, 51,
 748 51, 0, 51,
 749 51, 0, 51,
 750 51, 0, 51,
 751 51, 0, 51,
 752 51, 0, 51,
 753 51, 0, 51,
 754 51, 0, 0,
 755 51, 51, 0,
 756 51, 51, 0,
 757 51, 51, 0,
 758 51, 51, 0,
 759 51, 51, 0,
 760 51, 51, 0,
 761 51, 51, 0,
 762 51, 51, 0,
 763 0, 51, 0,
 764 0, 51, 51,
 765 0, 51, 51,
 766 0, 51, 51,
 767 0, 51, 51,
 768 51, 51, 51 };
 769         return rawValues;
 770     }
 771 }