import java.awt.Graphics; /** This class is the abstract interface for all items on the construction panel.*/ public abstract class CP_Item { /** The type of the object. 1=button 2=command 3=macro */ protected int type; /** The name of the object. */ protected String name; /** Position of the object. */ protected int x,y; /** Size of the object. */ protected int w,h; /** Returns the x-position of the object. */ public int getX() { return x; } /** Returns the y-position of the object. */ public int getY() { return y; } /** Returns the width of the object. */ public int getW() { return w; } /** Returns the height of the object. */ public int getH() { return h; } /** Returns the x-position of the port nr. "_port". */ public abstract int getPortX(int _port); /** Returns the y-position of the port nr. "_port". */ public abstract int getPortY(int _port); /** Sets the connection to another object. */ public abstract void setConnection(int _port, CP_Connection _conn); /** Gets the connection to another object. */ public abstract CP_Connection getConnection(int _port); /** Returns the type of the object. */ public int getType() { return type; } /** Sets the name of the object. */ public void setName(String _name) { name = _name; } /** Sets the position of the object. */ public void setPosition(int _x, int _y) { x = _x; y = _y; } /** Draws the object. */ public abstract void draw(Graphics g); }