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


Java Cursors类代码示例

本文整理汇总了Java中org.eclipse.draw2d.Cursors的典型用法代码示例。如果您正苦于以下问题:Java Cursors类的具体用法?Java Cursors怎么用?Java Cursors使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: createSelectionHandles

import org.eclipse.draw2d.Cursors; //导入依赖的package包/类
/**
 * Create selection handles in the style as predefined in DeltaEcore
 * @see DEGraphicalEditorTheme
 */
@Override
protected List<Object> createSelectionHandles() {
	List<Object> list = new ArrayList<Object>();

	MoveHandle moveHandle = new MoveHandle((GraphicalEditPart) getHost());
	moveHandle.setDragTracker(getDragTracker());		
	
	if (isDragAllowed()) {
		moveHandle.setCursor(Cursors.SIZEALL);
	} else {
		moveHandle.setCursor(SharedCursors.ARROW);
	}
	
	// set line style to meet the predefined theme
	DEGraphicalEditorTheme theme = DEGraphicalEditor.getTheme();
	LineBorder border = new LineBorder();
	border.setColor(theme.getSelectionSecondaryColor());
	border.setWidth(theme.getLineWidth());
	moveHandle.setBorder(border);
	
	list.add(moveHandle);
	
	return list;
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:29,代码来源:DwThemedNonResizableEditPolicy.java

示例2: makeConnection

import org.eclipse.draw2d.Cursors; //导入依赖的package包/类
private PolylineConnection makeConnection(IFigure contents, IFigure source, NodeFigure target, Color color) {
	PolylineConnection c = new PolylineConnection();
	ConnectionAnchor targetAnchor = new ChopboxAnchor(target);
	c.setTargetAnchor(targetAnchor);
	c.setSourceAnchor(new ChopboxAnchor(source));
	PolygonDecoration decoration = new PolygonDecoration();
	decoration.setTemplate(PolygonDecoration.TRIANGLE_TIP);
	c.setTargetDecoration(decoration);
	c.setForegroundColor(color);
	ConnectionMouseListener listener = new ConnectionMouseListener(c);
	c.addMouseMotionListener(listener);
	c.addMouseListener(listener);
	c.setCursor(Cursors.HAND);
	contents.add(c);
	connections.add(c);
	return c;
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:18,代码来源:GraphEditPart.java

示例3: Annotation

import org.eclipse.draw2d.Cursors; //导入依赖的package包/类
/**Construct a free annotation.
 * @param xAxis the xAxis of the annotation.
 * @param yAxis the yAxis of the annotation.
 * @param name the name of the annotation.
 */
public Annotation(String name, Axis xAxis, Axis yAxis) {
	this.xAxis = xAxis;
	this.yAxis = yAxis;
	this.name = name;
	trace = null;			
	infoLabel = new Label();
	infoLabel.setOpaque(false);
	infoLabel.setCursor(Cursors.SIZEALL);		
	add(infoLabel);
	InfoLabelDragger infoLabelDragger = new InfoLabelDragger();
	infoLabel.addMouseMotionListener(infoLabelDragger);
	infoLabel.addMouseListener(infoLabelDragger);		
	pointer = new Pointer();
	add(pointer);
	updateToDefaultPosition();	
	xAxis.addListener(this);
	yAxis.addListener(this);
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:24,代码来源:Annotation.java

示例4: initialize

import org.eclipse.draw2d.Cursors; //导入依赖的package包/类
/**
 * Initializes the handle. Sets the {@link DragTracker}and DragCursor.
 */
protected void initialize( )
{
	setOpaque( true );
	LineBorder bd = new LineBorder( 1 );
	bd.setColor( ReportColorConstants.HandleBorderColor );
	setBorder( bd );

	String tp = getTooltipText( );
	if ( tp != null )
	{
		Label tooltip = new Label( tp );
		tooltip.setBorder( new MarginBorder( 0, 2, 0, 2 ) );
		setToolTip( tooltip );
	}

	setCursor( Cursors.ARROW );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:21,代码来源:RowHandle.java

示例5: NodeFigure

import org.eclipse.draw2d.Cursors; //导入依赖的package包/类
public NodeFigure(Node node, Color bgcolor, Color fgcolor) {
	this.node = node;
	this.bgcolor = bgcolor;
	setLayoutManager(new BorderLayout());
	setBackgroundColor(bgcolor);
	setForegroundColor(fgcolor);
	setOpaque(true);

	setToolTip(new NodeTooltipFigure(node));
	setCursor(Cursors.HAND);
}
 
开发者ID:subclipse,项目名称:subclipse,代码行数:12,代码来源:NodeFigure.java

示例6: initialize

import org.eclipse.draw2d.Cursors; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void initialize() {
    setOpaque(false);
    setBorder(new ERDiagramLineBorder());
    setCursor(Cursors.SIZEALL);
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:10,代码来源:ERDiagramMoveHandle.java

示例7: initialize

import org.eclipse.draw2d.Cursors; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void initialize() {
	setOpaque(false);
	setBorder(new ERDiagramLineBorder());
	setCursor(Cursors.SIZEALL);
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:10,代码来源:ERDiagramMoveHandle.java

示例8: getCursor

import org.eclipse.draw2d.Cursors; //导入依赖的package包/类
public static Cursor getCursor(CURSOR_TYPE cursorType){
	switch (cursorType) {
	case GRABBING:
		if(CURSOR_GRABBING == null){
			
			CURSOR_GRABBING = new Cursor(Display.getDefault(), 
					getInstance().getImage("images/Grabbing.png").getImageData(), 8,8);		
		}
		return CURSOR_GRABBING;

	default:
		return Cursors.HAND;
		
	}
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:16,代码来源:XYGraphMediaFactory.java

示例9: createResizeHandle

import org.eclipse.draw2d.Cursors; //导入依赖的package包/类
@Override
protected void createResizeHandle(List handles, int direction) {
	if ((getResizeDirections() & direction) == direction) {
		SothEastRectangleHandles handle = new SothEastRectangleHandles((GraphicalEditPart) getHost(), direction);
		handle.setDragTracker(getResizeTracker(direction));
		handle.setCursor(Cursors.getDirectionalCursor(direction, getHostFigure().isMirrored()));
		handles.add(handle);
	} else {
		// display 'resize' handle to allow dragging or indicate selection
		// only
		createDragHandle(handles, direction);
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:14,代码来源:CalloutElementResizableEditPolicy.java

示例10: createMoveHandle

import org.eclipse.draw2d.Cursors; //导入依赖的package包/类
protected void createMoveHandle(List handles) {
	if (isDragAllowed()) {
		// display 'move' handle to allow dragging
		ResizableHandleKit.addMoveHandle((GraphicalEditPart) getHost(), handles, getDragTracker(), Cursors.SIZEALL);
	} else {
		// display 'move' handle only to indicate selection
		ResizableHandleKit.addMoveHandle((GraphicalEditPart) getHost(), handles, getSelectTracker(), SharedCursors.ARROW);
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:10,代码来源:ElementResizableEditPolicy.java

示例11: createResizeHandle

import org.eclipse.draw2d.Cursors; //导入依赖的package包/类
protected void createResizeHandle(List handles, int direction) {
	if ((getResizeDirections() & direction) == direction) {
		ColoredSquareHandles handle = new ColoredSquareHandles((GraphicalEditPart) getHost(), direction);
		handle.setDragTracker(getResizeTracker(direction));
		handle.setCursor(Cursors.getDirectionalCursor(direction, getHostFigure().isMirrored()));
		handles.add(handle);
	} else {
		// display 'resize' handle to allow dragging or indicate selection
		// only
		createDragHandle(handles, direction);
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:13,代码来源:ElementResizableEditPolicy.java

示例12: getDragTracker

import org.eclipse.draw2d.Cursors; //导入依赖的package包/类
public DragTracker getDragTracker(Request request) {
	return new DragEditPartsTracker(this) {
		protected Cursor calculateCursor() {
			if (isInState(STATE_INVALID))
				return Cursors.NO;
			return getCurrentCursor();
		}

		protected boolean isMove() {
			return true;
		}
	};
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:14,代码来源:JDGuideEditPart.java

示例13: setViewer

import org.eclipse.draw2d.Cursors; //导入依赖的package包/类
@Override
public void setViewer(EditPartViewer viewer) {
	if (viewer == getCurrentViewer())
		return;
	super.setViewer(viewer);
	if (viewer instanceof GraphicalViewer)
		setDefaultCursor(Cursors.SIZEWE);
	else
		setDefaultCursor(Cursors.NO);
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:11,代码来源:ZoomSweepTool.java

示例14: initialize

import org.eclipse.draw2d.Cursors; //导入依赖的package包/类
@Override
protected void initialize() {
	switch(((SplitEditPart)getOwner()).getCastedFigure().getOrientation()) {
	case SplitConstants.HORIZONTAL_SPLIT:
		setCursor(Cursors.SIZEWE);
		break;
	case SplitConstants.VERTICAL_SPLIT:
		setCursor(Cursors.SIZENS);
		break;
	}
}
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:12,代码来源:SplitEditPart.java

示例15: ConnectionHandle

import org.eclipse.draw2d.Cursors; //导入依赖的package包/类
/**
 * Creates a new handle with the given fixed setting. If the handle is
 * fixed, it cannot be dragged.
 * 
 * @param fixed
 *            <code>true</code> if the handle cannot be dragged.
 */
public ConnectionHandle(boolean fixed) {
	setFixed(fixed);
	if (fixed)
		setCursor(Cursors.NO);
	else
		setCursor(Cursors.CROSS);
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:15,代码来源:ConnectionHandle.java


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