public class Attributes
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.awt.Color |
bgColor
The background color of the NetPuzlObject
|
private int |
energy
The energy of the NetPuzlObject
|
private java.awt.Color |
fgColor
The foreground color of the NetPuzlObject
|
private Image |
image
The Image of the NetPuzlObject
|
private java.lang.String |
name
The name of the NetPuzlObject
|
private java.lang.String |
text
The text of the NetPuzlObject
|
private int |
x
The x value of the NetPuzlObject
|
private int |
y
The y value of the NetPuzlObject
|
Constructor and Description |
---|
Attributes()
This constructor builds a new Attributes object without setting any of
its data members.
|
Attributes(java.lang.String name,
java.lang.String text,
int energy,
java.awt.Color bgColor,
java.awt.Color fgColor,
int x,
int y,
Image image)
Constructs an Attributes object with the given parameters
|
Modifier and Type | Method and Description |
---|---|
Attributes |
copy() |
boolean |
equals(java.lang.Object obj) |
java.awt.Color |
getBackgroundColor()
Gets the background color of this Attributes object
|
int |
getEnergy()
Gets the energy of this Attributes object
|
java.awt.Color |
getForegroundColor()
Gets the foreground color of this Attributes object
|
Image |
getImage()
Gets the image of this Attributes object
|
java.lang.String |
getName()
Gets the name of this Attributes object
|
java.lang.String |
getText()
Gets the text of this Attributes object
|
int |
getX()
Gets the x value of this Attributes object
|
int |
getY()
Gets the y value of this Attributes object
|
int |
hashCode() |
private void |
initializeAttributes(java.lang.String name,
java.lang.String text,
int energy,
java.awt.Color bgColor,
java.awt.Color fgColor,
int x,
int y,
Image image)
This method sets an Attributes value to some "default values," used for
instantiation of an Attributes object.
|
void |
setBackgroundColor(java.awt.Color bgColor)
Sets the background color of this Attributes object
|
void |
setEnergy(int energy)
Sets the energy of this Attributes object
|
void |
setForegroundColor(java.awt.Color fgColor)
Sets the foreground color of this Attributes object
|
void |
setImage(Image image)
Sets the image of this Attributes object
|
void |
setName(java.lang.String name)
Sets the name of this Attributes object
|
void |
setText(java.lang.String text)
Sets the text of this Attributes object
|
void |
setX(int x)
Sets the x value of this Attributes object
|
void |
setY(int y)
Sets the y value of this Attributes object
|
java.lang.String |
toString()
Returns a String representation of this Attributes object
|
private java.lang.String name
private java.lang.String text
private int energy
private java.awt.Color bgColor
private java.awt.Color fgColor
private int x
private int y
private Image image
public Attributes()
public Attributes(java.lang.String name, java.lang.String text, int energy, java.awt.Color bgColor, java.awt.Color fgColor, int x, int y, Image image)
name
- The name to construct this Attributes object withtext
- The text to construct this Attributes object withenergy
- The energy to construct this Attributes object withbgColor
- The background color to construct this Attributes object
withfgColor
- The foreground color to construct this Attributes object
withx
- The x value to construct this Attributes object withy
- The y value to construct this Attributes object withimage
- The Image to construct this Attributes object withpublic int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public Attributes copy()
public java.awt.Color getBackgroundColor()
public int getEnergy()
public java.awt.Color getForegroundColor()
public Image getImage()
public java.lang.String getName()
public java.lang.String getText()
public int getX()
public int getY()
private void initializeAttributes(java.lang.String name, java.lang.String text, int energy, java.awt.Color bgColor, java.awt.Color fgColor, int x, int y, Image image)
name
- The name to set this Attributes object totext
- The text to set this Attributes object toenergy
- The energy to set this Attributes object tobgColor
- The background color to set this Attributes object tofgColor
- The foreground color to set this Attributes object tox
- The x value to set this Attributes object toy
- The y value to set this Attributes object toimage
- The Image to set this Attributes object topublic void setBackgroundColor(java.awt.Color bgColor)
bgColor
- The Color to set the 'backgroundColor' attribute to.public void setEnergy(int energy)
energy
- The int to set the 'energy' attribute to.public void setForegroundColor(java.awt.Color fgColor)
fgColor
- The Color to set the 'foregroundColor' attribute to.public void setImage(Image image)
image
- The Image to set the 'image' attribute to.public void setName(java.lang.String name)
name
- The String to set the 'name' attribute to.public void setText(java.lang.String text)
text
- The String to set the 'text' attribute to.public void setX(int x)
x
- The int to set the 'x' attribute to.public void setY(int y)
y
- The int to set the 'y' attribute to.public java.lang.String toString()
toString
in class java.lang.Object