Class Legend
java.lang.Object
|
+----Legend
- public class Legend
- extends Object
- implements DrawingObj
This is just another example implementation of the DrawingObj
interface. It creates a small Legend describing the color code used
in the drawing panel. This class has to be modified for different
application. The draw
method has to be re-implemented
to reflex a particular application. This drawing object can be added
to the drawing panel by:
drawingPanel.addDrawingObj(new Legend(x, y));
- See Also:
- ComBox, IntMatrix
-
Legend(int, int)
- Construct a legend object on the same drawing panel with the topleft
corner specified by the parameters.
-
draw(Graphics)
- This method draws the details of the legend object on the appropriate
graphical context, normally the drawing panel.
-
getX()
- Get the left most position of the legend object.
-
getY()
- Get the top most position of the legend object.
-
move(int, int)
- Move the object to the position as specified by the parameter.
Legend
public Legend(int x,
int y)
- Construct a legend object on the same drawing panel with the topleft
corner specified by the parameters.
- Parameters:
- x - Left most position of the legend object.
- y - Right most position of the legend object.
move
public void move(int x,
int y)
- Move the object to the position as specified by the parameter.
This coordinate represents the topleft corner of the object.
- Parameters:
- x - The left most position of the legend object.
- y - The right most position of the legend object.
getX
public int getX()
- Get the left most position of the legend object. This method is not
actually used. Just there for completeness when implementing the
DrawingObj
interface.
- Returns:
- The left most position of the legend object.
getY
public int getY()
- Get the top most position of the legend object. This method is not
actually used. Just there for completeness when implementing the
DrawingObj
interface.
- Returns:
- The top most position of the legend object.
draw
public void draw(Graphics g)
- This method draws the details of the legend object on the appropriate
graphical context, normally the drawing panel.
This method has to be modified for various application.