org.eclipse.draw2d.Polygon Java Examples

The following examples show how to use org.eclipse.draw2d.Polygon. 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: GaugeFigure.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
@Override
public void setConstraint(IFigure child, Object constraint) {
	if(constraint.equals(SCALE))
		scale = (RoundScale)child;
	else if (constraint.equals(RAMP))
		ramp = (RoundScaledRamp) child;
	else if (constraint.equals(NEEDLE))
		needle = (Polygon) child;
	else if (constraint.equals(NEEDLE_CENTER))
		needleCenter = (NeedleCenter) child;
	else if (constraint.equals(VALUE_LABEL))
		valueLabel = (Label)child;
	else if (constraint.equals(TITLE_LABEL))
		titleLabel = (Label)child;
	else if (constraint.equals(UNIT_LABEL))
		unitLabel = (Label)child;
	
}
 
Example #2
Source File: MeterFigure.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void setConstraint(IFigure child, Object constraint) {
	if(constraint.equals(SCALE))
		scale = (RoundScale)child;
	else if (constraint.equals(RAMP))
		ramp = (RoundScaledRamp) child;
	else if (constraint.equals(NEEDLE))
		needle = (Polygon) child;
//	else if (constraint.equals(NEEDLE_CENTER))
//		needleCenter = (Ellipse) child;
	else if (constraint.equals(VALUE_LABEL))
		valueLabel = (Label)child;
}
 
Example #3
Source File: HierarchyNodeEditPart.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
private Polygon getPolygon( Object model )
{
	Polygon polygon = new Polygon( );
	int x = getPosX( model );
	int y = getPosY( model );
	int width = getWidth( model );
	int height = getHeight( model );
	polygon.addPoint( new Point( x - 50, y - 50 ) );
	polygon.addPoint( new Point( x + width + 50, y - 50 ) );
	polygon.addPoint( new Point( x + width + 50, y + height + 50 ) );
	polygon.addPoint( new Point( x - 50, y + height + 50 ) );
	return polygon;
}
 
Example #4
Source File: ComponentMeterFigure.java    From arx with Apache License 2.0 5 votes vote down vote up
@Override
public void setConstraint(IFigure child, Object constraint) {
    if(constraint.equals(SCALE))
        scale = (RoundScale)child;
    else if (constraint.equals(RAMP))
        ramp = (RoundScaledRamp) child;
    else if (constraint.equals(NEEDLE))
        needle = (Polygon) child;
    else if (constraint.equals(VALUE_LABEL))
        valueLabel = (Label)child;
}