Problem #1

I have these objects in my program called SpinCADPins. They are just colored circles that represent the endpoints of connections in a network diagram. I want to add tooltips to these so that the user knows what the function is of that pin by hovering the mouse over it. Read that this would be easy if the object was a JComponent. So I extended JComponent and added a JTooltip in the constructor, but it still doesn't do anything.

I'd been using drawPin() to draw the pins, read I should use paintComponent() instead. But when I did that, nothing happened. Code below is not a SSCE but it is the code of my SpinCADPin class.

Problem #2

When I developed my program (using Eclipse) I created methods for the SpinCADPins called getX() and getY(). These have the same name as functions of a JComponent. However, turns out I want to use the local function to refer to a relative position of each pin to the block it is attached to, rather than its absolute position within the JPanel. When I tried to use Eclipse to refactor/rename the local getX() and getY() to e.g. getPinX() and getPinY(), it failed with some sort of binary error. Of course I can rename them by hand as they are not used in so many different places, but I was just wondering if the problem was the result of this being a built in method of JComponent and Eclipse fails if you try to refactor one of those methods.

Java Code:
public class SpinCADPin extends JComponent implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6926516028763652131L;
	private int x_pos = -1;
	private int y_pos = -1;
	private SpinCADBlock block = null;
	private SpinCADBlock connectorBlock = null;
	private SpinCADPin connectorPin = null;	

	// the register value is assigned during code generation
	private int Register = -1;

	private Color pinColor;
	private String name = "";

	public SpinCADPin() {
		setToolTipText("Default");
		setEnabled(true);
	}

	/**
	 * @param args
	 */

	public SpinCADPin(SpinCADBlock b, String pinName, int x, int y) {
		block = b;
		name = pinName;
		setToolTipText("Default");
		setEnabled(true);
		x_pos = x;
		y_pos = y;
		setVisible(true);
		setBackground(Color.BLUE);
	}

	public void setConnection(SpinCADBlock b, SpinCADPin p) {
		connectorBlock = b;
		connectorPin = p;
	}

	public SpinCADBlock getBlockConnection() {
		return connectorBlock;
	}

	public SpinCADPin getPinConnection() {
		return connectorPin;
	}

	public void drawPinX(Graphics2D g2) {
		int size = 8;
		Ellipse2D boundingRect = new Ellipse2D.Double(block.getX() + x_pos - size/2, block.getY() + y_pos - size/2, size, size);
		g2.setColor(pinColor);
		g2.setStroke(new BasicStroke(2));
		g2.draw(boundingRect);

	}

	public void paint(Graphics2D g2) {
		int size = 8;
		setBounds(block.getX() + x_pos - size/2, block.getY() + y_pos - size/2, size, size);
//		contains(x,y);
		int x1 = getX();
		int y1 = getY();
		Ellipse2D boundingRect = new Ellipse2D.Double(block.getX() + x_pos - size/2, block.getY() + y_pos - size/2, size, size);
		g2.setColor(pinColor);
		g2.setStroke(new BasicStroke(2));
		g2.draw(boundingRect);
	}

	public int getX() {
		return x_pos;
	}

	public int getY() {
		return y_pos;
	}

	public void setColor(Color c) {
		pinColor = c;
	}

	public Color getColor() {
		return pinColor;
	}

	public void setRegister(int r) {
		Register = r;
	}

	public int getRegister() {
		return Register;
	}

	public String getName() {
		return name;
	}	

	public boolean isInputPin() {
		if(name.contains("Input")) 
			return true;
		else
			return false;
	}

	public boolean isOutputPin() {
		if(name.contains("Output")) 
			return true;
		else
			return false;
	}
}