/* JFlexiPix - Java implementation of FlexiPix output library
*
* Copyright 2010-2011 Stefan Schuermans <stefan schuermans info>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.blinkenarea.JFlexiPix;
import java.net.*;
/// FlexiPix display
public class Display
{
/**
* @brief constructor
* @param[in] configFile name of config file to read
* @param[in] messageIf message interface to report messages to or null
*/
public Display(String configFile, MessageIf messageIf)
throws Exception
{
Config config;
// set default bind address
try {
InetAddress ip = InetAddress.getByAddress(Constants.bindIp);
m_bindAddr = new InetSocketAddress(ip, Constants.bindPort);
} catch (java.net.UnknownHostException e) {
String txt = "internal error: bad default bind address";
if (messageIf != null)
messageIf.message(MsgType.Err, txt + "\n");
throw new Exception(txt, e);
}
// allocate pixel object to store size
m_size = new Pixel();
// allocate distributor array
m_distris = new Distri [Constants.distriMaxCnt];