Java源码示例:org.eclipse.draw2d.Cursors
示例1
/**
* 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);
}
示例2
/**
* 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 );
}
示例3
public CustomResizeHandle(GraphicalEditPart owner, int direction) {
setOwner(owner);
RelativeHandleLocator locator = new RelativeHandleLocator(owner.getFigure(), direction){
protected Rectangle getReferenceBox() {
IFigure f = getReferenceFigure();
if (f instanceof HandleBounds){
Rectangle r = ((HandleBounds) f).getHandleBounds() ;
return r;
}
return super.getReferenceBox();
}
};
setLocator(locator);
setCursor(Cursors.getDirectionalCursor(direction, owner.getFigure()
.isMirrored()));
cursorDirection = direction;
}
示例4
public Thumb() {
super();
setOutline(true);
setFill(true);
setCursor(Cursors.HAND);
setForegroundColor(GRAY_COLOR);
setLineWidth(1);
ThumbDragger thumbDragger = new ThumbDragger();
addMouseMotionListener(thumbDragger);
addMouseListener(thumbDragger);
}
示例5
@Override
public void setEnabled(boolean value) {
super.setEnabled(value);
if(value)
thumb.setCursor(Cursors.HAND);
//the disabled cursor should be controlled by widget controller.
repaint();
}
示例6
/**
* {@inheritDoc}
*/
@Override
protected void initialize() {
setOpaque(false);
setBorder(new ERDiagramLineBorder());
setCursor(Cursors.SIZEALL);
}
示例7
/**
* @param owner
* @param direction
* @param start
* @param end
*/
public CrosstavCellDragHandle( CrosstabCellEditPart owner, int direction,int start,
int end)
{
setOwner(owner);
setLocator(new CellDragoicator(owner.getFigure(), direction));
setCursor(Cursors.getDirectionalCursor(direction, owner.getFigure().isMirrored()));
cursorDirection = direction;
setOpaque( false );
this.start = start;
this.end = end;
}
示例8
@Override
protected Cursor getDefaultCursor( )
{
if (isCloneActive())
{
return Cursors.SIZENS;
}
return super.getDefaultCursor( );
}
示例9
@Override
protected Cursor getDefaultCursor( )
{
if (isCloneActive())
{
return Cursors.SIZEWE;
}
return super.getDefaultCursor( );
}
示例10
/**
* @param owner
* @param direction
* @param start
* @param end
*/
public TableCellDragHandle( TableCellEditPart owner, int direction,int start,
int end)
{
setOwner(owner);
setLocator(new CellDragoicator(owner.getFigure(), direction));
setCursor(Cursors.getDirectionalCursor(direction, owner.getFigure().isMirrored()));
cursorDirection = direction;
setOpaque( false );
this.start = start;
this.end = end;
}
示例11
/**
* Initializes the handle. Sets the {@link DragTracker}and DragCursor.
*/
protected void initialize( )
{
setOpaque( true );
setBorder( new LineBorder( 1 ) );
setCursor( Cursors.SIZEWE );
}
示例12
/**
* Initializes the handle. Sets the {@link DragTracker}and DragCursor.
*/
protected void initialize( )
{
setOpaque( true );
setBorder( new LineBorder( 1 ) );
setCursor( Cursors.SIZENS );
}
示例13
/**
* Initializes the handle. Sets the {@link DragTracker}and DragCursor.
*/
protected void initialize( )
{
//should draw the fill rectangle
setOpaque( true );
//draw the border line width is 1
LineBorder bd = new LineBorder( 1 );
bd.setColor( ReportColorConstants.HandleBorderColor );
setBorder( bd );
//set the default cursor, may not be a SIZEALL cursor()
setCursor( Cursors.ARROW );
initChildrenHandle( );
}
示例14
/**
* 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 );
setCursor( Cursors.ARROW );
}
示例15
/**
* Initializes the handle. Sets the {@link DragTracker} and DragCursor.
*/
protected void initialize( )
{
setOpaque( false );
setBorder( new SelectionBorder( 1 ) );
setCursor( Cursors.SIZEALL );
}
示例16
/**
* 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 );
setCursor( Cursors.ARROW );
}
示例17
@Override
protected Cursor getDefaultCursor( )
{
if (isCloneActive())
{
return Cursors.SIZEWE;
}
return super.getDefaultCursor( );
}
示例18
@Override
protected Cursor getDefaultCursor( )
{
if (isCloneActive())
{
return Cursors.SIZENS;
}
return super.getDefaultCursor( );
}
示例19
protected Cursor getDefaultCursor() {
if (getCurrentViewer() instanceof GraphicalViewer) {
if (getZoomMode() == ZOOM_IN_MODE)
return zoom_in_cursor;
else if (getZoomMode() == ZOOM_OUT_MODE)
return zoom_out_cursor;
else if (getZoomMode() == ZOOM_PAN_MODE)
return zoom_pan_cursor;
}
return Cursors.NO;
}
示例20
public CustomPoolResizeHandle(GraphicalEditPart owner, int direction) {
setOwner(owner);
setLocator(new RelativeHandleLocator(owner.getFigure(), direction));
setCursor(Cursors.getDirectionalCursor(direction, owner.getFigure()
.isMirrored()));
cursorDirection = direction;
}
示例21
/**
* Creates a new Compartment Collapse Handle
*
* @param owner
*/
public SubprocessCollapseHandle(IGraphicalEditPart owner) {
setOwner(owner);
zoomManager = ((DiagramRootEditPart) owner.getRoot()).getZoomManager();
setLocator(new CollapseHandleLocator());
setCursor(Cursors.HAND);
plus = FiguresHelper.getDecoratorFigure(FiguresHelper.SUBPROCESS_DECORATOR_EXPAND) ;
minus = FiguresHelper.getDecoratorFigure(FiguresHelper.SUBPROCESS_DECORATOR_COLLAPSE) ;
setLayoutManager(new StackLayout());
zoomManager.addZoomListener(this) ;
setSize(plus.getSize().scale(zoomManager.getZoom()));
View view = owner.getNotationView();
if (view != null) {
DrawerStyle style = (DrawerStyle) view.getStyle(NotationPackage.eINSTANCE.getDrawerStyle());
if (style != null) {
if(style.isCollapsed()){
add(plus) ;
}else{
add(minus) ;
}
for(Object child : getChildren()){
if(child instanceof DecoratorSVGFigure){
final IGraphicalEditPart parentEditpart = (IGraphicalEditPart)getOwner().getParent();
((DecoratorSVGFigure) child).setColor(ColorRegistry.getInstance().getColor((Integer) parentEditpart.getStructuralFeatureValue(NotationPackage.eINSTANCE.getLineStyle_LineColor()))
,ColorRegistry.getInstance().getColor((Integer) parentEditpart.getStructuralFeatureValue(NotationPackage.eINSTANCE.getFillStyle_FillColor())));
}
}
return;
}
}
}
示例22
/**
* {@inheritDoc}
*/
@Override
protected void initialize() {
setOpaque(false);
setBorder(new ERDiagramLineBorder());
setCursor(Cursors.SIZEALL);
}
示例23
public Thumb() {
setCursor(Cursors.HAND);
ThumbDragger thumbDragger = new ThumbDragger();
addMouseMotionListener(thumbDragger);
addMouseListener(thumbDragger);
}
示例24
public Pointer() {
setCursor(Cursors.CROSS);
AnnotationDragger dragger = new AnnotationDragger(true, true);
addMouseMotionListener(dragger);
addMouseListener(dragger);
}
示例25
@Override
protected void initialize() {
setOpaque(false);
setBorder(new ERDiagramLineBorder());
setCursor(Cursors.SIZEALL);
}
示例26
protected Cursor calculateCursor() {
if (isInState(STATE_INVALID))
return Cursors.NO;
return getCurrentCursor();
}
示例27
/**
* Constructor
*
* @param sourceEditPart
* @param start
* @param end
*/
public CrosstabColumnDragTracker( EditPart sourceEditPart, int start,
int end )
{
super( sourceEditPart, start, end );
setDisabledCursor( Cursors.SIZEWE );
}
示例28
/**
* Constructor
*
* @param sourceEditPart
* @param start
* @param end
*/
public CrosstabRowDragTracker( EditPart sourceEditPart, int start, int end )
{
super( sourceEditPart, start, end );
setDisabledCursor( Cursors.SIZENS );
}
示例29
/**
* Creates new ColumnDragtrcker, for resize the table column width
*
* @param sourceEditPart
* @param start
* @param end
*/
public ColumnDragTracker( EditPart sourceEditPart, int start, int end )
{
super( sourceEditPart, start, end );
setDisabledCursor( Cursors.SIZEWE );
}
示例30
/**
* Constructor
* @param sourceEditPart
* @param start
* @param end
*/
public RowDragTracker( EditPart sourceEditPart, int start, int end )
{
super( sourceEditPart, start, end );
setDisabledCursor( Cursors.SIZENS );
}