public abstract static class GraphView.CustomObject
extends java.lang.Object
GraphView.CustomString
Modifier and Type | Field and Description |
---|---|
protected java.awt.Color |
background
the background color of the object
|
protected java.awt.Color |
foreground
the foreground color of the object
|
protected int |
height
the height of the object
|
protected int |
width
the width of the object
|
protected int |
x
the x position of the object
|
protected int |
y
the y position of the object
|
Constructor and Description |
---|
GraphView.CustomObject()
Creates a new custom object at the position
(0,0) and with a width and height of 0 . |
GraphView.CustomObject(int x,
int y,
int width,
int height,
java.awt.Color background,
java.awt.Color foreground)
Creates a new custom object.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
draw(java.awt.Graphics2D g)
Draws the object.
|
java.awt.Color |
getBackground()
Gets the background color of the object.
|
java.awt.Color |
getForeground()
Gets the foreground color of the object.
|
int |
getHeight()
Gets the height of the object.
|
int |
getWidth()
Gets the width of the object.
|
int |
getX()
Gets the x position of the object.
|
int |
getY()
Gets the y position of the object.
|
void |
setBackground(java.awt.Color c)
Sets the background color of the object.
|
void |
setForeground(java.awt.Color c)
Sets the foreground color of the object.
|
void |
setHeight(int height)
Sets the height of the object.
|
void |
setWidth(int width)
Sets the width of the object.
|
void |
setX(int x)
Sets the x position of the object.
|
void |
setY(int y)
Sets the y position of the object.
|
protected int x
protected int y
protected int width
protected int height
protected java.awt.Color background
protected java.awt.Color foreground
public GraphView.CustomObject()
(0,0)
and with a width and height of 0
.public GraphView.CustomObject(int x, int y, int width, int height, java.awt.Color background, java.awt.Color foreground) throws java.lang.IllegalArgumentException
x
- the x position of the objecty
- the y position of the objectwidth
- the width of the objectheight
- the height of the objectbackground
- the background of the objectforeground
- the foreground of the objectjava.lang.IllegalArgumentException
- public int getX()
public void setX(int x)
getX()
.x
- the x position of the objectpublic int getY()
public void setY(int y)
getY()
.y
- the y position of the objectpublic int getWidth()
public void setWidth(int width)
getWidth()
.width
- the width of the objectpublic int getHeight()
public void setHeight(int height)
getHeight()
.height
- the height of the objectpublic java.awt.Color getBackground()
public void setBackground(java.awt.Color c) throws java.lang.IllegalArgumentException
c
- the background color of the objectjava.lang.IllegalArgumentException
- public java.awt.Color getForeground()
public void setForeground(java.awt.Color c) throws java.lang.IllegalArgumentException
c
- the foreground color of the objectjava.lang.IllegalArgumentException
- public abstract void draw(java.awt.Graphics2D g)
g
- the graphics context