/** * 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; }
protected List createSelectionHandles( ) { List list = new ArrayList( ); if ( isDragAllowed( ) ) { ReportNonResizableHandleKit.addHandles( (GraphicalEditPart) getHost( ), list ); } else { ReportNonResizableHandleKit.addHandles( (GraphicalEditPart) getHost( ), list, new SelectEditPartTracker( getHost( ) ), SharedCursors.ARROW ); } return list; }
/** * Creates the cell editor on the given composite. The cell editor is * created by instantiating the cell editor type passed into this * DirectEditManager's constuctor. * * @param composite * the composite to create the cell editor on * @return the newly created cell editor */ protected CellEditor createCellEditorOn( Composite composite ) { int style = this.applyBidiStyle( SWT.MULTI | SWT.WRAP ); // bidi_hcg LabelCellEditor editor = new LabelCellEditor( composite, style ); //new LabelCellEditor( composite, SWT.MULTI | SWT.WRAP ); final Control c = editor.getControl( ); c.addMouseTrackListener( new MouseTrackAdapter( ) { public void mouseEnter( MouseEvent e ) { c.setCursor( SharedCursors.IBEAM ); } } ); return editor; }
/** * Creates and returns a new {@link ConnectionBendpointTracker}. * @return the new ConnectionBendpointTracker */ protected DragTracker createDragTracker() { ConnectionBendpointTracker tracker; tracker = new ConnectionBendpointTracker( (ConnectionEditPart)getOwner(), getIndex()); tracker.setType(RequestConstants.REQ_CREATE_BENDPOINT); tracker.setDefaultCursor(getCursor()); //DisabledCursor를 설정해준다. tracker.setDisabledCursor(SharedCursors.NO); return tracker; }
/** * @see org.eclipse.gef.editpolicies.NonResizableEditPolicy#createSelectionHandles() */ @Override protected List createSelectionHandles() { List list = new ArrayList(); if (isDragAllowed()) SequenceLineNonResizableHandleKit.addHandles((GraphicalEditPart)getHost(), list); else SequenceLineNonResizableHandleKit.addHandles((GraphicalEditPart)getHost(), list, new SelectEditPartTracker(getHost()), SharedCursors.ARROW); return list; }
/** * @see org.eclipse.gef.Tool#setViewer(org.eclipse.gef.EditPartViewer) */ @Override public void setViewer(EditPartViewer viewer) { if (viewer == getCurrentViewer()) return; super.setViewer(viewer); if (viewer instanceof GraphicalViewer) setDefaultCursor(SharedCursors.CROSS); else setDefaultCursor(SharedCursors.NO); }
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 createDragHandle(List handles, int direction) { if (isDragAllowed()) { // display 'resize' handles to allow dragging (drag tracker) NonResizableHandleKit.addHandle((GraphicalEditPart) getHost(), handles, direction, getDragTracker(), SharedCursors.SIZEALL); } else { // display 'resize' handles to indicate selection only (selection // tracker) NonResizableHandleKit.addHandle((GraphicalEditPart) getHost(), handles, direction, getSelectTracker(), SharedCursors.ARROW); } }
protected Cursor getDefaultCursor() { if (isDelete()) return super.getDefaultCursor(); else if (isCreationValid()) return source.isHorizontal() ? SharedCursors.SIZEE : SharedCursors.SIZEN; else return SharedCursors.NO; }
/** * Creates a 'resize'/'drag' 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 resize handle to * @param direction * A position constant indicating the direction to create the * handle for * @since 3.7 */ protected void createDragHandle(List handles, int direction) { if (isDragAllowed()) { // display 'resize' handles to allow dragging (drag tracker) NonResizableHandleKit .addHandle((GraphicalEditPart) getHost(), handles, direction, getDragTracker(), SharedCursors.SIZEALL); } else { // display 'resize' handles to indicate selection only (selection // tracker) NonResizableHandleKit .addHandle((GraphicalEditPart) getHost(), handles, direction, getSelectTracker(), SharedCursors.ARROW); } }
/** * 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); } }
public void run() { final Tracker tracker = new Tracker(FlyoutPaletteComposite.this, SWT.RIGHT | SWT.LEFT); Rectangle[] rects = new Rectangle[1]; rects[0] = sash.getBounds(); tracker.setCursor(SharedCursors.SIZEE); tracker.setRectangles(rects); if (tracker.open()) { int deltaX = sash.getBounds().x - tracker.getRectangles()[0].x; if (dock == PositionConstants.WEST) deltaX = -deltaX; setPaletteWidth(paletteContainer.getBounds().width + deltaX); } tracker.dispose(); }
private void init() { setCursor(SharedCursors.ARROW); lws = new LightweightSystem(); lws.setControl(this); final ArrowButton b = new ArrowButton(getArrowDirection()); b.setRolloverEnabled(true); b.setBorder(new ButtonBorder(ButtonBorder.SCHEMES.TOOLBAR)); b.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { transferFocus = true; if (isInState(STATE_COLLAPSED)) setState(STATE_PINNED_OPEN); else setState(STATE_COLLAPSED); } }); listeners.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent evt) { if (evt.getPropertyName().equals(PROPERTY_STATE)) { b.setDirection(getArrowDirection()); setToolTipText(getButtonTooltipText()); } else if (evt.getPropertyName().equals( PROPERTY_DOCK_LOCATION)) b.setDirection(getArrowDirection()); } }); lws.setContents(b); }
public GuideFigure(boolean isHorizontal) { horizontal = isHorizontal; setBackgroundColor(ColorConstants.button); if (horizontal) { setCursor(SharedCursors.SIZENS); } else { setCursor(SharedCursors.SIZEWE); } }
/** * Constructs a new DragEditPartsTracker with the given source edit part. * * @param sourceEditPart * the source edit part */ public DragEditPartsTracker(EditPart sourceEditPart) { super(sourceEditPart); cloneActive = false; setDisabledCursor(SharedCursors.NO); }
/** * @see org.eclipse.gef.Tool#setViewer(org.eclipse.gef.EditPartViewer) */ public void setViewer(EditPartViewer viewer) { if (viewer == getCurrentViewer()) return; super.setViewer(viewer); if (viewer instanceof GraphicalViewer) setDefaultCursor(SharedCursors.CROSS); else setDefaultCursor(SharedCursors.NO); }
/** * @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; }
public EditorGuideFigure( boolean isHorizontal ) { horizontal = isHorizontal; setBackgroundColor( ColorConstants.button ); if ( horizontal ) { setCursor( SharedCursors.SIZENS ); } else { setCursor( SharedCursors.SIZEWE ); } }
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; }
static Handle createHandle( GraphicalEditPart owner, int direction ) { ReportResizeHandle handle = new ReportResizeHandle( owner, direction ); handle.setCursor( SharedCursors.SIZEALL ); handle.setDragTracker( new DragEditPartsTracker( owner ) ); return handle; }
/** * Constructor * @param sourceEditPart */ public TableSelectionGuideTracker( TableEditPart sourceEditPart, int number ) { super( sourceEditPart ); this.number = number; setDefaultCursor( SharedCursors.ARROW ); setUnloadWhenFinished( false ); }
/** * Creates a new CellTracker, with the CROSS cursor * * @param sourceEditPart */ public CellDragTracker( EditPart sourceEditPart ) { super( sourceEditPart ); setDefaultCursor( SharedCursors.CROSS ); setUnloadWhenFinished( false ); }
/** * @see org.eclipse.gef.Tool#setViewer(org.eclipse.gef.EditPartViewer) */ public void setViewer( EditPartViewer viewer ) { if ( viewer == getCurrentViewer( ) ) return; super.setViewer( viewer ); if ( viewer instanceof GraphicalViewer ) setDefaultCursor( SharedCursors.CROSS ); else setDefaultCursor( SharedCursors.NO ); }
public UMLDragTracker(EditPart sourceEditPart) { super(sourceEditPart); setDisabledCursor(SharedCursors.ARROW); this.sourceEditPart = sourceEditPart; }
/** * Creates a new Marquee Selection Tool of default type {@link #BEHAVIOR_NODES_CONTAINED}. * The no param constructor is necessary to have the JDMarqueeToolEntry working */ public NotMovablePartDragTracker() { super(null); setDefaultCursor(SharedCursors.CROSS); setUnloadWhenFinished(false); }
public void showSourceFeedback(Request request) { if (!dragInProgress) { dragInProgress = true; // add the placeholder guide figure to the ruler getHostFigure().getParent().add(getDummyGuideFigure(), 0); ((GraphicalEditPart) getHost().getParent()).setLayoutConstraint(getHost(), getDummyGuideFigure(), new Integer( getGuideEditPart().getZoomedPosition())); getDummyGuideFigure().setBounds(getHostFigure().getBounds()); // add the invisible placeholder line figure to the primary viewer getGuideEditPart().getGuideLayer().add(getDummyLineFigure(), 0); getGuideEditPart().getGuideLayer().setConstraint(getDummyLineFigure(), new Boolean(getGuideEditPart().isHorizontal())); getDummyLineFigure().setBounds(getGuideEditPart().getGuideLineFigure().getBounds()); // move the guide being dragged to the last index so that it's drawn // on // top of other guides List<IFigure> children = getHostFigure().getParent().getChildren(); children.remove(getHostFigure()); children.add(getHostFigure()); } ChangeBoundsRequest req = (ChangeBoundsRequest) request; if (isDeleteRequest(req)) { getHostFigure().setVisible(false); getGuideEditPart().getGuideLineFigure().setVisible(false); getGuideEditPart().setCurrentCursor(SharedCursors.ARROW); eraseAttachedPartsFeedback(request); } else { int newPosition; if (getGuideEditPart().isHorizontal()) { newPosition = getGuideEditPart().getZoomedPosition() + req.getMoveDelta().y; } else { newPosition = getGuideEditPart().getZoomedPosition() + req.getMoveDelta().x; } getHostFigure().setVisible(true); getGuideEditPart().getGuideLineFigure().setVisible(true); if (isMoveValid(newPosition)) { getGuideEditPart().setCurrentCursor(null); getGuideEditPart().updateLocationOfFigures(newPosition); showAttachedPartsFeedback(req); } else { getGuideEditPart().setCurrentCursor(SharedCursors.NO); getGuideEditPart().updateLocationOfFigures(getGuideEditPart().getZoomedPosition()); eraseAttachedPartsFeedback(request); } } }
static Handle createHandle(GraphicalEditPart owner, int direction) { ResizeHandle handle = new ResizeHandle(owner, direction); handle.setCursor(SharedCursors.SIZEALL); handle.setDragTracker(new DragEditPartsTracker(owner)); return handle; }
private void updateState() { setCursor(isInState(STATE_EXPANDED | STATE_PINNED_OPEN) ? SharedCursors.SIZEWE : null); }
public void showSourceFeedback(Request request) { if (!dragInProgress) { dragInProgress = true; // add the placeholder guide figure to the ruler getHostFigure().getParent().add(getDummyGuideFigure(), 0); ((GraphicalEditPart) getHost().getParent()).setLayoutConstraint( getHost(), getDummyGuideFigure(), new Integer( getGuideEditPart().getZoomedPosition())); getDummyGuideFigure().setBounds(getHostFigure().getBounds()); // add the invisible placeholder line figure to the primary viewer getGuideEditPart().getGuideLayer().add(getDummyLineFigure(), 0); getGuideEditPart().getGuideLayer().setConstraint( getDummyLineFigure(), new Boolean(getGuideEditPart().isHorizontal())); getDummyLineFigure().setBounds( getGuideEditPart().getGuideLineFigure().getBounds()); // move the guide being dragged to the last index so that it's drawn // on // top of other guides List children = getHostFigure().getParent().getChildren(); children.remove(getHostFigure()); children.add(getHostFigure()); } ChangeBoundsRequest req = (ChangeBoundsRequest) request; if (isDeleteRequest(req)) { getHostFigure().setVisible(false); getGuideEditPart().getGuideLineFigure().setVisible(false); getGuideEditPart().setCurrentCursor(SharedCursors.ARROW); eraseAttachedPartsFeedback(request); } else { int newPosition; if (getGuideEditPart().isHorizontal()) { newPosition = getGuideEditPart().getZoomedPosition() + req.getMoveDelta().y; } else { newPosition = getGuideEditPart().getZoomedPosition() + req.getMoveDelta().x; } getHostFigure().setVisible(true); getGuideEditPart().getGuideLineFigure().setVisible(true); if (isMoveValid(newPosition)) { getGuideEditPart().setCurrentCursor(null); getGuideEditPart().updateLocationOfFigures(newPosition); showAttachedPartsFeedback(req); } else { getGuideEditPart().setCurrentCursor(SharedCursors.NO); getGuideEditPart().updateLocationOfFigures( getGuideEditPart().getZoomedPosition()); eraseAttachedPartsFeedback(request); } } }
/** * @see org.eclipse.gef.tools.AbstractTool#getDefaultCursor() */ protected Cursor getDefaultCursor() { return SharedCursors.getDirectionalCursor(direction, getTargetEditPart().getFigure().isMirrored()); }
/** * Default constructor. Sets the default and disabled cursors. */ public CreationTool() { setDefaultCursor(SharedCursors.CURSOR_TREE_ADD); setDisabledCursor(SharedCursors.NO); }
/** * Creates a new MarqueeSelectionTool of default type * {@link #BEHAVIOR_NODES_CONTAINED}. */ public MarqueeSelectionTool() { setDefaultCursor(SharedCursors.CROSS); setUnloadWhenFinished(false); }
/** * The default constructor */ public AbstractConnectionCreationTool() { setDefaultCursor(SharedCursors.CURSOR_PLUG); setDisabledCursor(SharedCursors.CURSOR_PLUG_NOT); }
public void showSourceFeedback( Request request ) { ChangeBoundsRequest req = (ChangeBoundsRequest) request; // add the placeholder guide figure to the ruler getHostFigure( ).getParent( ).add( getDummyGuideFigure( ), 0 ); ( (GraphicalEditPart) getHost( ).getParent( ) ).setLayoutConstraint( getHost( ), getDummyGuideFigure( ), Integer.valueOf( getGuideEditPart( ).getZoomedPosition( ) ) ); getDummyGuideFigure( ).setBounds( getHostFigure( ).getBounds( ) ); // add the invisible placeholder line figure to the primary viewer getGuideEditPart( ).getGuideLayer( ).add( getDummyLineFigure( ), 0 ); getGuideEditPart( ).getGuideLayer( ).setConstraint( getDummyLineFigure( ), Boolean.valueOf( getGuideEditPart( ).isHorizontal( ) ) ); // getDummyLineFigure( ).setBounds( // getGuideEditPart( ).getGuideLineFigure( ).getBounds( ) ); getDummyLineFigure( ).setBounds( getDummyLineFigureBounds( req ) ); //add the info label getGuideEditPart( ).getGuideLayer( ).add( getInfoLabel( ), 0 ); // getGuideEditPart( ).getGuideLayer( ).setConstraint( // getInfoLabel( ), // Boolean.valueOf( getGuideEditPart( ).isHorizontal( ) ) ); updateInfomation( getShowLable( req ) ); // move the guide being dragged to the last index so that it's drawn // on // top of other guides List children = getHostFigure( ).getParent( ).getChildren( ); children.remove( getHostFigure( ) ); children.add( getHostFigure( ) ); if ( isDeleteRequest( req ) ) { getHostFigure( ).setVisible( false ); getGuideEditPart( ).getGuideLineFigure( ).setVisible( false ); getGuideEditPart( ).setCurrentCursor( SharedCursors.ARROW ); eraseAttachedPartsFeedback( request ); } else { int newPosition; if ( getGuideEditPart( ).isHorizontal( ) ) { newPosition = getGuideEditPart( ).getZoomedPosition( ) + req.getMoveDelta( ).y; } else { newPosition = getGuideEditPart( ).getZoomedPosition( ) + req.getMoveDelta( ).x; } getHostFigure( ).setVisible( true ); getGuideEditPart( ).getGuideLineFigure( ).setVisible( true ); if ( isMoveValid( newPosition ) ) { getGuideEditPart( ).setCurrentCursor( null ); getGuideEditPart( ).updateLocationOfFigures( newPosition ); showAttachedPartsFeedback( req ); } else { getGuideEditPart( ).setCurrentCursor( SharedCursors.NO ); getGuideEditPart( ).updateLocationOfFigures( getGuideEditPart( ).getZoomedPosition( ) ); eraseAttachedPartsFeedback( request ); } } }
/** * Creates a new MarqueeSelectionTool. */ public RootDragTracker( ) { setDefaultCursor( SharedCursors.CROSS ); setUnloadWhenFinished( false ); }
/** * createHandle * * @param owner * @param direction * @return Handle */ static Handle createHandle(GraphicalEditPart owner, int direction) { ResizeHandle handle = new SequenceLineResizeHandle(owner, direction); handle.setCursor(SharedCursors.SIZEALL); handle.setDragTracker(new DragEditPartsTracker(owner)); return handle; }