当前位置: 首页>>代码示例>>Java>>正文


Java ActionEvent类代码示例

本文整理汇总了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;
}
 
开发者ID:kozake,项目名称:ermaster-k,代码行数:27,代码来源:ImageTest.java

示例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);
		}
	});
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:18,代码来源:ObjectFigure.java

示例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());
		}
	});		
}
 
开发者ID:DarwinSPL,项目名称:DarwinSPL,代码行数:19,代码来源:DwFeatureFigure.java

示例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);
		}
	});
}
 
开发者ID:scouter-project,项目名称:scouter,代码行数:24,代码来源:XYGraphToolbar.java

示例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;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:16,代码来源:RoundDetailsPart.java

示例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;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:16,代码来源:BooleanAlarmDetails.java

示例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;
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:16,代码来源:InputScaleDetails.java

示例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);
	}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:34,代码来源:TestFigureParser.java

示例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;
}
 
开发者ID:roundrop,项目名称:ermasterr,代码行数:28,代码来源:ImageTest.java

示例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);
  }
}
 
开发者ID:debrief,项目名称:limpet,代码行数:11,代码来源:DatasetEditPart.java

示例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);
  }

}
 
开发者ID:debrief,项目名称:limpet,代码行数:12,代码来源:ChartEditPart.java

示例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);
}
 
开发者ID:debrief,项目名称:limpet,代码行数:13,代码来源:ChartSetHeaderEditPart.java

示例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);
}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:29,代码来源:FlyoutPaletteComposite.java

示例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;
	}
 
开发者ID:ghillairet,项目名称:gef-gwt,代码行数:13,代码来源:ToolEntryEditPart.java

示例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;

}
 
开发者ID:leondart,项目名称:FRaMED,代码行数:33,代码来源:ORMCompartmentEditPart.java


注:本文中的org.eclipse.draw2d.ActionEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。