Java Code Examples for org.eclipse.swt.graphics.GC#drawPoint()

The following examples show how to use org.eclipse.swt.graphics.GC#drawPoint() . 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: ExpandToggleRenderer.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
private void drawRightPointingLine(GC gc, Color innerColor, Color outerColor, int xOffset)
{
    gc.setForeground(outerColor);
    gc.drawLine(getBounds().x + 1 + xOffset, getBounds().y, getBounds().x + 5 + xOffset,
                getBounds().y + 4);
    gc.drawLine(getBounds().x + 4 + xOffset, getBounds().y + 5, getBounds().x + 1 + xOffset,
                getBounds().y + 8);
    gc.drawPoint(getBounds().x + xOffset, getBounds().y + 7);
    gc.drawLine(getBounds().x + xOffset, getBounds().y + 6, getBounds().x + 2 + xOffset,
                getBounds().y + 4);
    gc.drawLine(getBounds().x + 1 + xOffset, getBounds().y + 3, getBounds().x + xOffset,
                getBounds().y + 2);
    gc.drawPoint(getBounds().x + xOffset, getBounds().y + 1);

    gc.setForeground(innerColor);
    gc.drawLine(getBounds().x + 1 + xOffset, getBounds().y + 1, getBounds().x + 4 + xOffset,
                getBounds().y + 4);
    gc.drawLine(getBounds().x + 1 + xOffset, getBounds().y + 2, getBounds().x + 3 + xOffset,
                getBounds().y + 4);
    gc.drawLine(getBounds().x + 3 + xOffset, getBounds().y + 5, getBounds().x + 1 + xOffset,
                getBounds().y + 7);
    gc.drawLine(getBounds().x + 2 + xOffset, getBounds().y + 5, getBounds().x + 1 + xOffset,
                getBounds().y + 6);
}
 
Example 2
Source File: ExpandToggleRenderer.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
private void drawLeftPointingLine(GC gc, Color innerColor, Color outerColor, int xOffset)
{
    gc.setForeground(outerColor);
    gc.drawLine(getBounds().x + xOffset, getBounds().y + 4, getBounds().x + 4 + xOffset,
                getBounds().y);
    gc.drawPoint(getBounds().x + 5 + xOffset, getBounds().y + 1);
    gc.drawLine(getBounds().x + 5 + xOffset, getBounds().y + 2, getBounds().x + 3 + xOffset,
                getBounds().y + 4);
    gc.drawPoint(getBounds().x + 4 + xOffset, getBounds().y + 5);
    gc.drawLine(getBounds().x + 5 + xOffset, getBounds().y + 6, getBounds().x + 5 + xOffset,
                getBounds().y + 7);
    gc.drawLine(getBounds().x + 4 + xOffset, getBounds().y + 8, getBounds().x + 1 + xOffset,
                getBounds().y + 5);

    gc.setForeground(innerColor);
    gc.drawLine(getBounds().x + 1 + xOffset, getBounds().y + 4, getBounds().x + 4 + xOffset,
                getBounds().y + 1);
    gc.drawLine(getBounds().x + 2 + xOffset, getBounds().y + 4, getBounds().x + 4 + xOffset,
                getBounds().y + 2);
    gc.drawLine(getBounds().x + 2 + xOffset, getBounds().y + 5, getBounds().x + 4 + xOffset,
                getBounds().y + 7);
    gc.drawLine(getBounds().x + 2 + xOffset, getBounds().y + 4, getBounds().x + 4 + xOffset,
                getBounds().y + 6);
}
 
Example 3
Source File: ExpandToggleRenderer.java    From translationstudio8 with GNU General Public License v2.0 6 votes vote down vote up
private void drawRightPointingLine(GC gc, Color innerColor, Color outerColor, int xOffset)
{
    gc.setForeground(outerColor);
    gc.drawLine(getBounds().x + 1 + xOffset, getBounds().y, getBounds().x + 5 + xOffset,
                getBounds().y + 4);
    gc.drawLine(getBounds().x + 4 + xOffset, getBounds().y + 5, getBounds().x + 1 + xOffset,
                getBounds().y + 8);
    gc.drawPoint(getBounds().x + xOffset, getBounds().y + 7);
    gc.drawLine(getBounds().x + xOffset, getBounds().y + 6, getBounds().x + 2 + xOffset,
                getBounds().y + 4);
    gc.drawLine(getBounds().x + 1 + xOffset, getBounds().y + 3, getBounds().x + xOffset,
                getBounds().y + 2);
    gc.drawPoint(getBounds().x + xOffset, getBounds().y + 1);

    gc.setForeground(innerColor);
    gc.drawLine(getBounds().x + 1 + xOffset, getBounds().y + 1, getBounds().x + 4 + xOffset,
                getBounds().y + 4);
    gc.drawLine(getBounds().x + 1 + xOffset, getBounds().y + 2, getBounds().x + 3 + xOffset,
                getBounds().y + 4);
    gc.drawLine(getBounds().x + 3 + xOffset, getBounds().y + 5, getBounds().x + 1 + xOffset,
                getBounds().y + 7);
    gc.drawLine(getBounds().x + 2 + xOffset, getBounds().y + 5, getBounds().x + 1 + xOffset,
                getBounds().y + 6);
}
 
Example 4
Source File: ExpandToggleRenderer.java    From translationstudio8 with GNU General Public License v2.0 6 votes vote down vote up
private void drawLeftPointingLine(GC gc, Color innerColor, Color outerColor, int xOffset)
{
    gc.setForeground(outerColor);
    gc.drawLine(getBounds().x + xOffset, getBounds().y + 4, getBounds().x + 4 + xOffset,
                getBounds().y);
    gc.drawPoint(getBounds().x + 5 + xOffset, getBounds().y + 1);
    gc.drawLine(getBounds().x + 5 + xOffset, getBounds().y + 2, getBounds().x + 3 + xOffset,
                getBounds().y + 4);
    gc.drawPoint(getBounds().x + 4 + xOffset, getBounds().y + 5);
    gc.drawLine(getBounds().x + 5 + xOffset, getBounds().y + 6, getBounds().x + 5 + xOffset,
                getBounds().y + 7);
    gc.drawLine(getBounds().x + 4 + xOffset, getBounds().y + 8, getBounds().x + 1 + xOffset,
                getBounds().y + 5);

    gc.setForeground(innerColor);
    gc.drawLine(getBounds().x + 1 + xOffset, getBounds().y + 4, getBounds().x + 4 + xOffset,
                getBounds().y + 1);
    gc.drawLine(getBounds().x + 2 + xOffset, getBounds().y + 4, getBounds().x + 4 + xOffset,
                getBounds().y + 2);
    gc.drawLine(getBounds().x + 2 + xOffset, getBounds().y + 5, getBounds().x + 4 + xOffset,
                getBounds().y + 7);
    gc.drawLine(getBounds().x + 2 + xOffset, getBounds().y + 4, getBounds().x + 4 + xOffset,
                getBounds().y + 6);
}
 
Example 5
Source File: ExpandToggleRenderer.java    From tmxeditor8 with GNU General Public License v2.0 6 votes vote down vote up
private void drawRightPointingLine(GC gc, Color innerColor, Color outerColor, int xOffset)
{
    gc.setForeground(outerColor);
    gc.drawLine(getBounds().x + 1 + xOffset, getBounds().y, getBounds().x + 5 + xOffset,
                getBounds().y + 4);
    gc.drawLine(getBounds().x + 4 + xOffset, getBounds().y + 5, getBounds().x + 1 + xOffset,
                getBounds().y + 8);
    gc.drawPoint(getBounds().x + xOffset, getBounds().y + 7);
    gc.drawLine(getBounds().x + xOffset, getBounds().y + 6, getBounds().x + 2 + xOffset,
                getBounds().y + 4);
    gc.drawLine(getBounds().x + 1 + xOffset, getBounds().y + 3, getBounds().x + xOffset,
                getBounds().y + 2);
    gc.drawPoint(getBounds().x + xOffset, getBounds().y + 1);

    gc.setForeground(innerColor);
    gc.drawLine(getBounds().x + 1 + xOffset, getBounds().y + 1, getBounds().x + 4 + xOffset,
                getBounds().y + 4);
    gc.drawLine(getBounds().x + 1 + xOffset, getBounds().y + 2, getBounds().x + 3 + xOffset,
                getBounds().y + 4);
    gc.drawLine(getBounds().x + 3 + xOffset, getBounds().y + 5, getBounds().x + 1 + xOffset,
                getBounds().y + 7);
    gc.drawLine(getBounds().x + 2 + xOffset, getBounds().y + 5, getBounds().x + 1 + xOffset,
                getBounds().y + 6);
}
 
Example 6
Source File: ExpandToggleRenderer.java    From tmxeditor8 with GNU General Public License v2.0 6 votes vote down vote up
private void drawLeftPointingLine(GC gc, Color innerColor, Color outerColor, int xOffset)
{
    gc.setForeground(outerColor);
    gc.drawLine(getBounds().x + xOffset, getBounds().y + 4, getBounds().x + 4 + xOffset,
                getBounds().y);
    gc.drawPoint(getBounds().x + 5 + xOffset, getBounds().y + 1);
    gc.drawLine(getBounds().x + 5 + xOffset, getBounds().y + 2, getBounds().x + 3 + xOffset,
                getBounds().y + 4);
    gc.drawPoint(getBounds().x + 4 + xOffset, getBounds().y + 5);
    gc.drawLine(getBounds().x + 5 + xOffset, getBounds().y + 6, getBounds().x + 5 + xOffset,
                getBounds().y + 7);
    gc.drawLine(getBounds().x + 4 + xOffset, getBounds().y + 8, getBounds().x + 1 + xOffset,
                getBounds().y + 5);

    gc.setForeground(innerColor);
    gc.drawLine(getBounds().x + 1 + xOffset, getBounds().y + 4, getBounds().x + 4 + xOffset,
                getBounds().y + 1);
    gc.drawLine(getBounds().x + 2 + xOffset, getBounds().y + 4, getBounds().x + 4 + xOffset,
                getBounds().y + 2);
    gc.drawLine(getBounds().x + 2 + xOffset, getBounds().y + 5, getBounds().x + 4 + xOffset,
                getBounds().y + 7);
    gc.drawLine(getBounds().x + 2 + xOffset, getBounds().y + 4, getBounds().x + 4 + xOffset,
                getBounds().y + 6);
}
 
Example 7
Source File: SortArrowRenderer.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
/** 
 * {@inheritDoc}
 */
public void paint(GC gc, Object value)
{
    gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW));
    if (isSelected())
    {
        gc
            .drawLine(getBounds().x + 0, getBounds().y + 0, getBounds().x + 6,
                      getBounds().y + 00);
        gc.drawLine(getBounds().x + 1, getBounds().y + 01, getBounds().x + 5,
                    getBounds().y + 01);
        gc.drawLine(getBounds().x + 2, getBounds().y + 02, getBounds().x + 4,
                    getBounds().y + 02);
        gc.drawPoint(getBounds().x + 3, getBounds().y + 03);
    }
    else
    {
        gc.drawPoint(getBounds().x + 3, getBounds().y + 0);
        gc.drawLine(getBounds().x + 2, getBounds().y + 01, getBounds().x + 4,
                    getBounds().y + 01);
        gc.drawLine(getBounds().x + 1, getBounds().y + 02, getBounds().x + 5,
                    getBounds().y + 02);
        gc.drawLine(getBounds().x + 0, getBounds().y + 03, getBounds().x + 6,
                    getBounds().y + 03);
    }

}
 
Example 8
Source File: TimeChartAnalysisProvider.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
private static void drawBookmark(Rectangle r, GC gc) {
    gc.setForeground(BOOKMARK_OUTER_COLOR);
    gc.drawLine(r.x - 1, r.y - 2, r.x - 1, r.y + 2);
    gc.drawLine(r.x + 1, r.y - 2, r.x + 1, r.y + 2);
    gc.drawPoint(r.x, r.y - 2);
    gc.setForeground(BOOKMARK_INNER_COLOR);
    gc.drawLine(r.x, r.y - 1, r.x, r.y + 1);
    gc.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
    gc.drawPoint(r.x - 1, r.y + 3);
    gc.drawPoint(r.x, r.y + 2);
    gc.drawPoint(r.x + 1, r.y + 3);
}
 
Example 9
Source File: TimeGraphRender.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void draw(@Nullable ITimeGraphPresentationProvider provider, GC gc) {
    if (fLength == 1) {
        gc.drawPoint(fX, fY);
    } else {
        gc.drawLine(fX, fY, fX + fLength - 1, fY);
    }
}
 
Example 10
Source File: SortArrowRenderer.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
/** 
 * {@inheritDoc}
 */
public void paint(GC gc, Object value)
{
    gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW));
    if (isSelected())
    {
        gc
            .drawLine(getBounds().x + 0, getBounds().y + 0, getBounds().x + 6,
                      getBounds().y + 00);
        gc.drawLine(getBounds().x + 1, getBounds().y + 01, getBounds().x + 5,
                    getBounds().y + 01);
        gc.drawLine(getBounds().x + 2, getBounds().y + 02, getBounds().x + 4,
                    getBounds().y + 02);
        gc.drawPoint(getBounds().x + 3, getBounds().y + 03);
    }
    else
    {
        gc.drawPoint(getBounds().x + 3, getBounds().y + 0);
        gc.drawLine(getBounds().x + 2, getBounds().y + 01, getBounds().x + 4,
                    getBounds().y + 01);
        gc.drawLine(getBounds().x + 1, getBounds().y + 02, getBounds().x + 5,
                    getBounds().y + 02);
        gc.drawLine(getBounds().x + 0, getBounds().y + 03, getBounds().x + 6,
                    getBounds().y + 03);
    }

}
 
Example 11
Source File: GridLineCellLayerPainter.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
protected void drawGridLines(ILayer natLayer, GC gc, Rectangle rectangle) {
	gc.setForeground(GUIHelper.COLOR_GRAY);

	drawHorizontalLines(natLayer, gc, rectangle);
	drawVerticalLines(natLayer, gc, rectangle);
	
	// paint far bottom left corner pixel
	gc.drawPoint(natLayer.getWidth() - 1, natLayer.getHeight() - 1);
}
 
Example 12
Source File: SortArrowRenderer.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
/** 
 * {@inheritDoc}
 */
public void paint(GC gc, Object value)
{
    gc.setForeground(getDisplay().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW));
    if (isSelected())
    {
        gc
            .drawLine(getBounds().x + 0, getBounds().y + 0, getBounds().x + 6,
                      getBounds().y + 00);
        gc.drawLine(getBounds().x + 1, getBounds().y + 01, getBounds().x + 5,
                    getBounds().y + 01);
        gc.drawLine(getBounds().x + 2, getBounds().y + 02, getBounds().x + 4,
                    getBounds().y + 02);
        gc.drawPoint(getBounds().x + 3, getBounds().y + 03);
    }
    else
    {
        gc.drawPoint(getBounds().x + 3, getBounds().y + 0);
        gc.drawLine(getBounds().x + 2, getBounds().y + 01, getBounds().x + 4,
                    getBounds().y + 01);
        gc.drawLine(getBounds().x + 1, getBounds().y + 02, getBounds().x + 5,
                    getBounds().y + 02);
        gc.drawLine(getBounds().x + 0, getBounds().y + 03, getBounds().x + 6,
                    getBounds().y + 03);
    }

}
 
Example 13
Source File: GridLineCellLayerPainter.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
protected void drawGridLines(ILayer natLayer, GC gc, Rectangle rectangle) {
	gc.setForeground(GUIHelper.COLOR_GRAY);

	drawHorizontalLines(natLayer, gc, rectangle);
	drawVerticalLines(natLayer, gc, rectangle);
	
	// paint far bottom left corner pixel
	gc.drawPoint(natLayer.getWidth() - 1, natLayer.getHeight() - 1);
}
 
Example 14
Source File: TimeChartAnalysisProvider.java    From tracecompass with Eclipse Public License 2.0 4 votes vote down vote up
private static void drawSearchMatch(Rectangle r, GC gc) {
    gc.setForeground(SEARCH_MATCH_COLOR);
    gc.drawPoint(r.x, r.y + r.height);
    gc.drawLine(r.x - 1, r.y + r.height + 1, r.x + 1, r.y + r.height + 1);
    gc.drawLine(r.x - 2, r.y + r.height + 2, r.x + 2, r.y + r.height + 2);
}