本文整理匯總了Java中org.eclipse.draw2d.Figure.setBackgroundColor方法的典型用法代碼示例。如果您正苦於以下問題:Java Figure.setBackgroundColor方法的具體用法?Java Figure.setBackgroundColor怎麽用?Java Figure.setBackgroundColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.draw2d.Figure
的用法示例。
在下文中一共展示了Figure.setBackgroundColor方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initTitleBar
import org.eclipse.draw2d.Figure; //導入方法依賴的package包/類
/**
* {@inheritDoc}
*/
@Override
public void initTitleBar(final Figure top) {
final ToolbarLayout topLayout = new ToolbarLayout();
topLayout.setMinorAlignment(OrderedLayout.ALIGN_TOPLEFT);
topLayout.setStretchMinorAxis(true);
top.setLayoutManager(topLayout);
nameLabel = new Label();
nameLabel.setBorder(new MarginBorder(new Insets(5, 20, 5, 20)));
top.add(nameLabel);
final Figure separater = new Figure();
separater.setSize(-1, 1);
separater.setBackgroundColor(getTextColor());
separater.setOpaque(true);
top.add(separater);
}
示例2: initTitleBar
import org.eclipse.draw2d.Figure; //導入方法依賴的package包/類
/**
* {@inheritDoc}
*/
@Override
public void initTitleBar(Figure top) {
ToolbarLayout topLayout = new ToolbarLayout();
topLayout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
topLayout.setStretchMinorAxis(true);
top.setLayoutManager(topLayout);
this.nameLabel = new Label();
this.nameLabel.setBorder(new MarginBorder(new Insets(5, 20, 5, 20)));
top.add(nameLabel);
Figure separater = new Figure();
separater.setSize(-1, 1);
separater.setBackgroundColor(this.getTextColor());
separater.setOpaque(true);
top.add(separater);
}
示例3: initTitleBar
import org.eclipse.draw2d.Figure; //導入方法依賴的package包/類
@Override
public void initTitleBar(Figure top) {
final ToolbarLayout topLayout = new ToolbarLayout();
topLayout.setMinorAlignment(ToolbarLayout.ALIGN_TOPLEFT);
topLayout.setStretchMinorAxis(true);
top.setLayoutManager(topLayout);
this.nameLabel = new Label();
nameLabel.setBorder(new MarginBorder(new Insets(5, 20, 5, 20)));
top.add(nameLabel);
final Figure separater = new Figure();
separater.setSize(-1, 1);
separater.setBackgroundColor(getTextColor());
separater.setOpaque(true);
top.add(separater);
}
示例4: initTitleBar
import org.eclipse.draw2d.Figure; //導入方法依賴的package包/類
/**
* {@inheritDoc}
*/
public void initTitleBar(Figure top) {
top.setLayoutManager(new BorderLayout());
Figure title = new Figure();
top.add(title, BorderLayout.TOP);
title.setLayoutManager(new FlowLayout());
title.setBackgroundColor(ColorConstants.darkGreen);
ImageFigure image = new ImageFigure();
image.setBorder(new MarginBorder(new Insets(5, 10, 5, 2)));
image.setImage(Activator.getImageDescriptor(ImageResource.VIEW).createImage());
title.add(image);
this.nameLabel = new Label();
this.nameLabel.setBorder(new MarginBorder(new Insets(5, 0, 5, 20)));
title.add(this.nameLabel);
Figure separater = new Figure();
separater.setSize(-1, 1);
separater.setBackgroundColor(ColorConstants.black);
separater.setOpaque(true);
top.add(separater, BorderLayout.BOTTOM);
}
示例5: initTitleBar
import org.eclipse.draw2d.Figure; //導入方法依賴的package包/類
/**
* {@inheritDoc}
*/
public void initTitleBar(Figure top) {
top.setLayoutManager(new BorderLayout());
Figure title = new Figure();
top.add(title, BorderLayout.TOP);
title.setLayoutManager(new FlowLayout());
title.setBackgroundColor(ColorConstants.darkGreen);
ImageFigure image = new ImageFigure();
image.setBorder(new MarginBorder(new Insets(5, 10, 5, 2)));
image.setImage(Activator.getImageDescriptor(ImageResource.TABLE).createImage());
title.add(image);
this.nameLabel = new Label();
this.nameLabel.setBorder(new MarginBorder(new Insets(5, 0, 5, 20)));
title.add(this.nameLabel);
Figure separater = new Figure();
separater.setSize(100, 100);
separater.setBackgroundColor(ColorConstants.black);
separater.setOpaque(false);
top.add(separater, BorderLayout.BOTTOM);
}
示例6: createColumnArea
import org.eclipse.draw2d.Figure; //導入方法依賴的package包/類
/**
* {@inheritDoc}
*/
public void createColumnArea() {
columns=new Figure();
this.initColumnArea(columns);
columns.setBorder(new MarginBorder(0, 0, 0, 0));
columns.setBackgroundColor(ColorConstants.white);
columns.setOpaque(true);
Figure centerFigure = new Figure();
centerFigure.setLayoutManager(new BorderLayout());
centerFigure.setBorder(new MarginBorder(new Insets(0, 2, 0, 2)));
centerFigure.setBackgroundColor(new Color(null,192,192,192));
centerFigure.add(columns, BorderLayout.CENTER);
this.add(centerFigure, BorderLayout.CENTER);
}
示例7: createFigure
import org.eclipse.draw2d.Figure; //導入方法依賴的package包/類
protected IFigure createFigure() {
Figure f = new Figure();
f.setBackgroundColor(ColorConstants.white);
f.setOpaque(true);
XYLayout layout = new XYLayout();
f.setLayoutManager(layout);
Branch branch = (Branch)getModel();
Rectangle rect = new Rectangle(10+branch.getIndex()*BRANCH_OFFSET, 10, BRANCH_WIDTH, -1);
((AbstractGraphicalEditPart)getParent()).getFigure().getLayoutManager().setConstraint(f, rect);
return f;
}
示例8: createFigure
import org.eclipse.draw2d.Figure; //導入方法依賴的package包/類
protected IFigure createFigure() {
Figure f = new Figure();
f.setBackgroundColor(ColorConstants.white);
f.setOpaque(true);
XYLayout layout = new XYLayout();
f.setLayoutManager(layout);
return f;
}
示例9: createFigure
import org.eclipse.draw2d.Figure; //導入方法依賴的package包/類
protected IFigure createFigure() {
Figure f = new Figure();
f.setBackgroundColor(ColorConstants.white);
f.setOpaque(true);
BorderLayout layout = new BorderLayout();
f.setLayoutManager(layout);
Path path = (Path)getModel();
GraphEditPart graphEditPart = (GraphEditPart)getParent().getParent();
branchFigure = graphEditPart.getBranchFigure(path.getPath());
f.add(branchFigure, BorderLayout.CENTER);
return f;
}
示例10: initTitleBar
import org.eclipse.draw2d.Figure; //導入方法依賴的package包/類
/**
* {@inheritDoc}
*/
@Override
public void initTitleBar(final Figure top) {
top.setLayoutManager(new BorderLayout());
final Figure title = new Figure();
top.add(title, BorderLayout.TOP);
final FlowLayout titleLayout = new FlowLayout();
titleLayout.setMinorAlignment(OrderedLayout.ALIGN_CENTER);
title.setLayoutManager(titleLayout);
final ImageFigure image = new ImageFigure();
image.setBorder(new MarginBorder(new Insets(5, 10, 5, 2)));
image.setImage(ERDiagramActivator.getImage(getTableFigure().getImageKey()));
title.add(image);
nameLabel = new Label();
nameLabel.setBorder(new MarginBorder(new Insets(5, 0, 5, 20)));
title.add(nameLabel);
final Figure separater = new Figure();
separater.setSize(-1, 1);
separater.setBackgroundColor(ColorConstants.black);
separater.setOpaque(true);
top.add(separater, BorderLayout.BOTTOM);
}
示例11: initTitleBar
import org.eclipse.draw2d.Figure; //導入方法依賴的package包/類
/**
* {@inheritDoc}
*/
@Override
public void initTitleBar(Figure top) {
top.setLayoutManager(new BorderLayout());
Figure title = new Figure();
top.add(title, BorderLayout.TOP);
FlowLayout titleLayout = new FlowLayout();
titleLayout.setMinorAlignment(FlowLayout.ALIGN_CENTER);
title.setLayoutManager(titleLayout);
ImageFigure image = new ImageFigure();
image.setBorder(new MarginBorder(new Insets(5, 10, 5, 2)));
image.setImage(ERDiagramActivator.getImage(this.getTableFigure().getImageKey()));
title.add(image);
this.nameLabel = new Label();
this.nameLabel.setBorder(new MarginBorder(new Insets(5, 0, 5, 20)));
title.add(this.nameLabel);
Figure separater = new Figure();
separater.setSize(-1, 1);
separater.setBackgroundColor(ColorConstants.black);
separater.setOpaque(true);
top.add(separater, BorderLayout.BOTTOM);
}
示例12: initTitleBar
import org.eclipse.draw2d.Figure; //導入方法依賴的package包/類
@Override
public void initTitleBar(Figure top) {
top.setLayoutManager(new BorderLayout());
final FlowLayout layout = new FlowLayout();
layout.setStretchMinorAxis(true);
final Figure title = new Figure();
top.add(title, BorderLayout.TOP);
title.setLayoutManager(layout);
title.setBorder(new MarginBorder(new Insets(2, 2, 2, 2)));
final ImageFigure image = new ImageFigure();
image.setBorder(new MarginBorder(new Insets(0, 0, 0, 0)));
image.setImage(Activator.getImage(getTableFigure().getImageKey()));
title.add(image);
this.nameLabel = new Label();
nameLabel.setBorder(new MarginBorder(new Insets(0, 0, 0, 20)));
title.add(nameLabel);
final Figure separater = new Figure();
separater.setSize(-1, 1);
separater.setBackgroundColor(ColorConstants.black);
separater.setOpaque(true);
top.add(separater, BorderLayout.BOTTOM);
}
示例13: createFigure
import org.eclipse.draw2d.Figure; //導入方法依賴的package包/類
@Override
protected IFigure createFigure() {
Figure figure = new Figure();
ToolbarLayout layout = new ToolbarLayout();
layout.setSpacing(2);
figure.setLayoutManager(layout);
figure.setOpaque(true);
figure.setBackgroundColor(ColorConstants.white);
figure.setMinimumSize(new Dimension(0, getModel().getMinimumHeight()));
return figure;
}
示例14: showLayoutTargetFeedback
import org.eclipse.draw2d.Figure; //導入方法依賴的package包/類
/**
* {@inheritDoc} In this case the backround color changes to blue when the user is about to
* execute a possible command.
*/
@Override
protected void showLayoutTargetFeedback(final Request request) {
if (request.getType() == RequestConstants.REQ_CREATE) {
if (((CreateRequest) request).getNewObjectType().equals(Type.ROLE_TYPE)
|| ((CreateRequest) request).getNewObjectType().equals(Type.COMPARTMENT_TYPE)
|| ((CreateRequest) request).getNewObjectType().equals(Type.NATURAL_TYPE)
|| ((CreateRequest) request).getNewObjectType().equals(Type.ROLE_GROUP)) {
final Figure figure = (Figure) getHostFigure();
figure.setBackgroundColor(ColorConstants.lightBlue);
figure.setOpaque(true);
}
}
}
示例15: eraseLayoutTargetFeedback
import org.eclipse.draw2d.Figure; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override
protected void eraseLayoutTargetFeedback(final Request request) {
final Figure figure = (Figure) getHostFigure();
figure.setBackgroundColor(ColorConstants.white);
figure.setOpaque(false);
}