fi.paatti.research.paattiapplication.views.eventview.tools
Class Clickable

java.lang.Object
  extended by fi.paatti.research.paattiapplication.views.eventview.tools.Clickable
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ContextMenu, ContextMenu.MenuItem, NodeFactory.TreeNode

public abstract class Clickable
extends Object
implements Serializable

Clickable is an abstract class that provides the functionality needed by simple clickable, rectangular items such as context menus etc. Basically a very simplified version of the Rectangle class. Clickable has just one method for checking whether a point lies inside the area.

Author:
Tapio Keränen, t.tapio.keranen@student.jyu.fi
See Also:
Serialized Form
 

Field Summary
protected  int height
           
protected  int width
           
protected  int x
           
protected  int y
           
 
Constructor Summary
Clickable()
           
 
Method Summary
 boolean contains(int x, int y)
          Checks whether or not this node contains the point at the specified location (x,y).
abstract  void paint(Graphics g)
          Paints the clickable to the graphics context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

protected int x

y

protected int y

width

protected int width

height

protected int height
Constructor Detail

Clickable

public Clickable()
Method Detail

contains

public boolean contains(int x,
                        int y)
Checks whether or not this node contains the point at the specified location (x,y).

Parameters:
x - the specified X coordinate.
y - the specified Y coordinate.
Returns:
true if the point (X,Y) is inside, otherwise false.

paint

public abstract void paint(Graphics g)
Paints the clickable to the graphics context.

Parameters:
g - the graphics context.


Copyright © 2012. All Rights Reserved.