/*
 This file is part of the software framework JStatCom, 
 a library for building applications for data based analysis.

 Copyright (C) 2000-2005  Markus Kraetzig

 This library is free software; you can redistribute it and/or modify
 it under the terms of the GNU Lesser General Public License as
 published by the Free Software Foundation; either version 2.1 of the
 License, or (at your option) any later version.

 This library is distributed in the hope that it will be useful, but
 WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 Lesser General Public License for more details.

 You should have received a copy of the GNU Lesser General Public
 License along with this library; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
 USA
 */

package com.jstatcom.ts;
import java.awt.event.MouseAdapter;


/**
 * A MouseListener that is especially designed to be used with the
 * TSList. It is meant to be shared between TSList instances,
 * but can also be created and subclassed if necessary.
 * The default implementation is empty, because no special mouse behaviour
 * is attached to the TSList.
 * 
 * @author Markus Kraetzig
 */
public class DefaultTSMouseListener extends MouseAdapter {
    private final String name;
    /**
     * Default instance that can be shared between TSList instances.
     */
    private static final DefaultTSMouseListener defaultTSMouseListener =
        new DefaultTSMouseListener("DEFAULT_TSList_MouseListener");

/**
 * Creates a DefaultTSMouseListener with a descriptive name.
 */
public DefaultTSMouseListener(String name) {
	super();
	this.name = name;
}


/**
 * Returns an instance of the DefaultTSMouseListener, that can be shared
 * across all TSList instances. It is also possible to create
 * subclasses that can be individually configured and set to a TSList 
 * that should have a different MouseListener.
 * 
 * @return an instance of this class that can be shared
 */
public static DefaultTSMouseListener getSharedInstance() {
    return defaultTSMouseListener;
}


/**
 * Returns String representation of DefaultTSMouseListener.
 * 
 * @return string representation
 */
public String toString() {
	return name;
}
}
 

Ads help maintain this website.