org.eclipse.draw2d.PositionConstants Java Examples
The following examples show how to use
org.eclipse.draw2d.PositionConstants.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: CustomResizeHandle.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
/** * Draws the handle with fill color and outline color dependent on the * primary selection status of the owner editpart. * * @param g * The graphics used to paint the figure. */ public void paintFigure(Graphics g) { Rectangle r = getBounds() ; switch (cursorDirection) { case PositionConstants.SOUTH_EAST: g.drawImage(Pics.getImage("resize_SE.gif"),r.getLocation()) ; break; case PositionConstants.NORTH: g.drawImage(Pics.getImage("resize_N.gif"),r.getLocation().translate(0, -2)) ; break; case PositionConstants.SOUTH: g.drawImage(Pics.getImage("resize_S.gif"),r.getLocation().translate(0, 5)) ; break; case PositionConstants.WEST: g.drawImage(Pics.getImage("resize_W.gif"),r.getLocation().translate(-2, 0)) ; break; case PositionConstants.EAST: g.drawImage(Pics.getImage("resize_E.gif"),r.getLocation().translate(5, 0)) ; break; default: break; } }
Example #2
Source File: FunnyStyleSupport.java From erflute with Apache License 2.0 | 6 votes |
@Override public void addColumnGroup(GroupColumnFigure columnFigure, int viewMode, String name, boolean isAdded, boolean isUpdated, boolean isRemoved) { columnFigure.setBorder(new MarginBorder(new Insets(1, 0, 1, 0))); final ImageFigure image = new ImageFigure(); image.setBorder(new MarginBorder(new Insets(0, 4, 0, 7))); image.setImage(Activator.getImage(ImageKey.GROUP)); columnFigure.add(image); final StringBuilder text = new StringBuilder(); text.append(name); text.append(" (GROUP)"); setColumnFigureColor(columnFigure, false, false, isAdded, isUpdated, isRemoved); final Label label = createColumnLabel(); label.setForegroundColor(ColorConstants.black); label.setLabelAlignment(PositionConstants.RIGHT); label.setBorder(new MarginBorder(new Insets(1, 3, 0, 4))); label.setText(text.toString()); columnFigure.add(label); }
Example #3
Source File: ServiceTask2EditPart.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
protected boolean addFixedChild(EditPart childEditPart) { if (childEditPart instanceof ServiceTaskLabel2EditPart) { ((ServiceTaskLabel2EditPart) childEditPart).setLabel(getPrimaryShape().getFigureActivityNameFigure()); if (VISUAL_ID != 3007 && VISUAL_ID != 2007 && VISUAL_ID != 3015 && VISUAL_ID != 3058) { getPrimaryShape().getFigureActivityNameFigure() .addMouseMotionListener(new ActivityNameCursorMouseMotionListener(this)); } return true; } if (childEditPart instanceof IntermediateErrorCatchEvent4EditPart) { BorderItemLocator locator = new ActivityBorderItemLocator(getMainFigure(), PositionConstants.SOUTH); getBorderedFigure().getBorderItemContainer() .add(((IntermediateErrorCatchEvent4EditPart) childEditPart).getFigure(), locator); return true; } return false; }
Example #4
Source File: ActivityEditPart.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
protected boolean addFixedChild(EditPart childEditPart) { if (childEditPart instanceof ActivityNameEditPart) { ((ActivityNameEditPart) childEditPart).setLabel(getPrimaryShape().getFigureActivityNameFigure()); if (VISUAL_ID != 3007 && VISUAL_ID != 2007 && VISUAL_ID != 3015 && VISUAL_ID != 3058) { getPrimaryShape().getFigureActivityNameFigure() .addMouseMotionListener(new ActivityNameCursorMouseMotionListener(this)); } return true; } if (childEditPart instanceof IntermediateErrorCatchEvent6EditPart) { BorderItemLocator locator = new ActivityBorderItemLocator(getMainFigure(), PositionConstants.SOUTH); getBorderedFigure().getBorderItemContainer() .add(((IntermediateErrorCatchEvent6EditPart) childEditPart).getFigure(), locator); return true; } return false; }
Example #5
Source File: ReportNonResizableHandleKit.java From birt with Eclipse Public License 1.0 | 6 votes |
/** * Fills the given List with handles at each corner of a figure. * * @param part * the handles' GraphicalEditPart * @param handles * the List to add the four corner handles to * @param tracker * the handles' DragTracker * @param cursor * the handles' Cursor */ public static void addCornerHandles( GraphicalEditPart part, List handles, DragTracker tracker, Cursor cursor ) { handles.add( createHandle( part, PositionConstants.SOUTH_EAST, tracker, cursor ) ); handles.add( createHandle( part, PositionConstants.SOUTH_WEST, tracker, cursor ) ); handles.add( createHandle( part, PositionConstants.NORTH_WEST, tracker, cursor ) ); handles.add( createHandle( part, PositionConstants.NORTH_EAST, tracker, cursor ) ); }
Example #6
Source File: ScriptTaskEditPart.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
protected boolean addFixedChild(EditPart childEditPart) { if (childEditPart instanceof ScriptTaskLabelEditPart) { ((ScriptTaskLabelEditPart) childEditPart).setLabel(getPrimaryShape().getFigureActivityNameFigure()); if (VISUAL_ID != 3007 && VISUAL_ID != 2007 && VISUAL_ID != 3015 && VISUAL_ID != 3058) { getPrimaryShape().getFigureActivityNameFigure() .addMouseMotionListener(new ActivityNameCursorMouseMotionListener(this)); } return true; } if (childEditPart instanceof IntermediateErrorCatchEvent5EditPart) { BorderItemLocator locator = new ActivityBorderItemLocator(getMainFigure(), PositionConstants.SOUTH); getBorderedFigure().getBorderItemContainer() .add(((IntermediateErrorCatchEvent5EditPart) childEditPart).getFigure(), locator); return true; } return false; }
Example #7
Source File: ReportResizeTracker.java From birt with Eclipse Public License 1.0 | 6 votes |
@Override protected boolean handleDragInProgress( ) { boolean bool = super.handleDragInProgress( ); if (processor != null) { int width = 0; if (PositionConstants.EAST == getResizeDirection()) { width = getFigureSize().width + getMouseTrueValueX( ); } else if (PositionConstants.SOUTH == getResizeDirection()) { width = getFigureSize().height + getMouseTrueValueY( ); } if (width < 1) { width = 1; } processor.updateInfomation( getInfomation( width ), getStartLocation( ) ); } return bool; }
Example #8
Source File: TestWebPurchase.java From bonita-studio with GNU General Public License v2.0 | 6 votes |
private void stepMoreInfo(final SWTBotGefEditor gmfEditor) { bot.editorByTitle(diagramTitle).show(); bot.editorByTitle(diagramTitle).setFocus(); SWTBotTestUtil.selectElementInContextualPaletteAndDragIt(gmfEditor, "Sales Review", SWTBotTestUtil.CONTEXTUALPALETTE_STEP, PositionConstants.SOUTH); SWTBotTestUtil.selectTabbedPropertyView(bot, "General"); bot.textWithLabel("Name").setText("More Info"); bot.sleep(1000); bot.comboBoxWithLabel("Task type").setSelection("Human"); bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_GENERAL).show(); bot.viewById(SWTBotTestUtil.VIEWS_PROPERTIES_PROCESS_GENERAL).setFocus(); SWTBotTestUtil.selectTabbedPropertyView(bot, "Actors"); bot.radio(useTaskActors).click(); bot.comboBoxWithLabel(selectActorTitle).setSelection(0); selectDataVariablesTabbedPropertyView(); bot.button("Add...").click(); SWTBotTestUtil.addNewData(bot, "comment", "Text", false, "add a comment"); bot.editorByTitle(diagramTitle).show(); bot.editorByTitle(diagramTitle).setFocus(); SWTBotTestUtil.configureSequenceFlow(bot, "add a comment", "Web Purchase", false, "decision==\"More info\"", ExpressionConstants.SCRIPT_TYPE); SWTBotTestUtil.addSequenceFlow(bot, gmfEditor, "More Info", "Gateway1", PositionConstants.SOUTH); SWTBotTestUtil.configureSequenceFlow(bot, "sequenceFlow2", "Web Purchase", false, "true", ExpressionConstants.SCRIPT_TYPE); }
Example #9
Source File: PlaceHolderEditPart.java From birt with Eclipse Public License 1.0 | 6 votes |
public void refreshFigure( ) { StyleHandle style = ( (DesignElementHandle) getDefaultHandle( ) ) .getPrivateStyle( ); //TODO:fixed the bug 191874 //( (LabelFigure) getFigure( ) ).setFont( getFont( ) ); ( (LabelFigure) getFigure( ) ).setImage( getImage( ) ); ( (LabelFigure) getFigure( ) ).setAlignment( PositionConstants.WEST ); ( (LabelFigure) getFigure( ) ).setDirection( getTextDirection( getDefaultHandle( )) ); // bidi_hcg ( (LabelFigure) getFigure( ) ).setText( getTemplateModel( ) .getDisplayDescription( ) ); ( (LabelFigure) getFigure( ) ) .setTextAlign( DesignChoiceConstants.TEXT_ALIGN_CENTER ); ( (LabelFigure) getFigure( ) ) .setForegroundColor( ReportColorConstants.ShadowLineColor ); ( (LabelFigure) getFigure( ) ).setDisplay( style.getDisplay( ) ); getFigure( ).setBorder( new LineBorder( 1 ) ); }
Example #10
Source File: DesignElementHandleAdapter.java From birt with Eclipse Public License 1.0 | 6 votes |
/** * Get the position from string * @param position * The given string * @return * The position */ public static int getPosition( String position ) { if ( DesignChoiceConstants.BACKGROUND_POSITION_LEFT.equals( position ) ) { return PositionConstants.WEST; } if ( DesignChoiceConstants.BACKGROUND_POSITION_RIGHT.equals( position ) ) { return PositionConstants.EAST; } if ( DesignChoiceConstants.BACKGROUND_POSITION_TOP.equals( position ) ) { return PositionConstants.NORTH; } if ( DesignChoiceConstants.BACKGROUND_POSITION_BOTTOM.equals( position ) ) { return PositionConstants.SOUTH; } return PositionConstants.CENTER; }
Example #11
Source File: RoundDetailsPart.java From neoscada with Eclipse Public License 1.0 | 6 votes |
private void createRoundArrow ( final Figure figure ) { final PolylineConnection c = new PolylineConnection (); c.setSourceAnchor ( new ChopboxAnchor ( this.sourceRect ) ); c.setTargetAnchor ( new ChopboxAnchor ( this.targetRect ) ); final PolygonDecoration dec = new PolygonDecoration (); dec.setTemplate ( PolygonDecoration.TRIANGLE_TIP ); c.setTargetDecoration ( dec ); final MidpointLocator typeLocator = new MidpointLocator ( c, 0 ); typeLocator.setRelativePosition ( PositionConstants.NORTH ); this.typeLabel = new Label ( "" ); //$NON-NLS-1$ c.add ( this.typeLabel, typeLocator ); figure.add ( c ); this.roundConnection = c; }
Example #12
Source File: CustomTextDirectEditManager.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Override protected CellEditor createCellEditorOn(Composite composite) { if (!Platform.getOS().equals(Platform.OS_MACOSX)) { ILabelDelegate label = (ILabelDelegate) getEditPart().getAdapter( ILabelDelegate.class); int style = SWT.WRAP | SWT.MULTI; if (label != null /* && label.isTextWrapOn() */) { switch (label.getTextJustification()) { case PositionConstants.LEFT: style = style | SWT.LEAD; break; case PositionConstants.RIGHT: style = style | SWT.TRAIL; break; case PositionConstants.CENTER: style = style | SWT.CENTER; break; default: break; } } return new CustomWrapTextCellEditor(composite, style); } else { //USE normal textcelleditor if running on mac return super.createCellEditorOn(composite); } }
Example #13
Source File: IntermediateCatchTimerEvent2EditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public EditPolicy getPrimaryDragEditPolicy() { EditPolicy result = super.getPrimaryDragEditPolicy(); if (result instanceof ResizableEditPolicy) { ResizableEditPolicy ep = (ResizableEditPolicy) result; ep.setResizeDirections(PositionConstants.NONE); } return result; }
Example #14
Source File: IntermediateThrowMessageEventEditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) { if (borderItemEditPart instanceof IntermediateThrowMessageEventLabelEditPart) { BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH); locator.setBorderItemOffset(new Dimension(-20, -20)); borderItemContainer.add(borderItemEditPart.getFigure(), locator); } else { super.addBorderItem(borderItemContainer, borderItemEditPart); } }
Example #15
Source File: IntermediateErrorCatchEvent2EditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) { if (borderItemEditPart instanceof IntermediateErrorCatchEventLabelEditPart) { BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH); locator.setBorderItemOffset(new Dimension(-20, -20)); borderItemContainer.add(borderItemEditPart.getFigure(), locator); } else { super.addBorderItem(borderItemContainer, borderItemEditPart); } }
Example #16
Source File: EndSignalEventEditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) { if (borderItemEditPart instanceof EndSignalEventLabelEditPart) { BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH); locator.setBorderItemOffset(new Dimension(-20, -20)); borderItemContainer.add(borderItemEditPart.getFigure(), locator); } else { super.addBorderItem(borderItemContainer, borderItemEditPart); } }
Example #17
Source File: EndTerminatedEventEditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) { if (borderItemEditPart instanceof EndTerminatedEventLabelEditPart) { BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH); locator.setBorderItemOffset(new Dimension(-20, -20)); borderItemContainer.add(borderItemEditPart.getFigure(), locator); } else { super.addBorderItem(borderItemContainer, borderItemEditPart); } }
Example #18
Source File: CustomSendTaskLabel2EditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Override public void setLabel(WrappingLabel figure) { figure.setTextWrap(true); figure.setAlignment(PositionConstants.CENTER); figure.setTextJustification(PositionConstants.CENTER); super.setLabel(figure); }
Example #19
Source File: CustomReceiveTaskLabel2EditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Override public void setLabel(WrappingLabel figure) { figure.setTextWrap(true); figure.setAlignment(PositionConstants.CENTER); figure.setTextJustification(PositionConstants.CENTER); super.setLabel(figure); }
Example #20
Source File: IntermediateThrowSignalEvent2EditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) { if (borderItemEditPart instanceof IntermediateThrowSignalEventLabel2EditPart) { BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH); locator.setBorderItemOffset(new Dimension(-20, -20)); borderItemContainer.add(borderItemEditPart.getFigure(), locator); } else { super.addBorderItem(borderItemContainer, borderItemEditPart); } }
Example #21
Source File: FunnyStyleSupport.java From ermaster-b with Apache License 2.0 | 5 votes |
@Override public void addColumnGroup(GroupColumnFigure columnFigure, int viewMode, String name, boolean isAdded, boolean isUpdated, boolean isRemoved) { columnFigure.setBorder(new MarginBorder(new Insets(1, 0, 1, 0))); ImageFigure image = new ImageFigure(); image.setBorder(new MarginBorder(new Insets(0, 4, 0, 7))); image.setImage(Activator.getImage(ImageKey.GROUP)); columnFigure.add(image); // Label filler = new Label(); // filler.setBorder(new MarginBorder(new Insets(0, 0, 0, 16))); // filler.setBorder(new MarginBorder(new Insets(0, 0, 0, 6))); // columnFigure.add(filler); // filler = new Label(); // filler.setBorder(new MarginBorder(new Insets(0, 0, 0, 16))); // columnFigure.add(filler); StringBuilder text = new StringBuilder(); text.append(name); text.append(" (GROUP)"); this.setColumnFigureColor(columnFigure, false, false, isAdded, isUpdated, isRemoved); Label label = this.createColumnLabel(); label.setForegroundColor(ColorConstants.black); label.setLabelAlignment(PositionConstants.RIGHT); label.setBorder(new MarginBorder(new Insets(1, 3, 0, 4))); label.setText(text.toString()); columnFigure.add(label); }
Example #22
Source File: IntermediateErrorCatchEvent4EditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) { if (borderItemEditPart instanceof IntermediateErrorCatchEventLabel4EditPart) { BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH); locator.setBorderItemOffset(new Dimension(-20, -20)); borderItemContainer.add(borderItemEditPart.getFigure(), locator); } else { super.addBorderItem(borderItemContainer, borderItemEditPart); } }
Example #23
Source File: IntermediateCatchMessageEvent2EditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) { if (borderItemEditPart instanceof IntermediateCatchMessageEventLabel2EditPart) { BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH); locator.setBorderItemOffset(new Dimension(-20, -20)); borderItemContainer.add(borderItemEditPart.getFigure(), locator); } else { super.addBorderItem(borderItemContainer, borderItemEditPart); } }
Example #24
Source File: CustomCallActivityName2EditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
@Override public void setLabel(WrappingLabel figure) { figure.setTextWrap(true); figure.setAlignment(PositionConstants.CENTER); figure.setTextJustification(PositionConstants.CENTER); super.setLabel(figure); }
Example #25
Source File: IntermediateCatchMessageEvent2EditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public EditPolicy getPrimaryDragEditPolicy() { EditPolicy result = super.getPrimaryDragEditPolicy(); if (result instanceof ResizableEditPolicy) { ResizableEditPolicy ep = (ResizableEditPolicy) result; ep.setResizeDirections(PositionConstants.NONE); } return result; }
Example #26
Source File: CatchLinkEvent2EditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ protected void addBorderItem(IFigure borderItemContainer, IBorderItemEditPart borderItemEditPart) { if (borderItemEditPart instanceof CatchLinkEventLabel2EditPart) { BorderItemLocator locator = new BorderItemLocator(getMainFigure(), PositionConstants.SOUTH); locator.setBorderItemOffset(new Dimension(-20, -20)); borderItemContainer.add(borderItemEditPart.getFigure(), locator); } else { super.addBorderItem(borderItemContainer, borderItemEditPart); } }
Example #27
Source File: EventEditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public EditPolicy getPrimaryDragEditPolicy() { EditPolicy result = super.getPrimaryDragEditPolicy(); if (result instanceof ResizableEditPolicy) { ResizableEditPolicy ep = (ResizableEditPolicy) result; ep.setResizeDirections(PositionConstants.NONE); } return result; }
Example #28
Source File: ScriptTask2EditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public EditPolicy getPrimaryDragEditPolicy() { EditPolicy result = super.getPrimaryDragEditPolicy(); if (result instanceof ResizableEditPolicy) { ResizableEditPolicy ep = (ResizableEditPolicy) result; ep.setResizeDirections(PositionConstants.NONE); } return result; }
Example #29
Source File: EditorRulerComposite.java From birt with Eclipse Public License 1.0 | 5 votes |
private void setRulerVisibility( boolean isVisible ) { if ( isRulerVisible != isVisible ) { isRulerVisible = isVisible; if ( diagramViewer != null ) { setRuler( (RulerProvider) diagramViewer.getProperty( RulerProvider.PROPERTY_HORIZONTAL_RULER ), PositionConstants.NORTH ); setRuler( (RulerProvider) diagramViewer.getProperty( RulerProvider.PROPERTY_VERTICAL_RULER ), PositionConstants.WEST ); } } }
Example #30
Source File: EndEvent2EditPart.java From bonita-studio with GNU General Public License v2.0 | 5 votes |
/** * @generated */ public EditPolicy getPrimaryDragEditPolicy() { EditPolicy result = super.getPrimaryDragEditPolicy(); if (result instanceof ResizableEditPolicy) { ResizableEditPolicy ep = (ResizableEditPolicy) result; ep.setResizeDirections(PositionConstants.NONE); } return result; }