/** * Confirm that the equals method can distinguish all the required fields. */ public void testEquals() { ColorPalette p1 = new GreyPalette(); ColorPalette p2 = new GreyPalette(); assertTrue(p1.equals(p2)); }
/** * Returns the color palette. * * @return The color palette. */ public ColorPalette getColorPalette() { return this.colorPalette; }
/** * Sets the color palette. * * @param palette the new palette. */ public void setColorPalette(ColorPalette palette) { this.colorPalette = palette; }
/** * Creates a new sample. * * @param palette the palette. */ public PaletteSample(ColorPalette palette) { this.palette = palette; this.preferredSize = new Dimension(80, 18); }
/** * Returns the current palette object being displayed. * * @return The palette. */ public ColorPalette getPalette() { return this.palette; }
/** * Sets the palette object being displayed. * * @param palette the palette. */ public void setPalette(ColorPalette palette) { this.palette = palette; this.repaint(); }
/** * Returns the selected palette. * * @return The selected palette. */ public ColorPalette getSelectedPalette() { PaletteSample sample = (PaletteSample) this.selector.getSelectedItem(); return sample.getPalette(); }