[Japi-cvs] SF.net SVN: japi:[1336] libs/midi/trunk/src/prj/net/sf/japi/midi/gui
Status: Beta
Brought to you by:
christianhujer
From: <chr...@us...> - 2009-06-11 18:51:22
|
Revision: 1336 http://japi.svn.sourceforge.net/japi/?rev=1336&view=rev Author: christianhujer Date: 2009-06-11 18:51:10 +0000 (Thu, 11 Jun 2009) Log Message: ----------- Rename SpinnerChannelModel to ChannelSpinnerModel. Modified Paths: -------------- libs/midi/trunk/src/prj/net/sf/japi/midi/gui/OutputConfigurator.java Added Paths: ----------- libs/midi/trunk/src/prj/net/sf/japi/midi/gui/ChannelSpinnerModel.java Removed Paths: ------------- libs/midi/trunk/src/prj/net/sf/japi/midi/gui/SpinnerChannelModel.java Copied: libs/midi/trunk/src/prj/net/sf/japi/midi/gui/ChannelSpinnerModel.java (from rev 1330, libs/midi/trunk/src/prj/net/sf/japi/midi/gui/SpinnerChannelModel.java) =================================================================== --- libs/midi/trunk/src/prj/net/sf/japi/midi/gui/ChannelSpinnerModel.java (rev 0) +++ libs/midi/trunk/src/prj/net/sf/japi/midi/gui/ChannelSpinnerModel.java 2009-06-11 18:51:10 UTC (rev 1336) @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2009 Christian Hujer. + * + * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +package net.sf.japi.midi.gui; + +import javax.swing.AbstractSpinnerModel; +import org.jetbrains.annotations.Nullable; + +/** A SpinnerModel for MIDI Channels. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @since 0.1 + */ +public class ChannelSpinnerModel extends AbstractSpinnerModel { + + /** The current channel. */ + private int value; + + /** Creates a SpinnerChannelModel which initially selects channel 0. */ + public ChannelSpinnerModel() { + value = 0; + } + + /** {@inheritDoc} */ + public Object getValue() { + return value; + } + + /** {@inheritDoc} */ + public void setValue(final Object value) { + final int newValue = (Integer) value; + if (newValue < 0x0 || newValue > 0xF) { + throw new IllegalArgumentException("Not a valid MIDI channel."); + } + this.value = newValue; + fireStateChanged(); + } + + /** {@inheritDoc} */ + @Nullable public Object getNextValue() { + return value < 0xF ? value + 1 : null; + } + + /** {@inheritDoc} */ + @Nullable public Object getPreviousValue() { + return value > 0x0 ? value - 1 : null; + } +} Property changes on: libs/midi/trunk/src/prj/net/sf/japi/midi/gui/ChannelSpinnerModel.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: libs/midi/trunk/src/prj/net/sf/japi/midi/gui/OutputConfigurator.java =================================================================== --- libs/midi/trunk/src/prj/net/sf/japi/midi/gui/OutputConfigurator.java 2009-06-06 14:23:50 UTC (rev 1335) +++ libs/midi/trunk/src/prj/net/sf/japi/midi/gui/OutputConfigurator.java 2009-06-11 18:51:10 UTC (rev 1336) @@ -68,7 +68,7 @@ deviceList.setCellRenderer(new MidiDeviceListCellRenderer()); deviceList.setSelectedIndex(0); channelSpinner = new JSpinner(new SpinnerNumberModel(0, 0x0, 0xF, 1)); - //channelSpinner = new JSpinner(new SpinnerChannelModel()); + //channelSpinner = new JSpinner(new ChannelSpinnerModel()); add(new JScrollPane(deviceList)); final Container spinnerPanel = new JPanel(); spinnerPanel.setLayout(new FlowLayout()); Deleted: libs/midi/trunk/src/prj/net/sf/japi/midi/gui/SpinnerChannelModel.java =================================================================== --- libs/midi/trunk/src/prj/net/sf/japi/midi/gui/SpinnerChannelModel.java 2009-06-06 14:23:50 UTC (rev 1335) +++ libs/midi/trunk/src/prj/net/sf/japi/midi/gui/SpinnerChannelModel.java 2009-06-11 18:51:10 UTC (rev 1336) @@ -1,62 +0,0 @@ -/* - * Copyright (C) 2009 Christian Hujer. - * - * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - -package net.sf.japi.midi.gui; - -import javax.swing.AbstractSpinnerModel; -import org.jetbrains.annotations.Nullable; - -/** A SpinnerModel for MIDI Channels. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @since 0.1 - */ -public class SpinnerChannelModel extends AbstractSpinnerModel { - - /** The current channel. */ - private int value; - - /** Creates a SpinnerChannelModel which initially selects channel 0. */ - public SpinnerChannelModel() { - value = 0; - } - - /** {@inheritDoc} */ - public Object getValue() { - return value; - } - - /** {@inheritDoc} */ - public void setValue(final Object value) { - final int newValue = (Integer) value; - if (newValue < 0x0 || newValue > 0xF) { - throw new IllegalArgumentException("Not a valid MIDI channel."); - } - this.value = newValue; - fireStateChanged(); - } - - /** {@inheritDoc} */ - @Nullable public Object getNextValue() { - return value < 0xF ? value + 1 : null; - } - - /** {@inheritDoc} */ - @Nullable public Object getPreviousValue() { - return value > 0x0 ? value - 1 : null; - } -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |