Beispiel #1
0
 /** Creates the color choice for the given attribute. */
 protected JComboBox createColorChoice(String attribute) {
   CommandChoice choice = new CommandChoice();
   for (int i = 0; i < ColorMap.size(); i++)
     choice.addItem(
         new ChangeAttributeCommand(ColorMap.name(i), attribute, ColorMap.color(i), this));
   return choice;
 }
 /** Creates the color menu. */
 protected JMenu createColorMenu(String title, String attribute) {
   CommandMenu menu = new CommandMenu(title);
   for (int i = 0; i < ColorMap.size(); i++)
     menu.add(
         new UndoableCommand(
             new ChangeAttributeCommand(ColorMap.name(i), attribute, ColorMap.color(i), this)));
   return menu;
 }