Added missing fields
Added Uri-related enums Added Microphone class and related enum Updated whitespace
This commit is contained in:
parent
9335b2e748
commit
9cfedf1e78
@ -12,9 +12,9 @@ import Microsoft.Xna.Framework.Net.*;
|
||||
*/
|
||||
public class Game1 extends Game
|
||||
{
|
||||
GraphicsDeviceManager graphics;
|
||||
SpriteBatch spriteBatch;
|
||||
Texture2D background;
|
||||
private GraphicsDeviceManager graphics;
|
||||
private SpriteBatch spriteBatch;
|
||||
private Texture2D background;
|
||||
|
||||
public Game1()
|
||||
{
|
||||
@ -24,9 +24,9 @@ public class Game1 extends Game
|
||||
|
||||
/**
|
||||
* Allows the game to perform any initialization it needs to before starting to run.
|
||||
* This is where it can query for any required services and load any non-graphic
|
||||
* related content. Calling base.Initialize will enumerate through any components
|
||||
* and initialize them as well.
|
||||
* This is where it can query for any required services and load any non-graphic
|
||||
* related content. Calling base.Initialize will enumerate through any components
|
||||
* and initialize them as well.
|
||||
*/
|
||||
@Override
|
||||
public void Initialize()
|
||||
@ -38,7 +38,7 @@ public class Game1 extends Game
|
||||
|
||||
/**
|
||||
* LoadContent will be called once per game and is the place to load
|
||||
* all of your content.
|
||||
* all of your content.
|
||||
*/
|
||||
@Override
|
||||
public void LoadContent()
|
||||
@ -54,7 +54,7 @@ public class Game1 extends Game
|
||||
|
||||
/**
|
||||
* UnloadContent will be called once per game and is the place to unload
|
||||
* all content.
|
||||
* all content.
|
||||
*/
|
||||
@Override
|
||||
protected void UnloadContent()
|
||||
|
@ -39,7 +39,7 @@ public final class DynamicSoundEffectInstance extends SoundEffectInstance
|
||||
throw new ArgumentOutOfRangeException("channels");
|
||||
}
|
||||
|
||||
// TODO: implement
|
||||
// TODO: implement
|
||||
}
|
||||
|
||||
/**
|
||||
@ -74,13 +74,19 @@ public final class DynamicSoundEffectInstance extends SoundEffectInstance
|
||||
synchronized (super.VoiceHandleLock)
|
||||
{
|
||||
if (super.IsDisposed())
|
||||
{
|
||||
throw new ObjectDisposedException(super.getClass().getName(), "This object has already been disposed.");
|
||||
}
|
||||
|
||||
if (sizeInBytes < 0)
|
||||
{
|
||||
throw new ArgumentException("Buffer size cannot be negative.");
|
||||
}
|
||||
|
||||
if (sizeInBytes == 0)
|
||||
{
|
||||
return TimeSpan.Zero;
|
||||
}
|
||||
|
||||
// TODO: get this from AudioFormat
|
||||
throw new NotImplementedException();
|
||||
@ -107,23 +113,24 @@ public final class DynamicSoundEffectInstance extends SoundEffectInstance
|
||||
throw new ObjectDisposedException(super.getClass().getName(), "This object has already been disposed.");
|
||||
|
||||
if ((duration.getTotalMilliseconds() < 0.0) || (duration.getTotalMilliseconds() > 2147483647.0))
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("duration");
|
||||
}
|
||||
if (duration == TimeSpan.Zero)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("duration");
|
||||
}
|
||||
if (duration == TimeSpan.Zero)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
// TODO: implement
|
||||
}
|
||||
catch(OverflowException ex)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("duration");
|
||||
}
|
||||
try
|
||||
{
|
||||
// TODO: implement
|
||||
}
|
||||
catch(OverflowException ex)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("duration", ex);
|
||||
}
|
||||
}
|
||||
|
||||
return num;
|
||||
}
|
||||
|
||||
@ -138,7 +145,9 @@ public final class DynamicSoundEffectInstance extends SoundEffectInstance
|
||||
synchronized(super.VoiceHandleLock)
|
||||
{
|
||||
if (super.IsDisposed())
|
||||
{
|
||||
throw new ObjectDisposedException(super.getClass().getName(), "This object has already been disposed.");
|
||||
}
|
||||
|
||||
// TODO: implement
|
||||
throw new NotImplementedException();
|
||||
@ -153,7 +162,7 @@ public final class DynamicSoundEffectInstance extends SoundEffectInstance
|
||||
*/
|
||||
public void SubmitBuffer(byte[] buffer)
|
||||
{
|
||||
this.SubmitBuffer(buffer, 0, buffer.length);
|
||||
this.SubmitBuffer(buffer, 0, buffer.length);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -178,8 +187,11 @@ public final class DynamicSoundEffectInstance extends SoundEffectInstance
|
||||
synchronized(super.VoiceHandleLock)
|
||||
{
|
||||
int num = 0;
|
||||
|
||||
if (super.IsDisposed())
|
||||
{
|
||||
throw new ObjectDisposedException(super.getClass().getName(), "This object has already been disposed.");
|
||||
}
|
||||
|
||||
if (((buffer == null) || (buffer.length == 0)) || !this.format.IsAligned(buffer.length))
|
||||
{
|
||||
@ -195,7 +207,7 @@ public final class DynamicSoundEffectInstance extends SoundEffectInstance
|
||||
}
|
||||
catch(OverflowException ex)
|
||||
{
|
||||
throw new ArgumentException("Ensure that count is valid and meets the block alignment requirements for the audio format. Offset and count must define a valid region within the buffer boundaries.");
|
||||
throw new ArgumentException("Ensure that count is valid and meets the block alignment requirements for the audio format. Offset and count must define a valid region within the buffer boundaries.", ex);
|
||||
}
|
||||
if (((count <= 0) || (num > buffer.length)) |!this.format.IsAligned(count))
|
||||
{
|
||||
|
@ -0,0 +1,150 @@
|
||||
package Microsoft.Xna.Framework.Audio;
|
||||
|
||||
import System.*;
|
||||
import System.Collections.ObjectModel.*;
|
||||
|
||||
/**
|
||||
* Provides properties, methods, and fields and events for capturing audio data with microphones.
|
||||
*
|
||||
* @author Halofreak1990
|
||||
*/
|
||||
public final class Microphone
|
||||
{
|
||||
/**
|
||||
* Returns the collection of all currently-available microphones.
|
||||
*/
|
||||
public static ReadOnlyCollection<Microphone> getAll()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets audio capture buffer duration of the microphone.
|
||||
*/
|
||||
public TimeSpan getBufferDuration()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets audio capture buffer duration of the microphone.
|
||||
*
|
||||
* @param value
|
||||
*/
|
||||
public void setBufferDuration(TimeSpan value)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the default attached microphone.
|
||||
*/
|
||||
public static Microphone getDefault()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if the microphone is a wired headset or a Bluetooth device.
|
||||
*/
|
||||
public boolean IsHeadset()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the friendly name of the microphone.
|
||||
*/
|
||||
public final String Name = ""; // TODO: use constructor to get this at run-time.
|
||||
|
||||
/**
|
||||
* Returns the sample rate at which the microphone is capturing audio data.
|
||||
*/
|
||||
public int getSampleRate()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the recording state of the Microphone object.
|
||||
*/
|
||||
public MicrophoneState getState()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/**
|
||||
* The event that occurs when the audio capture buffer is ready to processed.
|
||||
*/
|
||||
public final Event<EventArgs> BufferReady = new Event<EventArgs>();
|
||||
|
||||
protected void finalize()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the latest recorded data from the microphone based on the audio capture buffer.
|
||||
*
|
||||
* @param buffer
|
||||
* Buffer, in bytes, containing the captured audio data. The audio format must be PCM wave data.
|
||||
*/
|
||||
public int GetData(byte[] buffer)
|
||||
{
|
||||
return this.GetData(buffer, 0, buffer.length);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the latest captured audio data from the microphone based on the specified offset and byte count.
|
||||
*
|
||||
* @param buffer
|
||||
* Buffer, in bytes, containing the captured audio data. The audio format must be PCM wave data.
|
||||
*
|
||||
* @param offset
|
||||
* Offset, in bytes, to the starting position of the data.
|
||||
*
|
||||
* @param count
|
||||
* Amount, in bytes, of desired audio data.
|
||||
*/
|
||||
public int GetData(byte[ ] buffer, int offset, int count)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the duration of audio playback based on the size of the buffer.
|
||||
*
|
||||
* @param sizeInBytes
|
||||
* Size, in bytes, of the audio data.
|
||||
*/
|
||||
public TimeSpan GetSampleDuration(int sizeInBytes)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the size of the byte array required to hold the specified duration of audio for this microphone object.
|
||||
*
|
||||
* @param duration
|
||||
* TimeSpan object that contains the duration of the audio sample.
|
||||
*/
|
||||
public int GetSampleSizeInBytes(TimeSpan duration)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts microphone audio capture.
|
||||
*/
|
||||
public void Start()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Stops microphone audio capture.
|
||||
*/
|
||||
public void Stop()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package Microsoft.Xna.Framework.Audio;
|
||||
|
||||
/**
|
||||
* Current state of the Microphone audio capture (started or stopped).
|
||||
*
|
||||
* @author Halofreak1990
|
||||
*/
|
||||
public enum MicrophoneState
|
||||
{
|
||||
/**
|
||||
* The Microphone audio capture has started.
|
||||
*/
|
||||
Started,
|
||||
/**
|
||||
* The Microphone audio capture has stopped.
|
||||
*/
|
||||
Stopped
|
||||
}
|
@ -10,8 +10,8 @@ import System.*;
|
||||
public class SoundEffectInstance implements IDisposable
|
||||
{
|
||||
private float currentPan;
|
||||
private float currentPitch;
|
||||
private float currentVolume;
|
||||
private float currentPitch;
|
||||
private float currentVolume;
|
||||
private boolean isDisposed;
|
||||
private boolean isFireAndForget;
|
||||
private SoundEffect parent;
|
||||
@ -51,13 +51,17 @@ public class SoundEffectInstance implements IDisposable
|
||||
synchronized(this)
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException(super.getClass().toString(), "FrameworkResources.ObjectDisposedException");
|
||||
}
|
||||
|
||||
if (value < -1f || value > 1f)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("value");
|
||||
}
|
||||
|
||||
//Helpers.ThrowExceptionFromErrorCode(SoundEffectUnsafeNativeMethods.SetPan(this.voiceHandle, value));
|
||||
this.currentPan = value;
|
||||
this.currentPan = value;
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,10 +81,14 @@ public class SoundEffectInstance implements IDisposable
|
||||
synchronized(this)
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException(super.getClass().toString(), "FrameworkResources.ObjectDisposedException");
|
||||
}
|
||||
|
||||
if (value < -1f || value > 1f)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("value");
|
||||
}
|
||||
|
||||
//Helpers.ThrowExceptionFromErrorCode(SoundEffectUnsafeNativeMethods.SetPitch(this.voiceHandle, value));
|
||||
this.currentPitch = value;
|
||||
@ -100,7 +108,9 @@ public class SoundEffectInstance implements IDisposable
|
||||
synchronized(this)
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException(super.getClass().toString(), "FrameworkResources.ObjectDisposedException");
|
||||
}
|
||||
|
||||
// TODO: implement
|
||||
throw new NotImplementedException();
|
||||
@ -123,10 +133,14 @@ public class SoundEffectInstance implements IDisposable
|
||||
synchronized(this)
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException(super.getClass().toString(), "FrameworkResources.ObjectDisposedException");
|
||||
}
|
||||
|
||||
if (value < -1f || value > 1f)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("value");
|
||||
}
|
||||
|
||||
//Helpers.ThrowExceptionFromErrorCode(SoundEffectUnsafeNativeMethods.SetVolume(this.voiceHandle, value));
|
||||
this.currentVolume = value;
|
||||
@ -145,7 +159,9 @@ public class SoundEffectInstance implements IDisposable
|
||||
this.currentVolume = 1f;
|
||||
this.VoiceHandleLock = new Object();
|
||||
if (parentEffect.IsDisposed())
|
||||
{
|
||||
throw new ObjectDisposedException(SoundEffect.class.getName(), "This object has already been disposed.");
|
||||
}
|
||||
|
||||
this.parent = parentEffect;
|
||||
this.setVolume(1f);
|
||||
@ -183,7 +199,9 @@ public class SoundEffectInstance implements IDisposable
|
||||
synchronized(this)
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException(super.getClass().toString(), "FrameworkResources.ObjectDisposedException");
|
||||
}
|
||||
|
||||
// TODO: implement
|
||||
throw new NotImplementedException();
|
||||
@ -235,7 +253,9 @@ public class SoundEffectInstance implements IDisposable
|
||||
synchronized(this)
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException(super.getClass().toString(), "FrameworkResources.ObjectDisposedException");
|
||||
}
|
||||
|
||||
// TODO: implement
|
||||
throw new NotImplementedException();
|
||||
@ -250,7 +270,9 @@ public class SoundEffectInstance implements IDisposable
|
||||
synchronized(this)
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException(super.getClass().toString(), "FrameworkResources.ObjectDisposedException");
|
||||
}
|
||||
|
||||
// TODO: implement
|
||||
throw new NotImplementedException();
|
||||
@ -265,7 +287,9 @@ public class SoundEffectInstance implements IDisposable
|
||||
synchronized(this)
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException(super.getClass().toString(), "FrameworkResources.ObjectDisposedException");
|
||||
}
|
||||
|
||||
// TODO: implement
|
||||
throw new NotImplementedException();
|
||||
@ -291,7 +315,9 @@ public class SoundEffectInstance implements IDisposable
|
||||
synchronized(this)
|
||||
{
|
||||
if (this.isDisposed)
|
||||
{
|
||||
throw new ObjectDisposedException(super.getClass().toString(), "FrameworkResources.ObjectDisposedException");
|
||||
}
|
||||
|
||||
// TODO: implement
|
||||
throw new NotImplementedException();
|
||||
|
@ -1,5 +1,6 @@
|
||||
package Microsoft.Xna.Framework.Content;
|
||||
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.*;
|
||||
import java.util.*;
|
||||
|
||||
@ -20,18 +21,30 @@ public class ContentManager implements IDisposable
|
||||
private IServiceProvider serviceProvider;
|
||||
private Action<IDisposable> recordDisposableObject;
|
||||
|
||||
/**
|
||||
* Gets the root directory associated with this ContentManager.
|
||||
*/
|
||||
public String getRootDirectory()
|
||||
{
|
||||
return this.rootDirectory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the root directory associated with this ContentManager.
|
||||
*
|
||||
* @param value
|
||||
*/
|
||||
public void setRootDirectory(String value)
|
||||
{
|
||||
if (value == null)
|
||||
{
|
||||
throw new ArgumentNullException("value");
|
||||
}
|
||||
|
||||
if (this.assets.size() > 0)
|
||||
{
|
||||
throw new InvalidOperationException("");
|
||||
}
|
||||
|
||||
this.rootDirectory = value;
|
||||
/*this.fullRootDirectory = value;
|
||||
@ -48,15 +61,22 @@ public class ContentManager implements IDisposable
|
||||
}*/
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the service provider associated with the ContentManager.
|
||||
*/
|
||||
public IServiceProvider getServiceProvider()
|
||||
{
|
||||
return this.serviceProvider;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes a new instance of ContentManager.
|
||||
*
|
||||
* @param serviceProvider
|
||||
* The service provider that the ContentManager should use to locate services.
|
||||
*
|
||||
* @throws ArgumentNullException
|
||||
* serviceProvider is null.
|
||||
*/
|
||||
public ContentManager(IServiceProvider serviceProvider)
|
||||
{
|
||||
@ -64,10 +84,16 @@ public class ContentManager implements IDisposable
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes a new instance of ContentManager.
|
||||
*
|
||||
* @param serviceProvider
|
||||
* The service provider the ContentManager should use to locate services.
|
||||
*
|
||||
* @param rootDirectory
|
||||
* The root directory to search for content.
|
||||
*
|
||||
* @throws ArgumentNullException
|
||||
* serviceProvider or rootDirectory is null.
|
||||
*/
|
||||
public ContentManager(IServiceProvider serviceProvider, String rootDirectory)
|
||||
{
|
||||
@ -87,7 +113,7 @@ public class ContentManager implements IDisposable
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Releases all resources used by the ContentManager class.
|
||||
*/
|
||||
@Override
|
||||
public void Dispose()
|
||||
@ -95,6 +121,12 @@ public class ContentManager implements IDisposable
|
||||
Dispose(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Releases the unmanaged resources used by the ContentManager and optionally releases the managed resources.
|
||||
*
|
||||
* @param disposing
|
||||
* true to release both managed and unmanaged resources; false to release only unmanaged resources.
|
||||
*/
|
||||
protected void Dispose(boolean disposing)
|
||||
{
|
||||
if (!this.disposed)
|
||||
@ -158,6 +190,17 @@ public class ContentManager implements IDisposable
|
||||
return asset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Opens a stream for reading the specified asset. Derived classes can replace this to implement pack files or asset compression.
|
||||
*
|
||||
* @param assetName
|
||||
* The name of the asset being read.
|
||||
*/
|
||||
protected InputStream OpenStream(String assetName)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Low-level worker method that reads asset data.
|
||||
*
|
||||
|
@ -2,6 +2,8 @@ package Microsoft.Xna.Framework.GamerServices;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import System.*;
|
||||
|
||||
/**
|
||||
* Provides the presence information of a friend of the local gamer.
|
||||
*
|
||||
@ -13,7 +15,29 @@ public final class FriendGamer extends Gamer
|
||||
private FriendCollection parent;
|
||||
private String presence;
|
||||
|
||||
/**
|
||||
* Gets whether the local gamer who requested the friends list has received a friend request from this gamer.
|
||||
*/
|
||||
public boolean FriendRequestReceivedFrom()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets whether the local gamer who requested the friends list has sent a friend request to this gamer.
|
||||
*/
|
||||
public boolean FriendRequestSentTo()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a title-defined presence string describing what this friend is currently doing.
|
||||
*/
|
||||
public String getPresence()
|
||||
{
|
||||
return presence;
|
||||
}
|
||||
|
||||
FriendGamer(FriendCollection parent, String gamertag, String presence, EnumSet<FriendState> friendState)
|
||||
{
|
||||
|
@ -73,13 +73,9 @@ public final class Album implements IEquatable<Album>, IDisposable
|
||||
if (!isDisposed)
|
||||
{
|
||||
this.isDisposed = true;
|
||||
|
||||
// TODO: implement
|
||||
|
||||
if (false)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
songs = SongCollection.Empty;
|
||||
}
|
||||
}
|
||||
|
@ -11,6 +11,8 @@ import System.*;
|
||||
*/
|
||||
public final class AlbumCollection implements Iterable<Album>
|
||||
{
|
||||
static final AlbumCollection Empty = null;
|
||||
|
||||
/**
|
||||
* Returns an iterator that iterates through the AlbumCollection.
|
||||
*/
|
||||
|
@ -51,6 +51,7 @@ public final class Artist implements IEquatable<Artist>, IDisposable
|
||||
this.songs = SongCollection.Empty;
|
||||
this.albums = AlbumCollection.Empty;
|
||||
this.handle = handle;
|
||||
|
||||
if (this.IsValidHandle)
|
||||
{
|
||||
StringBuilder sbName = new StringBuilder(260);
|
||||
|
@ -9,6 +9,8 @@ import System.*;
|
||||
*/
|
||||
public final class Genre implements IEquatable<Genre>, IDisposable
|
||||
{
|
||||
static final Genre Empty = null;
|
||||
|
||||
/**
|
||||
* Gets the AlbumCollection for the Genre.
|
||||
*/
|
||||
|
@ -12,6 +12,8 @@ import System.*;
|
||||
public final class SongCollection implements Iterable<Song>
|
||||
{
|
||||
|
||||
static final SongCollection Empty = null;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
@ -68,7 +68,7 @@ public final class Point extends ValueType implements IEquatable<Point>
|
||||
*/
|
||||
public boolean Equals(Point other)
|
||||
{
|
||||
return ((this.X == other.X) && (this.Y == other.Y));
|
||||
return ((this.X == other.X) && (this.Y == other.Y));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -77,7 +77,7 @@ public final class Point extends ValueType implements IEquatable<Point>
|
||||
@Override
|
||||
public int hashCode()
|
||||
{
|
||||
return (this.X ^ this.Y);
|
||||
return (this.X ^ this.Y);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -86,6 +86,6 @@ public final class Point extends ValueType implements IEquatable<Point>
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
return String.format(Locale.getDefault(), "{X:%i Y:%i}", this.X, this.Y);
|
||||
return String.format(Locale.getDefault(), "{X:%i Y:%i}", this.X, this.Y);
|
||||
}
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ public final class Rectangle extends ValueType implements IEquatable<Rectangle>
|
||||
public void setLocation(Point newLocation)
|
||||
{
|
||||
this.X = newLocation.X;
|
||||
this.Y = newLocation.Y;
|
||||
this.Y = newLocation.Y;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -121,10 +121,10 @@ public final class Rectangle extends ValueType implements IEquatable<Rectangle>
|
||||
*/
|
||||
public Rectangle(int x, int y, int width, int height)
|
||||
{
|
||||
this.X = x;
|
||||
this.Y = y;
|
||||
this.Width = width;
|
||||
this.Height = height;
|
||||
this.X = x;
|
||||
this.Y = y;
|
||||
this.Width = width;
|
||||
this.Height = height;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -146,7 +146,7 @@ public final class Rectangle extends ValueType implements IEquatable<Rectangle>
|
||||
*/
|
||||
public boolean Contains(Point value)
|
||||
{
|
||||
return ((((this.X <= value.X) && (value.X < (this.X + this.Width))) && (this.Y <= value.Y)) && (value.Y < (this.Y + this.Height)));
|
||||
return ((((this.X <= value.X) && (value.X < (this.X + this.Width))) && (this.Y <= value.Y)) && (value.Y < (this.Y + this.Height)));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -157,7 +157,7 @@ public final class Rectangle extends ValueType implements IEquatable<Rectangle>
|
||||
*/
|
||||
public boolean Contains(Rectangle value)
|
||||
{
|
||||
return ((((this.X <= value.X) && ((value.X + value.Width) <= (this.X + this.Width))) && (this.Y <= value.Y)) && ((value.Y + value.Height) <= (this.Y + this.Height)));
|
||||
return ((((this.X <= value.X) && ((value.X + value.Width) <= (this.X + this.Width))) && (this.Y <= value.Y)) && ((value.Y + value.Height) <= (this.Y + this.Height)));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -171,7 +171,7 @@ public final class Rectangle extends ValueType implements IEquatable<Rectangle>
|
||||
*/
|
||||
public void Contains(Rectangle value, boolean result)
|
||||
{
|
||||
result = (((this.X <= value.X) && ((value.X + value.Width) <= (this.X + this.Width))) && (this.Y <= value.Y)) && ((value.Y + value.Height) <= (this.Y + this.Height));
|
||||
result = (((this.X <= value.X) && ((value.X + value.Width) <= (this.X + this.Width))) && (this.Y <= value.Y)) && ((value.Y + value.Height) <= (this.Y + this.Height));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -185,7 +185,7 @@ public final class Rectangle extends ValueType implements IEquatable<Rectangle>
|
||||
*/
|
||||
public boolean Contains(int x, int y)
|
||||
{
|
||||
return ((((this.X <= x) && (x < (this.X + this.Width))) && (this.Y <= y)) && (y < (this.Y + this.Height)));
|
||||
return ((((this.X <= x) && (x < (this.X + this.Width))) && (this.Y <= y)) && (y < (this.Y + this.Height)));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -199,7 +199,7 @@ public final class Rectangle extends ValueType implements IEquatable<Rectangle>
|
||||
*/
|
||||
public void Contains(Point value, boolean result)
|
||||
{
|
||||
result = (((this.X <= value.X) && (value.X < (this.X + this.Width))) && (this.Y <= value.Y)) && (value.Y < (this.Y + this.Height));
|
||||
result = (((this.X <= value.X) && (value.X < (this.X + this.Width))) && (this.Y <= value.Y)) && (value.Y < (this.Y + this.Height));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -222,7 +222,7 @@ public final class Rectangle extends ValueType implements IEquatable<Rectangle>
|
||||
*/
|
||||
public boolean Equals(Rectangle other)
|
||||
{
|
||||
return ((((this.X == other.X) && (this.Y == other.Y)) && (this.Width == other.Width)) && (this.Height == other.Height));
|
||||
return ((((this.X == other.X) && (this.Y == other.Y)) && (this.Width == other.Width)) && (this.Height == other.Height));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -230,7 +230,7 @@ public final class Rectangle extends ValueType implements IEquatable<Rectangle>
|
||||
*/
|
||||
public int GetHashCode()
|
||||
{
|
||||
return (this.X ^ this.Y ^ this.Width ^ this.Height);
|
||||
return (this.X ^ this.Y ^ this.Width ^ this.Height);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -244,10 +244,10 @@ public final class Rectangle extends ValueType implements IEquatable<Rectangle>
|
||||
*/
|
||||
public void Inflate(int horizontalAmount, int verticalAmount)
|
||||
{
|
||||
this.X -= horizontalAmount;
|
||||
this.Y -= verticalAmount;
|
||||
this.Width += horizontalAmount * 2;
|
||||
this.Height += verticalAmount * 2;
|
||||
this.X -= horizontalAmount;
|
||||
this.Y -= verticalAmount;
|
||||
this.Width += horizontalAmount * 2;
|
||||
this.Height += verticalAmount * 2;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -264,28 +264,28 @@ public final class Rectangle extends ValueType implements IEquatable<Rectangle>
|
||||
*/
|
||||
public static Rectangle Intersect(Rectangle value1, Rectangle value2)
|
||||
{
|
||||
Rectangle rectangle = Rectangle.Empty;
|
||||
int num8 = value1.X + value1.Width;
|
||||
int num7 = value2.X + value2.Width;
|
||||
int num6 = value1.Y + value1.Height;
|
||||
int num5 = value2.Y + value2.Height;
|
||||
int num2 = (value1.X > value2.X) ? value1.X : value2.X;
|
||||
int num = (value1.Y > value2.Y) ? value1.Y : value2.Y;
|
||||
int num4 = (num8 < num7) ? num8 : num7;
|
||||
int num3 = (num6 < num5) ? num6 : num5;
|
||||
if ((num4 > num2) && (num3 > num))
|
||||
{
|
||||
rectangle.X = num2;
|
||||
rectangle.Y = num;
|
||||
rectangle.Width = num4 - num2;
|
||||
rectangle.Height = num3 - num;
|
||||
return rectangle;
|
||||
}
|
||||
rectangle.X = 0;
|
||||
rectangle.Y = 0;
|
||||
rectangle.Width = 0;
|
||||
rectangle.Height = 0;
|
||||
return rectangle;
|
||||
Rectangle rectangle = Rectangle.Empty;
|
||||
int num8 = value1.X + value1.Width;
|
||||
int num7 = value2.X + value2.Width;
|
||||
int num6 = value1.Y + value1.Height;
|
||||
int num5 = value2.Y + value2.Height;
|
||||
int num2 = (value1.X > value2.X) ? value1.X : value2.X;
|
||||
int num = (value1.Y > value2.Y) ? value1.Y : value2.Y;
|
||||
int num4 = (num8 < num7) ? num8 : num7;
|
||||
int num3 = (num6 < num5) ? num6 : num5;
|
||||
if ((num4 > num2) && (num3 > num))
|
||||
{
|
||||
rectangle.X = num2;
|
||||
rectangle.Y = num;
|
||||
rectangle.Width = num4 - num2;
|
||||
rectangle.Height = num3 - num;
|
||||
return rectangle;
|
||||
}
|
||||
rectangle.X = 0;
|
||||
rectangle.Y = 0;
|
||||
rectangle.Width = 0;
|
||||
rectangle.Height = 0;
|
||||
return rectangle;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -302,28 +302,28 @@ public final class Rectangle extends ValueType implements IEquatable<Rectangle>
|
||||
*/
|
||||
public static void Intersect(Rectangle value1, Rectangle value2, Rectangle result)
|
||||
{
|
||||
int num8 = value1.X + value1.Width;
|
||||
int num7 = value2.X + value2.Width;
|
||||
int num6 = value1.Y + value1.Height;
|
||||
int num5 = value2.Y + value2.Height;
|
||||
int num2 = (value1.X > value2.X) ? value1.X : value2.X;
|
||||
int num = (value1.Y > value2.Y) ? value1.Y : value2.Y;
|
||||
int num4 = (num8 < num7) ? num8 : num7;
|
||||
int num3 = (num6 < num5) ? num6 : num5;
|
||||
if ((num4 > num2) && (num3 > num))
|
||||
{
|
||||
result.X = num2;
|
||||
result.Y = num;
|
||||
result.Width = num4 - num2;
|
||||
result.Height = num3 - num;
|
||||
}
|
||||
else
|
||||
{
|
||||
result.X = 0;
|
||||
result.Y = 0;
|
||||
result.Width = 0;
|
||||
result.Height = 0;
|
||||
}
|
||||
int num8 = value1.X + value1.Width;
|
||||
int num7 = value2.X + value2.Width;
|
||||
int num6 = value1.Y + value1.Height;
|
||||
int num5 = value2.Y + value2.Height;
|
||||
int num2 = (value1.X > value2.X) ? value1.X : value2.X;
|
||||
int num = (value1.Y > value2.Y) ? value1.Y : value2.Y;
|
||||
int num4 = (num8 < num7) ? num8 : num7;
|
||||
int num3 = (num6 < num5) ? num6 : num5;
|
||||
if ((num4 > num2) && (num3 > num))
|
||||
{
|
||||
result.X = num2;
|
||||
result.Y = num;
|
||||
result.Width = num4 - num2;
|
||||
result.Height = num3 - num;
|
||||
}
|
||||
else
|
||||
{
|
||||
result.X = 0;
|
||||
result.Y = 0;
|
||||
result.Width = 0;
|
||||
result.Height = 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -337,7 +337,7 @@ public final class Rectangle extends ValueType implements IEquatable<Rectangle>
|
||||
*/
|
||||
public boolean Intersects(Rectangle value)
|
||||
{
|
||||
return ((((value.X < (this.X + this.Width)) && (this.X < (value.X + value.Width))) && (value.Y < (this.Y + this.Height))) && (this.Y < (value.Y + value.Height)));
|
||||
return ((((value.X < (this.X + this.Width)) && (this.X < (value.X + value.Width))) && (value.Y < (this.Y + this.Height))) && (this.Y < (value.Y + value.Height)));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -351,7 +351,7 @@ public final class Rectangle extends ValueType implements IEquatable<Rectangle>
|
||||
*/
|
||||
public void Intersects(Rectangle value, boolean result)
|
||||
{
|
||||
result = (((value.X < (this.X + this.Width)) && (this.X < (value.X + value.Width))) && (value.Y < (this.Y + this.Height))) && (this.Y < (value.Y + value.Height));
|
||||
result = (((value.X < (this.X + this.Width)) && (this.X < (value.X + value.Width))) && (value.Y < (this.Y + this.Height))) && (this.Y < (value.Y + value.Height));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -362,8 +362,8 @@ public final class Rectangle extends ValueType implements IEquatable<Rectangle>
|
||||
*/
|
||||
public void Offset(Point amount)
|
||||
{
|
||||
this.X += amount.X;
|
||||
this.Y += amount.Y;
|
||||
this.X += amount.X;
|
||||
this.Y += amount.Y;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -377,8 +377,8 @@ public final class Rectangle extends ValueType implements IEquatable<Rectangle>
|
||||
*/
|
||||
public void Offset(int offsetX, int offsetY)
|
||||
{
|
||||
this.X += offsetX;
|
||||
this.Y += offsetY;
|
||||
this.X += offsetX;
|
||||
this.Y += offsetY;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -389,7 +389,7 @@ public final class Rectangle extends ValueType implements IEquatable<Rectangle>
|
||||
*/
|
||||
public String toString()
|
||||
{
|
||||
return String.format(Locale.getDefault(), "{{X:%i Y:%i Width:%i Height:%i}}", this.X, this.Y, this.Width, this.Height);
|
||||
return String.format(Locale.getDefault(), "{{X:%i Y:%i Width:%i Height:%i}}", this.X, this.Y, this.Width, this.Height);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -403,20 +403,20 @@ public final class Rectangle extends ValueType implements IEquatable<Rectangle>
|
||||
*/
|
||||
public static Rectangle Union(Rectangle value1, Rectangle value2)
|
||||
{
|
||||
Rectangle rectangle = Rectangle.Empty;
|
||||
int num6 = value1.X + value1.Width;
|
||||
int num5 = value2.X + value2.Width;
|
||||
int num4 = value1.Y + value1.Height;
|
||||
int num3 = value2.Y + value2.Height;
|
||||
int num2 = (value1.X < value2.X) ? value1.X : value2.X;
|
||||
int num = (value1.Y < value2.Y) ? value1.Y : value2.Y;
|
||||
int num8 = (num6 > num5) ? num6 : num5;
|
||||
int num7 = (num4 > num3) ? num4 : num3;
|
||||
rectangle.X = num2;
|
||||
rectangle.Y = num;
|
||||
rectangle.Width = num8 - num2;
|
||||
rectangle.Height = num7 - num;
|
||||
return rectangle;
|
||||
Rectangle rectangle = Rectangle.Empty;
|
||||
int num6 = value1.X + value1.Width;
|
||||
int num5 = value2.X + value2.Width;
|
||||
int num4 = value1.Y + value1.Height;
|
||||
int num3 = value2.Y + value2.Height;
|
||||
int num2 = (value1.X < value2.X) ? value1.X : value2.X;
|
||||
int num = (value1.Y < value2.Y) ? value1.Y : value2.Y;
|
||||
int num8 = (num6 > num5) ? num6 : num5;
|
||||
int num7 = (num4 > num3) ? num4 : num3;
|
||||
rectangle.X = num2;
|
||||
rectangle.Y = num;
|
||||
rectangle.Width = num8 - num2;
|
||||
rectangle.Height = num7 - num;
|
||||
return rectangle;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -433,17 +433,17 @@ public final class Rectangle extends ValueType implements IEquatable<Rectangle>
|
||||
*/
|
||||
public static void Union(Rectangle value1, Rectangle value2, Rectangle result)
|
||||
{
|
||||
int num6 = value1.X + value1.Width;
|
||||
int num5 = value2.X + value2.Width;
|
||||
int num4 = value1.Y + value1.Height;
|
||||
int num3 = value2.Y + value2.Height;
|
||||
int num2 = (value1.X < value2.X) ? value1.X : value2.X;
|
||||
int num = (value1.Y < value2.Y) ? value1.Y : value2.Y;
|
||||
int num8 = (num6 > num5) ? num6 : num5;
|
||||
int num7 = (num4 > num3) ? num4 : num3;
|
||||
result.X = num2;
|
||||
result.Y = num;
|
||||
result.Width = num8 - num2;
|
||||
result.Height = num7 - num;
|
||||
int num6 = value1.X + value1.Width;
|
||||
int num5 = value2.X + value2.Width;
|
||||
int num4 = value1.Y + value1.Height;
|
||||
int num3 = value2.Y + value2.Height;
|
||||
int num2 = (value1.X < value2.X) ? value1.X : value2.X;
|
||||
int num = (value1.Y < value2.Y) ? value1.Y : value2.Y;
|
||||
int num8 = (num6 > num5) ? num6 : num5;
|
||||
int num7 = (num4 > num3) ? num4 : num3;
|
||||
result.X = num2;
|
||||
result.Y = num;
|
||||
result.Width = num8 - num2;
|
||||
result.Height = num7 - num;
|
||||
}
|
||||
}
|
||||
|
@ -148,7 +148,8 @@ public class TitleContainer
|
||||
{
|
||||
if (exception instanceof java.io.FileNotFoundException)
|
||||
{
|
||||
throw new FileNotFoundException("", "name", exception);
|
||||
// TODO: error message
|
||||
throw new FileNotFoundException("", name, exception);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,26 @@ public class Uri
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/**
|
||||
* This instance represents a relative URI, and this property is valid only for absolute URIs.
|
||||
*
|
||||
* @return
|
||||
* A boolean value that is true if the System.Uri is a file URI; otherwise, false.
|
||||
*
|
||||
* @exception System.InvalidOperationException
|
||||
* This instance represents a relative URI, and this property is valid only for absolute URIs.
|
||||
*/
|
||||
public boolean IsFile()
|
||||
{
|
||||
if (!this.IsAbsoluteUri())
|
||||
{
|
||||
// TODO: error message
|
||||
throw new InvalidOperationException();
|
||||
}
|
||||
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the original URI string that was passed to the System.Uri constructor.
|
||||
*
|
||||
@ -39,11 +59,22 @@ public class Uri
|
||||
return uriString;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param uriString
|
||||
*/
|
||||
public Uri(String uriString)
|
||||
{
|
||||
this.uriString = uriString;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param uriString
|
||||
* @param dontEscape
|
||||
*/
|
||||
public Uri(String uriString, boolean dontEscape)
|
||||
{
|
||||
this.uriString = uriString;
|
||||
@ -68,4 +99,36 @@ public class Uri
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void Canonicalize()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
protected void CheckSecurity()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public static UriHostNameType CheckHostName(String name)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public static boolean CheckSchemeName(String schemeName)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a canonical string representation for the specified System.Uri instance.
|
||||
*
|
||||
* @return
|
||||
* A java.lang.String instance that contains the unescaped canonical representation of the System.Uri instance. All characters are unescaped except #, ?, and %.
|
||||
*/
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
|
22
Microsoft.Xna.Framework/src/System/UriFormat.java
Normal file
22
Microsoft.Xna.Framework/src/System/UriFormat.java
Normal file
@ -0,0 +1,22 @@
|
||||
package System;
|
||||
|
||||
/**
|
||||
* Controls how URI information is escaped.
|
||||
*
|
||||
* @author Halofreak1990
|
||||
*/
|
||||
public enum UriFormat
|
||||
{
|
||||
/**
|
||||
* Escaping is performed according to the rules in RFC 2396.
|
||||
*/
|
||||
UriEscaped,
|
||||
/**
|
||||
* No escaping is performed.
|
||||
*/
|
||||
Unescaped,
|
||||
/**
|
||||
* Characters that have a reserved meaning in the requested URI components remain escaped. All others are not escaped. See Remarks.
|
||||
*/
|
||||
SafeUnescaped
|
||||
}
|
43
Microsoft.Xna.Framework/src/System/UriFormatException.java
Normal file
43
Microsoft.Xna.Framework/src/System/UriFormatException.java
Normal file
@ -0,0 +1,43 @@
|
||||
package System;
|
||||
|
||||
/**
|
||||
* The exception that is thrown when an invalid Uniform Resource Identifier (URI) is detected.
|
||||
*
|
||||
* @author Halofreak1990
|
||||
*/
|
||||
public class UriFormatException extends FormatException
|
||||
{
|
||||
private static final long serialVersionUID = 3724278989095091838L;
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the System.UriFormatException class.
|
||||
*/
|
||||
public UriFormatException()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the System.UriFormatException class with the specified message.
|
||||
*
|
||||
* @param textString
|
||||
* The error message string.
|
||||
*/
|
||||
public UriFormatException(String textString)
|
||||
{
|
||||
super(textString);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes a new instance of the System.UriFormatException class with a specified error message and a reference to the inner exception that is the cause of this exception.
|
||||
*
|
||||
* @param textString
|
||||
* The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture.
|
||||
*
|
||||
* @param e
|
||||
* The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception.
|
||||
*/
|
||||
public UriFormatException(String textString, RuntimeException e)
|
||||
{
|
||||
super(textString, e);
|
||||
}
|
||||
}
|
30
Microsoft.Xna.Framework/src/System/UriHostNameType.java
Normal file
30
Microsoft.Xna.Framework/src/System/UriHostNameType.java
Normal file
@ -0,0 +1,30 @@
|
||||
package System;
|
||||
|
||||
/**
|
||||
* Defines host name types for the System.Uri.CheckHostName(System.String) method.
|
||||
*
|
||||
* @author Halofreak1990
|
||||
*/
|
||||
public enum UriHostNameType
|
||||
{
|
||||
/**
|
||||
* The type of the host name is not supplied.
|
||||
*/
|
||||
Unknown,
|
||||
/**
|
||||
* The host is set, but the type cannot be determined.
|
||||
*/
|
||||
Basic,
|
||||
/**
|
||||
* The host name is a domain name system (DNS) style host name.
|
||||
*/
|
||||
Dns,
|
||||
/**
|
||||
* The host name is an Internet Protocol (IP) version 4 host address.
|
||||
*/
|
||||
IPv4,
|
||||
/**
|
||||
* The host name is an Internet Protocol (IP) version 6 host address.
|
||||
*/
|
||||
IPv6
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user