Added missing project files
Updated whitespace
This commit is contained in:
parent
309f7d2a3a
commit
a1dc59f2ba
17
JavaXNA Test/.project
Normal file
17
JavaXNA Test/.project
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>JavaXNA Test</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
17
Microsoft.Xna.Framework.Game/.project
Normal file
17
Microsoft.Xna.Framework.Game/.project
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Microsoft.Xna.Framework.Game</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
17
Microsoft.Xna.Framework/.project
Normal file
17
Microsoft.Xna.Framework/.project
Normal file
@ -0,0 +1,17 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<projectDescription>
|
||||
<name>Microsoft.Xna.Framework</name>
|
||||
<comment></comment>
|
||||
<projects>
|
||||
</projects>
|
||||
<buildSpec>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
@ -10,43 +10,44 @@ import System.*;
|
||||
public final class Album implements IEquatable<Album>, IDisposable
|
||||
{
|
||||
private Artist artist;
|
||||
private TimeSpan duration;
|
||||
static Album Empty;
|
||||
private Genre genre;
|
||||
//private uint handle;
|
||||
private boolean hasArt;
|
||||
private int hashcode;
|
||||
private boolean isDisposed;
|
||||
private String name;
|
||||
private SongCollection songs;
|
||||
private TimeSpan duration;
|
||||
static Album Empty;
|
||||
private Genre genre;
|
||||
//private uint handle;
|
||||
private boolean hasArt;
|
||||
private int hashcode;
|
||||
private boolean isDisposed;
|
||||
private String name;
|
||||
private SongCollection songs;
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Artist getArtist()
|
||||
{
|
||||
if (this.artist == Artist.Empty)
|
||||
{
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
public Artist getArtist()
|
||||
{
|
||||
if (this.artist == Artist.Empty)
|
||||
{
|
||||
|
||||
}
|
||||
return this.artist;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean HasArt()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return this.hasArt;
|
||||
}
|
||||
return this.artist;
|
||||
}
|
||||
|
||||
private Album()
|
||||
{
|
||||
this.name = "";
|
||||
this.artist = Artist.Empty;
|
||||
this.genre = Genre.Empty;
|
||||
this.songs = SongCollection.Empty;
|
||||
this.duration = TimeSpan.Zero;
|
||||
}
|
||||
public boolean HasArt()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return this.hasArt;
|
||||
}
|
||||
|
||||
private Album()
|
||||
{
|
||||
this.name = "";
|
||||
this.artist = Artist.Empty;
|
||||
this.genre = Genre.Empty;
|
||||
this.songs = SongCollection.Empty;
|
||||
this.duration = TimeSpan.Zero;
|
||||
}
|
||||
|
||||
/*
|
||||
Album(uint handle)
|
||||
@ -58,9 +59,9 @@ public final class Album implements IEquatable<Album>, IDisposable
|
||||
this.duration = TimeSpan.Zero;
|
||||
}*/
|
||||
|
||||
/**
|
||||
* Immediately releases the unmanaged resources used by this object.
|
||||
*/
|
||||
/**
|
||||
* Immediately releases the unmanaged resources used by this object.
|
||||
*/
|
||||
@Override
|
||||
public void Dispose()
|
||||
{
|
||||
@ -73,10 +74,12 @@ public final class Album implements IEquatable<Album>, IDisposable
|
||||
{
|
||||
this.isDisposed = true;
|
||||
// TODO: implement
|
||||
|
||||
if (false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
songs = SongCollection.Empty;
|
||||
}
|
||||
}
|
||||
@ -118,17 +121,19 @@ public final class Album implements IEquatable<Album>, IDisposable
|
||||
public int hashCode()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
|
||||
if (this.hashcode == -1)
|
||||
{
|
||||
this.hashcode = this.name.hashCode();
|
||||
}
|
||||
|
||||
return this.hashcode;
|
||||
}
|
||||
|
||||
private void ThrowIfDisposed()
|
||||
{
|
||||
if (this.isDisposed)
|
||||
throw new ObjectDisposedException(super.toString(), "This object has already been disposed.");
|
||||
throw new ObjectDisposedException(super.toString(), "This object has already been disposed.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -10,56 +10,56 @@ import System.*;
|
||||
public final class Artist implements IEquatable<Artist>, IDisposable
|
||||
{
|
||||
private AlbumCollection albums;
|
||||
static Artist Empty;
|
||||
//private uint handle;
|
||||
private int hashcode;
|
||||
private boolean isDisposed;
|
||||
private String name;
|
||||
private SongCollection songs;
|
||||
static Artist Empty;
|
||||
//private uint handle;
|
||||
private int hashcode;
|
||||
private boolean isDisposed;
|
||||
private String name;
|
||||
private SongCollection songs;
|
||||
|
||||
/**
|
||||
* Gets a value indicating whether the object is disposed.
|
||||
*/
|
||||
public boolean IsDisposed()
|
||||
{
|
||||
return this.isDisposed;
|
||||
}
|
||||
/**
|
||||
* Gets a value indicating whether the object is disposed.
|
||||
*/
|
||||
public boolean IsDisposed()
|
||||
{
|
||||
return this.isDisposed;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the name of the Artist.
|
||||
*/
|
||||
public String getName()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return this.name;
|
||||
}
|
||||
/**
|
||||
* Gets the name of the Artist.
|
||||
*/
|
||||
public String getName()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
return this.name;
|
||||
}
|
||||
|
||||
private Artist()
|
||||
{
|
||||
//this.handle = uint.MaxValue;
|
||||
this.hashcode = -1;
|
||||
this.name = "";
|
||||
this.songs = SongCollection.Empty;
|
||||
this.albums = AlbumCollection.Empty;
|
||||
}
|
||||
private Artist()
|
||||
{
|
||||
//this.handle = uint.MaxValue;
|
||||
this.hashcode = -1;
|
||||
this.name = "";
|
||||
this.songs = SongCollection.Empty;
|
||||
this.albums = AlbumCollection.Empty;
|
||||
}
|
||||
|
||||
/*Artist(uint handle)
|
||||
{
|
||||
this.handle = uint.MaxValue;
|
||||
this.hashcode = -1;
|
||||
this.name = "";
|
||||
this.songs = SongCollection.Empty;
|
||||
this.albums = AlbumCollection.Empty;
|
||||
this.handle = handle;
|
||||
if (this.IsValidHandle)
|
||||
{
|
||||
StringBuilder sbName = new StringBuilder(260);
|
||||
if (Helpers.Succeeded(UnsafeNativeMethods.MediaItem_GetName(handle, sbName, 260)))
|
||||
{
|
||||
this.name = sbName.ToString();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
/*Artist(uint handle)
|
||||
{
|
||||
this.handle = uint.MaxValue;
|
||||
this.hashcode = -1;
|
||||
this.name = "";
|
||||
this.songs = SongCollection.Empty;
|
||||
this.albums = AlbumCollection.Empty;
|
||||
this.handle = handle;
|
||||
if (this.IsValidHandle)
|
||||
{
|
||||
StringBuilder sbName = new StringBuilder(260);
|
||||
if (Helpers.Succeeded(UnsafeNativeMethods.MediaItem_GetName(handle, sbName, 260)))
|
||||
{
|
||||
this.name = sbName.ToString();
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public void Dispose()
|
||||
@ -116,7 +116,9 @@ public final class Artist implements IEquatable<Artist>, IDisposable
|
||||
private void ThrowIfDisposed()
|
||||
{
|
||||
if (this.isDisposed)
|
||||
throw new ObjectDisposedException(super.toString(), "This object has already been disposed.");
|
||||
{
|
||||
throw new ObjectDisposedException(super.toString(), "This object has already been disposed.");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -28,8 +28,10 @@ public class MediaPlayer
|
||||
*/
|
||||
public static void MoveNext()
|
||||
{
|
||||
if (!ActiveSongChanged.getHandlers().isEmpty())
|
||||
if (!ActiveSongChanged.hasHandlers())
|
||||
{
|
||||
ActiveSongChanged.raise(null, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -37,8 +39,10 @@ public class MediaPlayer
|
||||
*/
|
||||
public static void MovePrevious()
|
||||
{
|
||||
if (!ActiveSongChanged.getHandlers().isEmpty())
|
||||
if (!ActiveSongChanged.hasHandlers())
|
||||
{
|
||||
ActiveSongChanged.raise(null, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -46,8 +50,10 @@ public class MediaPlayer
|
||||
*/
|
||||
public static void Pause()
|
||||
{
|
||||
if (!MediaStateChanged.getHandlers().isEmpty())
|
||||
if (!MediaStateChanged.hasHandlers())
|
||||
{
|
||||
MediaStateChanged.raise(null, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -83,8 +89,10 @@ public class MediaPlayer
|
||||
*/
|
||||
public static void Resume()
|
||||
{
|
||||
if (!MediaStateChanged.getHandlers().isEmpty())
|
||||
if (!MediaStateChanged.hasHandlers())
|
||||
{
|
||||
MediaStateChanged.raise(null, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -92,8 +100,10 @@ public class MediaPlayer
|
||||
*/
|
||||
public static void Stop()
|
||||
{
|
||||
if (!MediaStateChanged.getHandlers().isEmpty())
|
||||
if (!MediaStateChanged.hasHandlers())
|
||||
{
|
||||
MediaStateChanged.raise(null, EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
static
|
||||
|
@ -10,13 +10,13 @@ public enum MediaState
|
||||
/**
|
||||
* Media playback is stopped.
|
||||
*/
|
||||
Stopped,
|
||||
/**
|
||||
* Media is currently playing.
|
||||
*/
|
||||
Playing,
|
||||
/**
|
||||
* Media playback is paused.
|
||||
*/
|
||||
Paused
|
||||
Stopped,
|
||||
/**
|
||||
* Media is currently playing.
|
||||
*/
|
||||
Playing,
|
||||
/**
|
||||
* Media playback is paused.
|
||||
*/
|
||||
Paused
|
||||
}
|
||||
|
@ -23,17 +23,17 @@ public final class Song implements IEquatable<Song>, IDisposable
|
||||
|
||||
}
|
||||
|
||||
private void Dispose(boolean disposing)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void Dispose()
|
||||
{
|
||||
this.Dispose(true);
|
||||
}
|
||||
|
||||
private void Dispose(boolean disposing)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@ -82,7 +82,9 @@ public final class Song implements IEquatable<Song>, IDisposable
|
||||
private void ThrowIfDisposed()
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException(this.toString(), "This object has already been disposed.");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -191,6 +191,7 @@ public abstract class KeyedCollection<TKey, TItem> extends Collection<TItem>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -198,10 +199,12 @@ public abstract class KeyedCollection<TKey, TItem> extends Collection<TItem>
|
||||
{
|
||||
TKey local;
|
||||
TItem local2;
|
||||
|
||||
if ((this.dict != null) || ((local = this.GetKeyForItem(item)) != null))
|
||||
{
|
||||
return super.getItems().contains(item);
|
||||
}
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@ -216,10 +219,12 @@ public abstract class KeyedCollection<TKey, TItem> extends Collection<TItem>
|
||||
protected void InsertItem(int index, TItem item)
|
||||
{
|
||||
TKey keyForItem = this.GetKeyForItem(item);
|
||||
|
||||
if (keyForItem != null)
|
||||
{
|
||||
this.AddKey(keyForItem, item);
|
||||
}
|
||||
|
||||
super.InsertItem(index, item);
|
||||
}
|
||||
|
||||
@ -229,10 +234,12 @@ public abstract class KeyedCollection<TKey, TItem> extends Collection<TItem>
|
||||
{
|
||||
throw new ArgumentNullException("key");
|
||||
}
|
||||
|
||||
if (this.dict != null)
|
||||
{
|
||||
return (this.dict.containsKey(key) && super.Remove(this.dict.get(key)));
|
||||
}
|
||||
|
||||
if (key != null)
|
||||
{
|
||||
for (int i = 0; i < super.getItems().size(); i++)
|
||||
@ -244,6 +251,7 @@ public abstract class KeyedCollection<TKey, TItem> extends Collection<TItem>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -251,10 +259,12 @@ public abstract class KeyedCollection<TKey, TItem> extends Collection<TItem>
|
||||
protected void RemoveItem(int index)
|
||||
{
|
||||
TKey keyForItem = this.GetKeyForItem(super.getItems().get(index));
|
||||
|
||||
if (keyForItem != null)
|
||||
{
|
||||
this.RemoveKey(keyForItem);
|
||||
}
|
||||
|
||||
super.RemoveItem(index);
|
||||
}
|
||||
|
||||
@ -275,6 +285,7 @@ public abstract class KeyedCollection<TKey, TItem> extends Collection<TItem>
|
||||
{
|
||||
TKey keyForItem = this.GetKeyForItem(item);
|
||||
TKey x = this.GetKeyForItem(super.getItems().get(index));
|
||||
|
||||
if (this.comparer.equals(x, keyForItem))
|
||||
{
|
||||
if ((keyForItem != null) && (this.dict != null))
|
||||
@ -288,11 +299,13 @@ public abstract class KeyedCollection<TKey, TItem> extends Collection<TItem>
|
||||
{
|
||||
this.AddKey(keyForItem, item);
|
||||
}
|
||||
|
||||
if (x != null)
|
||||
{
|
||||
this.RemoveKey(x);
|
||||
}
|
||||
}
|
||||
|
||||
super.SetItem(index, item);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user