/** * 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; }
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; }
/**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); }
/** * 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 ); }
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); }
/** * {@inheritDoc} */ @Override protected void initialize() { setOpaque(false); setBorder(new ERDiagramLineBorder()); setCursor(Cursors.SIZEALL); }
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; } }
@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); } }
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); } }
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); } }
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; } }; }
@Override public void setViewer(EditPartViewer viewer) { if (viewer == getCurrentViewer()) return; super.setViewer(viewer); if (viewer instanceof GraphicalViewer) setDefaultCursor(Cursors.SIZEWE); else setDefaultCursor(Cursors.NO); }
@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; } }
/** * 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); }
/** * Sets whether the handle is fixed and cannot be moved * * @param fixed * <code>true</code> if the handle should be unmovable */ public void setFixed(boolean fixed) { this.fixed = fixed; if (fixed) setCursor(Cursors.NO); else setCursor(Cursors.CROSS); }
/** * Initializes the handle. Sets the {@link org.eclipse.gef.DragTracker} and * DragCursor. */ protected void initialize() { setOpaque(false); border = new CornerTriangleBorder(false); setBorder(border); setCursor(Cursors.SIZEALL); setDragTracker(new DragEditPartsTracker(getOwner())); }
/** * Creates a 'move' handle, which uses a {@link DragEditPartsTracker} in * case {@link #isDragAllowed()} returns true, and a * {@link SelectEditPartTracker} otherwise. * * @param handles * The list of handles to add the move handle to. * @since 3.7 */ 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); } }
/** * @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; }
@Override protected Cursor getDefaultCursor( ) { if (isCloneActive()) { return Cursors.SIZENS; } return super.getDefaultCursor( ); }
@Override protected Cursor getDefaultCursor( ) { if (isCloneActive()) { return Cursors.SIZEWE; } return super.getDefaultCursor( ); }
/** * @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; }
/** * Initializes the handle. Sets the {@link DragTracker}and DragCursor. */ protected void initialize( ) { setOpaque( true ); setBorder( new LineBorder( 1 ) ); setCursor( Cursors.SIZEWE ); }
/** * Initializes the handle. Sets the {@link DragTracker}and DragCursor. */ protected void initialize( ) { setOpaque( true ); setBorder( new LineBorder( 1 ) ); setCursor( Cursors.SIZENS ); }
/** * 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( ); }
/** * 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 ); }
/** * Initializes the handle. Sets the {@link DragTracker} and DragCursor. */ protected void initialize( ) { setOpaque( false ); setBorder( new SelectionBorder( 1 ) ); setCursor( Cursors.SIZEALL ); }
/** * {@inheritDoc} */ @Override protected void initialize() { setOpaque(false); setBorder(new NodeLineBorder()); setCursor(Cursors.SIZEALL); }
/** * Sets this figure's clickable state. If the figure is clickable, it can be * moved to the center. * * @param inClickable * boolean */ public void setClickable(final boolean inClickable) { if (inClickable) { isClickable = true; label.setForegroundColor(ACTIVE_COLOR); underline.setVisible(true); defaultCursor = getCursor(); setCursor(Cursors.HAND); } else { isClickable = false; label.setForegroundColor(Display.getCurrent().getSystemColor(SWT.COLOR_BLACK)); underline.setVisible(false); setCursor(defaultCursor); } }
/** * NoteFigure */ public NoteFigure() { super(); textFlow = createTextFlow(); setCursor(Cursors.IBEAM); }
public Pointer() { setCursor(Cursors.CROSS); PointerDragger dragger = new PointerDragger(); addMouseMotionListener(dragger); addMouseListener(dragger); }
/** * Initializes the handle. Sets the {@link DragTracker} and * DragCursor. */ protected void initialize() { setOpaque(false); setCursor(Cursors.SIZES); }
@Override protected void initialize() { setOpaque(false); setBorder(new ERDiagramLineBorder()); setCursor(Cursors.SIZEALL); }
public ZoomSweepTool() { super(); setDefaultCursor(Cursors.SIZEWE); setUnloadWhenFinished(false); }
/** * Creates a new ConnectionHandle. */ public ConnectionHandle() { setCursor(Cursors.CROSS); }