本文整理汇总了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;
}
示例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;
}
示例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);
}
示例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 );
}
示例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);
}
示例6: initialize
import org.eclipse.draw2d.Cursors; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void initialize() {
setOpaque(false);
setBorder(new ERDiagramLineBorder());
setCursor(Cursors.SIZEALL);
}
示例7: initialize
import org.eclipse.draw2d.Cursors; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void initialize() {
setOpaque(false);
setBorder(new ERDiagramLineBorder());
setCursor(Cursors.SIZEALL);
}
示例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;
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
};
}
示例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);
}
示例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;
}
}
示例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);
}