## SwingOSC – Java-based GUI classes

last mod: 27-Jan-08 sciss

# SwingOptions

`SwingOptions` encapsulates the commandline options for a SwingOSC server app within an object. This makes it convienent to launch multiple servers with the same options, or to archive different sets of options, etc. Every SwingOSC has an instance of `SwingOptions` created for it if one is not passed as the options argument when the SwingOSC object is created. (This is the case for example with the default SwingOSC which is created at startup.)

A SwingOSC's instance of `SwingOptions` is stored in its `options` instance variable, which can be accessed through corresponding getter and setter methods.

Note: The `SwingOptions`' instance variables are translated into commandline arguments when a SwingOSC server app is booted. Thus a running server must be rebooted before changes will take effect.

## Instantiation

    	SwingOptions.new

## Instance Variables (the Options)

The following instance variables can be changed through getter and setter methods. Note that the defaults listed below only apply to newly created instances of `SwingOptions`. The options for the default server may be changed at startup in Main-startup or in `~/scwork/startup.rtf`.

- `protocol` – (Symbol) `\tcp` or `\udp` communications protocol used. default is `\tcp`
- `loopBack` – (Boolean) whether to limit communication to the local computer. default is `true`.
- `initGUI` – (Boolean) default is `true`.
- `oscBufSize` – (Integer) OSC-packet size in bytes. default is `65536`.
- `javaOptions` – (String) options passed to the `"java"` program. Use this to set the look-and-feel, heap memory size, or vendor specific settings (e.g. Dock name and icon on Mac OS X). The default is platform dependant.

Note that the socket port is determined from the NetAddr object used to create the server. The application path is determined from the `program` class field in the server.