本文整理汇总了Java中org.eclipse.draw2d.PositionConstants.SOUTH_EAST属性的典型用法代码示例。如果您正苦于以下问题:Java PositionConstants.SOUTH_EAST属性的具体用法?Java PositionConstants.SOUTH_EAST怎么用?Java PositionConstants.SOUTH_EAST使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.draw2d.PositionConstants
的用法示例。
在下文中一共展示了PositionConstants.SOUTH_EAST属性的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
/**
* Initializes this obstacle to the values of the given rectangle
*
* @param rect
* bounds of this obstacle
*/
void init(Rectangle rect) {
this.x = rect.x;
this.y = rect.y;
this.width = rect.width;
this.height = rect.height;
exclude = false;
topLeft = new Vertex(x, y, this);
topLeft.positionOnObstacle = PositionConstants.NORTH_WEST;
topRight = new Vertex(x + width - 1, y, this);
topRight.positionOnObstacle = PositionConstants.NORTH_EAST;
bottomLeft = new Vertex(x, y + height - 1, this);
bottomLeft.positionOnObstacle = PositionConstants.SOUTH_WEST;
bottomRight = new Vertex(x + width - 1, y + height - 1, this);
bottomRight.positionOnObstacle = PositionConstants.SOUTH_EAST;
center = new Vertex(getCenter(), this);
}
示例2: 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();
}
}
示例3: 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();
}
}
示例4: createSelectionHandles
protected List createSelectionHandles( )
{
List list = new ArrayList( );
ReportResizableHandleKit.addMoveHandle( (GraphicalEditPart) getHost( ),
list );
if ( ( this.getResizeDirections( ) & PositionConstants.SOUTH_EAST ) == PositionConstants.SOUTH_EAST )
ReportResizableHandleKit.addHandle( (GraphicalEditPart) getHost( ),
list,
PositionConstants.SOUTH_EAST );
return list;
}
示例5: getResizeCommand
/**
* @see org.eclipse.gef.editpolicies.ResizableEditPolicy#getResizeCommand(org.eclipse.gef.requests.ChangeBoundsRequest)
*/
@Override
protected Command getResizeCommand(ChangeBoundsRequest request) {
NotationNode behaviorNode = (NotationNode) getHost().getModel();
if (behaviorNode.getHeight() + request.getSizeDelta().height < 10) {
// 10보다 작게 리사이즈 할 수 없다.
return null;
}
Diagram diagram = SequenceUtil.getDiagram(getHost());
for( AbstractNode node : diagram.getNodeList() ) {
Point resizeLocation = request.getLocation();//new Point(request.getLocation().x, request.getLocation().y + behaviorNode.getHeight() + request.getSizeDelta().height);
if( node.getUmlModel() instanceof CombinedFragment ) {
if( node.getY() < resizeLocation.y && resizeLocation.y < node.getY() + node.getHeight()) {
if(( node.getY() < behaviorNode.getY() && behaviorNode.getY() + behaviorNode.getHeight() < node.getY() + node.getHeight() )) {
return null;
}
}
if(( node.getY() < behaviorNode.getY() && behaviorNode.getY() + behaviorNode.getHeight() < node.getY() + node.getHeight() )) {
if( node.getY() + node.getHeight() < behaviorNode.getY() + behaviorNode.getHeight() + request.getSizeDelta().height ) {
return null;
}
}
if( behaviorNode.getY() < node.getY() && node.getY() < behaviorNode.getY() + behaviorNode.getHeight() + request.getSizeDelta().height && behaviorNode.getY() + behaviorNode.getHeight() + request.getSizeDelta().height < node.getY() + node.getHeight() ) {
return null;
}
}
if( node.getParent() instanceof Diagram ) {
continue;
}
if( !(node.getUmlModel() instanceof CombinedFragment) ) {
continue;
}
Rectangle rect = new Rectangle(node.getX(), node.getY(), node.getWidth(), node.getHeight());
if( rect.contains(new Point(behaviorNode.getX(), behaviorNode.getY())) && rect.contains(resizeLocation) ) {
break;
}
if(resizeLocation.y > node.getY()) {
return null;
}
}
// 위 방향으로 리사이즈 못하도록 제한. 20120605 by Kang
// TODO 위 방향으로 리사이즈 했을 때 synch, asynch meassage도 같이 이동하도록 한다.
resizeRequestDirection = request.getResizeDirection();
if (resizeRequestDirection != PositionConstants.SOUTH && resizeRequestDirection != PositionConstants.SOUTH_EAST && resizeRequestDirection != PositionConstants.SOUTH_WEST ) {
return null;
}
NotationNode sourceNode = (NotationNode) getHost().getModel();
for( AbstractConnection asynch : sourceNode.getIncomingConnectionList() ) {
if( asynch.getY() + request.getSizeDelta().height < sourceNode.getY() ) {
}
}
for( AbstractConnection reply : sourceNode.getOutgoingConnectionList() ) {
if( reply.getY() + request.getSizeDelta().height < sourceNode.getY() ) {
return null;
}
}
if ( request.getSizeDelta().height != 0 ) {
return new ReSizeOnlyHeightBehaviorNodeCommand(getHost(), request.getSizeDelta().height);
} else {
return null;
}
}
示例6: addSegmentsFor
/**
* Adds the segments between the given obstacles.
*
* @param source
* source obstacle
* @param target
* target obstacle
*/
private void addSegmentsFor(Vertex vertex, Obstacle obs) {
Segment seg = null;
Segment seg2 = null;
switch (obs.getPosition(vertex)) {
case PositionConstants.SOUTH_WEST:
case PositionConstants.NORTH_EAST:
seg = new Segment(vertex, obs.topLeft);
seg2 = new Segment(vertex, obs.bottomRight);
break;
case PositionConstants.SOUTH_EAST:
case PositionConstants.NORTH_WEST:
seg = new Segment(vertex, obs.topRight);
seg2 = new Segment(vertex, obs.bottomLeft);
break;
case PositionConstants.NORTH:
seg = new Segment(vertex, obs.topLeft);
seg2 = new Segment(vertex, obs.topRight);
break;
case PositionConstants.EAST:
seg = new Segment(vertex, obs.bottomRight);
seg2 = new Segment(vertex, obs.topRight);
break;
case PositionConstants.SOUTH:
seg = new Segment(vertex, obs.bottomRight);
seg2 = new Segment(vertex, obs.bottomLeft);
break;
case PositionConstants.WEST:
seg = new Segment(vertex, obs.topLeft);
seg2 = new Segment(vertex, obs.bottomLeft);
break;
default:
if (vertex.x == obs.x) {
seg = new Segment(vertex, obs.topLeft);
seg2 = new Segment(vertex, obs.bottomLeft);
} else if (vertex.y == obs.y) {
seg = new Segment(vertex, obs.topLeft);
seg2 = new Segment(vertex, obs.topRight);
} else if (vertex.y == obs.bottom() - 1) {
seg = new Segment(vertex, obs.bottomLeft);
seg2 = new Segment(vertex, obs.bottomRight);
} else if (vertex.x == obs.right() - 1) {
seg = new Segment(vertex, obs.topRight);
seg2 = new Segment(vertex, obs.bottomRight);
} else {
throw new RuntimeException("Unexpected vertex conditions"); //$NON-NLS-1$
}
}
stack.push(obs);
stack.push(null);
stack.push(seg);
stack.push(obs);
stack.push(null);
stack.push(seg2);
}
示例7: createSelectionHandles
/**
* @see org.eclipse.gef.editpolicies.SelectionHandlesEditPolicy#createSelectionHandles()
*/
protected List createSelectionHandles( )
{
List list = new ArrayList( );
if ( this.getResizeDirections( ) != -1 )
{
ReportResizableHandleKit.addMoveHandle( (GraphicalEditPart) getHost( ), list );
if ( ( this.getResizeDirections( ) & PositionConstants.EAST ) != 0 )
ReportResizableHandleKit.addHandle( (GraphicalEditPart) getHost( ),
list,
PositionConstants.EAST );
if ( ( this.getResizeDirections( ) & PositionConstants.SOUTH_EAST ) == PositionConstants.SOUTH_EAST )
ReportResizableHandleKit.addHandle( (GraphicalEditPart) getHost( ),
list,
PositionConstants.SOUTH_EAST );
if ( ( this.getResizeDirections( ) & PositionConstants.SOUTH ) != 0 )
ReportResizableHandleKit.addHandle( (GraphicalEditPart) getHost( ),
list,
PositionConstants.SOUTH );
if ( ( this.getResizeDirections( ) & PositionConstants.SOUTH_WEST ) == PositionConstants.SOUTH_WEST )
ReportResizableHandleKit.addHandle( (GraphicalEditPart) getHost( ),
list,
PositionConstants.SOUTH_WEST );
if ( ( this.getResizeDirections( ) & PositionConstants.WEST ) != 0 )
ReportResizableHandleKit.addHandle( (GraphicalEditPart) getHost( ),
list,
PositionConstants.WEST );
if ( ( this.getResizeDirections( ) & PositionConstants.NORTH_WEST ) == PositionConstants.NORTH_WEST )
ReportResizableHandleKit.addHandle( (GraphicalEditPart) getHost( ),
list,
PositionConstants.NORTH_WEST );
if ( ( this.getResizeDirections( ) & PositionConstants.NORTH ) != 0 )
ReportResizableHandleKit.addHandle( (GraphicalEditPart) getHost( ),
list,
PositionConstants.NORTH );
if ( ( this.getResizeDirections( ) & PositionConstants.NORTH_EAST ) == PositionConstants.NORTH_EAST )
ReportResizableHandleKit.addHandle( (GraphicalEditPart) getHost( ),
list,
PositionConstants.NORTH_EAST );
}
else
ReportResizableHandleKit.addHandles( (GraphicalEditPart) getHost( ), list );
return list;
}