/* $Id: MemoPadTextAction.java 477 2011-12-02 09:04:43Z ohura $ */
package smart_gs.drawing_tool.action;

import java.awt.MouseInfo;
import java.awt.Point;
import java.awt.PointerInfo;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;

import javax.swing.JOptionPane;
import smart_gs.drawing_tool.ImageLabel;
import smart_gs.drawing_tool.view.MemoPadView;
import smart_gs.drawing_tool.view.View;
import smart_gs.logical.Region;
import smart_gs.logical.region.MemoPadRegion;
import smart_gs.swingui.GSMouseEvent;
import smart_gs.swingui.MemoPadDialog;
import smart_gs.swingui.WorkspaceWindow;

public class MemoPadTextAction implements ActionListener{

	private Region region;
	
	public MemoPadTextAction(Region selectedRegion){
		this.region = selectedRegion;
	}
	
	public void actionPerformed(ActionEvent e) {
		execute();
	}
	public void actionPerformed(MouseEvent e) {
		execute();
	}
	private void execute() {
		MemoPadDialog dialog = new MemoPadDialog(region);
		PointerInfo pointerInfo = MouseInfo.getPointerInfo();
		Point p = pointerInfo.getLocation();
		dialog.setBounds((int)p.getX()-120,(int)p.getY()-30,300,200);
		dialog.setVisible(true);		
	}



}
