本文整理汇总了Java中org.eclipse.draw2d.Locator类的典型用法代码示例。如果您正苦于以下问题:Java Locator类的具体用法?Java Locator怎么用?Java Locator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Locator类属于org.eclipse.draw2d包,在下文中一共展示了Locator类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: refreshNodeConnection
import org.eclipse.draw2d.Locator; //导入依赖的package包/类
/**
* Refresh this node SplineConnection's children (its decorations). Calling the locator's relocate() moves these decorations.
*
* @param conn
* the node connection
* @param force
* force a refresh that might cause infinite loops
* @return true if we could refresh (edit part and figure exist)
*/
public boolean refreshNodeConnection(NodeConnection conn, boolean force) {
NodeConnectionEditPart nc = (NodeConnectionEditPart) getViewer().getEditPartRegistry().get(conn);
if (nc != null) {
// seems to cause infinite loops with connection router.
if (force)
nc.refreshVisuals();
for (Iterator iter = nc.getFigure().getChildren().iterator(); iter.hasNext();) {
IFigure fig = (IFigure) iter.next();
if (fig instanceof TimeoutPathFigure || fig instanceof Label) {
Locator loc = (Locator) ((SplineConnection) nc.getFigure()).getLayoutManager().getConstraint(fig);
// don't know why isn't refreshing stub/timer labels
// probably has to do with implementation of locator
// Seems to be useful when moving the node connection
// indirectly.
loc.relocate(fig);
}
}
return true;
}
return false;
}
开发者ID:McGill-DP-Group,项目名称:seg.jUCMNav,代码行数:34,代码来源:PathNodeEditPart.java
示例2: showFocus
import org.eclipse.draw2d.Locator; //导入依赖的package包/类
/**
* Shows a focus rectangle around the host's figure. The focus rectangle is
* expanded by 5 pixels from the figure's bounds.
*
* @see org.eclipse.gef.editpolicies.SelectionEditPolicy#showFocus()
*/
protected void showFocus() {
focusRect = new AbstractHandle((GraphicalEditPart) getHost(),
new Locator() {
public void relocate(IFigure target) {
IFigure figure = getHostFigure();
Rectangle r;
if (figure instanceof HandleBounds)
r = ((HandleBounds) figure).getHandleBounds()
.getCopy();
else
r = getHostFigure().getBounds().getResized(-1, -1);
getHostFigure().translateToAbsolute(r);
target.translateToRelative(r);
target.setBounds(r.expand(5, 5).resize(1, 1));
}
}) {
{
setBorder(new FocusBorder());
}
protected DragTracker createDragTracker() {
return null;
}
};
addFeedback(focusRect);
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:33,代码来源:NonResizableEditPolicy.java
示例3: getConnectionLocator
import org.eclipse.draw2d.Locator; //导入依赖的package包/类
/**
* This method returns a {@link ConnectionEndpointLocator} for this {@link Relation} from type
* relationship.
*
* @return locator org.eclipse.draw2d.ConnectionEndpointLocator
* */
private Locator getConnectionLocator(final PolylineConnection connection, final boolean isEnd) {
final ConnectionEndpointLocator locator = new ConnectionEndpointLocator(connection, isEnd);
locator.setVDistance(-1);
locator.setUDistance(1);
return locator;
}
开发者ID:leondart,项目名称:FRaMED,代码行数:13,代码来源:ORMRelationshipEditPart.java
示例4: AbstractGuideHandle
import org.eclipse.draw2d.Locator; //导入依赖的package包/类
public AbstractGuideHandle( GraphicalEditPart owner, Locator loc )
{
super( owner, loc );
addMouseMotionListener( this );
getLocator( ).relocate( this );
}
开发者ID:eclipse,项目名称:birt,代码行数:8,代码来源:AbstractGuideHandle.java
示例5: ColumnDragHandle
import org.eclipse.draw2d.Locator; //导入依赖的package包/类
/**
* Creates a MoveHandle for the given <code>GraphicalEditPart</code> using
* the given <code>Locator</code>.
*
* @param owner
* The GraphicalEditPart to be moved by this handle.
* @param loc
* The Locator used to place the handle.
*/
public ColumnDragHandle( TableEditPart owner, Locator loc, int start,
int end )
{
super( owner, loc );
this.start = start;
this.end = end;
initialize( );
}
开发者ID:eclipse,项目名称:birt,代码行数:19,代码来源:ColumnDragHandle.java
示例6: BandMoveHandle
import org.eclipse.draw2d.Locator; //导入依赖的package包/类
public BandMoveHandle(GraphicalEditPart owner, Locator loc) {
super(owner, loc);
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:4,代码来源:BandMoveHandle.java
示例7: ControlFigure
import org.eclipse.draw2d.Locator; //导入依赖的package包/类
public ControlFigure(GraphicalEditPart owner, Locator loc)
{
super( owner, loc );
}
开发者ID:eclipse,项目名称:birt,代码行数:5,代码来源:CrosstabFirstCellEditPart.java
示例8: reveal
import org.eclipse.draw2d.Locator; //导入依赖的package包/类
public void reveal( EditPart part )
{
// In some case, the editor control is not created, but get the sync selection event.
// Fix this problem temporary.
if(getFigureCanvas( )==null || getFigureCanvas( ).isDisposed( ))
{
return;
}
Viewport port = getFigureCanvas( ).getViewport( );
IFigure target = ( (GraphicalEditPart) part ).getFigure( );
Rectangle exposeRegion = target.getBounds( ).getCopy( );
// Get the primary editpolicy
EditPolicy policy = part.getEditPolicy( EditPolicy.PRIMARY_DRAG_ROLE );
// If the policy let us access the handles, proceed, otherwise
// default to original behaviour
if ( !( policy instanceof ISelectionHandlesEditPolicy ) )
{
super.reveal( part );
return;
}
// First translate exposeRegion to the root level
target = target.getParent( );
while ( target != null && target != port )
{
target.translateToParent( exposeRegion );
target = target.getParent( );
}
// Merge selection handles if any to the exposeRegion
List handles = ( (ISelectionHandlesEditPolicy) policy ).getHandles( );
for ( Iterator iter = handles.iterator( ); iter.hasNext( ); )
{
AbstractHandle handle = (AbstractHandle) iter.next( );
Locator locator = handle.getLocator( );
locator.relocate( handle );
exposeRegion.union( handle.getBounds( ).getCopy( ) );
}
exposeRegion.getExpanded( 5, 5 );
Dimension viewportSize = port.getClientArea( ).getSize( );
Point topLeft = exposeRegion.getTopLeft( );
Point bottomRight = exposeRegion.getBottomRight( )
.translate( viewportSize.getNegated( ) );
Point finalLocation = new Point( );
if ( viewportSize.width < exposeRegion.width )
finalLocation.x = Math.min( bottomRight.x, Math.max( topLeft.x,
port.getViewLocation( ).x ) );
else
finalLocation.x = Math.min( topLeft.x, Math.max( bottomRight.x,
port.getViewLocation( ).x ) );
if ( viewportSize.height < exposeRegion.height )
finalLocation.y = Math.min( bottomRight.y, Math.max( topLeft.y,
port.getViewLocation( ).y ) );
else
finalLocation.y = Math.min( topLeft.y, Math.max( bottomRight.y,
port.getViewLocation( ).y ) );
getFigureCanvas( ).scrollSmoothTo( finalLocation.x, finalLocation.y );
}
开发者ID:eclipse,项目名称:birt,代码行数:69,代码来源:DeferredGraphicalViewer.java
示例9: ListControlMenuFigure
import org.eclipse.draw2d.Locator; //导入依赖的package包/类
/**
* @param owner
*/
public ListControlMenuFigure( GraphicalEditPart owner, Locator loc )
{
super( owner, loc );
setBounds( new Rectangle( 55, 0, 18, 19 ) );
}
开发者ID:eclipse,项目名称:birt,代码行数:9,代码来源:ListBandControlFigure.java
示例10: BendpointMoveHandle
import org.eclipse.draw2d.Locator; //导入依赖的package包/类
/**
* Creates a new BendpointMoveHandle and sets its owner to
* <code>owner</code>, sets its index to <code>index</code>, and sets its
* locator to <code>locator</code>.
*
* @param owner
* the ConnectionEditPart owner
* @param index
* the index
* @param locator
* the Locator
*/
public BendpointMoveHandle(ConnectionEditPart owner, int index,
Locator locator) {
setOwner(owner);
setIndex(index);
setLocator(locator);
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:19,代码来源:BendpointMoveHandle.java
示例11: BendpointCreationHandle
import org.eclipse.draw2d.Locator; //导入依赖的package包/类
/**
* Creates a new BendpointCreationHandle and sets its owner to
* <code>owner</code>, sets its index to <code>index</code>, and sets its
* locator to <code>locator</code>.
*
* @param owner
* the ConnectionEditPart owner
* @param index
* the index
* @param locator
* the Locator
*/
public BendpointCreationHandle(ConnectionEditPart owner, int index,
Locator locator) {
setOwner(owner);
setIndex(index);
setLocator(locator);
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:19,代码来源:BendpointCreationHandle.java
示例12: RowHandle
import org.eclipse.draw2d.Locator; //导入依赖的package包/类
/**
* Creates a MoveHandle for the given <code>GraphicalEditPart</code> using
* the given <code>Locator</code>.
*
* @param owner
* The GraphicalEditPart to be moved by this handle.
* @param loc
* The Locator used to place the handle.
*/
public RowHandle( TableEditPart owner, Locator loc, int number )
{
super( owner, loc );
this.rowNumber = number;
initialize( );
}
开发者ID:eclipse,项目名称:birt,代码行数:17,代码来源:RowHandle.java
示例13: RowDragHandle
import org.eclipse.draw2d.Locator; //导入依赖的package包/类
/**
* Creates a MoveHandle for the given <code>GraphicalEditPart</code> using
* the given <code>Locator</code>.
*
* @param owner
* The GraphicalEditPart to be moved by this handle.
* @param loc
* The Locator used to place the handle.
*/
public RowDragHandle( TableEditPart owner, Locator loc, int start, int end )
{
super( owner, loc );
this.start = start;
this.end = end;
initialize( );
}
开发者ID:eclipse,项目名称:birt,代码行数:18,代码来源:RowDragHandle.java
示例14: ColumnHandle
import org.eclipse.draw2d.Locator; //导入依赖的package包/类
/**
* Creates a MoveHandle for the given <code>GraphicalEditPart</code> using
* the given <code>Locator</code>.
*
* @param owner
* The GraphicalEditPart to be moved by this handle.
* @param loc
* The Locator used to place the handle.
*/
public ColumnHandle( TableEditPart owner, Locator loc, int number )
{
super( owner, loc );
this.columnNumber = number;
initialize( );
}
开发者ID:eclipse,项目名称:birt,代码行数:17,代码来源:ColumnHandle.java
示例15: SequenceBendpointCreationHandle
import org.eclipse.draw2d.Locator; //导入依赖的package包/类
/**
* Creates a new BendpointCreationHandle and sets its owner to
* <code>owner</code>, sets its index to <code>index</code>, and
* sets its locator to <code>locator</code>.
* @param owner the ConnectionEditPart owner
* @param index the index
* @param locator the Locator
*/
public SequenceBendpointCreationHandle(ConnectionEditPart owner, int index, Locator locator) {
setOwner(owner);
setIndex(index);
setLocator(locator);
}
开发者ID:SK-HOLDINGS-CC,项目名称:NEXCORE-UML-Modeler,代码行数:14,代码来源:SequenceBendpointCreationHandle.java
示例16: SothEastRectangleHandles
import org.eclipse.draw2d.Locator; //导入依赖的package包/类
/**
* Creates a new ResizeHandle for the given GraphicalEditPart.
*
* @see SquareHandle#SquareHandle(GraphicalEditPart, Locator, Cursor)
*/
public SothEastRectangleHandles(GraphicalEditPart owner, Locator loc, Cursor c) {
super(owner, loc, c);
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:9,代码来源:SothEastRectangleHandles.java
示例17: CellMoveHandle
import org.eclipse.draw2d.Locator; //导入依赖的package包/类
public CellMoveHandle(GraphicalEditPart owner, Locator loc) {
super(owner, loc);
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:5,代码来源:CellMoveHandle.java
示例18: ResizeHandle
import org.eclipse.draw2d.Locator; //导入依赖的package包/类
/**
* Creates a new ResizeHandle for the given GraphicalEditPart.
*
* @see SquareHandle#SquareHandle(GraphicalEditPart, Locator, Cursor)
*/
public ResizeHandle(GraphicalEditPart owner, Locator loc, Cursor c) {
super(owner, loc, c);
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:9,代码来源:ResizeHandle.java
示例19: SquareHandle
import org.eclipse.draw2d.Locator; //导入依赖的package包/类
/**
* Creates a SquareHandle for the given <code>GraphicalEditPart</code> with
* the given <code>Locator</code>.
*
* @param owner
* the owner
* @param loc
* the locator
*/
public SquareHandle(GraphicalEditPart owner, Locator loc) {
super(owner, loc);
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:13,代码来源:SquareHandle.java
示例20: NonResizableHandle
import org.eclipse.draw2d.Locator; //导入依赖的package包/类
/**
* Creates a NonResizableHandle for the given <code>GraphicalEditPart</code>
* using the given <code>Locator</code>.
*
* @param owner
* The GraphicalEditPart to be moved by this handle.
* @param loc
* The Locator used to place the handle.
*/
public NonResizableHandle(GraphicalEditPart owner, Locator loc) {
super(owner, loc);
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:13,代码来源:NonResizableHandle.java
注:本文中的org.eclipse.draw2d.Locator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论