本文整理汇总了Java中org.eclipse.draw2d.ActionEvent类的典型用法代码示例。如果您正苦于以下问题:Java ActionEvent类的具体用法?Java ActionEvent怎么用?Java ActionEvent使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ActionEvent类属于org.eclipse.draw2d包,在下文中一共展示了ActionEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createContents
import org.eclipse.draw2d.ActionEvent; //导入依赖的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: MethodWidget
import org.eclipse.draw2d.ActionEvent; //导入依赖的package包/类
MethodWidget(IMethod method) {
setLayoutManager(new FlowLayout());
button = new Button(shortSig(method));
button.setToolTip(new Label(longSig(method)));
button.setForegroundColor(ColorConstants.black);
FontManager.setFont(button, PandionJConstants.BUTTON_FONT_SIZE);
button.setEnabled(methodsEnabled);
add(button);
resultLabel = new Label();
resultLabel.setForegroundColor(ColorConstants.black);
add(resultLabel);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
invoke(model, method, resultLabel);
}
});
}
示例3: createExpandButton
import org.eclipse.draw2d.ActionEvent; //导入依赖的package包/类
/**
* Creates the button to show/hide children
*/
private void createExpandButton(){
expandButton = new DwExpandButton();
add(expandButton);
expandButton.setSize(new Dimension( 16, 16 ));
expandButton.setDirection(Orientable.NORTH);
expandButton.setVisible(false);
expandButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
feature.setHideChildren(!feature.isHideChildren(), editor.getCurrentSelectedDate());
}
});
}
示例4: addSnapshotButton
import org.eclipse.draw2d.ActionEvent; //导入依赖的package包/类
private void addSnapshotButton() {
Button snapShotButton = new Button(XYGraphMediaFactory.getInstance().getImage("images/camera.gif"));
snapShotButton.setToolTip(new Label("Save Snapshot to PNG file"));
addButton(snapShotButton);
snapShotButton.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent event) {
// Have valid name, so get image
ImageLoader loader = new ImageLoader();
Image image = xyGraph.getImage();
loader.data = new ImageData[]{image.getImageData()};
image.dispose();
// Prompt for file name
String path = SingleSourceHelper.getImageSavePath();
if (path == null || path.length() <= 0)
return;
// Assert *.png at end of file name
if (! path.toLowerCase().endsWith(".png"))
path = path + ".png";
// Save
loader.save(path, SWT.IMAGE_PNG);
}
});
}
示例5: makeHeader
import org.eclipse.draw2d.ActionEvent; //导入依赖的package包/类
private Figure makeHeader ()
{
this.button = new CheckBox ( "Active" );
this.button.getModel ().addActionListener ( new ActionListener () {
@Override
public void actionPerformed ( final ActionEvent event )
{
setEnabled ( RoundDetailsPart.this.button.getModel ().isSelected () );
}
} );
return this.button;
}
示例6: makeHeader
import org.eclipse.draw2d.ActionEvent; //导入依赖的package包/类
private Figure makeHeader ()
{
this.button = new CheckBox ( Messages.BooleanAlarmDetails_active );
this.button.getModel ().addActionListener ( new ActionListener () {
@Override
public void actionPerformed ( final ActionEvent event )
{
setEnabled ( BooleanAlarmDetails.this.button.getModel ().isSelected () );
}
} );
return this.button;
}
示例7: makeHeader
import org.eclipse.draw2d.ActionEvent; //导入依赖的package包/类
private Figure makeHeader ()
{
this.button = new CheckBox ( "Active" );
this.button.getModel ().addActionListener ( new ActionListener () {
@Override
public void actionPerformed ( final ActionEvent event )
{
setEnabled ( InputScaleDetails.this.button.getModel ().isSelected () );
}
} );
return this.button;
}
示例8: createDiagram
import org.eclipse.draw2d.ActionEvent; //导入依赖的package包/类
private static void createDiagram(IFigure root, VarParser parser) {
VariableInfo sum = parser.locateVariable("sum", 24);
VariableInfo i = parser.locateVariable("i", 24);
MockArray array = new MockArray("int", "a", 1,2,3,4);
MockArrayIndex i1 = new MockArrayIndex(i.getName(), null, 1, IArrayIndexModel.Direction.FORWARD,-4);
// MockArrayIndex v = new MockArrayIndex(v, null, 0, IArrayIndexModel.Direction.FORWARD, 3); ;
array.addIndexVariable(i1);
ArrayPrimitiveFigure fig = new ArrayPrimitiveFigure(array);
fig.setSize(fig.getPreferredSize());
fig.setLocation(new Point(100, 100));
root.add(fig);
Button but = new Button("test");
but.setLocation(new Point(5, 5));
but.setSize(but.getPreferredSize());
but.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
try {
array.set(i1.getCurrentIndex(), 9);
i1.set(i1.getCurrentIndex() + 1);
i1.set(i1.getCurrentIndex() - 1);
}
catch(IndexOutOfBoundsException e) {
e.printStackTrace();
}
}
});
root.add(but);
}
示例9: createContents
import org.eclipse.draw2d.ActionEvent; //导入依赖的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;
}
示例10: actionPerformed
import org.eclipse.draw2d.ActionEvent; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent event)
{
Command deleteCommand = getCommand(new GroupRequest(REQ_DELETE));
if (deleteCommand != null)
{
CommandStack commandStack = getViewer().getEditDomain().getCommandStack();
commandStack.execute(deleteCommand);
}
}
示例11: actionPerformed
import org.eclipse.draw2d.ActionEvent; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent event)
{
Command deleteCommand = getCommand(new GroupRequest(REQ_DELETE));
if (deleteCommand != null)
{
CommandStack commandStack = getViewer().getEditDomain().getCommandStack();
commandStack.execute(deleteCommand);
}
}
示例12: actionPerformed
import org.eclipse.draw2d.ActionEvent; //导入依赖的package包/类
@Override
public void actionPerformed(final ActionEvent event)
{
final List<Chart> charts = getModel().getCharts();
final StackedchartsFactory factory = StackedchartsFactory.eINSTANCE;
final Chart chart = factory.createChart();
chart.setName("New Chart");
final AddChartCommand addChartCommand = new AddChartCommand(charts, chart);
final CommandStack commandStack = getViewer().getEditDomain()
.getCommandStack();
commandStack.execute(addChartCommand);
}
示例13: init
import org.eclipse.draw2d.ActionEvent; //导入依赖的package包/类
private void init() {
setCursor(SharedCursors.ARROW);
lws = new LightweightSystem();
lws.setControl(this);
final ArrowButton b = new ArrowButton(getArrowDirection());
b.setRolloverEnabled(true);
b.setBorder(new ButtonBorder(ButtonBorder.SCHEMES.TOOLBAR));
b.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
transferFocus = true;
if (isInState(STATE_COLLAPSED))
setState(STATE_PINNED_OPEN);
else
setState(STATE_COLLAPSED);
}
});
listeners.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
if (evt.getPropertyName().equals(PROPERTY_STATE)) {
b.setDirection(getArrowDirection());
setToolTipText(getButtonTooltipText());
} else if (evt.getPropertyName().equals(
PROPERTY_DOCK_LOCATION))
b.setDirection(getArrowDirection());
}
});
lws.setContents(b);
}
示例14: createFigure
import org.eclipse.draw2d.ActionEvent; //导入依赖的package包/类
public IFigure createFigure() {
customLabel = new DetailedLabelFigure();
Clickable button = new ToolEntryToggle(customLabel);
button.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent event) {
getPaletteViewer().setActiveTool(getToolEntry());
}
});
return button;
}
示例15: completeORMCompartmentV2Figure
import org.eclipse.draw2d.ActionEvent; //导入依赖的package包/类
/**
* This method does the complets the setup of the
* {@link ORMCompartmentV2Figure}. That means it adds the collapse image to
* the button and sets the action listener of this button. The
* {@link ActionListener} calls on notification the method buttonExpand.
* */
private ORMCompartmentV2Figure completeORMCompartmentV2Figure(
final Shape model, final boolean isEditorData, Figure fig) {
ORMCompartmentV2Figure figure = (ORMCompartmentV2Figure) fig;
Image imageCollapse = new Image(null, Activator
.imageDescriptorFromPlugin(Activator.PLUGIN_ID,
"icons/collapseArrow3.png").createImage(),
SWT.IMAGE_COPY);
figure.getBasicRec().setAntialias(SWT.ON);
figure.getButton().addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent event) {
buttonExpand(isEditorData);
}
});
((Label) figure.getButton().getChildren().get(0))
.setIcon(imageCollapse);
return figure;
}