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


Java AxisEntity类代码示例

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


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

示例1: getOrientation

import org.jfree.chart.entity.AxisEntity; //导入依赖的package包/类
/**
 * use default orientation or orientation of axis
 * 
 * @param event
 * @return
 */
public Orientation getOrientation(ChartGestureEvent event) {
  ChartEntity ce = event.getEntity();
  if (ce instanceof AxisEntity) {
    JFreeChart chart = event.getChartPanel().getChart();
    PlotOrientation orient = PlotOrientation.HORIZONTAL;
    if (chart.getXYPlot() != null)
      orient = chart.getXYPlot().getOrientation();
    else if (chart.getCategoryPlot() != null)
      orient = chart.getCategoryPlot().getOrientation();

    Entity entity = event.getGesture().getEntity();
    if ((entity.equals(Entity.DOMAIN_AXIS) && orient.equals(PlotOrientation.VERTICAL))
        || (entity.equals(Entity.RANGE_AXIS) && orient.equals(PlotOrientation.HORIZONTAL)))
      return Orientation.HORIZONTAL;
    else
      return Orientation.VERTICAL;
  }
  return orient;
}
 
开发者ID:mzmine,项目名称:mzmine2,代码行数:26,代码来源:ChartGestureDragDiffHandler.java

示例2: createAndAddEntity

import org.jfree.chart.entity.AxisEntity; //导入依赖的package包/类
/**
 * Created an entity for the axis.
 *
 * @param cursor  the initial cursor value.
 * @param state  the axis state after completion of the drawing with a
 *     possibly updated cursor position.
 * @param dataArea  the data area.
 * @param edge  the edge.
 * @param plotState  the PlotRenderingInfo from which a reference to the
 *     entity collection can be obtained.
 *
 * @since 1.0.13
 */
protected void createAndAddEntity(double cursor, AxisState state,
        Rectangle2D dataArea, RectangleEdge edge,
        PlotRenderingInfo plotState) {

    if (plotState == null || plotState.getOwner() == null) {
        return;  // no need to create entity if we can't save it anyways...
    }
    Rectangle2D hotspot = null;
    if (edge.equals(RectangleEdge.TOP)) {
        hotspot = new Rectangle2D.Double(dataArea.getX(),
                state.getCursor(), dataArea.getWidth(),
                cursor - state.getCursor());
    }
    else if (edge.equals(RectangleEdge.BOTTOM)) {
        hotspot = new Rectangle2D.Double(dataArea.getX(), cursor,
                dataArea.getWidth(), state.getCursor() - cursor);
    }
    else if (edge.equals(RectangleEdge.LEFT)) {
        hotspot = new Rectangle2D.Double(state.getCursor(),
                dataArea.getY(), cursor - state.getCursor(),
                dataArea.getHeight());
    }
    else if (edge.equals(RectangleEdge.RIGHT)) {
        hotspot = new Rectangle2D.Double(cursor, dataArea.getY(),
                state.getCursor() - cursor, dataArea.getHeight());
    }
    EntityCollection e = plotState.getOwner().getEntityCollection();
    if (e != null) {
        e.add(new AxisEntity(hotspot, this));
    }
}
 
开发者ID:mdzio,项目名称:ccu-historian,代码行数:45,代码来源:Axis.java

示例3: getAxis

import org.jfree.chart.entity.AxisEntity; //导入依赖的package包/类
/**
 * The ValueAxis of this event's entity or null if the entity is different to an AxisEntity or if
 * the axis is not a ValueAxis
 * 
 * @return
 */
public ValueAxis getAxis() {
  if (entity != null && entity instanceof AxisEntity
      && ((AxisEntity) entity).getAxis() instanceof ValueAxis)
    return (ValueAxis) ((AxisEntity) entity).getAxis();
  else
    return null;
}
 
开发者ID:mzmine,项目名称:mzmine2,代码行数:14,代码来源:ChartGestureEvent.java

示例4: getGestureEntity

import org.jfree.chart.entity.AxisEntity; //导入依赖的package包/类
/**
 * The gesture entity type
 * 
 * @param entity
 * @return
 */
public static Entity getGestureEntity(ChartEntity entity) {
  if (entity == null)
    return NONE;
  if (entity instanceof PlotEntity)
    return PLOT;
  if (entity instanceof AxisEntity) {
    AxisEntity e = (AxisEntity) entity;
    if (e.getAxis().getPlot() instanceof XYPlot) {
      XYPlot plot = ((XYPlot) e.getAxis().getPlot());
      for (int i = 0; i < plot.getDomainAxisCount(); i++)
        if (plot.getDomainAxis(i).equals(e.getAxis()))
          return DOMAIN_AXIS;
      for (int i = 0; i < plot.getRangeAxisCount(); i++)
        if (plot.getRangeAxis(i).equals(e.getAxis()))
          return RANGE_AXIS;
    }
    // else return basic axis
    return AXIS;
  }
  if (entity instanceof LegendItemEntity)
    return LEGEND_ITEM;
  if (entity instanceof XYItemEntity)
    return XY_ITEM;
  if (entity instanceof XYAnnotationEntity)
    return XY_ANNOTATION;
  if (entity instanceof TitleEntity) {
    if (((TitleEntity) entity).getTitle() instanceof TextTitle)
      return TEXT_TITLE;
    else
      return NON_TEXT_TITLE;
  }
  if (entity instanceof JFreeChartEntity)
    return JFREECHART;
  if (entity instanceof CategoryItemEntity)
    return CATEGORY_ITEM;
  return GENERAL;
}
 
开发者ID:mzmine,项目名称:mzmine2,代码行数:44,代码来源:ChartGesture.java

示例5: createAndAddEntity

import org.jfree.chart.entity.AxisEntity; //导入依赖的package包/类
/**
    * Created an entity for the axis.
    *
    * @param cursor  the initial cursor value.
    * @param state  the axis state after completion of the drawing with a
    *     possibly updated cursor position.
    * @param dataArea  the data area.
    * @param edge  the edge.
    * @param plotState  the PlotRenderingInfo from which a reference to the
    *     entity collection can be obtained.
    *
    * @since 1.0.13
    */
protected void createAndAddEntity(double cursor, AxisState state,
           Rectangle2D dataArea, RectangleEdge edge,
           PlotRenderingInfo plotState){

	if (plotState == null || plotState.getOwner() == null) {
           return;  // no need to create entity if we can´t save it anyways...
       }
	Rectangle2D hotspot = null;
	if (edge.equals(RectangleEdge.TOP)){
		hotspot = new Rectangle2D.Double(dataArea.getX(),
                   state.getCursor(), dataArea.getWidth(),
                   cursor - state.getCursor());
	}
	else if(edge.equals(RectangleEdge.BOTTOM)) {
		hotspot = new Rectangle2D.Double(dataArea.getX(), cursor,
                   dataArea.getWidth(), state.getCursor() - cursor);
	}
	else if(edge.equals(RectangleEdge.LEFT)) {
		hotspot = new Rectangle2D.Double(state.getCursor(),
                   dataArea.getY(), cursor - state.getCursor(),
                   dataArea.getHeight());
	}
	else if(edge.equals(RectangleEdge.RIGHT)){
		hotspot = new Rectangle2D.Double(cursor, dataArea.getY(),
                   state.getCursor() - cursor, dataArea.getHeight());
	}
	EntityCollection e = plotState.getOwner().getEntityCollection();
	if (e != null) {
           e.add(new AxisEntity(hotspot, this));
       }
}
 
开发者ID:lulab,项目名称:PI,代码行数:45,代码来源:Axis.java

示例6: createAndAddEntity

import org.jfree.chart.entity.AxisEntity; //导入依赖的package包/类
/**
 * Created an entity for the axis.
 *
 * @param cursor  the initial cursor value.
 * @param state  the axis state after completion of the drawing with a
 *     possibly updated cursor position.
 * @param dataArea  the data area.
 * @param edge  the edge.
 * @param plotState  the PlotRenderingInfo from which a reference to the
 *     entity collection can be obtained.
 *
 * @since 1.0.13
 */
protected void createAndAddEntity(double cursor, AxisState state,
        Rectangle2D dataArea, RectangleEdge edge,
        PlotRenderingInfo plotState) {

    if (plotState == null || plotState.getOwner() == null) {
        return;  // no need to create entity if we can´t save it anyways...
    }
    Rectangle2D hotspot = null;
    if (edge.equals(RectangleEdge.TOP)) {
        hotspot = new Rectangle2D.Double(dataArea.getX(),
                state.getCursor(), dataArea.getWidth(),
                cursor - state.getCursor());
    }
    else if (edge.equals(RectangleEdge.BOTTOM)) {
        hotspot = new Rectangle2D.Double(dataArea.getX(), cursor,
                dataArea.getWidth(), state.getCursor() - cursor);
    }
    else if (edge.equals(RectangleEdge.LEFT)) {
        hotspot = new Rectangle2D.Double(state.getCursor(),
                dataArea.getY(), cursor - state.getCursor(),
                dataArea.getHeight());
    }
    else if (edge.equals(RectangleEdge.RIGHT)) {
        hotspot = new Rectangle2D.Double(cursor, dataArea.getY(),
                state.getCursor() - cursor, dataArea.getHeight());
    }
    EntityCollection e = plotState.getOwner().getEntityCollection();
    if (e != null) {
        e.add(new AxisEntity(hotspot, this));
    }
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:45,代码来源:Axis.java


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