本文整理汇总了Java中org.eclipse.gef.Handle类的典型用法代码示例。如果您正苦于以下问题:Java Handle类的具体用法?Java Handle怎么用?Java Handle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Handle类属于org.eclipse.gef包,在下文中一共展示了Handle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createDefaultEditPolicies
import org.eclipse.gef.Handle; //导入依赖的package包/类
@Override
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicy.COMPONENT_ROLE, new TransitionExpressionComponentEditPolicy());
installEditPolicy(EditPolicy.SELECTION_FEEDBACK_ROLE, new ContextSensitiveHelpPolicy(
HelpContextIds.SC_PROPERTIES_TRANSITION_EXPRESSION));
// BUGFIX:
// https://code.google.com/a/eclipselabs.org/p/yakindu/issues/detail?id=26
installEditPolicy(EditPolicy.PRIMARY_DRAG_ROLE, new NonResizableLabelEditPolicy() {
@Override
protected void replaceHandleDragEditPartsTracker(Handle handle) {
if (handle instanceof AbstractHandle) {
AbstractHandle h = (AbstractHandle) handle;
h.setDragTracker(new DragEditPartsTrackerEx(getHost()) {
protected boolean isMove() {
return true;
};
});
}
}
});
}
开发者ID:Yakindu,项目名称:statecharts,代码行数:23,代码来源:TransitionExpressionEditPart.java
示例2: getAdapter
import org.eclipse.gef.Handle; //导入依赖的package包/类
/**
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class)
*/
public Object getAdapter(Class key) {
if (key == AccessibleHandleProvider.class)
return new AccessibleHandleProvider() {
public List getAccessibleHandleLocations() {
List result = new ArrayList();
if (handles != null) {
for (int i = 0; i < handles.size(); i++) {
Point p = ((Handle) handles.get(i))
.getAccessibleLocation();
if (p != null)
result.add(p);
}
}
return result;
}
};
return null;
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:22,代码来源:SelectionHandlesEditPolicy.java
示例3: findHandleAt
import org.eclipse.gef.Handle; //导入依赖的package包/类
/**
* @see GraphicalViewer#findHandleAt(org.eclipse.draw2d.geometry.Point)
*/
public Handle findHandleAt(Point p) {
LayerManager layermanager = (LayerManager) getEditPartRegistry().get(
LayerManager.ID);
if (layermanager == null)
return null;
List list = new ArrayList(3);
list.add(layermanager.getLayer(LayerConstants.PRIMARY_LAYER));
list.add(layermanager.getLayer(LayerConstants.CONNECTION_LAYER));
list.add(layermanager.getLayer(LayerConstants.FEEDBACK_LAYER));
IFigure handle = getLightweightSystem().getRootFigure()
.findFigureAtExcluding(p.x, p.y, list);
if (handle instanceof Handle)
return (Handle) handle;
return null;
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:19,代码来源:GraphicalViewerImpl.java
示例4: findHandleAt
import org.eclipse.gef.Handle; //导入依赖的package包/类
/**
* @see org.eclipse.gef.GraphicalViewer#findHandleAt(org.eclipse.draw2d.geometry.Point)
*/
public Handle findHandleAt(org.eclipse.draw2d.geometry.Point p) {
final GraphicalEditPart gep = (GraphicalEditPart) findObjectAtExcluding(
p, new ArrayList());
if (gep == null || !(gep instanceof GuideEditPart))
return null;
return new Handle() {
public DragTracker getDragTracker() {
return ((GuideEditPart) gep).getDragTracker(null);
}
public org.eclipse.draw2d.geometry.Point getAccessibleLocation() {
return null;
}
};
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:19,代码来源:RulerComposite.java
示例5: handleMove
import org.eclipse.gef.Handle; //导入依赖的package包/类
/**
* If in the initial state, updates the request and the mouse target and
* asks to show target feedback. If in the traverse handle state, finds the
* next handle, moves the mouse cursor to that handle, and gets a drag
* tracker from the handle.
*
* @see AbstractTool#handleMove()
*/
protected boolean handleMove() {
if (stateTransition(STATE_ACCESSIBLE_DRAG, STATE_INITIAL))
setDragTracker(null);
if (isInState(STATE_INITIAL)) {
updateTargetRequest();
updateTargetUnderMouse();
showTargetFeedback();
return true;
} else if (isInState(STATE_TRAVERSE_HANDLE)) {
EditPartViewer viewer = getCurrentViewer();
if (viewer instanceof GraphicalViewer) {
Handle handle = ((GraphicalViewer) viewer)
.findHandleAt(getLocation());
if (handle != null) {
setState(STATE_ACCESSIBLE_DRAG);
setStartLocation(getLocation());
setDragTracker(handle.getDragTracker());
return true;
} else {
setState(STATE_INITIAL);
}
}
}
return false;
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:34,代码来源:SelectionTool.java
示例6: findHandleAt
import org.eclipse.gef.Handle; //导入依赖的package包/类
/**
* @see GraphicalViewer#findHandleAt(org.eclipse.draw2d.geometry.Point)
*/
public Handle findHandleAt( Point p )
{
LayerManager layermanager = (LayerManager) getEditPartRegistry( ).get( LayerManager.ID );
if ( layermanager == null )
return null;
List list = new ArrayList( 3 );
// list.add(layermanager.getLayer(LayerConstants.PRIMARY_LAYER));
list.add( layermanager.getLayer( LayerConstants.CONNECTION_LAYER ) );
list.add( layermanager.getLayer( LayerConstants.FEEDBACK_LAYER ) );
IFigure handle = getLightweightSystem( ).getRootFigure( )
.findFigureAtExcluding( p.x, p.y, list );
if ( handle instanceof Handle )
return (Handle) handle;
return null;
}
开发者ID:eclipse,项目名称:birt,代码行数:19,代码来源:DeferredGraphicalViewer.java
示例7: getHandleUnderMouse
import org.eclipse.gef.Handle; //导入依赖的package包/类
/**
* Updates the target editpart and returns <code>true</code> if the target changes. The
* target is updated by using the target conditional and the target request. If the
* target has been locked, this method does nothing and returns <code>false</code>.
* @return <code>true</code> if the target was changed
*/
// protected EditPart getEditPartUnderMouse() {
//
// Collection exclude = getExclusionSet();
// EditPart editPart = getCurrentViewer().findObjectAtExcluding(
// getLocation(),
// exclude,
// getTargetingConditional());
// if (editPart != null)
// return editPart.getTargetEditPart(getTargetRequest());
// return null;
//
// }
protected Handle getHandleUnderMouse()
{
return ((DeferredGraphicalViewer)(getSourceEditPart().getViewer())).findHandleAt(getLocation());
}
开发者ID:eclipse,项目名称:birt,代码行数:23,代码来源:TableSelectionGuideTracker.java
示例8: createSelectionHandles
import org.eclipse.gef.Handle; //导入依赖的package包/类
@Override
protected List<Handle> createSelectionHandles() {
List<Handle> list = new ArrayList<Handle>();
GraphicalEditPart geditPart = getHost();
list.add(new CellResizeHandle2(geditPart, PositionConstants.SOUTH));
list.add(new CellResizeHandle2(geditPart, PositionConstants.NORTH));
list.add(new CellResizeHandle2(geditPart, PositionConstants.EAST));
list.add(new CellResizeHandle2(geditPart, PositionConstants.WEST));
MoveHandle hand = new CellMoveHandle(geditPart, true, true);
list.add(hand);
return list;
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:16,代码来源:CrosstabCellResizableEditPolicy.java
示例9: createSelectionHandles
import org.eclipse.gef.Handle; //导入依赖的package包/类
@Override
protected List<Handle> createSelectionHandles() {
List<Handle> list = new ArrayList<Handle>();
GraphicalEditPart geditPart = getHost();
list.add(new CellResizeHandle2(geditPart, PositionConstants.SOUTH));
list.add(new CellResizeHandle2(geditPart, PositionConstants.NORTH));
list.add(new CellResizeHandle2(geditPart, PositionConstants.EAST));
list.add(new CellResizeHandle2(geditPart, PositionConstants.WEST));
MoveHandle hand = new CellMoveHandle(geditPart, true, false, -3);
list.add(hand);
return list;
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:16,代码来源:TableCellResizableEditPolicy.java
示例10: createSelectionHandles
import org.eclipse.gef.Handle; //导入依赖的package包/类
@Override
protected List<Handle> createSelectionHandles() {
List<Handle> list = new ArrayList<Handle>();
GraphicalEditPart geditPart = getHost();
list.add(new CellResizeHandle(geditPart, PositionConstants.SOUTH));
list.add(new CellResizeHandle(geditPart, PositionConstants.EAST));
return list;
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:9,代码来源:AContainerMoveEditPolicy.java
示例11: findHandleAt
import org.eclipse.gef.Handle; //导入依赖的package包/类
/**
* @see org.eclipse.gef.GraphicalViewer#findHandleAt(org.eclipse.draw2d.geometry.Point)
*/
public Handle findHandleAt(org.eclipse.draw2d.geometry.Point p) {
final GraphicalEditPart gep = (GraphicalEditPart) findObjectAtExcluding(p, new ArrayList<Object>());
if (gep == null || !(gep instanceof GuideEditPart))
return null;
return new Handle() {
public DragTracker getDragTracker() {
return ((GuideEditPart) gep).getDragTracker(null);
}
public org.eclipse.draw2d.geometry.Point getAccessibleLocation() {
return null;
}
};
}
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:18,代码来源:JDRulerComposite.java
示例12: createHandle
import org.eclipse.gef.Handle; //导入依赖的package包/类
static Handle createHandle(GraphicalEditPart owner, int direction,
DragTracker tracker, Cursor cursor) {
ResizeHandle handle = new ResizeHandle(owner, direction);
handle.setCursor(cursor);
handle.setDragTracker(tracker);
return handle;
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:8,代码来源:NonResizableHandleKit.java
示例13: createHandle
import org.eclipse.gef.Handle; //导入依赖的package包/类
static Handle createHandle(GraphicalEditPart owner, int direction,
DragTracker tracker, Cursor cursor) {
ResizeHandle handle = new ResizeHandle(owner, direction);
handle.setDragTracker(tracker);
handle.setCursor(cursor);
return handle;
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:8,代码来源:ResizableHandleKit.java
示例14: handleButtonDown
import org.eclipse.gef.Handle; //导入依赖的package包/类
/**
* If there is a {@link Handle} under the mouse, this method sets the drag
* tracker returned from the handle. If there's an {@link EditPart} under
* the mouse, this method sets the drag tracker returned from the edit part.
*
* @see AbstractTool#handleButtonDown(int)
*/
protected boolean handleButtonDown(int button) {
if (!stateTransition(STATE_INITIAL, STATE_DRAG)) {
resetHover();
return true;
}
resetHover();
EditPartViewer viewer = getCurrentViewer();
Point p = getLocation();
if (getDragTracker() != null)
getDragTracker().deactivate();
if (viewer instanceof GraphicalViewer) {
Handle handle = ((GraphicalViewer) viewer).findHandleAt(p);
if (handle != null) {
setDragTracker(handle.getDragTracker());
return true;
}
}
updateTargetRequest();
((SelectionRequest) getTargetRequest()).setLastButtonPressed(button);
updateTargetUnderMouse();
EditPart editpart = getTargetEditPart();
if (editpart != null) {
setDragTracker(editpart.getDragTracker(getTargetRequest()));
lockTargetEditPart(editpart);
return true;
}
return false;
}
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:38,代码来源:SelectionTool.java
示例15: createHandle
import org.eclipse.gef.Handle; //导入依赖的package包/类
/**
* @param owner
* @return
*/
static Handle createHandle( CrosstabCellEditPart owner )
{
CrosstabTableEditPart part = (CrosstabTableEditPart) owner.getParent( );
Rectangle rect = part.getSelectBounds( );
TableSelectionHandle handle = new TableSelectionHandle( owner, rect );
handle.setCursor( SharedCursors.SIZEALL );
return handle;
}
开发者ID:eclipse,项目名称:birt,代码行数:16,代码来源:CrosstabHandleKit.java
示例16: createHandle
import org.eclipse.gef.Handle; //导入依赖的package包/类
static Handle createHandle( TableCellEditPart owner )
{
TableEditPart part = (TableEditPart) owner.getParent( );
Rectangle rect = part.getSelectBounds( );
TableSelectionHandle handle = new TableSelectionHandle( owner, rect );
handle.setCursor( SharedCursors.SIZEALL );
return handle;
}
开发者ID:eclipse,项目名称:birt,代码行数:12,代码来源:TableHandleKit.java
示例17: createHandle
import org.eclipse.gef.Handle; //导入依赖的package包/类
static Handle createHandle( GraphicalEditPart owner, int direction,
DragTracker tracker, Cursor cursor )
{
ReportResizeHandle handle = new ReportResizeHandle( owner, direction );
handle.setDragTracker( tracker );
handle.setCursor( cursor );
return handle;
}
开发者ID:eclipse,项目名称:birt,代码行数:9,代码来源:ReportResizableHandleKit.java
示例18: createHandle
import org.eclipse.gef.Handle; //导入依赖的package包/类
static Handle createHandle( GraphicalEditPart owner, int direction )
{
ReportResizeHandle handle = new ReportResizeHandle( owner, direction );
handle.setCursor( SharedCursors.SIZEALL );
handle.setDragTracker( new DragEditPartsTracker( owner ) );
return handle;
}
开发者ID:eclipse,项目名称:birt,代码行数:8,代码来源:ReportNonResizableHandleKit.java
示例19: isDealwithDrag
import org.eclipse.gef.Handle; //导入依赖的package包/类
public boolean isDealwithDrag( )
{
Handle handle = getHandleUnderMouse( );
if ( handle instanceof ColumnHandle )
{
return ( (ColumnHandle) handle ).getOwner( ) == getSourceEditPart( );
}
return false;
// EditPart part = getEditPartUnderMouse();
// return part instanceof TableEditPart.DummyColumnEditPart ||
// isSameTable();
}
开发者ID:eclipse,项目名称:birt,代码行数:13,代码来源:ColumnTracker.java
示例20: isDealwithDrag
import org.eclipse.gef.Handle; //导入依赖的package包/类
public boolean isDealwithDrag( )
{
Handle handle = getHandleUnderMouse( );
if ( handle instanceof RowHandle )
{
return ( (RowHandle) handle ).getOwner( ) == getSourceEditPart( );
}
return false;
// EditPart part = getEditPartUnderMouse();
// return part instanceof TableEditPart.DummyColumnEditPart ||
// isSameTable();
}
开发者ID:eclipse,项目名称:birt,代码行数:13,代码来源:RowTracker.java
注:本文中的org.eclipse.gef.Handle类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论