本文整理匯總了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();
}
示例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 );
}
示例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);
}
}
示例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();
}
示例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);
}