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


Java AxeBox类代码示例

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

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

示例1: layout

import org.jzy3d.plot3d.primitives.axes.AxeBox; //导入依赖的package包/类
/** Set global chart view settings to best draw this histogram. */
public void layout(Chart chart) {
    AxeBox axe = (AxeBox) chart.getView().getAxe();
    IAxeLayout axeLayout = chart.getAxeLayout();

    int ymax = getModel().computeMaxCount();
    double[] ticks = { 0, ymax / 4, ymax / 2, ymax / 2 + ymax / 4, ymax };
    int n = 5;
    
    layoutAxeLabels(axeLayout, DATE_FORMATTER.print(getCentralDateRange().min));
    layoutAxeDateAnnotations(chart, axe, n);
    layoutAxeX(axeLayout);
    layoutAxeY(axeLayout, ticks);
    layoutAxeColor(axeLayout);
    
    // LOG transform not working :/
    boolean log = false;
    if (log) {
        SpaceTransformer spaceTransformer = new SpaceTransformer(null, new SpaceTransformLog(), null);
        axe.setSpaceTransformer(spaceTransformer);
        chart.getView().setSpaceTransformer(spaceTransformer);
    }
}
 
开发者ID:jzy3d,项目名称:bigpicture,代码行数:24,代码来源:HistogramDate2d.java


示例2: getChart

import org.jzy3d.plot3d.primitives.axes.AxeBox; //导入依赖的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


示例3: adjustFontSize

import org.jzy3d.plot3d.primitives.axes.AxeBox; //导入依赖的package包/类
private static void adjustFontSize(View view, int width, int height) {
	final AxeBox axeBox = (AxeBox) view.getAxe();
	if (width >= 1200 && height >= 1200) {
		axeBox.setTextRenderer(new TextBitmapRenderer() {{
			font = GLUT.BITMAP_HELVETICA_18;
			fontHeight = 20;
		}});
	} else {
		axeBox.setTextRenderer(new TextBitmapRenderer() {{
			font = GLUT.BITMAP_HELVETICA_12;
			fontHeight = 14;
		}});
	}
}
 
开发者ID:sing-group,项目名称:la-images,代码行数:15,代码来源:ShapeExporter.java


示例4: layoutAxeDateAnnotations

import org.jzy3d.plot3d.primitives.axes.AxeBox; //导入依赖的package包/类
private void layoutAxeDateAnnotations(Chart chart, AxeBox axe, int n) {
    for (int i = 0; i < model.ranges().length; i++) {
        if (i % n != 0)
            continue;
        DateRange range = model.ranges()[i];
        String s = DATETIME_FORMATTER.print(range.min);
        AxeTextAnnotation ata = new AxeTextAnnotation(s, new Coord3d(i, 0, 0));
        axe.addAnnotation(ata);
        ata.setRenderer3d(chart.getCanvas().getRenderer());
    }
}
 
开发者ID:jzy3d,项目名称:bigpicture,代码行数:12,代码来源:HistogramDate2d.java


示例5: draw

import org.jzy3d.plot3d.primitives.axes.AxeBox; //导入依赖的package包/类
public void draw(GL gl, AxeBox axe) {
    if (resource == null) {
        resource = cellRenderer.getImage();
        resource.mount(gl);
    }
    Texture texture = resource.getTexture(gl);
    texture.bind(gl);

    // Draw
    drawTexture(gl, axe, texture, resource.getCoords());

    if (false)
        drawDebugPoint(gl);
}
 
开发者ID:jzy3d,项目名称:bigpicture,代码行数:15,代码来源:AxeTextAnnotation.java


示例6: drawTexture

import org.jzy3d.plot3d.primitives.axes.AxeBox; //导入依赖的package包/类
private void drawTexture(GL gl, AxeBox axe, Texture texture, TextureCoords coords) {
    callWithAlphaFactor(gl, filter, 1);
    before(gl);
    if (horizontal) {
        mapTextureHorizontal(gl, coords, computeTextureVertex(axe, texture, horizontal, pos));
    } else {
        mapTextureVertical(gl, coords, computeTextureVertex(axe, texture, horizontal, pos));
    }
    after(gl);
}
 
开发者ID:jzy3d,项目名称:bigpicture,代码行数:11,代码来源:AxeTextAnnotation.java


示例7: computeTextureVertex

import org.jzy3d.plot3d.primitives.axes.AxeBox; //导入依赖的package包/类
/**
 * Compute a mapping to ensure :
 * <ul>
 * <li>text cell is vertical
 * <li>text cell height is 1/6 of axis bounds
 * <li>text cell image is stretched according to texture ratio (w/h when
 * horizontal, h/w when vertical layout) and scene scaling ratio (y/x)
 * </ul>
 * 
 * TODO : should consider renderer ratio as text is stretch on window resize
 * 
 * @param axe
 * @param texture
 * @param horizontal
 * @param pos
 * @return
 */
protected Mapping computeTextureVertex(AxeBox axe, Texture texture, boolean horizontal, Coord3d pos) {
    BoundingBox3d bounds = axe.getBoxBounds();
    float yrange = bounds.getYRange().getRange();
    float worldHeight = yrange / 6;
    float worldWidth = 1;
    float textureRatio = ((float) texture.getWidth() / (float) texture.getHeight());
    float rendererRatio = Float.NaN;
    
    if(renderer3d!=null){
        rendererRatio = (float)renderer3d.getHeight() / (float)renderer3d.getWidth();
    }
    float scaleRatio = axe.getScale().y / axe.getScale().x;
    if (horizontal) {
        worldWidth = worldHeight * textureRatio * scaleRatio;
    } else {
        worldWidth = worldHeight * (1 / textureRatio) * scaleRatio;
        if(!Float.isNaN(rendererRatio))
            worldWidth*=rendererRatio;
        //System.out.println("rendererRatio : " + rendererRatio);
    }

    Mapping mapping = new Mapping();
    mapping.leftBottom = new Coord3d(pos.x, pos.y - worldHeight, pos.z);
    mapping.rightBottom = new Coord3d(pos.x + worldWidth, pos.y - worldHeight, pos.z);
    mapping.rightTop = new Coord3d(pos.x + worldWidth, pos.y, pos.z);
    mapping.leftTop = new Coord3d(pos.x, pos.y, pos.z);
    return mapping;
}
 
开发者ID:jzy3d,项目名称:bigpicture,代码行数:46,代码来源:AxeTextAnnotation.java


示例8: showOnsetAsAxeAnnotation

import org.jzy3d.plot3d.primitives.axes.AxeBox; //导入依赖的package包/类
public void showOnsetAsAxeAnnotation(AxeBox axebox) {
	for (SoundEvent e : getVoice().onsetEvents) {
		AxeXLineAnnotation onset = new AxeXLineAnnotation();
		onset.setColor(Color.YELLOW);
		onset.setWidth(0.05f);
		onset.setValue(e.timeInSec);

		axebox.getAnnotations().add(onset);
	}
}
 
开发者ID:vocobox,项目名称:vocobox,代码行数:11,代码来源:VocoboxControllerWav2SynthRead.java


示例9: showOnsetAsAxeAnnotation

import org.jzy3d.plot3d.primitives.axes.AxeBox; //导入依赖的package包/类
public void showOnsetAsAxeAnnotation(AxeBox axebox, double time) {
    AxeXLineAnnotation onset = new AxeXLineAnnotation();
    onset.setColor(Color.YELLOW);
    onset.setWidth(0.05f);
    onset.setValue((float) time);
    axebox.getAnnotations().add(onset);
}
 
开发者ID:vocobox,项目名称:vocobox,代码行数:8,代码来源:SynthMonitorCharts.java


示例10: makePitchChartTimeCursor

import org.jzy3d.plot3d.primitives.axes.AxeBox; //导入依赖的package包/类
public void makePitchChartTimeCursor() {
    AxeBox axebox = (AxeBox) pitchChart.getView().getAxe();
    pitchCursorAnnotation = new AxeXRectangleAnnotation();
    pitchCursorAnnotation.setColor(Color.GRAY);
    pitchCursorAnnotation.setWidth(0.05f);
    axebox.getAnnotations().add(pitchCursorAnnotation);
}
 
开发者ID:vocobox,项目名称:vocobox,代码行数:8,代码来源:SynthMonitorCharts.java


示例11: makePitchLatencyCursor

import org.jzy3d.plot3d.primitives.axes.AxeBox; //导入依赖的package包/类
public void makePitchLatencyCursor() {
    AxeBox axebox = (AxeBox) evaluationChart.getView().getAxe();
    pitchLatencyCursorAnnotation = new AxeCrossAnnotation();
    pitchLatencyCursorAnnotation.setColor(new Color(0, 0.5f, 0));
    pitchLatencyCursorAnnotation.setWidth(1);
    axebox.getAnnotations().add(pitchLatencyCursorAnnotation);
}
 
开发者ID:vocobox,项目名称:vocobox,代码行数:8,代码来源:SynthMonitorCharts.java


示例12: makeAmpliChartTimeCursor

import org.jzy3d.plot3d.primitives.axes.AxeBox; //导入依赖的package包/类
public void makeAmpliChartTimeCursor() {
    AxeBox axebox = (AxeBox) ampliChart.getView().getAxe();
    ampliCursorAnnotation = new AxeXLineAnnotation();
    ampliCursorAnnotation.setColor(Color.GRAY);
    ampliCursorAnnotation.setWidth(1);
    axebox.getAnnotations().add(ampliCursorAnnotation);
}
 
开发者ID:vocobox,项目名称:vocobox,代码行数:8,代码来源:SynthMonitorCharts.java


示例13: showOnsets

import org.jzy3d.plot3d.primitives.axes.AxeBox; //导入依赖的package包/类
public void showOnsets() {
	SynthMonitorCharts monit = (SynthMonitorCharts) monitor;
	// AxeBox axebox = (AxeBox) monit.ampliChart.getView().getAxe();
	showOnsetAsAxeAnnotation((AxeBox) monit.pitchChart.getView().getAxe());
	showOnsetAsAxeAnnotation((AxeBox) monit.ampliChart.getView().getAxe());
}
 
开发者ID:vocobox,项目名称:vocobox,代码行数:7,代码来源:VocoboxControllerWav2SynthRead.java


示例14: onsetOccuredAt

import org.jzy3d.plot3d.primitives.axes.AxeBox; //导入依赖的package包/类
@Override
public void onsetOccuredAt(double time, float salience) {
    showOnsetAsAxeAnnotation((AxeBox) pitchChart.getView().getAxe(), time);
}
 
开发者ID:vocobox,项目名称:vocobox,代码行数:5,代码来源:SynthMonitorCharts.java


示例15: makeSpectro3dPanel

import org.jzy3d.plot3d.primitives.axes.AxeBox; //导入依赖的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



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