本文整理汇总了Java中org.eclipse.draw2d.ImageFigure类的典型用法代码示例。如果您正苦于以下问题:Java ImageFigure类的具体用法?Java ImageFigure怎么用?Java ImageFigure使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ImageFigure类属于org.eclipse.draw2d包,在下文中一共展示了ImageFigure类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createContents
import org.eclipse.draw2d.ImageFigure; //导入依赖的package包/类
private static Figure createContents() {
Figure contents = new Figure();
XYLayout layout = new XYLayout();
contents.setLayoutManager(layout);
Button button = new Button("Hello World");
layout.setConstraint(button, new Rectangle(0, 0, -1, -1));
contents.add(button);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionevent) {
setBrightness();
}
});
String path = "C:\\Users\\Public\\Pictures\\Sample Pictures\\Oryx Antelope.jpg";
image = new Image(Display.getDefault(), path);
imageFigure = new ImageFigure(image);
layout.setConstraint(imageFigure, new Rectangle(0, 30, -1, -1));
contents.add(imageFigure);
return contents;
}
示例2: AbstractNodeFigure
import org.eclipse.draw2d.ImageFigure; //导入依赖的package包/类
public AbstractNodeFigure(AbstractNodeElement node,Image icon){
this.node=node;
BorderLayout layout=new BorderLayout();
this.setLayoutManager(layout);
ImageFigure iconFigure=new ImageFigure(icon);
this.add(iconFigure,BorderLayout.LEFT);
this.label=new Label(this.node.getLabel());
this.label.setForegroundColor(ColorConstants.black);
this.add(this.label,BorderLayout.CENTER);
this.setAntialias(SWT.ON);
RGB rgb=Activator.getPreference().getBorderColor();
this.setForegroundColor(new Color(null,rgb.red,rgb.green,rgb.blue));
rgb=Activator.getPreference().getBackgroundColor();
this.setBackgroundColor(new Color(null,rgb.red,rgb.green,rgb.blue));
this.setLineWidth(2);
}
示例3: ServerObjectFigure
import org.eclipse.draw2d.ImageFigure; //导入依赖的package包/类
public ServerObjectFigure(ServerObject so, Font font) {
ToolbarLayout layout = new ToolbarLayout();
setLayoutManager(layout);
setOpaque(false);
add(new ImageFigure(Images.scouter_48));
Label title = new Label(so.getDisplayName(), null);
add(title);
StringBuffer sb = new StringBuffer();
sb.append(ScouterUtil.humanReadableByteCount(so.getUsedMemory(), true));
sb.append(" / ");
sb.append(ScouterUtil.humanReadableByteCount(so.getTotalMemory(), true));
Label memory = new Label(sb.toString(), null);
memory.setFont(font);
add(memory);
setSize(-1, -1);
}
示例4: addColumnGroup
import org.eclipse.draw2d.ImageFigure; //导入依赖的package包/类
@Override
public void addColumnGroup(GroupColumnFigure columnFigure, int viewMode,
String name, boolean isAdded, boolean isUpdated, boolean isRemoved) {
columnFigure.setBorder(new MarginBorder(new Insets(1, 0, 1, 0)));
final ImageFigure image = new ImageFigure();
image.setBorder(new MarginBorder(new Insets(0, 4, 0, 7)));
image.setImage(Activator.getImage(ImageKey.GROUP));
columnFigure.add(image);
final StringBuilder text = new StringBuilder();
text.append(name);
text.append(" (GROUP)");
setColumnFigureColor(columnFigure, false, false, isAdded, isUpdated, isRemoved);
final Label label = createColumnLabel();
label.setForegroundColor(ColorConstants.black);
label.setLabelAlignment(PositionConstants.RIGHT);
label.setBorder(new MarginBorder(new Insets(1, 3, 0, 4)));
label.setText(text.toString());
columnFigure.add(label);
}
示例5: addIndex
import org.eclipse.draw2d.ImageFigure; //导入依赖的package包/类
@Override
public void addIndex(IndexFigure indexFigure, String name, boolean isFirst) {
final ImageFigure image = new ImageFigure();
image.setBorder(new MarginBorder(new Insets(0, 0, 0, 19)));
image.setImage(Activator.getImage(ImageKey.BLANK_WHITE));
image.setOpaque(true);
indexFigure.add(image);
final StringBuilder text = new StringBuilder();
text.append(name);
final Label label = createColumnLabel();
label.setBorder(new MarginBorder(new Insets(1, 0, 0, 4)));
label.setForegroundColor(ColorConstants.black);
label.setText(text.toString());
indexFigure.add(label);
}
示例6: createFigure
import org.eclipse.draw2d.ImageFigure; //导入依赖的package包/类
public IFigure createFigure( ExtendedItemHandle handle )
{
switch( extensionType )
{
case FIGURE_EXTENSION_TYPE:
return figureExtension.createFigure(handle);
case IMAGE_EXTENSION_TYPE:
return new ImageFigure(imageExtension.getImage( handle ));
case LABEL_EXTENSION_TYPE:
return new Label(labelExtension.getLabel( handle ));
default:
return null;
}
}
示例7: updateFigure
import org.eclipse.draw2d.ImageFigure; //导入依赖的package包/类
public void updateFigure( ExtendedItemHandle handle, IFigure figure )
{
switch( extensionType )
{
case FIGURE_EXTENSION_TYPE:
figureExtension.updateFigure(handle, figure);
break;
case IMAGE_EXTENSION_TYPE:
ImageFigure imageFigure = (ImageFigure)figure;
Image newImage = imageExtension.getImage( handle );
Image oldImage = imageFigure.getImage();
if ( newImage != oldImage )
{
imageFigure.setImage(newImage);
imageExtension.disposeImage( handle, oldImage );
}
break;
case LABEL_EXTENSION_TYPE:
((Label)figure).setText(labelExtension.getLabel( handle ));
break;
}
}
示例8: disposeFigure
import org.eclipse.draw2d.ImageFigure; //导入依赖的package包/类
public void disposeFigure( ExtendedItemHandle handle, IFigure figure )
{
switch( extensionType )
{
case FIGURE_EXTENSION_TYPE:
figureExtension.disposeFigure(handle, figure);
break;
case IMAGE_EXTENSION_TYPE:
imageExtension.disposeImage( handle, ((ImageFigure)figure).getImage() );
break;
case LABEL_EXTENSION_TYPE:
// no action needed
break;
}
}
示例9: initTitleBar
import org.eclipse.draw2d.ImageFigure; //导入依赖的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);
}
示例10: CreateContainer
import org.eclipse.draw2d.ImageFigure; //导入依赖的package包/类
private void CreateContainer()
{
FKImage = new ImageFigure();
FKImage.setBounds(new Rectangle(this.bounds.x,this.bounds.y,80,20));
FKImage.setBorder(new MarginBorder(new Insets(5, 2, 5, 2)));
// FKImage.setImage(null);
Rectangle tempRect=new Rectangle();
Point loc=this.getLocation();
Dimension dim=new Dimension(16,16);
tempRect.setBounds(loc,dim);
this.add(FKImage,tempRect);
label = new Label();
label.setBorder(new MarginBorder(new Insets(3, 5, 3, 5)));
label.setLabelAlignment(PositionConstants.LEFT);
this.add(label);
}
示例11: initTitleBar
import org.eclipse.draw2d.ImageFigure; //导入依赖的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);
}
示例12: createFigure
import org.eclipse.draw2d.ImageFigure; //导入依赖的package包/类
private Label createFigure(final String inTitle) {
setOpaque(true);
setLayoutManager(new XYLayout());
setBorder(new LineBorder(ColorConstants.black));
setBackgroundColor(GraphicalViewerCreator.BG_COLOR);
setSize(RelationsConstants.ITEM_WIDTH, RelationsConstants.ITEM_HEIGHT);
final Label outLabel = new Label(inTitle);
outLabel.setOpaque(true);
outLabel.setBackgroundColor(GraphicalViewerCreator.BG_COLOR);
outLabel.setLabelAlignment(PositionConstants.LEFT);
add(outLabel);
setConstraint(outLabel, new Rectangle(ICON_WIDTH, 0, LABEL_WIDTH, RelationsConstants.ITEM_HEIGHT));
final ImageFigure lImage = new ImageFigure(image);
add(lImage);
setConstraint(lImage, new Rectangle(-1, -1, ICON_WIDTH, ICON_WIDTH));
return outLabel;
}
示例13: initTitleBar
import org.eclipse.draw2d.ImageFigure; //导入依赖的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);
}
示例14: createContents
import org.eclipse.draw2d.ImageFigure; //导入依赖的package包/类
private static Figure createContents() {
final Figure contents = new Figure();
final XYLayout layout = new XYLayout();
contents.setLayoutManager(layout);
final Button button = new Button("Hello World");
layout.setConstraint(button, new Rectangle(0, 0, -1, -1));
contents.add(button);
button.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent actionevent) {
setBrightness();
}
});
final String path = "C:\\Users\\Public\\Pictures\\Sample Pictures\\Oryx Antelope.jpg";
image = new Image(Display.getDefault(), path);
imageFigure = new ImageFigure(image);
layout.setConstraint(imageFigure, new Rectangle(0, 30, -1, -1));
contents.add(imageFigure);
return contents;
}
示例15: initTitleBar
import org.eclipse.draw2d.ImageFigure; //导入依赖的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);
}