예제 #1
0
 private void doPopUp(MouseEvent e) {
   if (e.isPopupTrigger()) {
     this.button = (ColorIndexSupplier) e.getComponent();
     int colorIndex = button.getColorCell();
     for (int i = 0; i < groups.length; i++) {
       JMenuItem m = (JMenuItem) getSubElements()[Palette.split(colorIndex, i) + 64 * i];
       m.setSelected(true);
     }
     show(e.getComponent(), e.getX(), e.getY());
   }
 }
예제 #2
0
 private void doSelect(ActionEvent e) {
   button.setColorCell(
       Palette.combine(
           IntStream.range(0, groups.length).map(i -> findSelected(groups[i])).toArray()));
 }