本文整理汇总了Java中org.eclipse.draw2d.RectangleFigure.setFill方法的典型用法代码示例。如果您正苦于以下问题:Java RectangleFigure.setFill方法的具体用法?Java RectangleFigure.setFill怎么用?Java RectangleFigure.setFill使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.draw2d.RectangleFigure
的用法示例。
在下文中一共展示了RectangleFigure.setFill方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: 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;
}
示例3: createContents
import org.eclipse.draw2d.RectangleFigure; //导入方法依赖的package包/类
private void createContents() {
nameLabel = new SyntaxColoringLabel();
GridData data = GridDataFactory.fillDefaults().grab(true, false).getData();
data.horizontalIndent = 5;
nameLabel.setTextPlacement(PositionConstants.WEST);
this.add(nameLabel, data);
/** Compartment container **/
compartmentPane = new RectangleFigure();
compartmentPane.setOutline(false);
compartmentPane.setLayoutManager(new StackLayout());
compartmentPane.setFill(false);
this.add(compartmentPane, GridDataFactory.fillDefaults().grab(true, true).getData());
}
示例4: createDragSourceFeedbackFigure
import org.eclipse.draw2d.RectangleFigure; //导入方法依赖的package包/类
@Override
protected IFigure createDragSourceFeedbackFigure() {
// Use a ghost rectangle for feedback
RectangleFigure r = new RectangleFigure();
r.setFill(false);
r.setLineStyle(Graphics.LINE_DOT);
r.setForegroundColor(ColorConstants.black);
r.setLineWidth(1);
r.setBounds(getInitialFeedbackBounds());
addFeedback(r);
return r;
}
示例5: showSelectionArea
import org.eclipse.draw2d.RectangleFigure; //导入方法依赖的package包/类
protected void showSelectionArea(RectangleFigure rf, Rectangle bds)
{
rf.setBounds(bds);
rf.setOutline(true);
rf.setFill(false);
//add new rectangle object to the array list
duplicatingDynamic.add(rf);
ui.getViewEditor().addInteractionFigure(rf);
}
示例6: createDragSourceFeedbackFigure
import org.eclipse.draw2d.RectangleFigure; //导入方法依赖的package包/类
protected IFigure createDragSourceFeedbackFigure() {
// Use an invisible rectangle
RectangleFigure r = new RectangleFigure() {
@Override
public void paintClientArea(Graphics g) {
// g.setForegroundColor(ColorConstants.green);
// Rectangle currentBounds = getBounds();
String text = getFeedbackText();
if (g == null)
return;
Rectangle clientArea = getClientArea();
Graphics2D gr = ((J2DGraphics) g).getGraphics2D();
// Stroke oldStroke = graphics2d.getStroke();
// gr.setStroke(J2DUtils.getInvertedZoomedStroke(oldStroke, g.getAbsoluteScale()));
// draw the line
gr.setColor(Color.gray);
// Draw the label...
gr.fillOval(clientArea.x + (clientArea.width) / 2 - 3, clientArea.y - 3, 7, 7);
gr.fillOval(clientArea.x + (clientArea.width) / 2 - 3, clientArea.y + clientArea.height - 4, 7, 7);
if (clientArea.width < 20 || clientArea.height < 20) {
gr.drawLine(clientArea.x + (clientArea.width) / 2, // Half X
clientArea.y, // Half Y
clientArea.x + (clientArea.width) / 2, // Half X
clientArea.y + clientArea.height); // Up to the top of the label...
return;
}
FontMetrics fm = gr.getFontMetrics();
Rectangle2D textBounds = fm.getStringBounds(text, gr);
java.awt.Rectangle textBgBounds = new java.awt.Rectangle(clientArea.x - 30 + (clientArea.width + 60) / 2
- (int) textBounds.getWidth() / 2 - 10, clientArea.y - 30 + (clientArea.height + 60) / 2
- (int) textBounds.getHeight() / 2 - 2, (int) textBounds.getWidth() + 20, (int) textBounds.getHeight() + 4);
gr.setColor(new Color(30, 30, 30, 128));
gr.fillRoundRect(textBgBounds.x, textBgBounds.y, textBgBounds.width, textBgBounds.height, 20, 20);
/*
* gr.drawLine(clientArea.x-30, // X clientArea.y-30 + (clientArea.height+60)/2, // Half Y clientArea.x-30 +
* (clientArea.width+60 -textBgBounds.width)/ 2, // Up to the right side of the label clientArea.y-30 +
* (clientArea.height+60)/2); // Same Y...
*
* gr.drawLine(clientArea.x-30 + (clientArea.width+60 + textBgBounds.width)/ 2, // From the left side of the
* label clientArea.y-30 + (clientArea.height+60)/2, // Half Y clientArea.x-30 + clientArea.width+60, // Up to
* the full width clientArea.y-30 + (clientArea.height+60)/2); // Same Y...
*/
gr.drawLine(clientArea.x - 30 + (clientArea.width + 60) / 2, // Half X
clientArea.y - 30, // Half Y
clientArea.x - 30 + (clientArea.width + 60) / 2, // Half X
clientArea.y - 30 + (clientArea.height + 60 - textBgBounds.height) / 2); // Up to the top of the label...
gr.drawLine(clientArea.x - 30 + (clientArea.width + 60) / 2, // Half X
clientArea.y - 30 + (clientArea.height + 60 + textBgBounds.height) / 2, // // Up to the bottom of the
// label...
clientArea.x - 30 + (clientArea.width + 60) / 2, // Half X
clientArea.y - 30 + clientArea.height + 60); // Up to the bounds height...
gr.setColor(Color.white);
gr.drawString(text, textBgBounds.x + 10, textBgBounds.y + fm.getAscent());
}
};
r.setOpaque(false);
r.setFill(false);
r.setBounds(getInitialFeedbackBounds());
addFeedback(r);
return r;
}
示例7: showSelectionArea
import org.eclipse.draw2d.RectangleFigure; //导入方法依赖的package包/类
protected void showSelectionArea(RectangleFigure rf)
{
rf.setOutline(true);
rf.setFill(false);
ui.getViewEditor().addInteractionFigure(rf);
}