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


Java ActionListener类代码示例

本文整理汇总了Java中org.eclipse.draw2d.ActionListener的典型用法代码示例。如果您正苦于以下问题:Java ActionListener类的具体用法?Java ActionListener怎么用?Java ActionListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ActionListener类属于org.eclipse.draw2d包,在下文中一共展示了ActionListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ChartFigure

import org.eclipse.draw2d.ActionListener; //导入依赖的package包/类
public ChartFigure(final Chart chart, final ActionListener deleteListener)
{
  setPreferredSize(-1, 200);
  setBackgroundColor(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
  setOutline(false);
  BorderLayout topLayout = new BorderLayout();
  setLayoutManager(topLayout);
  titleFigure = new DirectionalShape();

  chartNameLabel = new DirectionalIconLabel(StackedchartsImages.getImage(
      StackedchartsImages.DESC_CHART));
  titleFigure.add(chartNameLabel);
  final Button button = new Button(StackedchartsImages.getImage(
      StackedchartsImages.DESC_DELETE));
  button.setToolTip(new Label("Remove this chart from the chart set"));
  button.addActionListener(deleteListener);
  titleFigure.add(button);

  add(titleFigure);

  chartFigure = new JFreeChartFigure(chart);
  add(chartFigure, BorderLayout.CENTER);

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

示例2: createContents

import org.eclipse.draw2d.ActionListener; //导入依赖的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

示例3: MethodWidget

import org.eclipse.draw2d.ActionListener; //导入依赖的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

示例4: createExpandButton

import org.eclipse.draw2d.ActionListener; //导入依赖的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

示例5: addSnapshotButton

import org.eclipse.draw2d.ActionListener; //导入依赖的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

示例6: ChartsetFigure

import org.eclipse.draw2d.ActionListener; //导入依赖的package包/类
public ChartsetFigure(ActionListener addChartHandler)
{
  add(new Label(StackedchartsImages.getImage(
      StackedchartsImages.DESC_CHARTSET)));
  chartsetHeader = new DirectionalLabel(Activator.FONT_12);
  chartsetHeader.setText("Chart Set");
  chartsetHeader.setTextAlignment(PositionConstants.TOP);
  add(chartsetHeader);

  Button button = new Button(StackedchartsImages.getImage(
      StackedchartsImages.DESC_ADD));
  button.setToolTip(new Label("Add new chart"));
  button.addActionListener(addChartHandler);
  add(button);

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

示例7: makeHeader

import org.eclipse.draw2d.ActionListener; //导入依赖的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

示例8: makeHeader

import org.eclipse.draw2d.ActionListener; //导入依赖的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

示例9: makeHeader

import org.eclipse.draw2d.ActionListener; //导入依赖的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

示例10: createDiagram

import org.eclipse.draw2d.ActionListener; //导入依赖的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

示例11: createContents

import org.eclipse.draw2d.ActionListener; //导入依赖的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

示例12: init

import org.eclipse.draw2d.ActionListener; //导入依赖的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

示例13: createFigure

import org.eclipse.draw2d.ActionListener; //导入依赖的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

示例14: completeORMCompartmentV2Figure

import org.eclipse.draw2d.ActionListener; //导入依赖的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

示例15: createDiagram

import org.eclipse.draw2d.ActionListener; //导入依赖的package包/类
private static void createDiagram(IFigure root) {
	// Array com iteradores
	MockArray array = new MockArray("Integer", 1,2,3,4,5);
	//		MockVariable var = new MockVariable("int[]", "v", null, array);
	MockReference ref = new MockReference("int[]", "v", array, false);
	
	MockValue i1 = new MockValue("int", "i1", null, 0, false);
	MockArrayIndex ii1 = new MockArrayIndex(i1, ref, Direction.NONE);
	MockValue i2 = new MockValue("int", "i2", null, 1, false);
	MockArrayIndex ii2 = new MockArrayIndex(i2, ref, Direction.FORWARD);
	MockValue i3 = new MockValue("int", "i3", null, 5, false);
	MockArrayIndex ii3 = new MockArrayIndex(i3, ref, Direction.FORWARD, new MyBound(-1, BoundType.OPEN, "-1"));

	//		array.addIndexVariable(ii1);
	//		array.addIndexVariable(ii2);
	//		array.addIndexVariable(ii3);

	List<IArrayIndexModel> vars = new ArrayList<>();
	vars.add(ii1);
	vars.add(ii2);

	ArrayReferenceFigure fig = new ArrayReferenceFigure(array);
	fig.setLocation(new Point(100, 100));

	root.add(fig);



	//		IllustrationBorder b = new IllustrationBorder(vars, fig);
	//		MarginBorder b = new MarginBorder(15);
	//		fig.setBorder(b);



	// Array com lenght maior que o tamanho maximo da figura
	MockArray array2 = new MockArray("int", 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25);
	ArrayPrimitiveFigure fig2 = new ArrayPrimitiveFigure(array2);
	fig2.setLocation(new Point(250, 300));
	root.add(fig2);

	// Array vazia
	MockArray array3 = new MockArray("int");
	ArrayPrimitiveFigure fig3 = new ArrayPrimitiveFigure(array3);
	fig3.setLocation(new Point(400, 200));
	root.add(fig3);

	Connection c = new PolylineConnection();
	ChopboxAnchor a = new ChopboxAnchor(fig);
	ChopboxAnchor b = new ChopboxAnchor(fig2);
	c.setSourceAnchor(a);
	c.setTargetAnchor(b);

	root.add(c);

	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) {
			i1.set(ii1.getCurrentIndex()+1);
			try {
				if(ii3.getBound().getValue() != ii3.getCurrentIndex()) {
					i3.set(ii3.getCurrentIndex() - 1);
				}
				array.set(ii3.getCurrentIndex(), 9);
			}
			catch(IndexOutOfBoundsException e) {
				e.printStackTrace();
			}
			fig.repaint();
		}
	});
	root.add(but);
}
 
开发者ID:andre-santos-pt,项目名称:pandionj,代码行数:76,代码来源:TestFigure.java


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