当前位置: 首页>>代码示例>>Java>>正文


Java RectangleFigure.setBorder方法代码示例

本文整理汇总了Java中org.eclipse.draw2d.RectangleFigure.setBorder方法的典型用法代码示例。如果您正苦于以下问题:Java RectangleFigure.setBorder方法的具体用法?Java RectangleFigure.setBorder怎么用?Java RectangleFigure.setBorder使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.draw2d.RectangleFigure的用法示例。


在下文中一共展示了RectangleFigure.setBorder方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createDragSourceFeedbackFigure

import org.eclipse.draw2d.RectangleFigure; //导入方法依赖的package包/类
protected IFigure createDragSourceFeedbackFigure() {
	RectangleFigure r = new FeedbackFigure();
	r.setOpaque(false);
	r.setAlpha(50);
	r.setBackgroundColor(ColorConstants.gray);
	r.setFill(false);
	r.setBorder(new LineBorder(ColorConstants.gray, 1));
	addFeedback(r);
	return r;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:11,代码来源:TableCellResizableEditPolicy.java

示例2: createFigure

import org.eclipse.draw2d.RectangleFigure; //导入方法依赖的package包/类
@Override
protected IFigure createFigure()
{
  RectangleFigure figure = new RectangleFigure();
  figure.setBackgroundColor(BACKGROUND_COLOR);
  Color borderCol = Display.getCurrent().getSystemColor(SWT.COLOR_GRAY);
  Border figureBorder = new LineBorder(borderCol, 2);
  figure.setBorder(figureBorder);

  figure.setOutline(false);
  GridLayout layoutManager = new GridLayout();
  // zero margin, in order to connect the dependent axes to the shared one
  layoutManager.marginHeight = 0;
  layoutManager.marginWidth = 0;
  figure.setLayoutManager(layoutManager);

  datasetsPane = new RectangleFigure();
  datasetsPane.setOutline(false);
  final SimpleLoweredBorder datasetBorder = new SimpleLoweredBorder(3);
  datasetsPane.setBorder(datasetBorder);
  GridLayout datasetsPaneLayout = new GridLayout();
  datasetsPane.setLayoutManager(datasetsPaneLayout);
  figure.add(datasetsPane);

  arrowFigure = new ArrowFigure(false);
  figure.add(arrowFigure);

  axisNameLabel = new AxisNameFigure(this);
  figure.add(axisNameLabel);

  return figure;
}
 
开发者ID:debrief,项目名称:limpet,代码行数:33,代码来源:AxisEditPart.java

示例3: createFigure

import org.eclipse.draw2d.RectangleFigure; //导入方法依赖的package包/类
@Override
protected IFigure createFigure()
{
  final RectangleFigure figure = new RectangleFigure();
  figure.setOutline(false);
  final Color borderCol = Display.getCurrent().getSystemColor(SWT.COLOR_GRAY);
  final Border figureBorder = new LineBorder(borderCol, 2);
  figure.setBorder(figureBorder);

  figure.setLayoutManager(new GridLayout());
  nameLabel = new DirectionalLabel(Activator.FONT_8);

  final ChartPaneEditPart.AxisLandingPad pad =
      (ChartPaneEditPart.AxisLandingPad) getModel();

  nameLabel.setText(pad.pos == ChartPanePosition.MIN ? "Min Axis"
      : "Max Axis");

  figure.add(nameLabel);
  figure.getLayoutManager().setConstraint(nameLabel, new GridData(
      GridData.FILL, GridData.FILL, true, true));

  return figure;
}
 
开发者ID:debrief,项目名称:limpet,代码行数:25,代码来源:AxisLandingPadEditPart.java

示例4: SplitFigure

import org.eclipse.draw2d.RectangleFigure; //导入方法依赖的package包/类
public SplitFigure(int orientation) {
  	this.orientation = orientation;
  	setLayoutManager(new SplitFigureLayout());
  	
  	dividerFigure = new RectangleFigure();
  	dividerFigure.setOutline(false);
  	dividerFigure.setBorder(new SimpleRaisedBorder());
  	switch(getOrientation()) {
  	case HORIZONTAL_SPLIT:
      	dividerFigure.setSize(5, 0);
      	dividerFigure.setPreferredSize(new Dimension(5, 0));
  		break;
  	case VERTICAL_SPLIT:
      	dividerFigure.setSize(0, 5);
      	dividerFigure.setPreferredSize(new Dimension(0, 5));
  		break;
  	}
  	
add(dividerFigure, DIVIDER);
  }
 
开发者ID:nasa,项目名称:OpenSPIFe,代码行数:21,代码来源:SplitFigure.java

示例5: createFigure

import org.eclipse.draw2d.RectangleFigure; //导入方法依赖的package包/类
@Override
protected IFigure createFigure() {
	RectangleFigure f = new RectangleFigure() {
		@Override
		protected void outlineShape(Graphics graphics) {

		}
	};

	GridLayout lm = new GridLayout(2, true);
	lm.horizontalSpacing = 10;
	lm.verticalSpacing = 10;
	f.setLayoutManager(lm);
	f.setBounds(new Rectangle(10, 10, 600, 600));
	f.setBorder(null);
	
	//Event to refresh the editor when a styles is added or removed
	getModel().getPropertyChangeSupport().addPropertyChangeListener(new PropertyChangeListener() {	
		@Override
		public void propertyChange(PropertyChangeEvent evt) {
			//To avoid to refresh removed elements
			if (getViewer() != null){ 
					refresh();			
			} else {
				getModel().getPropertyChangeSupport().removePropertyChangeListener(this);
			}
		}
	});
	return f;
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:31,代码来源:StylesTemplateEditPart.java

示例6: addBreak

import org.eclipse.draw2d.RectangleFigure; //导入方法依赖的package包/类
protected void addBreak()
{
  final RectangleFigure messageBreak = new RectangleFigure();
  messageBreak.setBackgroundColor(ColorConstants.white);
  messageBreak.setOutline(false);
  final Rectangle bounds = Rectangle.SINGLETON;
  bounds.x = -1;
  bounds.y = -1;
  bounds.width = 4;
  bounds.height = 13;
  messageBreak.setBounds(bounds);
  messageBreak.setBorder(MessageFigure.MESSAGE_BREAK_BORDER);
  add(messageBreak, new MidpointLocator(this, 0));
}
 
开发者ID:UBPL,项目名称:jive,代码行数:15,代码来源:MessageFigure.java

示例7: PageFormatWidget

import org.eclipse.draw2d.RectangleFigure; //导入方法依赖的package包/类
public PageFormatWidget(Composite parent, int style) {
	super(parent, style);
	setLayout(new GridLayout());
	square = new Canvas(this, SWT.NO_REDRAW_RESIZE | SWT.NO_BACKGROUND);
	GridData gd = new GridData(GridData.FILL_BOTH);
	gd.verticalSpan = 2;
	square.setLayoutData(gd);

	lws = new J2DLightweightSystem();
	lws.setControl(square);
	parentFigure = new Figure();
	parentFigure.setLayoutManager(new XYLayout());
	lws.setContents(parentFigure);

	borderPreview = new RectangleFigure() {

		@Override
		public void paint(Graphics graphics) {
			Dimension psize = parentFigure.getSize();
			float zoom = Math.max((float) pwidth / (float) (psize.width - 20), (float) pheight
					/ (float) (psize.height - 20));

			int x = getBounds().x + 10 + Math.round(lmargin / zoom);
			int y = getBounds().y + 10 + Math.round(tmargin / zoom);
			int w = getBounds().width - 20 - Math.round((rmargin) / zoom) - Math.round(lmargin / zoom);
			int h = getBounds().height - 20 - Math.round((bmargin) / zoom) - Math.round(tmargin / zoom);
			graphics.setForegroundColor(ColorConstants.blue);
			graphics.setBackgroundColor(ColorConstants.lightGray);
			graphics.setLineWidthFloat(0.1f);
			graphics.drawRectangle(x, y, w, h);

			int sw = Math.round(space / zoom);
			w = Math.round((cwidth) / zoom);
			for (int i = 1; i < cols; i++) {
				x += w;
				graphics.drawLine(x, y, x, y + h);
				graphics.fillRectangle(x, y, sw, h);
				x += sw;
				graphics.drawLine(x, y, x, y + h);
			}
			paintBorder(graphics);
		}
	};
	borderPreview.setBorder(new ShadowBorder());
	parentFigure.add(borderPreview);
	Display.getCurrent().asyncExec(new Runnable() {

		public void run() {
			setTBounds();
		}
	});
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:53,代码来源:PageFormatWidget.java

示例8: addSpeakerBox

import org.eclipse.draw2d.RectangleFigure; //导入方法依赖的package包/类
protected void addSpeakerBox()
{
    speakerBox.setBorder(new LineBorder(ColorConstants.black, 1));
    speakerBox.setOpaque(true);

    Image speakerIconImg = getSpeakerIconImage();
    // TODO: handle getImage returning null
    org.eclipse.swt.graphics.Rectangle bds = speakerIconImg.getBounds();
    IFigure speakerImgFig = new ImageFigure(speakerIconImg);
    IFigure speakerImgToolTip = new Label(L10N.get("DEF.SpeakerText",
                                               "Speaker text"));
    speakerImgFig.setToolTip(speakerImgToolTip);

    speakerImgWidth = bds.width;
    speakerImgHeight = bds.height;
    speakerLayout.setConstraint(speakerImgFig,
                                     new Rectangle(0,
                                                   0,
                                                   bds.width,
                                                   bds.height));
    speakerBox.add(speakerImgFig);

    RectangleFigure speakerEastBorder = new RectangleFigure();
    speakerEastBorder.setBorder(new LineBorder(ColorConstants.black, 1));
    speakerLayout.setConstraint(speakerEastBorder,
                                     new Rectangle(speakerImgWidth,
                                                   0,
                                                   SPEAKER_DIVIDER_WIDTH,
                                                   speakerImgHeight));
    speakerBox.add(speakerEastBorder);

    timeWestBorder = new RectangleFigure();
    timeWestBorder.setBorder(new LineBorder(ColorConstants.black, 1));
    speakerBox.add(timeWestBorder);

    String text = frame.getSpeakerText();
    speakerText = new Label(text);
    speakerText.setLabelAlignment(PositionConstants.LEFT);

    speakerTextToolTip = new Label(text);
    if ((text != null) && ! text.equals("")) {
        speakerText.setToolTip(speakerTextToolTip);
    }

    speakerBox.add(speakerText);

    divider = new RectangleFigure();
    divider.setBorder(new LineBorder(ColorConstants.black, 1));
    speakerBox.add(divider);

    double listenTimeInSecs = frame.getListenTimeInSecs();

    listenTime =
        new Label((listenTimeInSecs == Frame.NO_LISTEN_TIME)
                      ? NO_LISTEN_TIME_LABEL
                      : Double.toString(listenTimeInSecs));
    listenTime.setLabelAlignment(PositionConstants.RIGHT);
    speakerBox.add(listenTime);

    Label listenTimeToolTip = new Label(LISTEN_TIME_TOOLTIP);
    listenTime.setToolTip(listenTimeToolTip);
}
 
开发者ID:cogtool,项目名称:cogtool,代码行数:63,代码来源:DesignEditorFrame.java


注:本文中的org.eclipse.draw2d.RectangleFigure.setBorder方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。