本文整理汇总了Java中org.eclipse.draw2d.RectangleFigure.setBackgroundColor方法的典型用法代码示例。如果您正苦于以下问题:Java RectangleFigure.setBackgroundColor方法的具体用法?Java RectangleFigure.setBackgroundColor怎么用?Java RectangleFigure.setBackgroundColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.draw2d.RectangleFigure
的用法示例。
在下文中一共展示了RectangleFigure.setBackgroundColor方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: showLayoutTargetFeedback
import org.eclipse.draw2d.RectangleFigure; //导入方法依赖的package包/类
@Override
protected void showLayoutTargetFeedback(Request request) {
eraseLayoutTargetFeedback(request);
if (request instanceof ChangeBoundsRequest || (request instanceof CreateRequest
&& acceptCreate((CreateRequest) request))){
targetFeedback = new RectangleFigure();
Rectangle parentBounds = ((ElementEditPart)getHost()).getBounds();
translateToAbsolute(getContainerFigure(), parentBounds);
Rectangle lineBounds = parentBounds.getCopy();
lineBounds.height = 4;
lineBounds.y--;
targetFeedback.setForegroundColor(ColorConstants.green);
targetFeedback.setBackgroundColor(ColorConstants.green);
if (isInsertAfter((DropRequest) request)){
lineBounds.y += parentBounds.height;
}
targetFeedback.setBounds(lineBounds);
addFeedback(targetFeedback);
} else if (request instanceof ChangeBoundsRequest){
}
}
示例2: 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;
}
示例3: 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;
}
示例4: PickerFigure
import org.eclipse.draw2d.RectangleFigure; //导入方法依赖的package包/类
public PickerFigure() {
super.setMargin(10);
selection = new RectangleFigure();
selection.setAlpha(50);
selection.setBackgroundColor(ColorConstants.blue);
//setLayoutManager(new PickerFigureLayout());
}
示例5: createFigure
import org.eclipse.draw2d.RectangleFigure; //导入方法依赖的package包/类
/**
* @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
*/
protected IFigure createFigure() {
NotationNode notationNode = (NotationNode) getModel();
RectangleFigure figure = new RectangleFigure();
figure.setBackgroundColor(ColorConstants.lightBlue);
figure.setForegroundColor(UiCorePlugin.getDefault().getColor(IConstantColorRegistry.Black));
figure.setLineWidth(2);
figure.setFill(true);
figure.setLocation(new Point(notationNode.getX(), notationNode.getY()));
figure.setSize(notationNode.getWidth(), notationNode.getHeight());
return figure;
}
示例6: createFigure
import org.eclipse.draw2d.RectangleFigure; //导入方法依赖的package包/类
@Override
protected IFigure createFigure()
{
RectangleFigure rectangle = new RectangleFigure();
rectangle.setOutline(false);
GridLayout layout = new GridLayout();
layout.marginHeight = 0;
layout.marginWidth = 0;
layout.horizontalSpacing = 10;
layout.verticalSpacing = 10;
rectangle.setLayoutManager(layout);
rectangle.setBackgroundColor(Display.getDefault().getSystemColor(
SWT.COLOR_WIDGET_BACKGROUND));
return rectangle;
}
示例7: createFigure
import org.eclipse.draw2d.RectangleFigure; //导入方法依赖的package包/类
@Override
protected IFigure createFigure()
{
RectangleFigure rectangle = new RectangleFigure();
rectangle.setOutline(false);
GridLayout gridLayout = new GridLayout();
gridLayout.marginHeight = 10;
gridLayout.marginWidth = 10;
rectangle.setLayoutManager(gridLayout);
rectangle.setBackgroundColor(Display.getDefault().getSystemColor(
SWT.COLOR_WIDGET_BACKGROUND));
return rectangle;
}
示例8: 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));
}
示例9: InteractionDrawingEditor
import org.eclipse.draw2d.RectangleFigure; //导入方法依赖的package包/类
/**
* Create the Interaction drawing editor.
* Requires the needed motion listeners, the parent window as well as the
* height and location of the properties panel.
*
* It also takes a background color which is used to color the window.
*
* A cursor is also provided to handle rollovers.
*
* NOTE: color will be disposed by this class;
* DO NOT Dispose of it yourself.
*
* @param child
* @param motionL
* @param clickL
* @param window
* @param propertiesPaneSize
* @param propertiesPaneLoc
* @param paletteSize
* @param editorCursor
*/
public InteractionDrawingEditor(CogToolScalableFigure child,
IFlatDraw2DMouseMotionListener motionL,
IFlatDraw2DMouseListener clickL,
Zoomable zoom,
Composite window,
int propertiesPaneSize,
int propertiesPaneLoc,
int paletteSize,
Cursor editorCursor,
Color bgColor)
{
// Call the parent StandardDrawingEditor
super(window, propertiesPaneSize, propertiesPaneLoc, paletteSize, zoom, 0);
// Store the interaction layer, which is created with the motion and
// click listeners as well as the editing cursor.
interactionLayer =
new InteractionFigure(this, motionL, clickL, editorCursor);
backgroundColor = bgColor;
backgroundColorFigure = new RectangleFigure();
backgroundColorFigure.setBackgroundColor(backgroundColor);
mouseClickState = clickL;
mouseMotionState = motionL;
setContents(child);
// set default editors size
editorComposite.setBounds(getContentSize());
// Set the contents of the LightweightSystem to the interaction layer.
// The scaled interaction layer will be the TOPMOST parent of all
// draw2d objects.
// Also calls resize the scroll area to handle the current object size.
getLWS().setContents(interactionLayer);
// Specify a control adapter to handle resize events.
super.addEditorControlListener(new ControlAdapter() {
@Override
public void controlResized(ControlEvent e) {
// On resize, get the new area, and resize the internal
// contents
org.eclipse.swt.graphics.Rectangle r =
editorComposite.getClientArea();
// Specify true to shrink the minimum area of the
// window; this is to allow for the window to reclaim
// space that is no longer needed.
resizeContents(r.width, r.height, true);
// set scroll increments to something larger than one
setScrollIncrements();
}
});
}