ch.sahits.game.graphic.display.util
Class ClickablePolygon

java.lang.Object
  extended by ch.sahits.game.graphic.display.util.ClickablePolygon

public class ClickablePolygon
extends Object


Field Summary
private  Runnable action
           
private  NamedPolygon polygon
           
 
Constructor Summary
ClickablePolygon(NamedPolygon polygon, Runnable action)
           
 
Method Summary
 void execute()
          Execute the action associated with the polygon
 NamedPolygon getPolygon()
           
 boolean isInside(Point p)
          check if the point is inside the polygon
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

polygon

private final NamedPolygon polygon

action

private final Runnable action
Constructor Detail

ClickablePolygon

public ClickablePolygon(NamedPolygon polygon,
                        Runnable action)
Method Detail

isInside

public boolean isInside(Point p)
check if the point is inside the polygon

Parameters:
p - Point
Returns:
true if p is inside the polygon

execute

public void execute()
Execute the action associated with the polygon


getPolygon

public NamedPolygon getPolygon()


Copyright © 2011 Sahits GmbH. All Rights Reserved.