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


Java ScrolledComposite.setBackground方法代码示例

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


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

示例1: MappingViewer

import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
/**
 * @param editor
 * @param parent
 * @param background
 */
public MappingViewer(final TransformationEditor editor,
        final Composite parent,
        final Color background) {
    this.editor = editor;

    scroller = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
    scroller.setExpandHorizontal(true);
    scroller.setExpandVertical(true);
    scroller.setBackground(background);

    final Label label = new Label(parent.getShell(), SWT.NONE);
    label.setImage(Util.Images.ADD_FUNCTION);
    imageButtonLabelSize = label.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    label.dispose();
}
 
开发者ID:fabric8io,项目名称:data-mapper,代码行数:21,代码来源:MappingViewer.java

示例2: ImageViewer

import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
public ImageViewer( Composite parent ) {
  scrolledComposite = new ScrolledComposite( parent, SWT.H_SCROLL | SWT.V_SCROLL );
  scrolledComposite.setBackground( getBackgroundColor() );
  imageLabel = new Label( scrolledComposite, SWT.NONE );
  imageLabel.setBackground( getBackgroundColor() );
  scrolledComposite.setContent( imageLabel );
  scrolledComposite.addListener( SWT.Dispose, this::handleDispose );
}
 
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:9,代码来源:ImageViewer.java

示例3: createContents

import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
@SuppressWarnings("unused")
private void createContents(final TransformationEditor editor,
        final MapperConfiguration config) {
    scroller = new ScrolledComposite(this, SWT.V_SCROLL);
    scroller.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
    scroller.setExpandHorizontal(true);
    scroller.setExpandVertical(true);
    scroller.setBackground(getBackground());
    pane = new Composite(scroller, SWT.NONE);
    scroller.setContent(pane);
    pane.setLayout(GridLayoutFactory.fillDefaults().numColumns(3).spacing(0, 0).create());
    pane.setBackground(getBackground());
    createHeader(pane, config.getSourceModel());
    new Label(pane, SWT.NONE); // spacer
    createHeader(pane, config.getTargetModel());
    sourcePane = new Composite(pane, SWT.BORDER);
    sourcePane.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
    sourcePane.setLayout(GridLayoutFactory.fillDefaults().spacing(0, 0).create());
    sourcePane.setBackground(getBackground());
    mapsToPane = new Composite(pane, SWT.NONE);
    mapsToPane.setLayoutData(GridDataFactory.fillDefaults().grab(false, true).create());
    final int margin = sourcePane.computeSize(SWT.DEFAULT, SWT.DEFAULT).y / 2;
    mapsToPane.setLayout(GridLayoutFactory.fillDefaults().margins(margin, margin).spacing(0, 0)
            .create());
    mapsToPane.setBackground(getBackground());
    targetPane = new Composite(pane, SWT.BORDER);
    targetPane.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
    targetPane.setLayout(GridLayoutFactory.fillDefaults().spacing(0, 0).create());
    targetPane.setBackground(getBackground());

    for (final MappingOperation<?, ?> mapping : config.getMappings()) {
        createMapping(editor, mapping);
    }
}
 
开发者ID:fabric8io,项目名称:data-mapper,代码行数:35,代码来源:MappingsViewer.java

示例4: RuntimeViewer

import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
RuntimeViewer(Composite parent) {
	super(parent, SWT.BORDER);
	instance = this;

	setLayout(new FillLayout());
	setBackground(PandionJConstants.Colors.VIEW_BACKGROUND);
	scroll = new ScrolledComposite(this, SWT.H_SCROLL | SWT.V_SCROLL);
	scroll.setBackground(PandionJConstants.Colors.VIEW_BACKGROUND);
	canvas = new Canvas(scroll, SWT.DOUBLE_BUFFERED);
	canvas.setBackground(ColorConstants.white);
	canvas.setLayoutData(new GridData(GridData.FILL_BOTH));
	scroll.setContent(canvas);
	addMenu();

	//				rootFig = new ScalableLayeredPane();
	//				((ScalableLayeredPane) rootFig).setScale(2);
	rootFig = new Figure();
	rootFig.setOpaque(true);
	rootGrid = new GridLayout(2, false);
	rootGrid.horizontalSpacing = PandionJConstants.STACK_TO_OBJECTS_GAP;
	rootGrid.marginWidth = PandionJConstants.MARGIN;
	rootGrid.marginHeight = PandionJConstants.MARGIN;
	rootFig.setLayoutManager(rootGrid);

	stackFig = new StackContainer();
	rootFig.add(stackFig);
	org.eclipse.draw2d.GridData d = new org.eclipse.draw2d.GridData(SWT.BEGINNING, SWT.BEGINNING, true, true);
	d.widthHint = Math.max(PandionJConstants.STACKCOLUMN_MIN_WIDTH, stackFig.getPreferredSize().width);
	rootGrid.setConstraint(stackFig, d);

	objectContainers = new ArrayList<>();
	objectContainer = ObjectContainer.create(true);
	rootFig.add(objectContainer);
	rootGrid.setConstraint(objectContainer, new org.eclipse.draw2d.GridData(SWT.FILL, SWT.FILL, true, true));

	lws = new LightweightSystem(canvas);
	lws.setContents(rootFig);
	pointersMap = new HashMap<>();
	pointersMapOwners = ArrayListMultimap.create();

}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:42,代码来源:RuntimeViewer.java

示例5: postConstruct

import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
@PostConstruct
public void postConstruct(Composite parent) {
	GridLayout gl_parent = new GridLayout(1, false);
	gl_parent.verticalSpacing = 0;
	gl_parent.marginWidth = 0;
	gl_parent.marginHeight = 0;
	gl_parent.horizontalSpacing = 0;
	parent.setLayout(gl_parent);
	
	part = partService
			.findPart("org.bbaw.bts.ui.corpus.part.AnnotationsPart");
	resizeListener = new Listener() {

		@Override
		public void handleEvent(
				org.eclipse.swt.widgets.Event event) {
			Rectangle r = scrollComposite
					.getClientArea();
			composite.layout();
			scrollComposite.setMinSize(composite
					.computeSize(r.width, SWT.DEFAULT));
		}

	};

	selectionListener = new Listener() {

		@Override
		public void handleEvent(
				org.eclipse.swt.widgets.Event event) {
			RelatedObjectGroup roGroup = (RelatedObjectGroup) event.widget;
			selfselection = true;
			setSelectedInternal(new Vector<>(Arrays.asList(roGroup)), true);
			selfselection = false;
		}

	};
	
	scrollComposite = new ScrolledComposite(parent,
			SWT.V_SCROLL | SWT.H_SCROLL);
	scrollComposite.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
	scrollComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	scrollComposite.setMinWidth(100);
	scrollComposite.setMinHeight(400);
	composite = new Composite(scrollComposite, SWT.BORDER);
	scrollComposite.setExpandHorizontal(true);

	scrollComposite.setExpandVertical(true);
	scrollComposite.addControlListener(new ControlAdapter() {
		@Override
		public void controlResized(ControlEvent e) {
			Rectangle r = scrollComposite.getClientArea();
			scrollComposite.setMinSize(composite.computeSize(r.width,
					SWT.DEFAULT));
		}
	});
	composite.setBackground(SWTResourceManager.getColor(SWT.COLOR_WHITE));
	composite.setLayout(new GridLayout(1, false));
	((GridLayout)composite.getLayout()).marginHeight = 0;
	((GridLayout)composite.getLayout()).marginWidth = 0;
	((GridLayout)composite.getLayout()).verticalSpacing = 0;

	// populate extended annotation filter menu and initialize context node
	extendAnnotationsFilterMenu();

	scrollComposite.setContent(composite);
	constructed = true;
	// request input from text editor
	eventBroker.post(BTSUIConstants.EVENT_EGY_TEXT_EDITOR_INPUT_REQUESTED+"annotations_part", relatingObjectsEvent);
}
 
开发者ID:cplutte,项目名称:bts,代码行数:71,代码来源:AnnotationsPart.java


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