com.swtxml.swt.types.PointType.java Source code

Java tutorial

Introduction

Here is the source code for com.swtxml.swt.types.PointType.java

Source

/*******************************************************************************
 * Copyright (c) 2008 Ralf Ebert
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Ralf Ebert - initial API and implementation
 *******************************************************************************/
package com.swtxml.swt.types;

import org.apache.commons.lang.StringUtils;
import org.eclipse.swt.graphics.Point;

import com.swtxml.util.types.IType;

public class PointType implements IType<Point> {

    public Point convert(String value) {
        String[] sizes = StringUtils.split(value, ",x");
        return new Point(Integer.parseInt(sizes[0]), Integer.parseInt(sizes[1]));
    }

}