当前位置: 首页>>代码示例>>Java>>正文


Java PositionConstants.SOUTH属性代码示例

本文整理汇总了Java中org.eclipse.draw2d.PositionConstants.SOUTH属性的典型用法代码示例。如果您正苦于以下问题:Java PositionConstants.SOUTH属性的具体用法?Java PositionConstants.SOUTH怎么用?Java PositionConstants.SOUTH使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.draw2d.PositionConstants的用法示例。


在下文中一共展示了PositionConstants.SOUTH属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: updateImage

@SuppressWarnings("synthetic-access")
public void updateImage() {
  if (editPart.figure == null)
    return;
  IBorderItemLocator borderItemLocator = getBorderItemLocator();
  if (borderItemLocator != null) {
    BorderedNodeFigure borderedNodeFigure = getBorderedNodeFigure();
    int side = DBorderItemLocator.findClosestSideOfParent(editPart.getFigure().getBounds(), borderedNodeFigure.getBounds());

    switch (side) {
      case PositionConstants.SOUTH:
        editPart.primaryShape.setImage(editPart.primaryShape.getBottomImage());
      break;
      case PositionConstants.NORTH:
        editPart.primaryShape.setImage(editPart.primaryShape.getTopImage());
      break;
      case PositionConstants.WEST:
        editPart.primaryShape.setImage(editPart.primaryShape.getLeftImage());
      break;
      case PositionConstants.EAST:
        editPart.primaryShape.setImage(editPart.primaryShape.getRightImage());
      break;
    }
  }
}
 
开发者ID:polarsys,项目名称:time4sys,代码行数:25,代码来源:RotativeImageEditPart.java

示例2: relocate

/**
 * Sets the handle's bounds to that of its owner figure's bounds, expanded by the handle's Insets.
 * 
 * @param target
 *          the target
 */
public void relocate(IFigure target) {
	Rectangle bounds = getReference().getBounds().getCopy();

	switch (position) {
	case PositionConstants.NORTH:
		bounds.y = bounds.y + bandHandleOffset - 1;
		bounds.height = bandHandleOffset;
		break;
	case PositionConstants.SOUTH:
		bounds.y = bounds.y + bounds.height - bandHandleOffset - 1;
		bounds.height = bandHandleOffset;
		break;
	}
	// bounds.x = bounds.x + bounds.width - bandHandleOffset - 1;
	// bounds.width = bandHandleOffset;

	getReference().translateToAbsolute(bounds);
	target.translateToRelative(bounds);
	target.setBounds(bounds);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:26,代码来源:CellHandleLocator.java

示例3: CellResizeHandleLocator2

/**
 * Constructs a RelativeLocator with the given reference figure and relative location. The location is a constant from
 * {@link PositionConstants} used as a convenient and readable way to set both the relativeX and relativeY values.
 * 
 * @param reference
 *          the reference figure
 * @param location
 *          one of NORTH, NORTH_EAST, etc.
 * @since 2.0
 */
public CellResizeHandleLocator2(GraphicalEditPart editPart, int location) {
	setReferenceFigure(editPart.getFigure());
	this.editPart = editPart;
	switch (location & PositionConstants.NORTH_SOUTH) {
	case PositionConstants.NORTH:
		relativeY = 0;
		break;
	case PositionConstants.SOUTH:
		relativeY = 1.0;
		break;
	default:
		relativeY = 0.5;
	}
	switch (location & PositionConstants.EAST_WEST) {
	case PositionConstants.WEST:
		relativeX = 0;
		break;
	case PositionConstants.EAST:
		relativeX = 1.0;
		break;
	default:
		relativeX = 0.5;
	}
	this.direction = location;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:35,代码来源:CellResizeHandleLocator2.java

示例4: CellResizeHandleLocator

/**
 * Constructs a RelativeLocator with the given reference figure and relative location. The location is a constant from
 * {@link PositionConstants} used as a convenient and readable way to set both the relativeX and relativeY values.
 * 
 * @param reference
 *          the reference figure
 * @param location
 *          one of NORTH, NORTH_EAST, etc.
 * @since 2.0
 */
public CellResizeHandleLocator(GraphicalEditPart editPart, int location) {
	setReferenceFigure(editPart.getFigure());
	switch (location & PositionConstants.NORTH_SOUTH) {
	case PositionConstants.NORTH:
		relativeY = 0;
		break;
	case PositionConstants.SOUTH:
		relativeY = 1.0;
		break;
	default:
		relativeY = 0.5;
	}
	switch (location & PositionConstants.EAST_WEST) {
	case PositionConstants.WEST:
		relativeX = 0;
		break;
	case PositionConstants.EAST:
		relativeX = 1.0;
		break;
	default:
		relativeX = 0.5;
	}
	this.direction = location;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:34,代码来源:CellResizeHandleLocator.java

示例5: getShowLabel

private String getShowLabel(int pix)
{
	String unit = getDefaultUnits( );
	
	double doubleValue = MetricUtility.pixelToPixelInch( pix );
	double showValue = DimensionUtil.convertTo( doubleValue,DesignChoiceConstants.UNITS_IN, unit ).getMeasure( );
	String prefix = "";
	if (PositionConstants.EAST == getResizeDirection())
	{
		prefix = Messages.getString("ColumnDragTracker.Show.Label");;
	}
	else if (PositionConstants.SOUTH == getResizeDirection())
	{
		prefix = Messages.getString("RowDragTracker.Show.Label");
	}
	return prefix + " "  + TableDragGuideTracker.FORMAT.format( showValue )+ " " + TableDragGuideTracker.getUnitDisplayName( unit)  + " (" + pix +" " + TableDragGuideTracker.PIXELS_LABEL + ")"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$ //$NON-NLS-5$
}
 
开发者ID:eclipse,项目名称:birt,代码行数:17,代码来源:ReportResizeTracker.java

示例6: getPosition

/**
 * <P>
 * Returns an integer which represents the position of the given point with
 * respect to this rectangle. Possible return values are bitwise ORs of the
 * constants WEST, EAST, NORTH, and SOUTH as found in
 * {@link org.eclipse.draw2d.PositionConstants}.
 * 
 * <P>
 * Returns PositionConstant.NONE if the given point is inside this
 * Rectangle.
 * 
 * @param p
 *            The Point whose position has to be determined
 * @return An <code>int</code> which is a PositionConstant
 * @see org.eclipse.draw2d.PositionConstants
 * @since 2.0
 */
public int getPosition(Point p) {
	int result = PositionConstants.NONE;

	if (contains(p))
		return result;

	if (p.x() < x)
		result = PositionConstants.WEST;
	else if (p.x() >= (x + width))
		result = PositionConstants.EAST;

	if (p.y() < y)
		result = result | PositionConstants.NORTH;
	else if (p.y() >= (y + height))
		result = result | PositionConstants.SOUTH;

	return result;
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:35,代码来源:Rectangle.java

示例7: showSourceFeedback

protected void showSourceFeedback( )
{
	super.showSourceFeedback( );
	if (processor != null)
	{
		int pix = 0;
		if (PositionConstants.EAST == getResizeDirection())
		{
			pix = getFigureSize().width;
		}
		else if (PositionConstants.SOUTH == getResizeDirection())
		{
			pix = getFigureSize().height;
		}
		processor.getInfomationLabel(getInfomation( pix ), getStartLocation( ) ).setText( getInfomation( pix ) );
	}	
}
 
开发者ID:eclipse,项目名称:birt,代码行数:17,代码来源:ReportResizeTracker.java

示例8: calculateCorrectPoint

/**
 * This method calculates and returns the correct refrence point of a {@link Rectangle} in regards
 * to a given Point.
 * */
protected Point calculateCorrectPoint(Rectangle rec, Point locationOfOther) {
  // TODO: doesn't work properly for the shape connection anchors of a relation
  switch (rec.getPosition(locationOfOther)) {
    case PositionConstants.NORTH:
      return rec.getTop();
    case PositionConstants.NORTH_EAST:
      return rec.getTop();
    case PositionConstants.NORTH_WEST:
      return rec.getTop();
    case PositionConstants.EAST:
      return rec.getRight();
    case PositionConstants.WEST:
      return rec.getLeft();
    case PositionConstants.SOUTH:
      return rec.getBottom();
    case PositionConstants.SOUTH_EAST:
      return rec.getBottom();
    case PositionConstants.SOUTH_WEST:
      return rec.getBottom();
    default:
      return rec.getCenter();
  }
}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:27,代码来源:ORMRelationCreateCommand.java

示例9: handleDragInProgress

@Override
protected boolean handleDragInProgress( )
{
	boolean bool =  super.handleDragInProgress( );
	if (processor != null)
	{
		int width = 0;
		if (PositionConstants.EAST == getResizeDirection())
		{
			width = getFigureSize().width + getMouseTrueValueX( );
		}
		else if (PositionConstants.SOUTH == getResizeDirection())
		{
			width = getFigureSize().height + getMouseTrueValueY( );
		}
		if (width < 1)
		{
			width = 1;
		}
		processor.updateInfomation( getInfomation( width ), getStartLocation( ) );
	}
	return bool;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:23,代码来源:ReportResizeTracker.java

示例10: getPosition

/**
 *  Get the position from string
 * @param position
 * 	  The given string
 * @return
 *    The position
 */
public static int getPosition( String position )
{
	if ( DesignChoiceConstants.BACKGROUND_POSITION_LEFT.equals( position ) )
	{
		return PositionConstants.WEST;
	}
	if ( DesignChoiceConstants.BACKGROUND_POSITION_RIGHT.equals( position ) )
	{
		return PositionConstants.EAST;
	}
	if ( DesignChoiceConstants.BACKGROUND_POSITION_TOP.equals( position ) )
	{
		return PositionConstants.NORTH;
	}
	if ( DesignChoiceConstants.BACKGROUND_POSITION_BOTTOM.equals( position ) )
	{
		return PositionConstants.SOUTH;
	}
	return PositionConstants.CENTER;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:27,代码来源:DesignElementHandleAdapter.java

示例11: getFigureSize

private Dimension getFigureSize()
{
	IFigure figure = getOwner( ).getFigure( );
	Dimension dim = figure.getSize( );
	if (figure instanceof IOutsideBorder)
	{
		Border border = ((IOutsideBorder)figure).getOutsideBorder( );
		Insets insets = border.getInsets( figure );
		if (PositionConstants.EAST == getResizeDirection())
		{
			dim.width = dim.width - insets.right - insets.left;
		}
		else if (PositionConstants.SOUTH == getResizeDirection())
		{
			dim.height = dim.height - insets.bottom - insets.top;
		}
	}
	return dim;
}
 
开发者ID:eclipse,项目名称:birt,代码行数:19,代码来源:ReportResizeTracker.java

示例12: getDragSourceFeedbackFigure

/**
 * @see org.eclipse.gef.editpolicies.NonResizableEditPolicy#getDragSourceFeedbackFigure()
 */
@Override
protected IFigure getDragSourceFeedbackFigure() {
    
    if( resizeRequestDirection == PositionConstants.SOUTH || resizeRequestDirection == PositionConstants.SOUTH_EAST || resizeRequestDirection == PositionConstants.SOUTH_WEST ) {
        return super.getDragSourceFeedbackFigure();
    } else {
        return new Figure();
    }
}
 
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:12,代码来源:BehaviorResizableEditPolicy.java

示例13: relocate

@Override
public void relocate(IFigure target) {
	IFigure reference = getReferenceFigure();
	Rectangle referenceBox = ((HandleBounds) reference).getHandleBounds();
	Rectangle targetBounds = new PrecisionRectangle(referenceBox.getResized(-1, -1));
	reference.translateToAbsolute(targetBounds);
	target.translateToRelative(targetBounds);
	targetBounds.resize(1, 1);

	int w = 2;
	int h = 2;
	switch (direction & PositionConstants.NORTH_SOUTH) {
	case PositionConstants.NORTH:
		w = targetBounds.width;
		targetBounds.y += (int) (targetBounds.height * relativeY - ((h / 2))) + 1;
		break;
	case PositionConstants.SOUTH:
		w = targetBounds.width;
		targetBounds.y += (int) (targetBounds.height * relativeY - (h / 2)) - 1;
		targetBounds.x += -1;
		break;
	}
	switch (direction & PositionConstants.EAST_WEST) {
	case PositionConstants.WEST:
		h = targetBounds.height;
		targetBounds.y += (int) relativeY - 1;
		targetBounds.x += (int) (targetBounds.width * relativeX - (w / 2)) - 1;
		break;
	case PositionConstants.EAST:
		h = targetBounds.height;
		targetBounds.y += (int) relativeY - 1;
		targetBounds.x += (int) (targetBounds.width * relativeX - (w / 2) - 1);
		break;
	}

	targetBounds.setSize(w, h);
	target.setBounds(targetBounds);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:38,代码来源:CellResizeHandleLocator.java

示例14: BandResizeHandleLocator

/**
 * Constructs a RelativeLocator with the given reference figure and relative location. The location is a constant from
 * {@link PositionConstants} used as a convenient and readable way to set both the relativeX and relativeY values.
 * 
 * @param reference
 *          the reference figure
 * @param location
 *          one of NORTH, NORTH_EAST, etc.
 * @since 2.0
 */
public BandResizeHandleLocator(IFigure reference, int location) {
	setReferenceFigure(reference);
	switch (location & PositionConstants.NORTH_SOUTH) {
	case PositionConstants.NORTH:
		relativeY = 0;
		break;
	case PositionConstants.SOUTH:
		relativeY = 1.0;
		break;
	default:
		relativeY = 0.5;
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:23,代码来源:BandResizeHandleLocator.java

示例15: understandsRequest

public boolean understandsRequest(Request request) {
	if (REQ_RESIZE.equals(request.getType())) {
		ChangeBoundsRequest r = (ChangeBoundsRequest) request;
		if (r.getResizeDirection() == PositionConstants.SOUTH)
			return true;
	}
	return false;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:8,代码来源:BandMoveEditPolicy.java


注:本文中的org.eclipse.draw2d.PositionConstants.SOUTH属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。