Thread: [Japi-cvs] SF.net SVN: japi:[686] libs
Status: Beta
Brought to you by:
christianhujer
|
From: <chr...@us...> - 2008-10-07 20:32:00
|
Revision: 686
http://japi.svn.sourceforge.net/japi/?rev=686&view=rev
Author: christianhujer
Date: 2008-10-07 20:31:57 +0000 (Tue, 07 Oct 2008)
Log Message:
-----------
Added midi library.
Added Paths:
-----------
libs/midi/
libs/midi/branches/
libs/midi/tags/
libs/midi/trunk/
libs/midi/trunk/midi.iml
libs/midi/trunk/src/
libs/midi/trunk/src/doc/
libs/midi/trunk/src/prj/
libs/midi/trunk/src/prj/net/
libs/midi/trunk/src/prj/net/sf/
libs/midi/trunk/src/prj/net/sf/japi/
libs/midi/trunk/src/prj/net/sf/japi/midi/
libs/midi/trunk/src/prj/net/sf/japi/midi/DeviceComparator.java
libs/midi/trunk/src/prj/net/sf/japi/midi/Interval.java
libs/midi/trunk/src/prj/net/sf/japi/midi/Interval.properties
libs/midi/trunk/src/prj/net/sf/japi/midi/IntervalTrainer.java
libs/midi/trunk/src/prj/net/sf/japi/midi/Interval_de.properties
libs/midi/trunk/src/prj/net/sf/japi/midi/MidiUtils.java
libs/midi/trunk/src/prj/net/sf/japi/midi/MonitorReceiver.java
libs/midi/trunk/src/prj/net/sf/japi/midi/MultiReceiver.java
libs/midi/trunk/src/prj/net/sf/japi/midi/OutputConfiguration.java
libs/midi/trunk/src/prj/net/sf/japi/midi/gui/
libs/midi/trunk/src/prj/net/sf/japi/midi/gui/MidiDeviceListCellRenderer.java
libs/midi/trunk/src/prj/net/sf/japi/midi/gui/OutputConfigurator.java
libs/midi/trunk/src/prj/net/sf/japi/midi/gui/SpinnerChannelModel.java
libs/midi/trunk/src/prj/net/sf/japi/midi/gui/action.properties
libs/midi/trunk/src/tst/
Added: libs/midi/trunk/midi.iml
===================================================================
--- libs/midi/trunk/midi.iml (rev 0)
+++ libs/midi/trunk/midi.iml 2008-10-07 20:31:57 UTC (rev 686)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module relativePaths="true" type="JAVA_MODULE" version="4">
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
+ <exclude-output />
+ <content url="file://$MODULE_DIR$">
+ <sourceFolder url="file://$MODULE_DIR$/src/doc" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/prj" isTestSource="false" />
+ <sourceFolder url="file://$MODULE_DIR$/src/tst" isTestSource="true" />
+ </content>
+ <orderEntry type="inheritedJdk" />
+ <orderEntry type="sourceFolder" forTests="false" />
+ <orderEntry type="library" name="annotations" level="project" />
+ <orderEntry type="library" name="junit" level="project" />
+ <orderEntry type="module" module-name="libs-swing-action" />
+ <orderEntryProperties />
+ </component>
+</module>
+
Property changes on: libs/midi/trunk/midi.iml
___________________________________________________________________
Added: svn:mime-type
+ text/xml
Added: svn:eol-style
+ LF
Added: libs/midi/trunk/src/prj/net/sf/japi/midi/DeviceComparator.java
===================================================================
--- libs/midi/trunk/src/prj/net/sf/japi/midi/DeviceComparator.java (rev 0)
+++ libs/midi/trunk/src/prj/net/sf/japi/midi/DeviceComparator.java 2008-10-07 20:31:57 UTC (rev 686)
@@ -0,0 +1,24 @@
+package net.sf.japi.midi;
+
+import java.util.Comparator;
+import javax.sound.midi.MidiDevice;
+
+/** Comparator for MidiDevices which compares them by name.
+ * @author <a href="mailto:ch...@ri...">Christian Hujer</a>
+ */
+public class DeviceComparator implements Comparator<MidiDevice> {
+
+ private static Comparator<? super MidiDevice> instance = new DeviceComparator();
+
+ /** {@inheritDoc} */
+ public int compare(final MidiDevice o1, final MidiDevice o2) {
+ return o1.getDeviceInfo().getName().compareTo(o2.getDeviceInfo().getName());
+ }
+
+ /** Returns a default instance.
+ * @return Default instance.
+ */
+ public static Comparator<? super MidiDevice> getInstance() {
+ return instance;
+ }
+}
Property changes on: libs/midi/trunk/src/prj/net/sf/japi/midi/DeviceComparator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ LF
Added: libs/midi/trunk/src/prj/net/sf/japi/midi/Interval.java
===================================================================
--- libs/midi/trunk/src/prj/net/sf/japi/midi/Interval.java (rev 0)
+++ libs/midi/trunk/src/prj/net/sf/japi/midi/Interval.java 2008-10-07 20:31:57 UTC (rev 686)
@@ -0,0 +1,29 @@
+package net.sf.japi.midi;
+
+import java.util.Locale;
+import java.util.ResourceBundle;
+import org.jetbrains.annotations.NotNull;
+
+/** An Interval, used for the {@link IntervalTrainer}.
+ * @author <a href="mailto:ch...@ri...">Christian Hujer</a>
+ */
+public class Interval {
+
+ /** The distance of this interval, e.g. 0 for prime, 12 for octave. */
+ private int distance;
+
+ /** Returns the names of this interval in the current locale.
+ * @return The names of this interval in the current locale.
+ */
+ public String[] getNames() {
+ return ResourceBundle.getBundle("Interval").getString("I_" + distance + ".names").split(",");
+ }
+
+ /** Returns the names of this interval in the specified locale.
+ * @param locale Locale in which to return the names.
+ * @return The names of this interval in the specified locale.
+ */
+ public String[] getNames(@NotNull final Locale locale) {
+ return ResourceBundle.getBundle("Interval", locale).getString("I_" + distance + ".names").split(",");
+ }
+}
Property changes on: libs/midi/trunk/src/prj/net/sf/japi/midi/Interval.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ LF
Added: libs/midi/trunk/src/prj/net/sf/japi/midi/Interval.properties
===================================================================
--- libs/midi/trunk/src/prj/net/sf/japi/midi/Interval.properties (rev 0)
+++ libs/midi/trunk/src/prj/net/sf/japi/midi/Interval.properties 2008-10-07 20:31:57 UTC (rev 686)
@@ -0,0 +1,13 @@
+I_0.names=Prime
+I_1.names=Kleine Sekunde,\xDCberm\xE4\xDFige Prime
+I_2.names=Gro\xDFe Sekunde,Verminderte Terz
+I_3.names=Kleine Terz
+I_4.names=Gro\xDFe Terz
+I_5.names=Quarte,\xDCberm\xE4\xDFige Terz
+I_6.names=Tritonus,\xDCberm\xE4\xDFige Quarte,Verminderte Quinte
+I_7.names=Quinte,Verminderte Sexte
+I_8.names=Kleine Sexte,\xDCberm\xE4\xDFige Quinte
+I_9.names=Gro\xDFe Sexte,Verminderte Septime
+I_10.names=Kleine Septime,\xDCberm\xE4\xDFige Sexte
+I_11.names=Gro\xDFe Septime,Verminderte Oktave
+I_12.names=Oktave,\xDCberm\xE4\xDFige Septime
Property changes on: libs/midi/trunk/src/prj/net/sf/japi/midi/Interval.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ LF
Added: libs/midi/trunk/src/prj/net/sf/japi/midi/IntervalTrainer.java
===================================================================
--- libs/midi/trunk/src/prj/net/sf/japi/midi/IntervalTrainer.java (rev 0)
+++ libs/midi/trunk/src/prj/net/sf/japi/midi/IntervalTrainer.java 2008-10-07 20:31:57 UTC (rev 686)
@@ -0,0 +1,10 @@
+package net.sf.japi.midi;
+
+/** Training program for intervals.
+ * Plays intervals and asks the user to tell the correct kind of interval.
+ * @author <a href="mailto:ch...@ri...">Christian Hujer</a>
+ */
+public class IntervalTrainer {
+
+}
+
Property changes on: libs/midi/trunk/src/prj/net/sf/japi/midi/IntervalTrainer.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ LF
Added: libs/midi/trunk/src/prj/net/sf/japi/midi/Interval_de.properties
===================================================================
--- libs/midi/trunk/src/prj/net/sf/japi/midi/Interval_de.properties (rev 0)
+++ libs/midi/trunk/src/prj/net/sf/japi/midi/Interval_de.properties 2008-10-07 20:31:57 UTC (rev 686)
@@ -0,0 +1,13 @@
+I_0.names=Prime
+I_1.names=Kleine Sekunde,\xDCberm\xE4\xDFige Prime
+I_2.names=Gro\xDFe Sekunde,Verminderte Terz
+I_3.names=Kleine Terz
+I_4.names=Gro\xDFe Terz
+I_5.names=Quarte,\xDCberm\xE4\xDFige Terz
+I_6.names=Tritonus,\xDCberm\xE4\xDFige Quarte,Verminderte Quinte
+I_7.names=Quinte,Verminderte Sexte
+I_8.names=Kleine Sexte,\xDCberm\xE4\xDFige Quinte
+I_9.names=Gro\xDFe Sexte,Verminderte Septime
+I_10.names=Kleine Septime,\xDCberm\xE4\xDFige Sexte
+I_11.names=Gro\xDFe Septime,Verminderte Oktave
+I_12.names=Oktave,\xDCberm\xE4\xDFige Septime
Property changes on: libs/midi/trunk/src/prj/net/sf/japi/midi/Interval_de.properties
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ LF
Added: libs/midi/trunk/src/prj/net/sf/japi/midi/MidiUtils.java
===================================================================
--- libs/midi/trunk/src/prj/net/sf/japi/midi/MidiUtils.java (rev 0)
+++ libs/midi/trunk/src/prj/net/sf/japi/midi/MidiUtils.java 2008-10-07 20:31:57 UTC (rev 686)
@@ -0,0 +1,136 @@
+package net.sf.japi.midi;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import javax.sound.midi.InvalidMidiDataException;
+import javax.sound.midi.MidiDevice;
+import javax.sound.midi.MidiSystem;
+import javax.sound.midi.MidiUnavailableException;
+import javax.sound.midi.Receiver;
+import javax.sound.midi.SysexMessage;
+import javax.sound.midi.Transmitter;
+import org.jetbrains.annotations.NotNull;
+
+/** Utility functions for working with MIDI.
+ * @author <a href="mailto:ch...@ri...">Christian Hujer</a>
+ */
+public class MidiUtils {
+
+ /** Utility class - do not instanciate. */
+ private MidiUtils() {
+ }
+
+ /** Returns all {@link MidiDevice}s which provide {@link Receiver}s.
+ * @return All {@link MidiDevice}s which provide {@link Receiver}s.
+ * @throws MidiUnavailableException if one of the requested devices is unavailable due to resource restrictions.
+ */
+ public static MidiDevice[] getAllReceivingDevices() throws MidiUnavailableException {
+ return getReceivingDevices(MidiSystem.getMidiDeviceInfo());
+ }
+
+ /** Returns all {@iink MidiDevice}s which provide {@link Transmitter}s.
+ * @return All {@link MidiDevice}s which provide {@link Transmitter}s.
+ * @throws MidiUnavailableException if one of the requested devices is unavailable due to resource restrictions.
+ */
+ public static MidiDevice[] getAllTransmittingDevices() throws MidiUnavailableException {
+ return getTransmittingDevices(MidiSystem.getMidiDeviceInfo());
+ }
+
+ /** Returns those {@link MidiDevice}s which provide {@link Receiver}s.
+ * @param infos Device informations of which to return devices.
+ * @return Those {@link MidiDevice}s from <var>infos</var> which provide {@link Receiver}s.
+ * @throws MidiUnavailableException if one of the requested devices is unavailable due to resource restrictions.
+ */
+ public static MidiDevice[] getReceivingDevices(final MidiDevice.Info... infos) throws MidiUnavailableException {
+ final List<MidiDevice> receivingDevices = new ArrayList<MidiDevice>();
+ for (final MidiDevice.Info deviceInfo : infos) {
+ final MidiDevice device = MidiSystem.getMidiDevice(deviceInfo);
+ if (device.getMaxReceivers() != 0) {
+ receivingDevices.add(device);
+ }
+ }
+ Collections.sort(receivingDevices, DeviceComparator.getInstance());
+ return receivingDevices.toArray(new MidiDevice[receivingDevices.size()]);
+ }
+
+ /** Returns those {@link MidiDevice}s which provide {@link Transmitter}s.
+ * @param infos Device informations of which to return devices.
+ * @return Those {@link MidiDevice}s from <var>infos</var> which provide {@link Transmitter}s.
+ * @throws MidiUnavailableException if one of the requested devices is unavailable due to resource restrictions.
+ */
+ public static MidiDevice[] getTransmittingDevices(final MidiDevice.Info... infos) throws MidiUnavailableException {
+ final List<MidiDevice> transmittingDevices = new ArrayList<MidiDevice>();
+ for (final MidiDevice.Info deviceInfo : infos) {
+ final MidiDevice device = MidiSystem.getMidiDevice(deviceInfo);
+ if (device.getMaxTransmitters() != 0) {
+ transmittingDevices.add(device);
+ }
+ }
+ Collections.sort(transmittingDevices, DeviceComparator.getInstance());
+ return transmittingDevices.toArray(new MidiDevice[transmittingDevices.size()]);
+ }
+
+ /** Creates a Sysex message from a String.
+ * @param data String from which to create the Sysex message.
+ * @return Sysex message created from <var>data</var>.
+ * @throws InvalidMidiDataException if <var>data</var> does not denote a valid Sysex message (the first byte must be 0xF0 or 0xF7).
+ */
+ public static SysexMessage createSysexMessage(@NotNull final String data) throws InvalidMidiDataException {
+ final SysexMessage message = new SysexMessage();
+ final byte[] realData = new byte[data.length() / 2];
+ for (int i = 0; i < realData.length; i++) {
+ realData[i] = (byte) Integer.parseInt(data.substring(i * 2, i * 2 + 2), 16);
+ }
+ System.out.format("%n");
+ message.setMessage(realData, realData.length);
+ return message;
+ }
+
+ /** Returns the first device found in the system with the specified name that provides Receivers.
+ * @param name Name of the receiving device to return.
+ * @return The requested device or <code>null</code> if the requested device was not found.
+ * @throws MidiUnavailableException if one of the requested devices is unavailable due to resource restrictions.
+ */
+ public static MidiDevice getReceivingDevice(@NotNull final String name) throws MidiUnavailableException {
+ for (final MidiDevice.Info deviceInfo : MidiSystem.getMidiDeviceInfo()) {
+ if (deviceInfo.getName().equals(name)) {
+ final MidiDevice device = MidiSystem.getMidiDevice(deviceInfo);
+ if (device.getMaxReceivers() != 0) {
+ return device;
+ }
+ }
+ }
+ return null;
+ }
+
+ /** Returns the first device found in the system with the specified name that provides Transmitters.
+ * @param name Name of the receiving device to return.
+ * @return The requested device or <code>null</code> if the requested device was not found.
+ * @throws MidiUnavailableException if one of the requested devices is unavailable due to resource restrictions.
+ */
+ public static MidiDevice getTransmittingDevice(@NotNull final String name) throws MidiUnavailableException {
+ for (final MidiDevice.Info deviceInfo : MidiSystem.getMidiDeviceInfo()) {
+ if (deviceInfo.getName().equals(name)) {
+ final MidiDevice device = MidiSystem.getMidiDevice(deviceInfo);
+ if (device.getMaxTransmitters() != 0) {
+ return device;
+ }
+ }
+ }
+ return null;
+ }
+
+ /** Returns a device by its name.
+ * @param name Name of the device to return.
+ * @return The first device found that matches <var>name</var> or <code>null</code> if the requested device was not found.
+ */
+ public static MidiDevice getDeviceByName(@NotNull final String name) throws MidiUnavailableException {
+ for (final MidiDevice.Info deviceInfo : MidiSystem.getMidiDeviceInfo()) {
+ if (deviceInfo.getName().equals(name)) {
+ return MidiSystem.getMidiDevice(deviceInfo);
+ }
+ }
+ return null;
+ }
+}
Property changes on: libs/midi/trunk/src/prj/net/sf/japi/midi/MidiUtils.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ LF
Added: libs/midi/trunk/src/prj/net/sf/japi/midi/MonitorReceiver.java
===================================================================
--- libs/midi/trunk/src/prj/net/sf/japi/midi/MonitorReceiver.java (rev 0)
+++ libs/midi/trunk/src/prj/net/sf/japi/midi/MonitorReceiver.java 2008-10-07 20:31:57 UTC (rev 686)
@@ -0,0 +1,76 @@
+package net.sf.japi.midi;
+
+import java.io.Closeable;
+import java.io.IOException;
+import java.util.Formatter;
+import javax.sound.midi.MidiMessage;
+import javax.sound.midi.Receiver;
+import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
+
+/** A MonitorReceiver is a Receiver that prints messages to System.out.
+ * It optionally can delegate to another receiver.
+ * @author <a href="mailto:ch...@ri...">Christian Hujer</a>
+ */
+public class MonitorReceiver implements Receiver {
+
+ /** The Receiver to which to delegate. */
+ @Nullable private final Receiver receiver;
+
+ /** The prefix for messages printed by this MonitorReceiver. */
+ private final String prefix;
+
+ /** The Appendable to which messages are printed. */
+ private final Appendable out;
+
+ /** The Formatter that is used to format messages to {@link #out}. */
+ private final Formatter format;
+
+ /** Create a MonitorReceiver.
+ * @param prefix Prefix for messages printed by this MonitorReceiver.
+ */
+ public MonitorReceiver(@NotNull final String prefix) {
+ this(prefix, null);
+ }
+
+ /** Create a MonitorReceiver.
+ * @param prefix Prefix for messages printed by this MonitorReceiver.
+ * @param receiver Receiver to which messages shall be delegated.
+ */
+ public MonitorReceiver(@NotNull final String prefix, @Nullable final Receiver receiver) {
+ this.prefix = prefix;
+ out = System.out;
+ format = new Formatter(out);
+ this.receiver = receiver;
+ }
+
+ /** {@inheritDoc} */
+ public void send(final MidiMessage message, final long timeStamp) {
+ format.format("[%s] %08x ", prefix, timeStamp);
+ final byte[] msg = message.getMessage();
+ for (final byte b : msg) {
+ format.format("%02x", b);
+ }
+ format.format("%n");
+ format.flush();
+ if (receiver != null) {
+ receiver.send(message, timeStamp);
+ }
+ }
+
+ /** {@inheritDoc} */
+ public void close() {
+ if (receiver != null) {
+ receiver.close();
+ }
+ format.flush();
+ if (out instanceof Closeable) {
+ try {
+ ((Closeable) out).close();
+ } catch (final IOException e) {
+ // ignore
+ }
+ }
+ }
+
+}
Property changes on: libs/midi/trunk/src/prj/net/sf/japi/midi/MonitorReceiver.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ LF
Added: libs/midi/trunk/src/prj/net/sf/japi/midi/MultiReceiver.java
===================================================================
--- libs/midi/trunk/src/prj/net/sf/japi/midi/MultiReceiver.java (rev 0)
+++ libs/midi/trunk/src/prj/net/sf/japi/midi/MultiReceiver.java 2008-10-07 20:31:57 UTC (rev 686)
@@ -0,0 +1,44 @@
+package net.sf.japi.midi;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import javax.sound.midi.MidiMessage;
+import javax.sound.midi.Receiver;
+import org.jetbrains.annotations.NotNull;
+
+/** A Midi Receiver which sends its received message to an arbitrary number of other receivers.
+ * @author <a href="mailto:ch...@ri...">Christian Hujer</a>
+ */
+public class MultiReceiver implements Receiver {
+
+ /** The Receivers. */
+ private final Collection<Receiver> receivers = new ArrayList<Receiver>();
+
+ /** Adds a Receiver.
+ * @param receiver Receiver to add.
+ */
+ public void addReceiver(@NotNull final Receiver receiver) {
+ receivers.add(receiver);
+ }
+
+ /** Removes a Receiver.
+ * @param receiver Receiver to remove.
+ */
+ public void removeReceiver(@NotNull final Receiver receiver) {
+ receivers.remove(receiver);
+ }
+
+ /** {@inheritDoc} */
+ public void send(final MidiMessage message, final long timeStamp) {
+ for (final Receiver receiver : receivers) {
+ receiver.send(message, timeStamp);
+ }
+ }
+
+ /** {@inheritDoc} */
+ public void close() {
+ for (final Receiver receiver : receivers) {
+ receiver.close();
+ }
+ }
+}
Property changes on: libs/midi/trunk/src/prj/net/sf/japi/midi/MultiReceiver.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ LF
Added: libs/midi/trunk/src/prj/net/sf/japi/midi/OutputConfiguration.java
===================================================================
--- libs/midi/trunk/src/prj/net/sf/japi/midi/OutputConfiguration.java (rev 0)
+++ libs/midi/trunk/src/prj/net/sf/japi/midi/OutputConfiguration.java 2008-10-07 20:31:57 UTC (rev 686)
@@ -0,0 +1,44 @@
+package net.sf.japi.midi;
+
+import javax.sound.midi.MidiDevice;
+import org.jetbrains.annotations.NotNull;
+
+/** OutputConfiguration describes a MIDI target, which is the combination of device and channel.
+ * @author <a href="mailto:ch...@ri...">Christian Hujer</a>
+ */
+public class OutputConfiguration {
+
+ /** The device. */
+ @NotNull private final MidiDevice device;
+
+ /** The channel. */
+ private final int channel;
+
+ /** Creates an OutputConfiguration.
+ * @param device MidiDevice.
+ * @param channel Midi Channel.
+ */
+ public OutputConfiguration(@NotNull final MidiDevice device, final int channel) {
+ this.device = device;
+ this.channel = channel;
+ }
+
+ /** Returns the MidiDevice.
+ * @return The MidiDevice.
+ */
+ @NotNull public MidiDevice getDevice() {
+ return device;
+ }
+
+ /** Returns the Midi Channel.
+ * @return The Midi Channel.
+ */
+ public int getChannel() {
+ return channel;
+ }
+
+ /** {@inheritDoc} */
+ @Override public String toString() {
+ return device.getDeviceInfo().getName() + ": " + channel;
+ }
+}
Property changes on: libs/midi/trunk/src/prj/net/sf/japi/midi/OutputConfiguration.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ LF
Added: libs/midi/trunk/src/prj/net/sf/japi/midi/gui/MidiDeviceListCellRenderer.java
===================================================================
--- libs/midi/trunk/src/prj/net/sf/japi/midi/gui/MidiDeviceListCellRenderer.java (rev 0)
+++ libs/midi/trunk/src/prj/net/sf/japi/midi/gui/MidiDeviceListCellRenderer.java 2008-10-07 20:31:57 UTC (rev 686)
@@ -0,0 +1,22 @@
+package net.sf.japi.midi.gui;
+
+import java.awt.Component;
+import javax.sound.midi.MidiDevice;
+import javax.swing.DefaultListCellRenderer;
+import javax.swing.JList;
+
+/** ListCellRenderer for Midi Devices.
+ * Class Description.
+ * @author <a href="mailto:ch...@ri...">Christian Hujer</a>
+ */
+public class MidiDeviceListCellRenderer extends DefaultListCellRenderer {
+
+ /** {@inheritDoc} */
+ @Override public Component getListCellRendererComponent(final JList list, final Object value, final int index, final boolean isSelected, final boolean cellHasFocus) {
+ final Component c = super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
+ if (value instanceof MidiDevice) {
+ setText(((MidiDevice) value).getDeviceInfo().getName());
+ }
+ return c;
+ }
+}
Property changes on: libs/midi/trunk/src/prj/net/sf/japi/midi/gui/MidiDeviceListCellRenderer.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ LF
Added: libs/midi/trunk/src/prj/net/sf/japi/midi/gui/OutputConfigurator.java
===================================================================
--- libs/midi/trunk/src/prj/net/sf/japi/midi/gui/OutputConfigurator.java (rev 0)
+++ libs/midi/trunk/src/prj/net/sf/japi/midi/gui/OutputConfigurator.java 2008-10-07 20:31:57 UTC (rev 686)
@@ -0,0 +1,95 @@
+package net.sf.japi.midi.gui;
+
+import java.awt.BorderLayout;
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.FlowLayout;
+import javax.sound.midi.MidiDevice;
+import javax.sound.midi.MidiUnavailableException;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JOptionPane;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JSpinner;
+import javax.swing.SpinnerNumberModel;
+import net.sf.japi.midi.MidiUtils;
+import net.sf.japi.midi.OutputConfiguration;
+import net.sf.japi.swing.ActionBuilder;
+import net.sf.japi.swing.ActionBuilderFactory;
+import org.jetbrains.annotations.Nullable;
+
+/** UI component for configuring a midi output.
+ * The user can choose of one of the receiving devices and select a channel.
+ * @author <a href="mailto:ch...@ri...">Christian Hujer</a>
+ */
+public class OutputConfigurator extends JComponent {
+
+ private static final ActionBuilder ACTION_BUILDER = ActionBuilderFactory.getInstance().getActionBuilder(OutputConfigurator.class);
+
+ /** The List of Devices from which to choose. */
+ private final JList deviceList;
+
+ /** The Spinner for selecting the channel. */
+ private final JSpinner channelSpinner;
+
+ /** Creates an OutputConfigurator with no initial configuration.
+ * The first device and channel 0 will be selected as defaults.
+ * @throws MidiUnavailableException if one of the requested devices is unavailable due to resource restrictions.
+ */
+ public OutputConfigurator() throws MidiUnavailableException {
+ setLayout(new BorderLayout());
+ deviceList = new JList(MidiUtils.getAllReceivingDevices());
+ deviceList.setCellRenderer(new MidiDeviceListCellRenderer());
+ deviceList.setSelectedIndex(0);
+ channelSpinner = new JSpinner(new SpinnerNumberModel(0, 0x0, 0xF, 1));
+ //channelSpinner = new JSpinner(new SpinnerChannelModel());
+ add(new JScrollPane(deviceList));
+ final Container spinnerPanel = new JPanel();
+ spinnerPanel.setLayout(new FlowLayout());
+ spinnerPanel.add(new JLabel(ACTION_BUILDER.getString("Channel.label")));
+ spinnerPanel.add(channelSpinner);
+ add(spinnerPanel, BorderLayout.SOUTH);
+ }
+
+ /** Shows a dialog where the user can choose a receiving device and channel once.
+ * @param parent Parent component on which to show the dialog.
+ * @return OutputConfiguration or <code>null</code> if the user chose to abort the dialog.
+ * @throws MidiUnavailableException if one of the requested devices is unavailable due to resource restrictions.
+ */
+ @Nullable public static OutputConfiguration showDialog(@Nullable final Component parent) throws MidiUnavailableException {
+ final OutputConfigurator configurator = new OutputConfigurator();
+ final int result = JOptionPane.showConfirmDialog(parent, configurator, ACTION_BUILDER.getString("Dialog.title"), JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
+ return result == JOptionPane.OK_OPTION ? configurator.getConfiguration() : null;
+ }
+
+ /** Returns the selected configuration.
+ * @return The selected configuration.
+ */
+ public OutputConfiguration getConfiguration() {
+ return new OutputConfiguration(getSelectedDevice(), getSelectedChannel());
+ }
+
+ /** Returns the selected device.
+ * @return The selected device.
+ */
+ public MidiDevice getSelectedDevice() {
+ return (MidiDevice) deviceList.getSelectedValue();
+ }
+
+ /** Returns the selected channel.
+ * @return The selected channel.
+ */
+ public int getSelectedChannel() {
+ return (Integer) channelSpinner.getValue();
+ }
+
+ /** Main program of OutputConfigurator, used for trying the most common use cases.
+ * @param args Command line arguments (ignored).
+ * @throws MidiUnavailableException if one of the requested devices is unavailable due to resource restrictions.
+ */
+ public static void main(final String... args) throws MidiUnavailableException {
+ System.out.println(showDialog(null));
+ }
+}
Property changes on: libs/midi/trunk/src/prj/net/sf/japi/midi/gui/OutputConfigurator.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ LF
Added: libs/midi/trunk/src/prj/net/sf/japi/midi/gui/SpinnerChannelModel.java
===================================================================
--- libs/midi/trunk/src/prj/net/sf/japi/midi/gui/SpinnerChannelModel.java (rev 0)
+++ libs/midi/trunk/src/prj/net/sf/japi/midi/gui/SpinnerChannelModel.java 2008-10-07 20:31:57 UTC (rev 686)
@@ -0,0 +1,42 @@
+package net.sf.japi.midi.gui;
+
+import javax.swing.AbstractSpinnerModel;
+
+/** A SpinnerModel for MIDI Channels.
+ * @author <a href="mailto:ch...@ri...">Christian Hujer</a>
+ */
+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} */
+ public Object getNextValue() {...
[truncated message content] |
|
From: <chr...@us...> - 2008-12-26 15:05:38
|
Revision: 737
http://japi.svn.sourceforge.net/japi/?rev=737&view=rev
Author: christianhujer
Date: 2008-12-26 15:05:34 +0000 (Fri, 26 Dec 2008)
Log Message:
-----------
Removed module.version from module.properties - now this is auto-set.
Modified Paths:
--------------
libs/argparser/trunk/module.properties
libs/io/trunk/module.properties
libs/lang/trunk/module.properties
libs/logging/trunk/module.properties
libs/midi/trunk/module.properties
libs/net/trunk/module.properties
libs/registry/trunk/module.properties
libs/swing-about/trunk/module.properties
libs/swing-action/trunk/module.properties
libs/swing-app/trunk/module.properties
libs/swing-bookmarks/trunk/module.properties
libs/swing-extlib/trunk/module.properties
libs/swing-font/trunk/module.properties
libs/swing-keyprefs/trunk/module.properties
libs/swing-list/trunk/module.properties
libs/swing-misc/trunk/module.properties
libs/swing-prefs/trunk/module.properties
libs/swing-proxyprefs/trunk/module.properties
libs/swing-recent/trunk/module.properties
libs/swing-tod/trunk/module.properties
libs/swing-treetable/trunk/module.properties
libs/taglets/trunk/module.properties
libs/util/trunk/module.properties
libs/xml/trunk/module.properties
Modified: libs/argparser/trunk/module.properties
===================================================================
--- libs/argparser/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/argparser/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-argparser
module.shortname=argparser
module.title=ArgParser
Modified: libs/io/trunk/module.properties
===================================================================
--- libs/io/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/io/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-io
module.shortname=io
module.title=IO
Modified: libs/lang/trunk/module.properties
===================================================================
--- libs/lang/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/lang/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-lang
module.shortname=lang
module.title=Lang
Modified: libs/logging/trunk/module.properties
===================================================================
--- libs/logging/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/logging/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-logging
module.shortname=logging
module.title=Logging
Modified: libs/midi/trunk/module.properties
===================================================================
--- libs/midi/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/midi/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-midi
module.shortname=midi
module.title=Midi
Modified: libs/net/trunk/module.properties
===================================================================
--- libs/net/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/net/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-net
module.shortname=net
module.title=Net
Modified: libs/registry/trunk/module.properties
===================================================================
--- libs/registry/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/registry/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-registry
module.shortname=registry
module.title=Registry
Modified: libs/swing-about/trunk/module.properties
===================================================================
--- libs/swing-about/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/swing-about/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-swing-about
module.shortname=swing-about
module.title=SwingAbout
Modified: libs/swing-action/trunk/module.properties
===================================================================
--- libs/swing-action/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/swing-action/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-swing-action
module.shortname=swing-action
module.title=SwingAction
Modified: libs/swing-app/trunk/module.properties
===================================================================
--- libs/swing-app/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/swing-app/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-swing-app
module.shortname=swing-app
module.title=SwingApp
Modified: libs/swing-bookmarks/trunk/module.properties
===================================================================
--- libs/swing-bookmarks/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/swing-bookmarks/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-swing-bookmarks
module.shortname=swing-bookmarks
module.title=SwingBookmarks
Modified: libs/swing-extlib/trunk/module.properties
===================================================================
--- libs/swing-extlib/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/swing-extlib/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-swing-extlib
module.shortname=swing-extlib
module.title=SwingExtlib
Modified: libs/swing-font/trunk/module.properties
===================================================================
--- libs/swing-font/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/swing-font/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-swing-font
module.shortname=swing-font
module.title=SwingFont
Modified: libs/swing-keyprefs/trunk/module.properties
===================================================================
--- libs/swing-keyprefs/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/swing-keyprefs/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-swing-keyprefs
module.shortname=swing-keyprefs
module.title=SwingKeyprefs
Modified: libs/swing-list/trunk/module.properties
===================================================================
--- libs/swing-list/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/swing-list/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-swing-list
module.shortname=swing-list
module.title=SwingList
Modified: libs/swing-misc/trunk/module.properties
===================================================================
--- libs/swing-misc/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/swing-misc/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-swing-misc
module.shortname=swing-misc
module.title=SwingMisc
Modified: libs/swing-prefs/trunk/module.properties
===================================================================
--- libs/swing-prefs/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/swing-prefs/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-swing-prefs
module.shortname=swing-prefs
module.title=SwingPrefs
Modified: libs/swing-proxyprefs/trunk/module.properties
===================================================================
--- libs/swing-proxyprefs/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/swing-proxyprefs/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-swing-proxyprefs
module.shortname=swing-proxyprefs
module.title=SwingProxyprefs
Modified: libs/swing-recent/trunk/module.properties
===================================================================
--- libs/swing-recent/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/swing-recent/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-swing-recent
module.shortname=swing-recent
module.title=SwingRecent
Modified: libs/swing-tod/trunk/module.properties
===================================================================
--- libs/swing-tod/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/swing-tod/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-swing-tod
module.shortname=swing-tod
module.title=SwingTod
Modified: libs/swing-treetable/trunk/module.properties
===================================================================
--- libs/swing-treetable/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/swing-treetable/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-swing-treetable
module.shortname=swing-treetable
module.title=SwingTreetable
Modified: libs/taglets/trunk/module.properties
===================================================================
--- libs/taglets/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/taglets/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-taglets
module.shortname=taglets
module.title=Taglets
Modified: libs/util/trunk/module.properties
===================================================================
--- libs/util/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/util/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-util
module.shortname=util
module.title=Util
Modified: libs/xml/trunk/module.properties
===================================================================
--- libs/xml/trunk/module.properties 2008-12-26 15:01:47 UTC (rev 736)
+++ libs/xml/trunk/module.properties 2008-12-26 15:05:34 UTC (rev 737)
@@ -18,7 +18,6 @@
#
update.focus=none
-module.version=trunk
module.name=japi-lib-xml
module.shortname=xml
module.title=Xml
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2008-12-26 15:08:31
|
Revision: 739
http://japi.svn.sourceforge.net/japi/?rev=739&view=rev
Author: christianhujer
Date: 2008-12-26 15:08:28 +0000 (Fri, 26 Dec 2008)
Log Message:
-----------
Updated some of the LICENSE files.
Modified Paths:
--------------
common/trunk/LICENSE
libs/argparser/trunk/LICENSE
libs/io/trunk/LICENSE
libs/lang/trunk/LICENSE
libs/net/trunk/LICENSE
libs/taglets/trunk/LICENSE
Added Paths:
-----------
games/jmines/trunk/LICENSE
libs/logging/trunk/LICENSE
libs/midi/trunk/LICENSE
Modified: common/trunk/LICENSE
===================================================================
--- common/trunk/LICENSE 2008-12-26 15:07:38 UTC (rev 738)
+++ common/trunk/LICENSE 2008-12-26 15:08:28 UTC (rev 739)
@@ -1,9 +1,9 @@
JAPI COMMON LICENSE INFORMATION
-------------------------------
-Japi Common is licensed under GPL. See file COPYING.
+Japi Common is licensed under LGPL.
+See file COPYING.
-Japi Common uses some third part libraries, especially for building. These
-libraries are contained in the lib/ directory and have their own licenses. See
-the corresponding LICENSE-*-files in the common/lib/ directory for the licenses
-of third party libraries.
+Japi Common uses some third part libraries, especially for building.
+These libraries are contained in the lib/ directory and have their own licenses.
+See the corresponding LICENSE-*-files in the common/lib/ directory for the licenses of third party libraries.
Added: games/jmines/trunk/LICENSE
===================================================================
--- games/jmines/trunk/LICENSE (rev 0)
+++ games/jmines/trunk/LICENSE 2008-12-26 15:08:28 UTC (rev 739)
@@ -0,0 +1,9 @@
+JAPI JMines LICENSE INFORMATION
+-------------------------------
+
+Japi JMines is licensed under GPL.
+See file COPYING.
+
+Japi JMines uses some third part libraries, especially for building.
+These libraries are contained in the lib/ directory and have their own licenses.
+See the corresponding LICENSE-*-files in the common/lib/ directory for the licenses of third party libraries.
Property changes on: games/jmines/trunk/LICENSE
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ LF
Modified: libs/argparser/trunk/LICENSE
===================================================================
--- libs/argparser/trunk/LICENSE 2008-12-26 15:07:38 UTC (rev 738)
+++ libs/argparser/trunk/LICENSE 2008-12-26 15:08:28 UTC (rev 739)
@@ -1,9 +1,9 @@
JAPI ARGPARSER LICENSE INFORMATION
----------------------------------
-Japi ArgParser is licensed under GPL. See file COPYING.
+Japi ArgParser is licensed under GPL.
+See file COPYING.
-Japi ArgParser uses some third part libraries, especially for building. These
-libraries are contained in the lib/ directory and have their own licenses. See
-the corresponding LICENSE-*-files in the common/lib/ directory for the licenses
-of third party libraries.
+Japi ArgParser uses some third part libraries, especially for building.
+These libraries are contained in the lib/ directory and have their own licenses.
+See the corresponding LICENSE-*-files in the common/lib/ directory for the licenses of third party libraries.
Modified: libs/io/trunk/LICENSE
===================================================================
--- libs/io/trunk/LICENSE 2008-12-26 15:07:38 UTC (rev 738)
+++ libs/io/trunk/LICENSE 2008-12-26 15:08:28 UTC (rev 739)
@@ -1,9 +1,9 @@
JAPI LIB IO LICENSE INFORMATION
-------------------------------
-Japi Lib IO is licensed under GPL. See file COPYING.
+Japi Lib IO is licensed under LGPL.
+See file COPYING.
-Japi Lib IO uses some third part libraries, especially for building. These
-libraries are contained in the lib/ directory and have their own licenses. See
-the corresponding LICENSE-*-files in the common/lib/ directory for the licenses
-of third party libraries.
+Japi Lib IO uses some third part libraries, especially for building.
+These libraries are contained in the lib/ directory and have their own licenses.
+See the corresponding LICENSE-*-files in the common/lib/ directory for the licenses of third party libraries.
Modified: libs/lang/trunk/LICENSE
===================================================================
--- libs/lang/trunk/LICENSE 2008-12-26 15:07:38 UTC (rev 738)
+++ libs/lang/trunk/LICENSE 2008-12-26 15:08:28 UTC (rev 739)
@@ -1,9 +1,9 @@
JAPI LIB LANG LICENSE INFORMATION
---------------------------------
-Japi Lib Lang is licensed under GPL. See file COPYING.
+Japi Lib Lang is licensed under LGPL.
+See file COPYING.
-Japi Lib Lang uses some third part libraries, especially for building. These
-libraries are contained in the lib/ directory and have their own licenses. See
-the corresponding LICENSE-*-files in the common/lib/ directory for the licenses
-of third party libraries.
+Japi Lib Lang uses some third part libraries, especially for building.
+These libraries are contained in the lib/ directory and have their own licenses.
+See the corresponding LICENSE-*-files in the common/lib/ directory for the licenses of third party libraries.
Added: libs/logging/trunk/LICENSE
===================================================================
--- libs/logging/trunk/LICENSE (rev 0)
+++ libs/logging/trunk/LICENSE 2008-12-26 15:08:28 UTC (rev 739)
@@ -0,0 +1,9 @@
+JAPI LOGGING LANG LICENSE INFORMATION
+-------------------------------------
+
+Japi Lib Logging is licensed under LGPL.
+See file COPYING.
+
+Japi Lib Logging uses some third part libraries, especially for building.
+These libraries are contained in the lib/ directory and have their own licenses.
+See the corresponding LICENSE-*-files in the common/lib/ directory for the licenses of third party libraries.
Property changes on: libs/logging/trunk/LICENSE
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ LF
Added: libs/midi/trunk/LICENSE
===================================================================
--- libs/midi/trunk/LICENSE (rev 0)
+++ libs/midi/trunk/LICENSE 2008-12-26 15:08:28 UTC (rev 739)
@@ -0,0 +1,9 @@
+JAPI MIDI LICENSE INFORMATION
+-------------------------------------
+
+Japi Lib Midi is licensed under LGPL.
+See file COPYING.
+
+Japi Lib Midi uses some third part libraries, especially for building.
+These libraries are contained in the lib/ directory and have their own licenses.
+See the corresponding LICENSE-*-files in the common/lib/ directory for the licenses of third party libraries.
Property changes on: libs/midi/trunk/LICENSE
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ LF
Modified: libs/net/trunk/LICENSE
===================================================================
--- libs/net/trunk/LICENSE 2008-12-26 15:07:38 UTC (rev 738)
+++ libs/net/trunk/LICENSE 2008-12-26 15:08:28 UTC (rev 739)
@@ -1,9 +1,9 @@
JAPI LIB NET LICENSE INFORMATION
--------------------------------
-Japi Lib Net is licensed under GPL. See file COPYING.
+Japi Lib Net is licensed under GPL.
+See file COPYING.
-Japi Lib Net uses some third part libraries, especially for building. These
-libraries are contained in the lib/ directory and have their own licenses. See
-the corresponding LICENSE-*-files in the common/lib/ directory for the licenses
-of third party libraries.
+Japi Lib Net uses some third part libraries, especially for building.
+These libraries are contained in the lib/ directory and have their own licenses.
+See the corresponding LICENSE-*-files in the common/lib/ directory for the licenses of third party libraries.
Modified: libs/taglets/trunk/LICENSE
===================================================================
--- libs/taglets/trunk/LICENSE 2008-12-26 15:07:38 UTC (rev 738)
+++ libs/taglets/trunk/LICENSE 2008-12-26 15:08:28 UTC (rev 739)
@@ -1,9 +1,9 @@
JAPI TAGLETS LICENSE INFORMATION
--------------------------------
-Japi Taglets is licensed under GPL. See file COPYING.
+Japi Taglets is licensed under GPL.
+See file COPYING.
-Japi Taglets uses some third part libraries, especially for building. These
-libraries are contained in the lib/ directory and have their own licenses. See
-the corresponding LICENSE-*-files in the common/lib/ directory for the licenses
-of third party libraries.
+Japi Taglets uses some third part libraries, especially for building.
+These libraries are contained in the lib/ directory and have their own licenses.
+See the corresponding LICENSE-*-files in the common/lib/ directory for the licenses of third party libraries.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2008-12-29 04:26:46
|
Revision: 759
http://japi.svn.sourceforge.net/japi/?rev=759&view=rev
Author: christianhujer
Date: 2008-12-29 04:26:37 +0000 (Mon, 29 Dec 2008)
Log Message:
-----------
Removed unnecessary qualified static usage.
Modified Paths:
--------------
historic/trunk/src/app/net/sf/japi/cpp/CPreProcessor.java
libs/swing-app/trunk/src/prj/net/sf/japi/swing/app/DocumentFrame.java
libs/swing-keyprefs/trunk/src/prj/net/sf/japi/swing/prefs/keys/ActionKeyDisplay.java
libs/swing-prefs/trunk/src/prj/net/sf/japi/swing/prefs/PreferencesPane.java
Modified: historic/trunk/src/app/net/sf/japi/cpp/CPreProcessor.java
===================================================================
--- historic/trunk/src/app/net/sf/japi/cpp/CPreProcessor.java 2008-12-29 04:17:21 UTC (rev 758)
+++ historic/trunk/src/app/net/sf/japi/cpp/CPreProcessor.java 2008-12-29 04:26:37 UTC (rev 759)
@@ -135,7 +135,7 @@
}
private void run() throws IOException {
- State state = State.NORMAL;
+ State state = NORMAL;
while ((c = in.read()) != -1) {
switch (state) {
case NORMAL:
Modified: libs/swing-app/trunk/src/prj/net/sf/japi/swing/app/DocumentFrame.java
===================================================================
--- libs/swing-app/trunk/src/prj/net/sf/japi/swing/app/DocumentFrame.java 2008-12-29 04:17:21 UTC (rev 758)
+++ libs/swing-app/trunk/src/prj/net/sf/japi/swing/app/DocumentFrame.java 2008-12-29 04:26:37 UTC (rev 759)
@@ -37,7 +37,7 @@
*/
DocumentFrame(@NotNull final Document<D> document) {
super("TODO", true, true, true, true);
- setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
+ setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
this.document = document;
}
Modified: libs/swing-keyprefs/trunk/src/prj/net/sf/japi/swing/prefs/keys/ActionKeyDisplay.java
===================================================================
--- libs/swing-keyprefs/trunk/src/prj/net/sf/japi/swing/prefs/keys/ActionKeyDisplay.java 2008-12-29 04:17:21 UTC (rev 758)
+++ libs/swing-keyprefs/trunk/src/prj/net/sf/japi/swing/prefs/keys/ActionKeyDisplay.java 2008-12-29 04:26:37 UTC (rev 759)
@@ -144,7 +144,7 @@
*/
public void setAction(@Nullable final Action action) {
this.action = action;
- putValue(Action.NAME, getLocalizedKeyStrokeText(action));
+ putValue(NAME, getLocalizedKeyStrokeText(action));
setEnabled(action != null);
}
@@ -160,7 +160,7 @@
if (action == null) {
return "";
}
- return getLocalizedKeyStrokeText((KeyStroke) action.getValue(Action.ACCELERATOR_KEY));
+ return getLocalizedKeyStrokeText((KeyStroke) action.getValue(ACCELERATOR_KEY));
}
/** Get the localized text of a KeyStroke.
Modified: libs/swing-prefs/trunk/src/prj/net/sf/japi/swing/prefs/PreferencesPane.java
===================================================================
--- libs/swing-prefs/trunk/src/prj/net/sf/japi/swing/prefs/PreferencesPane.java 2008-12-29 04:17:21 UTC (rev 758)
+++ libs/swing-prefs/trunk/src/prj/net/sf/japi/swing/prefs/PreferencesPane.java 2008-12-29 04:26:37 UTC (rev 759)
@@ -35,7 +35,6 @@
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
-import javax.swing.SwingConstants;
import javax.swing.border.Border;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
@@ -278,10 +277,10 @@
/** Create a PrefsListCellRenderer. */
PrefsListCellRenderer() {
- setHorizontalTextPosition(SwingConstants.CENTER);
- setVerticalTextPosition(SwingConstants.BOTTOM);
- setHorizontalAlignment(SwingConstants.CENTER);
- setVerticalAlignment(SwingConstants.CENTER);
+ setHorizontalTextPosition(CENTER);
+ setVerticalTextPosition(BOTTOM);
+ setHorizontalAlignment(CENTER);
+ setVerticalAlignment(CENTER);
}
/** {@inheritDoc} */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-01-24 22:43:09
|
Revision: 783
http://japi.svn.sourceforge.net/japi/?rev=783&view=rev
Author: christianhujer
Date: 2009-01-24 22:43:02 +0000 (Sat, 24 Jan 2009)
Log Message:
-----------
Split SuperClassIterable from SuperClassIterator.
Modified Paths:
--------------
libs/lang/trunk/src/prj/net/sf/japi/lang/SuperClassIterator.java
libs/lang/trunk/src/tst/test/net/sf/japi/lang/SuperClassIteratorTest.java
libs/swing-action/trunk/src/prj/net/sf/japi/swing/ReflectionAction.java
Added Paths:
-----------
libs/lang/trunk/src/prj/net/sf/japi/lang/SuperClassIterable.java
Added: libs/lang/trunk/src/prj/net/sf/japi/lang/SuperClassIterable.java
===================================================================
--- libs/lang/trunk/src/prj/net/sf/japi/lang/SuperClassIterable.java (rev 0)
+++ libs/lang/trunk/src/prj/net/sf/japi/lang/SuperClassIterable.java 2009-01-24 22:43:02 UTC (rev 783)
@@ -0,0 +1,25 @@
+package net.sf.japi.lang;
+
+import java.util.Iterator;
+
+/**
+ * Iterable for iterating all superclasses of a class (including the class itself).
+ * @author <a href="mailto:ch...@ri...">Christian Hujer</a>
+ */
+public class SuperClassIterable implements Iterable<Class<?>> {
+
+ /** The class to iterate. */
+ private final Class<?> clazz;
+
+ /** Creates a SuperClassIterable.
+ * @param clazz Class to iterate.
+ */
+ public SuperClassIterable(final Class<?> clazz) {
+ this.clazz = clazz;
+ }
+
+ /** {@inheritDoc} */
+ public Iterator<Class<?>> iterator() {
+ return new SuperClassIterator(clazz);
+ }
+}
Property changes on: libs/lang/trunk/src/prj/net/sf/japi/lang/SuperClassIterable.java
___________________________________________________________________
Added: svn:mime-type
+ text/plain
Added: svn:eol-style
+ LF
Modified: libs/lang/trunk/src/prj/net/sf/japi/lang/SuperClassIterator.java
===================================================================
--- libs/lang/trunk/src/prj/net/sf/japi/lang/SuperClassIterator.java 2009-01-24 22:41:52 UTC (rev 782)
+++ libs/lang/trunk/src/prj/net/sf/japi/lang/SuperClassIterator.java 2009-01-24 22:43:02 UTC (rev 783)
@@ -29,7 +29,7 @@
* Note: The supplied class is included in iteration. If you want to omit it, you'll have to invoke getSuperclass() once, e.g. use <code>new SuperClassIterator(clazz.getSuperClass())</code> instead of <code>new SuperClassIterator(clazz)</code>.
* @author <a href="mailto:ch...@ri...">Christian Hujer</a>
*/
-public class SuperClassIterator implements Iterator<Class<?>>, Iterable<Class<?>> {
+public class SuperClassIterator implements Iterator<Class<?>> {
/** The current class. */
@Nullable private Class<?> nextClass;
@@ -64,9 +64,4 @@
throw new UnsupportedOperationException();
}
- /** {@inheritDoc} */
- @NotNull public Iterator<Class<?>> iterator() {
- return this;
- }
-
} // class ClassIterator
Modified: libs/lang/trunk/src/tst/test/net/sf/japi/lang/SuperClassIteratorTest.java
===================================================================
--- libs/lang/trunk/src/tst/test/net/sf/japi/lang/SuperClassIteratorTest.java 2009-01-24 22:41:52 UTC (rev 782)
+++ libs/lang/trunk/src/tst/test/net/sf/japi/lang/SuperClassIteratorTest.java 2009-01-24 22:43:02 UTC (rev 783)
@@ -20,12 +20,12 @@
package test.net.sf.japi.lang;
import java.util.NoSuchElementException;
+import net.sf.japi.lang.SuperClassIterable;
import net.sf.japi.lang.SuperClassIterator;
import org.junit.Assert;
import org.junit.Test;
/** Test for {@link SuperClassIterator}.
- * Created by IntelliJ IDEA.
*
* @author <a href="mailto:ch...@ri...">Christian Hujer</a>
*/
@@ -66,10 +66,10 @@
it.remove();
}
- /** Tests that using {@link SuperClassIterator} as Iterable works. */
+ /** Tests that using {@link SuperClassIterable} as Iterable works. */
@Test
public void testIterable() {
- for (final Class c : new SuperClassIterator(String.class)) {
+ for (final Class c : new SuperClassIterable(String.class)) {
if (!c.equals(String.class) && !c.equals(Object.class)) {
Assert.assertTrue("Expected String.class or Object.class.", false);
}
Modified: libs/swing-action/trunk/src/prj/net/sf/japi/swing/ReflectionAction.java
===================================================================
--- libs/swing-action/trunk/src/prj/net/sf/japi/swing/ReflectionAction.java 2009-01-24 22:41:52 UTC (rev 782)
+++ libs/swing-action/trunk/src/prj/net/sf/japi/swing/ReflectionAction.java 2009-01-24 22:43:02 UTC (rev 783)
@@ -25,7 +25,7 @@
import java.lang.reflect.Method;
import javax.swing.AbstractAction;
import javax.swing.Icon;
-import net.sf.japi.lang.SuperClassIterator;
+import net.sf.japi.lang.SuperClassIterable;
import static net.sf.japi.swing.ActionBuilder.ACTION_ID;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -182,7 +182,7 @@
final ActionBuilder actionBuilder = (ActionBuilder) getValue(REFLECTION_MESSAGE_PROVIDER);
final Throwable cause = ex.getCause();
if (actionBuilder != null) {
- for (final Class<?> c : new SuperClassIterator(cause.getClass())) {
+ for (final Class<?> c : new SuperClassIterable(cause.getClass())) {
final String dialogKey = getValue(ACTION_ID) + ".exception." + c.getName();
final String title = actionBuilder.getString(dialogKey + ".title");
if (title != null) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-02-15 20:23:07
|
Revision: 905
http://japi.svn.sourceforge.net/japi/?rev=905&view=rev
Author: christianhujer
Date: 2009-02-15 20:23:04 +0000 (Sun, 15 Feb 2009)
Log Message:
-----------
Added lib directories which are now required for building (even if empty).
Added Paths:
-----------
libs/lang/trunk/lib/
libs/logging/trunk/lib/
libs/registry/trunk/lib/
libs/swing-proxyprefs/trunk/lib/
libs/swing-recent/trunk/lib/
libs/swing-treetable/trunk/lib/
libs/taglets/trunk/lib/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <chr...@us...> - 2009-05-12 22:53:31
|
Revision: 1289
http://japi.svn.sourceforge.net/japi/?rev=1289&view=rev
Author: christianhujer
Date: 2009-05-12 22:53:23 +0000 (Tue, 12 May 2009)
Log Message:
-----------
Add structure for new sql lib.
Added Paths:
-----------
libs/sql/
libs/sql/branches/
libs/sql/tags/
libs/sql/trunk/
libs/sql/trunk/lib/
libs/sql/trunk/src/
libs/sql/trunk/src/doc/
libs/sql/trunk/src/prj/
libs/sql/trunk/src/tst/
Property changes on: libs/sql/trunk
___________________________________________________________________
Added: svn:ignore
+ bin
classes
dest
developer.properties
dist
docs
Added: svn:externals
+ ^/common/trunk common
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|