Ejemplo n.º 1
0
 public void setDefaultColor(float alpha, geogebra.common.awt.GColor gc) {
   defaultColor = gc;
   if (gc != null)
     this.setIcon(
         GeoGebraIcon.createColorSwatchIcon(
             alpha, iconSize, geogebra.awt.GColorD.getAwtColor(gc), null));
   else this.setIcon(GeoGebraIcon.createNullSymbolIcon(iconSize.width, iconSize.height));
 }
Ejemplo n.º 2
0
 @Override
 public ImageIcon getButtonIcon() {
   ImageIcon icon = super.getButtonIcon();
   if (icon == null && this.hasSlider) {
     icon =
         GeoGebraIcon.createColorSwatchIcon(
             getSliderValue() / 100f,
             iconSize,
             geogebra.awt.GColorD.getAwtColor(defaultColor),
             null);
   }
   return icon;
 }
Ejemplo n.º 3
0
 private static ImageIcon[] getColorSwatchIcons(
     geogebra.common.awt.GColor[] colorArray, float alpha, Dimension iconSize, int colorSetType) {
   ImageIcon[] a = new ImageIcon[colorArray.length];
   for (int i = 0; i < colorArray.length; i++)
     if (colorArray[i] != null) {
       a[i] =
           GeoGebraIcon.createColorSwatchIcon(
               alpha, iconSize, geogebra.awt.GColorD.getAwtColor(colorArray[i]), null);
     } else {
       a[i] = GeoGebraIcon.createNullSymbolIcon(iconSize.width, iconSize.height);
     }
   return a;
 }