Package org.emrick.project.dev
Record Class UnitsPanel.SwatchIcon
java.lang.Object
java.lang.Record
org.emrick.project.dev.UnitsPanel.SwatchIcon
- All Implemented Interfaces:
Icon
- Enclosing class:
- UnitsPanel
Small rounded color square.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateSwatchIcon(Color color) Creates an instance of aSwatchIconrecord class. -
Method Summary
Modifier and TypeMethodDescriptioncolor()Returns the value of thecolorrecord component.final booleanIndicates whether some other object is "equal to" this one.intintfinal inthashCode()Returns a hash code value for this object.voidfinal StringtoString()Returns a string representation of this record class.
-
Field Details
-
color
The field for thecolorrecord component.
-
-
Constructor Details
-
SwatchIcon
Creates an instance of aSwatchIconrecord class.- Parameters:
color- the value for thecolorrecord component
-
-
Method Details
-
paintIcon
-
getIconWidth
public int getIconWidth()- Specified by:
getIconWidthin interfaceIcon
-
getIconHeight
public int getIconHeight()- Specified by:
getIconHeightin interfaceIcon
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
color
Returns the value of thecolorrecord component.- Returns:
- the value of the
colorrecord component
-