*
* @author Roland Haeder
*/
-public class BaseModel extends BaseFrameworkSystem {
+public class BaseModel extends BaseFrameworkSystem implements Model {
/**
* List of event listeners
this.eventListenerList = new EventListenerList();
}
- /**
- * Adds a lister of this type to the list
- *
- * @param listener Listener instance
- */
+ @Override
public void addListDataListener (final ListDataListener listener) {
// Trace message
- this.getLogger().trace("listener=" + listener + " - CALLED!"); //NOI18N
+ this.getLogger().trace(MessageFormat.format("listener={0}", listener)); //NOI18N
// Listener must not be null
if (null == listener) {
// Abort here
- throw new NullPointerException("listener is null");
+ throw new NullPointerException("listener is null"); //NOI18N
}
// Debug message
- this.getLogger().debug(MessageFormat.format("Adding listener {0} ...", listener.getClass()));
+ this.getLogger().debug(MessageFormat.format("Adding listener {0} ...", listener.getClass())); //NOI18N
// Remove listener
this.eventListenerList.add(ListDataListener.class, listener);
this.getLogger().trace("EXIT!"); //NOI18N
}
- /**
- * Adds a TableModel listener instance to the event list.
- *
- * @param listener Lister instance
- */
+ @Override
public void addTableModelListener (final TableModelListener listener) {
// Trace message
- this.getLogger().trace("listener=" + listener + " - CALLED!"); //NOI18N
+ this.getLogger().trace(MessageFormat.format("listener={0}", listener)); //NOI18N
// Listener must not be null
if (null == listener) {
// Abort here
- throw new NullPointerException("listener is null");
+ throw new NullPointerException("listener is null"); //NOI18N
}
// Debug message
- this.getLogger().debug(MessageFormat.format("Adding listener {0} ...", listener.getClass()));
+ this.getLogger().debug(MessageFormat.format("Adding listener {0} ...", listener.getClass())); //NOI18N
// Add listener
this.eventListenerList.add(TableModelListener.class, listener);
this.getLogger().trace("EXIT!"); //NOI18N
}
- /**
- * Removes given listener
- *
- * @param listener Listener instance
- */
+ @Override
public void removeListDataListener (final ListDataListener listener) {
// Trace message
- this.getLogger().trace("listener=" + listener + " - CALLED!"); //NOI18N
+ this.getLogger().trace(MessageFormat.format("listener={0}", listener)); //NOI18N
// Listener must not be null
if (null == listener) {
// Abort here
- throw new NullPointerException("listener is null");
+ throw new NullPointerException("listener is null"); //NOI18N
}
// Debug message
- this.getLogger().debug(MessageFormat.format("Removing listener {0} ...", listener.getClass()));
+ this.getLogger().debug(MessageFormat.format("Removing listener {0} ...", listener.getClass())); //NOI18N
// Remove listener
this.eventListenerList.remove(ListDataListener.class, listener);
this.getLogger().trace("EXIT!"); //NOI18N
}
- /**
- * Removes a TableModel listener instance from the event list.
- *
- * @param listener Listener instance
- */
+ @Override
public void removeTableModelListener (final TableModelListener listener) {
// Trace message
- this.getLogger().trace("listener=" + listener + " - CALLED!"); //NOI18N
+ this.getLogger().trace(MessageFormat.format("listener={0}", listener)); //NOI18N
// Listener must not be null
if (null == listener) {
// Abort here
- throw new NullPointerException("listener is null");
+ throw new NullPointerException("listener is null"); //NOI18N
}
// Debug message
- this.getLogger().debug(MessageFormat.format("Removing listener {0} ...", listener.getClass()));
+ this.getLogger().debug(MessageFormat.format("Removing listener {0} ...", listener.getClass())); //NOI18N
// Remove listener
this.eventListenerList.remove(TableModelListener.class, listener);
--- /dev/null
+/*
+ * Copyright (C) 2015 Roland Haeder
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+package org.mxchange.jswingcore.model;
+
+import javax.swing.event.ListDataListener;
+import javax.swing.event.TableModelListener;
+import org.mxchange.jcore.FrameworkInterface;
+
+/**
+ * A general interface for models
+ *
+ * @author Roland Haeder
+ */
+public interface Model extends FrameworkInterface {
+
+ /**
+ * Adds a lister of this type to the list
+ *
+ * @param listener Listener instance
+ */
+ public void addListDataListener (final ListDataListener listener);
+
+ /**
+ * Adds a TableModel listener instance to the event list.
+ *
+ * @param listener Lister instance
+ */
+ public void addTableModelListener (final TableModelListener listener);
+
+ /**
+ * Removes given listener
+ *
+ * @param listener Listener instance
+ */
+ public void removeListDataListener (final ListDataListener listener);
+
+ /**
+ * Removes a TableModel listener instance from the event list.
+ *
+ * @param listener Listener instance
+ */
+ public void removeTableModelListener (final TableModelListener listener);
+}