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

The following examples show how to use org.eclipse.swt.SWT#CAP_FLAT . 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
Source File: SWTGraphics2D.java    From openstock with GNU General Public License v3.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 2
Source File: SWTGraphics2D.java    From openstock with GNU General Public License v3.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 3
Source File: SWTGraphics2D.java    From ccu-historian with GNU General Public License v3.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 4
Source File: SWTGraphics2D.java    From ccu-historian with GNU General Public License v3.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 5
Source File: SWTGraphics2D.java    From SIMVA-SoS with 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 File: SWTGraphics2D.java    From SIMVA-SoS with 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
Source File: SWTGraphics2D.java    From ECG-Viewer with GNU General Public License v2.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 8
Source File: SWTGraphics2D.java    From ECG-Viewer with GNU General Public License v2.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 9
Source File: SWTGraphics2D.java    From buffer_bci with GNU General Public License v3.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 10
Source File: SWTGraphics2D.java    From buffer_bci with GNU General Public License v3.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 11
Source File: SvgLoader.java    From nebula with 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;
}
 
Example 12
Source File: YAxisDynamicRenderer.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
public YAxisDynamicRenderer ( final ChartRenderer chart )
{
    super ( chart );
    this.chart = chart;

    this.lineAttributes = new LineAttributes ( 1.0f, SWT.CAP_FLAT, SWT.JOIN_BEVEL, SWT.LINE_SOLID, new float[0], 0.0f, 0.0f );
}
 
Example 13
Source File: XAxisDynamicRenderer.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
public XAxisDynamicRenderer ( final ChartRenderer chart )
{
    super ( chart );
    this.chart = chart;

    this.lineAttributes = new LineAttributes ( 1.0f, SWT.CAP_FLAT, SWT.JOIN_BEVEL, SWT.LINE_SOLID, new float[0], 0.0f, 0.0f );
    this.labelSpacing = 20;
}
 
Example 14
Source File: SvgGraphic.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
SvgStroke getStroke() {
	SvgStroke ds = new SvgStroke(this);
	for(SvgElement el : getAncestry(this)) {
		if(el instanceof SvgGraphic) {
			SvgStroke tmp = ((SvgGraphic) el).stroke;
			if(tmp.type != null) {
				ds.type = tmp.type;
			}
			if(tmp.color != null) {
				ds.color = tmp.color;
			}
			if(tmp.linkId != null) {
				ds.linkId = tmp.linkId;
			}
			if(tmp.opacity != null) {
				ds.opacity = tmp.opacity;
			}
			if(tmp.width != null) {
				ds.width = tmp.width;
			}
			if(tmp.lineCap != null) {
				ds.lineCap = tmp.lineCap;
			}
			if(tmp.lineJoin != null) {
				ds.lineJoin = tmp.lineJoin;
			}
		}
	}
	if(ds.type == null) {
		ds.type = PaintType.None;
	}
	if(ds.type != PaintType.None) {
		if(ds.color == null) {
			ds.color = 0;
		}
		if(ds.opacity == null) {
			ds.opacity = 1f;
		}
		if(ds.width == null) {
			ds.width = 1f;
		}
		if(ds.lineCap == null) {
			ds.lineCap = SWT.CAP_FLAT;
		}
		if(ds.lineJoin == null) {
			ds.lineJoin = SWT.JOIN_MITER;
		}
	}
	return ds;
}