• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AWTChartComponentFactory类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: init

import org.jzy3d.chart.factories.AWTChartComponentFactory; //导入依赖的package包/类
@Override
public void init() throws UnsupportedAudioFileException, IOException {
    File file = new File("data/sound/doremi.wav");
    Clip clip = Clip.newInstance(file);

    SpectrumModelSpectro spectrum = new SpectrumModelSpectro(clip);
    
    // Create a drawable clip
    int maxFreqId = 50;
    SpectrumSurface surface = new SpectrumSurface(spectrum, maxFreqId);
    surface.setFaceDisplayed(true);
    surface.setWireframeDisplayed(false);

    // Create a chart with time and frequency axes
    chart = AWTChartComponentFactory.chart(Quality.Advanced, getCanvasType());
    chart.getScene().getGraph().add(surface);
    make3d(chart);
}
 
开发者ID:vocobox,项目名称:vocobox,代码行数:19,代码来源:Spectro3dTrial.java


示例2: init

import org.jzy3d.chart.factories.AWTChartComponentFactory; //导入依赖的package包/类
@Override
public void init() throws UnsupportedAudioFileException, IOException {
    File file = new File("data/sound/piano.wav");
    Clip clip = Clip.newInstance(file);
    SpectrumModelSpectro spectrum = new SpectrumModelSpectro(clip);
    
    // --------------------
    JsynOscilloSpectroHarpSynth synth = new JsynOscilloSpectroHarpSynth(spectrum, 4000);

    // --------------------
    // Create a drawable clip
    int maxFreqId = 50;
    SpectrumSurface surface = new SpectrumSurface(spectrum, maxFreqId);
    surface.setFaceDisplayed(true);
    surface.setWireframeDisplayed(false);

    // Create a chart with time and frequency axes
    chart = AWTChartComponentFactory.chart(Quality.Advanced, getCanvasType());
    chart.getScene().getGraph().add(surface);
    make3d(chart);
    
    synth.play();
}
 
开发者ID:vocobox,项目名称:vocobox,代码行数:24,代码来源:OscilloSpectroHarpTrial.java


示例3: ColormapPlotPanel

import org.jzy3d.chart.factories.AWTChartComponentFactory; //导入依赖的package包/类
public ColormapPlotPanel()
{
    super(new GridLayout(1, 1));

    chart = AWTChartComponentFactory.chart(Quality.Nicest, "awt");
    graph = chart.getScene().getGraph();
    chart.getView().setViewPoint(new Coord3d(Math.toRadians(300), Math.toRadians(22.5), 0));
    float delta = 0.0f;
    setBounds(
        -delta, 1.0f + delta,
        -delta, 1.0f + delta,
        -delta, 1.0f + delta);
    chart.addMouseController();
    add((Component) chart.getCanvas());
    setCoordinateConverter(CoordinateConverters.createRgb());
}
 
开发者ID:igd-iva,项目名称:colormap-explorer,代码行数:17,代码来源:ColormapPlotPanel.java


示例4: getChart

import org.jzy3d.chart.factories.AWTChartComponentFactory; //导入依赖的package包/类
private synchronized Chart getChart() {
	if(chart == null) {
		surface = surfaceAdapter.generateSurface(getInterpolation().getLevel(),
			getColorMap(), getNormalizedColorMapRange(), 
			d -> d* getScale());
		if (is3DEnabled()) {
			chart = AWTChartComponentFactory.chart(QUALITY, "newt");
		} else {
			chart = Chart2dComponentFactory.chart(QUALITY, "newt");
		}
		chart.getScene().getGraph().add(surface);
		chart.getView().setSquared(false);
		chart.setAxeDisplayed(isShowAxes());
		chart.getAxeLayout().setTickLineDisplayed(isShowTickLines());
		chart.getAxeLayout().setXTickRenderer(TICK_RENDERER);
		chart.getAxeLayout().setYTickRenderer(TICK_RENDERER);
		chart.getAxeLayout().setZTickRenderer(this::formatZTick);
		chart.getView().addViewPointChangedListener(viewPointChangedListener);
		AxeBox a = (AxeBox) chart.getView().getAxe();
		a.setTextRenderer(new TextBitmapRenderer() {{
				font = GLUT.BITMAP_HELVETICA_12;
				fontHeight = 14;
		}});
		setColorBarLegend();
		_updateViewMode();
		chart.pauseAnimator();
	}
	return chart;
}
 
开发者ID:sing-group,项目名称:la-images,代码行数:30,代码来源:ElementDataView.java


示例5: main

import org.jzy3d.chart.factories.AWTChartComponentFactory; //导入依赖的package包/类
public static void main(String[] args) throws UnsupportedAudioFileException, IOException {
    VocoParseFileAndFFT voice = new VocoParseFileAndFFT(new File("data/sound/piano.wav"));
    Chart chart = AWTChartComponentFactory.chart();
    SpectrumSurface d = new SpectrumSurface(new SpectrumModelSpectro(voice.getAnalysis()));
    chart.addDrawable(d);
    ChartLauncher.openChart(chart);
}
 
开发者ID:vocobox,项目名称:vocobox,代码行数:8,代码来源:VocoParseFFT3dTrial.java


示例6: makeChart

import org.jzy3d.chart.factories.AWTChartComponentFactory; //导入依赖的package包/类
public void makeChart(Note note) {
    if (chart == null) {
        chart = AWTChartComponentFactory.chart(Quality.Intermediate, Toolkit.awt);// toolkit.newt behave differently, "offscreen,100,100"
        chart.getScene().getGraph().add(spectrogram);
        axeLabels(chart);
        make2d(chart);
    }
}
 
开发者ID:vocobox,项目名称:vocobox,代码行数:9,代码来源:NoteClipFFTChart.java


示例7: init

import org.jzy3d.chart.factories.AWTChartComponentFactory; //导入依赖的package包/类
public void init() {
	int size = 500000;
	float x;
	float y;
	float z;
	float a;

	Coord3d[] points = new Coord3d[size];
	Color[] colors = new Color[size];

	Random r = new Random();
	r.setSeed(0);

	for (int i = 0; i < size; i++) {
		x = r.nextFloat() - 0.5f;
		y = r.nextFloat() - 0.5f;
		z = r.nextFloat() - 0.5f;
		points[i] = new Coord3d(x, y, z);
		a = 0.25f;
		colors[i] = new Color(x, y, z, a);
	}

	Scatter scatter = new Scatter(points, colors);
	// scatter = new Scatter(points, colors, 5);
	chart = AWTChartComponentFactory.chart(Quality.Advanced, "newt");
	chart.getScene().add(scatter);
}
 
开发者ID:gsi-upm,项目名称:BARMAS,代码行数:28,代码来源:ScatterDemoTest.java


示例8: main

import org.jzy3d.chart.factories.AWTChartComponentFactory; //导入依赖的package包/类
public static void main(String[] args) {

		AWTChartComponentFactory factory = new AWTChartComponentFactory();
		Chart chart = new Chart(factory, Quality.Nicest, SurfaceDemoTest.DEFAULT_CANVAS_TYPE,
				Settings.getInstance().getGLCapabilities());

		Cylinder cylinder = new Cylinder();
		cylinder.setData(new Coord3d(0, 0, 0), 5, 1, 20, 0, new Color(1, 1, 1, 0.75f));

		cylinder.setFaceDisplayed(true);
		// cylinder.setWireframeDisplayed(true);
		cylinder.setColorMapper(new ColorMapper(new ColorMapRainbow(), cylinder.getBounds()
				.getZmin(), cylinder.getBounds().getZmax(), new Color(1, 1, 1, 0.75f)));

		chart.getScene().getGraph().add(cylinder);

		cylinder = new Cylinder();
		cylinder.setData(new Coord3d(-10, -10, -10), 10, 3, 20, 0, new Color(-10, -10, -10, 0.75f));

		cylinder.setFaceDisplayed(true);
		cylinder.setWireframeDisplayed(true);
		cylinder.setColorMapper(new ColorMapper(new ColorMapRainbow(), cylinder.getBounds()
				.getZmin(), cylinder.getBounds().getZmax(), new Color(10, 10, 10, 0.75f)));

		chart.getScene().getGraph().add(cylinder);

		ChartLauncher.openChart(chart);
	}
 
开发者ID:gsi-upm,项目名称:BARMAS,代码行数:29,代码来源:CylinderDemoTest.java


示例9: makeSpectro3dPanel

import org.jzy3d.chart.factories.AWTChartComponentFactory; //导入依赖的package包/类
public void makeSpectro3dPanel(final Clip clip) {
       // Create a drawable clip
       int maxFreqId = 50;
       SpectrumSurface surface = new SpectrumSurface(new SpectrumModelSpectro(clip), maxFreqId);
       surface.setFaceDisplayed(true);
       surface.setWireframeDisplayed(false);

       // Create a chart with time and frequency axes
       spectroChart3d = AWTChartComponentFactory.chart(Quality.Advanced, toolkit);
       spectroChart3d.getScene().getGraph().add(surface);
       
       // audio cursor on player
       final AxeXLineAnnotation ann = new AxeXLineAnnotation();
       final AxeBox axe = (AxeBox)spectroChart3d.getView().getAxe();
       axe.getAnnotations().add(ann);

       
       /*
         frame time samples:1024 frame count:2713 counter:0 playback pos:0
frame time samples:1024 frame count:2713 counter:768 playback pos:768
frame time samples:1024 frame count:2713 counter:768 playback pos:768
frame time samples:1024 frame count:2713 counter:768 playback pos:768
frame time samples:1024 frame count:2713 counter:768 playback pos:768
frame time samples:1024 frame count:2713 counter:768 playback pos:768
frame time samples:1024 frame count:2713 counter:1536 playback pos:1536
frame time samples:1024 frame count:2713 counter:1536 playback pos:1536
frame time samples:1024 frame count:2713 counter:1536 playback pos:1536
frame time samples:1024 frame count:2713 counter:1536 playback pos:1536
frame time samples:1024 frame count:2713 counter:2304 playback pos:2304
frame time samples:1024 frame count:2713 counter:2304 playback pos:2304 * 116
frame time samples:1024 frame count:2713 counter:2304 playback pos:2304
frame time samples:1024 frame count:2713 counter:3072 playback pos:3072

jusqu'à 2.780.158 / 1024 = 2714 = frame ID!!
31s
        */
       playerThread.addPlaybackPositionListener(new PlaybackPositionListener() {
           @Override
           public void playbackPositionUpdate(PlaybackPositionEvent e) {
               
               long p = e.getSamplePos();
               //float x = p/44100.0f;
               ann.setValue(p);
               
               
               float frameId = p / playerThread.getClip().getFrameTimeSamples();
               float x = (frameId/clip.getFrameCount()) * axe.getBoxBounds().getXRange().getRange() + axe.getBoxBounds().getXmin();
               //System.out.println(x);
               
               ann.setValue(frameId);
               
               //System.err.println(" frame time samples:" + clip.getFrameTimeSamples() + " frame count:" + clip.getFrameCount() +  " counter:"+p+" playback pos:"+e.getSource().getPlaybackPosition());
               //27130
               
               //if(p>3000)
               //System.exit(0);
               //System.out.println(p);
           }
       });
       
       
       //playerThread.get
       
       // styling
       Palette.apply(spectroChart3d);
       make2d(spectroChart3d);
       IAxeLayout layout = spectroChart3d.getAxeLayout();
       layout.setXTickLabelDisplayed(false);
       layout.setYTickLabelDisplayed(false);
       
       // Embed in jpanel
       spectroPanelAWT();
   }
 
开发者ID:vocobox,项目名称:vocobox,代码行数:74,代码来源:AudioSourceChart.java


示例10: Plotter

import org.jzy3d.chart.factories.AWTChartComponentFactory; //导入依赖的package包/类
public Plotter(Logger logger) {
	this.logger = logger;
	this.factory = new AWTChartComponentFactory();
	Settings.getInstance().setHardwareAccelerated(true);
}
 
开发者ID:gsi-upm,项目名称:BARMAS,代码行数:6,代码来源:Plotter.java


示例11: create2DChart

import org.jzy3d.chart.factories.AWTChartComponentFactory; //导入依赖的package包/类
private Chart create2DChart() {
	final Chart chart2d = AWTChartComponentFactory.chart(Quality.Nicest, "awt");
	chart2d.stopAnimator();
	
	final View view = chart2d.getView();
	view.getCamera().setViewportMode(ViewportMode.STRETCH_TO_FILL);
	chart2d.setViewMode(ViewPositionMode.TOP);
	// Initialize viewpoint
	chart2d.setViewPoint(new Coord3d(5,5,0));

	((CanvasAWT)chart2d.getCanvas()).addMouseWheelListener(new MouseWheelListener() {
		@Override
		public void mouseWheelMoved(MouseWheelEvent e) {
			final float factor = 1 + (e.getWheelRotation()/10.0f);
			final BoundingBox3d curScale = view.getBounds();

			final Coord3d center = curScale.getCenter();
			final double xMin = center.x + (curScale.getXmin()-center.x) * factor;
			final double xMax = center.x + (curScale.getXmax()-center.x) * factor;
			final double yMin = center.y + (curScale.getYmin()-center.y) * factor;
			final double yMax = center.y + (curScale.getYmax()-center.y) * factor;

			Scale xScale = null;
			if(xMin<xMax) {
				xScale = new Scale(xMin, xMax);
			}

			Scale yScale = null;
			if(yMin<yMax) {
				yScale = new Scale(yMin, yMax);
			}

			// Check scale limits
			if(canScaleAxis(xScale, factor, curScale.getXmax(), curScale.getXmin(), xMax, xMin)) {
				curScale.setXmin((float)xScale.getMin());
				curScale.setXmax((float)xScale.getMax());
			}

			// Check scale limits
			if(canScaleAxis(yScale, factor, curScale.getYmax(), curScale.getYmin(), yMax, yMin)) {
				curScale.setYmin((float)yScale.getMin());
				curScale.setYmax((float)yScale.getMax());
			}

			view.setBoundManual(curScale);
			chart2d.getCanvas().forceRepaint();
		}
	});

	return chart2d;
}
 
开发者ID:smaccm,项目名称:smaccm,代码行数:52,代码来源:ChartHelper.java


示例12: createChart

import org.jzy3d.chart.factories.AWTChartComponentFactory; //导入依赖的package包/类
private void createChart() {
		if (chartCreated.compareAndSet(false, true)) {
			System.out.println("Creating chart!");
			Runnable worker = new Runnable() {

				@Override
				public void run() {
					ProgressHandle ph = ProgressHandleFactory.createHandle("Opening Jzy3D View!");
					ph.start();
					ph.switchToIndeterminate();
					try {
						AWTChartComponentFactory accf = new AWTChartComponentFactory();
						final Chart chart = accf.newChart(Quality.Advanced, Toolkit.newt.name());
						chart.getView().setMaximized(true);
						canvas = (CanvasNewtAwt) chart.getCanvas();
						final CameraThreadController ctc = new CameraThreadController(chart);
						//signature change in latest upstream jogl causes java.lang.NoSuchMethodError: com.jogamp.newt.event.MouseEvent.getClickCount()I
//						NewtCameraMouseController camMouse = new NewtCameraMouseController(chart);
						WorkaroundNewtCameraMouseController camMouse = new WorkaroundNewtCameraMouseController(chart);
						// Create a surface drawing that function
						// Define a function to plot
						Mapper mapper = new Mapper() {
							public double f(double x, double y) {
								return 10 * Math.sin(x / 10) * Math.cos(y / 20) * x;
							}
						};
						// Define range and precision for the function to plot
						Range range = new Range(-150, 150);
						int steps = 50;
						Shape surface = Builder.buildOrthonormal(new OrthonormalGrid(range, steps, range, steps), mapper);
						surface.setColorMapper(new ColorMapper(new ColorMapRainbow(), surface.getBounds().getZmin(), surface.getBounds().getZmax(), new Color(1, 1, 1, .5f)));
						surface.setFaceDisplayed(true);
						surface.setWireframeDisplayed(false);
						surface.setWireframeColor(Color.BLACK);
						chart.getScene().getGraph().add(surface, true);
						SwingUtilities.invokeLater(new Runnable() {

							@Override
							public void run() {
								setChart(chart);
								canvas.setMinimumSize(getMinimumSize());
								canvas.setMaximumSize(getMaximumSize());
								canvas.setPreferredSize(getPreferredSize());
								add(canvas, BorderLayout.CENTER);
								setCameraThreadController(ctc);
								if (toggleAnimation.isSelected()) {
									ctc.start();
								}
								//need to update complete component tree
								invalidate();
								getTopLevelAncestor().invalidate();
								getTopLevelAncestor().revalidate();
							}
						});
					} finally {
						ph.finish();
					}
				}

			};
			Task t = RequestProcessor.getDefault().post(worker);
			t.addTaskListener(new TaskListener() {

				@Override
				public void taskFinished(Task task) {
					if (task.isFinished()) {
						requestAttention(true);
					}
				}
			});
		} else {
			System.out.println("Chart already created!");
		}
	}
 
开发者ID:nilshoffmann,项目名称:netbeans-jogl2,代码行数:75,代码来源:Jzy3DDemoTopComponent.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Minus类代码示例发布时间:2022-05-23
下一篇:
Java BoundedRangeStatistic类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap