本文整理汇总了Java中org.eclipse.draw2d.PositionConstants.EAST属性的典型用法代码示例。如果您正苦于以下问题:Java PositionConstants.EAST属性的具体用法?Java PositionConstants.EAST怎么用?Java PositionConstants.EAST使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.draw2d.PositionConstants
的用法示例。
在下文中一共展示了PositionConstants.EAST属性的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;
}
}
}
示例2: 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;
}
示例3: 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;
}
示例4: 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;
}
示例5: CellDragoicator
/**
* Constructor
*
* @param reference
* @param location
*/
public CellDragoicator( IFigure reference, int location )
{
setReferenceFigure( reference );
switch ( location & PositionConstants.NORTH_SOUTH )
{
case PositionConstants.SOUTH :
relativeY = 1.0;
break;
default :
relativeY = 0;
}
switch ( location & PositionConstants.EAST_WEST )
{
case PositionConstants.EAST :
relativeX = 1.0;
break;
default :
relativeX = 0;
}
}
示例6: getArrowDirection
private int getArrowDirection() {
int direction = PositionConstants.EAST;
if (isInState(STATE_EXPANDED | STATE_PINNED_OPEN))
direction = dock == PositionConstants.WEST ? PositionConstants.WEST
: PositionConstants.EAST;
else
direction = dock == PositionConstants.WEST ? PositionConstants.EAST
: PositionConstants.WEST;
if (isMirrored()) {
if (direction == PositionConstants.WEST)
direction = PositionConstants.EAST;
else
direction = PositionConstants.WEST;
}
return direction;
}
示例7: getDeformedRectangle
/**
* Returns a Rectangle that represents the region around this vertex that
* paths will be traveling in.
*
* @param extraOffset
* a buffer to add to the region.
* @return the rectangle
*/
Rectangle getDeformedRectangle(int extraOffset) {
Rectangle rect = new Rectangle(0, 0, 0, 0);
if ((positionOnObstacle & PositionConstants.NORTH) > 0) {
rect.y = y - extraOffset;
rect.height = origY - y + extraOffset;
} else {
rect.y = origY;
rect.height = y - origY + extraOffset;
}
if ((positionOnObstacle & PositionConstants.EAST) > 0) {
rect.x = origX;
rect.width = x - origX + extraOffset;
} else {
rect.x = x - extraOffset;
rect.width = origX - x + extraOffset;
}
return rect;
}
示例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();
}
}
示例9: 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;
}
示例10: 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);
}
示例11: showLayoutTargetFeedback
@Override
protected void showLayoutTargetFeedback(Request req) {
if (!(req instanceof ChangeBoundsRequest)) {
return;
}
ChangeBoundsRequest r = (ChangeBoundsRequest) req;
switch (r.getResizeDirection()) {
case PositionConstants.EAST:
case PositionConstants.WEST:
break;
default:
move(r);
break;
}
}
示例12: createDragTracker
protected DragTracker createDragTracker( )
{
if (cursorDirection == PositionConstants.EAST )
{
return new ColumnDragTracker(getOwner( ).getParent( ), start, end);
}
if (cursorDirection == PositionConstants.SOUTH)
{
return new RowDragTracker(getOwner( ).getParent( ), start, end);
}
//return null;
return new ResizeTracker( getOwner( ), cursorDirection )
{
protected void showTargetFeedback()
{
}
protected void eraseTargetFeedback()
{
}
protected void showSourceFeedback( )
{
}
protected void eraseSourceFeedback( )
{
}
protected Command getCommand( )
{
return UnexecutableCommand.INSTANCE;
}
};
}
示例13: setDockLocation
private void setDockLocation(int position) {
if (position != PositionConstants.EAST
&& position != PositionConstants.WEST)
return;
if (position != dock) {
int oldPosition = dock;
dock = position;
listeners.firePropertyChange(PROPERTY_DOCK_LOCATION, oldPosition,
dock);
if (pViewer != null)
layout(true);
}
}
示例14: bend
/**
* Creates a point that represents this vertex offset by the given amount
* times the offset.
*
* @param modifier
* the offset
* @return a Point that has been bent around this vertex
*/
Point bend(int modifier) {
Point point = new Point(x, y);
if ((positionOnObstacle & PositionConstants.NORTH) > 0)
point.y -= modifier * offset;
else
point.y += modifier * offset;
if ((positionOnObstacle & PositionConstants.EAST) > 0)
point.x += modifier * offset;
else
point.x -= modifier * offset;
return point;
}
示例15: createChangeConstraintCommand
/**
* @param request
* @param child
* @param constraintFor
* @return
*/
protected Command createChangeConstraintCommand(
ChangeBoundsRequest request, GraphicalEditPart child,
Object constraintFor )
{
ReportItemHandle handle = (ReportItemHandle) child.getModel( );
SetConstraintCommand command = new SetConstraintCommand( );
command.setModel( handle );
int direction = request.getResizeDirection( );
Dimension size = new Dimension( ( (Rectangle) constraintFor ).getSize( ) );
if ( direction == PositionConstants.EAST
|| direction == PositionConstants.WEST )
{
size.height = -1;
}
else if ( direction == PositionConstants.SOUTH
|| direction == PositionConstants.NORTH )
{
size.width = -1;
}
command.setSize( size );
return command;
}