Java Code Examples for org.eclipse.swt.SWT#CAP_ROUND

The following examples show how to use org.eclipse.swt.SWT#CAP_ROUND . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
/**
 * Returns the AWT line cap corresponding to the specified SWT line cap.
 *
 * @param swtLineCap  the SWT line cap.
 *
 * @return The AWT line cap.
 */
private int toAwtLineCap(int swtLineCap) {
    if (swtLineCap == SWT.CAP_FLAT) {
        return BasicStroke.CAP_BUTT;
    }
    else if (swtLineCap == SWT.CAP_ROUND) {
        return BasicStroke.CAP_ROUND;
    }
    else if (swtLineCap == SWT.CAP_SQUARE) {
        return BasicStroke.CAP_SQUARE;
    }
    else {
        throw new IllegalArgumentException("SWT LineCap " + swtLineCap
            + " not recognised");
    }
}
 
Example 2
/**
 * Returns the SWT line cap corresponding to the specified AWT line cap.
 *
 * @param awtLineCap  the AWT line cap.
 *
 * @return The SWT line cap.
 */
private int toSwtLineCap(int awtLineCap) {
    if (awtLineCap == BasicStroke.CAP_BUTT) {
        return SWT.CAP_FLAT;
    }
    else if (awtLineCap == BasicStroke.CAP_ROUND) {
        return SWT.CAP_ROUND;
    }
    else if (awtLineCap == BasicStroke.CAP_SQUARE) {
        return SWT.CAP_SQUARE;
    }
    else {
        throw new IllegalArgumentException("AWT LineCap " + awtLineCap
            + " not recognised");
    }
}
 
Example 3
/**
 * Returns the AWT line cap corresponding to the specified SWT line cap.
 *
 * @param swtLineCap  the SWT line cap.
 *
 * @return The AWT line cap.
 */
private int toAwtLineCap(int swtLineCap) {
    if (swtLineCap == SWT.CAP_FLAT) {
        return BasicStroke.CAP_BUTT;
    }
    else if (swtLineCap == SWT.CAP_ROUND) {
        return BasicStroke.CAP_ROUND;
    }
    else if (swtLineCap == SWT.CAP_SQUARE) {
        return BasicStroke.CAP_SQUARE;
    }
    else {
        throw new IllegalArgumentException("SWT LineCap " + swtLineCap
            + " not recognised");
    }
}
 
Example 4
/**
 * Returns the SWT line cap corresponding to the specified AWT line cap.
 *
 * @param awtLineCap  the AWT line cap.
 *
 * @return The SWT line cap.
 */
private int toSwtLineCap(int awtLineCap) {
    if (awtLineCap == BasicStroke.CAP_BUTT) {
        return SWT.CAP_FLAT;
    }
    else if (awtLineCap == BasicStroke.CAP_ROUND) {
        return SWT.CAP_ROUND;
    }
    else if (awtLineCap == BasicStroke.CAP_SQUARE) {
        return SWT.CAP_SQUARE;
    }
    else {
        throw new IllegalArgumentException("AWT LineCap " + awtLineCap
            + " not recognised");
    }
}
 
Example 5
Source Project: SIMVA-SoS   File: SWTGraphics2D.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Returns the AWT line cap corresponding to the specified SWT line cap.
 *
 * @param swtLineCap  the SWT line cap.
 *
 * @return The AWT line cap.
 */
private int toAwtLineCap(int swtLineCap) {
    if (swtLineCap == SWT.CAP_FLAT) {
        return BasicStroke.CAP_BUTT;
    }
    else if (swtLineCap == SWT.CAP_ROUND) {
        return BasicStroke.CAP_ROUND;
    }
    else if (swtLineCap == SWT.CAP_SQUARE) {
        return BasicStroke.CAP_SQUARE;
    }
    else {
        throw new IllegalArgumentException("SWT LineCap " + swtLineCap
            + " not recognised");
    }
}
 
Example 6
Source Project: SIMVA-SoS   File: SWTGraphics2D.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Returns the SWT line cap corresponding to the specified AWT line cap.
 *
 * @param awtLineCap  the AWT line cap.
 *
 * @return The SWT line cap.
 */
private int toSwtLineCap(int awtLineCap) {
    if (awtLineCap == BasicStroke.CAP_BUTT) {
        return SWT.CAP_FLAT;
    }
    else if (awtLineCap == BasicStroke.CAP_ROUND) {
        return SWT.CAP_ROUND;
    }
    else if (awtLineCap == BasicStroke.CAP_SQUARE) {
        return SWT.CAP_SQUARE;
    }
    else {
        throw new IllegalArgumentException("AWT LineCap " + awtLineCap
            + " not recognised");
    }
}
 
Example 7
/**
 * Returns the AWT line cap corresponding to the specified SWT line cap.
 *
 * @param swtLineCap  the SWT line cap.
 *
 * @return The AWT line cap.
 */
private int toAwtLineCap(int swtLineCap) {
    if (swtLineCap == SWT.CAP_FLAT) {
        return BasicStroke.CAP_BUTT;
    }
    else if (swtLineCap == SWT.CAP_ROUND) {
        return BasicStroke.CAP_ROUND;
    }
    else if (swtLineCap == SWT.CAP_SQUARE) {
        return BasicStroke.CAP_SQUARE;
    }
    else {
        throw new IllegalArgumentException("SWT LineCap " + swtLineCap
            + " not recognised");
    }
}
 
Example 8
/**
 * Returns the SWT line cap corresponding to the specified AWT line cap.
 *
 * @param awtLineCap  the AWT line cap.
 *
 * @return The SWT line cap.
 */
private int toSwtLineCap(int awtLineCap) {
    if (awtLineCap == BasicStroke.CAP_BUTT) {
        return SWT.CAP_FLAT;
    }
    else if (awtLineCap == BasicStroke.CAP_ROUND) {
        return SWT.CAP_ROUND;
    }
    else if (awtLineCap == BasicStroke.CAP_SQUARE) {
        return SWT.CAP_SQUARE;
    }
    else {
        throw new IllegalArgumentException("AWT LineCap " + awtLineCap
            + " not recognised");
    }
}
 
Example 9
/**
 * Returns the AWT line cap corresponding to the specified SWT line cap.
 *
 * @param swtLineCap  the SWT line cap.
 *
 * @return The AWT line cap.
 */
private int toAwtLineCap(int swtLineCap) {
    if (swtLineCap == SWT.CAP_FLAT) {
        return BasicStroke.CAP_BUTT;
    }
    else if (swtLineCap == SWT.CAP_ROUND) {
        return BasicStroke.CAP_ROUND;
    }
    else if (swtLineCap == SWT.CAP_SQUARE) {
        return BasicStroke.CAP_SQUARE;
    }
    else {
        throw new IllegalArgumentException("SWT LineCap " + swtLineCap
            + " not recognised");
    }
}
 
Example 10
/**
 * Returns the SWT line cap corresponding to the specified AWT line cap.
 *
 * @param awtLineCap  the AWT line cap.
 *
 * @return The SWT line cap.
 */
private int toSwtLineCap(int awtLineCap) {
    if (awtLineCap == BasicStroke.CAP_BUTT) {
        return SWT.CAP_FLAT;
    }
    else if (awtLineCap == BasicStroke.CAP_ROUND) {
        return SWT.CAP_ROUND;
    }
    else if (awtLineCap == BasicStroke.CAP_SQUARE) {
        return SWT.CAP_SQUARE;
    }
    else {
        throw new IllegalArgumentException("AWT LineCap " + awtLineCap
            + " not recognised");
    }
}
 
Example 11
Source Project: nebula   File: SvgLoader.java    License: Eclipse Public License 2.0 5 votes vote down vote up
private static Integer parseStrokeLineCap(String s) {
	if(s != null) {
		if("butt".equals(s)) { //$NON-NLS-1$
			return SWT.CAP_FLAT;
		} else if("round".equals(s)) { //$NON-NLS-1$
			return SWT.CAP_ROUND;
		} else if("square".equals(s)) { //$NON-NLS-1$
			return SWT.CAP_SQUARE;
		}
	}
	return null;
}