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


Java Chart2D.Y属性代码示例

本文整理汇总了Java中info.monitorenter.gui.chart.Chart2D.Y属性的典型用法代码示例。如果您正苦于以下问题:Java Chart2D.Y属性的具体用法?Java Chart2D.Y怎么用?Java Chart2D.Y使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在info.monitorenter.gui.chart.Chart2D的用法示例。


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

示例1: propertyChangeSynced

/**
 * @see info.monitorenter.gui.chart.axis.AAxis.APropertyChangeReactorSynced#propertyChangeSynced(java.beans.PropertyChangeEvent,
 *      info.monitorenter.gui.chart.axis.AAxis)
 */
@Override
protected boolean propertyChangeSynced(final PropertyChangeEvent changeEvent,
    final AAxis<?> receiver) {
  boolean result = false;
  if (Chart2D.DEBUG_SCALING) {
    System.out.println("pc-Ymax");
  }
  // only care if axis works in y dimension:
  if (receiver.getAccessor().getDimension() == Chart2D.Y) {
    final double value = ((Double) changeEvent.getNewValue()).doubleValue();
    if (value > receiver.m_max) {
      final ITrace2D trace = (ITrace2D) changeEvent.getSource();
      if (trace.isVisible()) {
        receiver.m_max = value;
        receiver.m_needsFullRescale = true;
        result = true;
      }
    } else if (value < receiver.m_max) {
      receiver.m_max = receiver.findMax();
      receiver.m_needsFullRescale = true;
      result = true;
    }
  }
  return result;
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:29,代码来源:AAxis.java

示例2: scalePoint

/**
 * Internally rescales the given <code>{@link ITracePoint2D}</code> in the
 * dimension this axis works in.
 * <p>
 * 
 * @param point
 *          the point to scale (between 0.0 and 1.0) according to the internal
 *          bounds.
 */
protected final void scalePoint(final ITracePoint2D point) {
  final int axis = this.getAccessor().getDimension();
  if (axis == Chart2D.X) {
    point.setScaledX(this.getScaledValue(point.getX()));

  } else if (axis == Chart2D.Y) {
    point.setScaledY(this.getScaledValue(point.getY()));

  }
  if (Chart2D.DEBUG_SCALING) {
    // This is ok for fixed viewports that zoom!
    if ((point.getScaledX() > 1.0) || (point.getScaledX() < 0.0) || (point.getScaledY() > 1.0)
        || (point.getScaledY() < 0.0)) {
      System.out.println("Scaled Point " + point + " to [" + point.getScaledX() + ","
          + point.getScaledY() + "]");
    }
  }
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:27,代码来源:AAxis.java

示例3: createAccessor

/**
 * @see info.monitorenter.gui.chart.axis.AAxis#createAccessor(info.monitorenter.gui.chart.Chart2D,
 *      int, int)
 */
@Override
protected AChart2DDataAccessor createAccessor(final Chart2D chart, final int dimension,
    final int position) {
  AChart2DDataAccessor result;
  if (dimension == Chart2D.X) {
    // Don't allow a combination of dimension and position that is not usable:
    if ((position & (Chart2D.CHART_POSITION_BOTTOM | Chart2D.CHART_POSITION_TOP)) == 0) {
      throw new IllegalArgumentException("X axis only valid with top or bottom position.");
    }
    this.setAxisPosition(position);
    result = new XDataAccessor(chart);
  } else if (dimension == Chart2D.Y) {
    // Don't allow a combination of dimension and position that is not usable:
    if ((position & (Chart2D.CHART_POSITION_LEFT | Chart2D.CHART_POSITION_RIGHT)) == 0) {
      throw new IllegalArgumentException("Y axis only valid with left or right position.");
    }
    this.setAxisPosition(position);
    result = new YDataAccessor(chart);
  } else {
    throw new IllegalArgumentException("Dimension has to be Chart2D.X or Chart2D.Y!");
  }
  return result;
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:27,代码来源:AxisLinear.java

示例4: createAccessor

/**
 * @see info.monitorenter.gui.chart.axis.AAxis#createAccessor(info.monitorenter.gui.chart.Chart2D,
 *      int, int)
 */
@Override
protected AAxis<T>.AChart2DDataAccessor createAccessor(final Chart2D chart, final int dimension,
    final int position) {
  AAxis<T>.AChart2DDataAccessor result;
  if (dimension == Chart2D.X) {
    // Don't allow a combination of dimension and position that is not usable:
    if ((position & (Chart2D.CHART_POSITION_BOTTOM | Chart2D.CHART_POSITION_TOP)) == 0) {
      throw new IllegalArgumentException("X axis only valid with top or bottom position.");
    }
    this.setAxisPosition(position);
    result = new XDataAccessor(chart);
  } else if (dimension == Chart2D.Y) {
    // Don't allow a combination of dimension and position that is not usable:
    if ((position & (Chart2D.CHART_POSITION_LEFT | Chart2D.CHART_POSITION_RIGHT)) == 0) {
      throw new IllegalArgumentException("Y axis only valid with left or right position.");
    }
    this.setAxisPosition(position);
    result = new YDataAccessor(chart);
  } else {
    throw new IllegalArgumentException("Dimension has to be Chart2D.X or Chart2D.Y!");
  }
  return result;
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:27,代码来源:AAxisTransformation.java

示例5: createAccessor

/**
 * @see info.monitorenter.gui.chart.axis.AAxis#createAccessor(info.monitorenter.gui.chart.Chart2D,
 *      int, int)
 */
@Override
protected AChart2DDataAccessor createAccessor(final Chart2D chart, final int dimension,
    final int position) {
  AChart2DDataAccessor result;
  if (dimension == Chart2D.X) {
    // Don't allow a combination of dimension and position that is not usable:
    if ((position & (Chart2D.CHART_POSITION_BOTTOM | Chart2D.CHART_POSITION_TOP)) == 0) {
      throw new IllegalArgumentException("X axis only valid with top or bottom position.");
    }
    this.setAxisPosition(position);
    result = new XDataInverseAccessor(chart);
  } else if (dimension == Chart2D.Y) {
    // Don't allow a combination of dimension and position that is not usable:
    if ((position & (Chart2D.CHART_POSITION_LEFT | Chart2D.CHART_POSITION_RIGHT)) == 0) {
      throw new IllegalArgumentException("Y axis only valid with left or right position.");
    }
    this.setAxisPosition(position);
    result = new YDataInverseAccessor(chart);
  } else {
    throw new IllegalArgumentException("Dimension has to be Chart2D.X or Chart2D.Y!");
  }
  return result;
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:27,代码来源:AxisInverse.java

示例6: getAxis

/**
 * Returns the axis that is controlled.
 * <p>
 * Note that several calls may return different instances (
 * <code>a.getAxis() == a.getAxis()</code> may be false) in case the
 * corresponding chart of the former axis gets a new axis assigned.
 * <p>
 * Note that this action only works for the first x axis / first y axis:
 * Additional axes cannot be handled by now.
 * <p>
 * 
 * @return the axis that is controlled.
 */
protected IAxis<?> getAxis() {

  // update in case the corresponding chart has a new axis:
  IAxis<?> axis = null;
  switch (this.m_axis) {
    case Chart2D.X:
      axis = this.m_chart.getAxisX();
      break;
    case Chart2D.Y:
      axis = this.m_chart.getAxisY();
      break;
    default:
      break;
  }
  return axis;
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:29,代码来源:AAxisAction.java

示例7: propertyChange

/**
 * @see java.beans.PropertyChangeListener#propertyChange(java.beans.PropertyChangeEvent)
 */
public void propertyChange(PropertyChangeEvent evt) {
  String property = evt.getPropertyName();
  if (((property.equals(Chart2D.PROPERTY_AXIS_X_BOTTOM_REPLACE)) && (this.m_axis == Chart2D.X))
      || (property.equals(Chart2D.PROPERTY_AXIS_Y_LEFT_REPLACE) && this.m_axis == Chart2D.Y)) {
    IAxis<?> oldAxis = (IAxis<?>) evt.getOldValue();
    IAxis<?> newAxis = (IAxis<?>) evt.getNewValue();
    if (property.equals(Chart2D.PROPERTY_AXIS_X_BOTTOM_REPLACE)) {
      oldAxis.removePropertyChangeListener(Chart2D.PROPERTY_AXIS_X_BOTTOM_REPLACE, this);
      newAxis.addPropertyChangeListener(Chart2D.PROPERTY_AXIS_X_BOTTOM_REPLACE, this);
    } else if (property.equals(Chart2D.PROPERTY_AXIS_Y_LEFT_REPLACE)) {
      oldAxis.removePropertyChangeListener(Chart2D.PROPERTY_AXIS_Y_LEFT_REPLACE, this);
      newAxis.addPropertyChangeListener(Chart2D.PROPERTY_AXIS_Y_LEFT_REPLACE, this);
    }
  }
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:18,代码来源:AAxisAction.java

示例8: actionPerformed

/**
 * @see java.awt.event.ActionListener#actionPerformed(java.awt.event.ActionEvent)
 */
public void actionPerformed(final ActionEvent e) {
  switch (this.m_axisTarget) {
    case Chart2D.X:
      this.m_chart.setAxisXBottom(this.m_axis,0);
      break;

    case Chart2D.Y:
      this.m_chart.setAxisYLeft(this.m_axis,0);
      break;

    default:
      // nop
      break;

  }
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:19,代码来源:Chart2DActionSetAxis.java

示例9: getHeight

/**
 * @see info.monitorenter.gui.chart.IAxisTitlePainter#getHeight(info.monitorenter.gui.chart.IAxis,
 *      java.awt.Graphics)
 */
public int getHeight(final IAxis<?> axis, final Graphics g2d) {
  int result = 0;
  IAxis.AxisTitle axisTitle = axis.getAxisTitle();
  String title = axisTitle.getTitle();
  if (!StringUtil.isEmpty(title)) {
    Rectangle2D bounds = g2d.getFontMetrics().getStringBounds(title, g2d);
    int dimension = axis.getDimension();
    switch (dimension) {
      case Chart2D.X:
        result = (int) bounds.getHeight();
        break;
      case Chart2D.Y:
        boolean supportsRotation = g2d instanceof Graphics2D;
        if (supportsRotation) {
          // for y it's rotated by 90 degrees:
          result = (int) bounds.getWidth();
        } else {
          result = (int) bounds.getHeight();
        }
        break;
      default:
        throw new IllegalArgumentException(
            "Given axis.getDimension() is neither Chart2D.X nor Chart2D.Y!");
    }
  }
  return result;
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:31,代码来源:AxisTitlePainterDefault.java

示例10: getWidth

/**
 * @see info.monitorenter.gui.chart.IAxisTitlePainter#getWidth(info.monitorenter.gui.chart.IAxis,
 *      java.awt.Graphics)
 */
public int getWidth(final IAxis<?> axis, final Graphics g2d) {
  int result = 0;
  IAxis.AxisTitle axisTitle = axis.getAxisTitle();
  String title = axisTitle.getTitle();
  if (!StringUtil.isEmpty(title)) {
    // incorporation of our font if there:
    Font backUpFont = g2d.getFont();
    Font titleFont = axisTitle.getTitleFont();
    if (titleFont != null) {
      g2d.setFont(titleFont);
    }
    Rectangle2D bounds = g2d.getFontMetrics().getStringBounds(title, g2d);
    int dimension = axis.getDimension();
    switch (dimension) {
      case Chart2D.X:
        result = (int) bounds.getWidth();
        break;
      case Chart2D.Y:
        boolean supportsRotation = g2d instanceof Graphics2D;
        if (supportsRotation) {
          // for y it's rotated by 90 degrees:
          result = (int) bounds.getHeight();
        } else {
          result = (int) bounds.getWidth();
        }
        break;
      default:
        throw new IllegalArgumentException(
            "Given axis.getDimension() is neither Chart2D.X nor Chart2D.Y!");
    }
    // resetting original font if it was changed:
    if (titleFont != null) {
      g2d.setFont(backUpFont);
    }
  }

  return result;
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:42,代码来源:AxisTitlePainterDefault.java

示例11: paint

/**
 * @see info.monitorenter.gui.chart.IAxis#paint(java.awt.Graphics)
 */
public void paint(final Graphics g2d) {
  if (!this.m_visible) {
    return;
  }
  switch (this.getDimension() | this.getAxisPosition()) {
    case (Chart2D.X | Chart2D.CHART_POSITION_BOTTOM): {
      this.paintAxisXBottom(g2d);
      break;
    }
    case (Chart2D.X | Chart2D.CHART_POSITION_TOP): {
      this.paintAxisXTop(g2d);
      break;
    }
    case (Chart2D.Y | Chart2D.CHART_POSITION_LEFT): {
      this.paintAxisYLeft(g2d);
      break;
    }
    case (Chart2D.Y | Chart2D.CHART_POSITION_RIGHT): {
      this.paintAxisYRight(g2d);
      break;
    }
    default: {

      throw new IllegalStateException("No valid Chart position found for this axis: " + this);
    }
  }
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:30,代码来源:AAxis.java

示例12: paintTitle

/**
 * @see info.monitorenter.gui.chart.IAxis#paintTitle(java.awt.Graphics)
 */
public int paintTitle(final Graphics g2d) {
  int result = 0;
  // TODO: Add support for different axis locations: top, bottom, left,right!
  // drawing the title :
  final IAxis.AxisTitle axisTitle = this.getAxisTitle();
  final String title = axisTitle.getTitle();
  if (!StringUtil.isEmpty(title)) {
    IAxisTitlePainter titlePainter;
    titlePainter = axisTitle.getTitlePainter();
    titlePainter.paintTitle(this, g2d);

    final int dimension = this.getDimension();
    switch (dimension) {
      case Chart2D.X:
        result = titlePainter.getHeight(this, g2d);
        break;
      case Chart2D.Y:
        result = titlePainter.getWidth(this, g2d);
        break;
      default:
        throw new IllegalArgumentException(
            "Given axis.getDimension() is neither Chart2D.X nor Chart2D.Y!");

    }
  }
  return result;
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:30,代码来源:AAxis.java

示例13: getDimension

/**
 * @see info.monitorenter.gui.chart.axis.AAxis.AChart2DDataAccessor#getDimension()
 */
@Override
public final int getDimension() {
  return Chart2D.Y;
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:7,代码来源:AAxis.java

示例14: createAxisMenuItem

/**
 * Creates a {@link JMenuItem} that allows to trigger the features related to
 * {@link info.monitorenter.gui.chart.axis.AAxis} features.
 * <p>
 * 
 * @param axis
 *          the axis to control.
 * @param axisDimension
 *          Identifies which dimension the axis controls in the chart: either
 *          {@link Chart2D#X} or {@link Chart2D#Y}
 * @param adaptUI2Chart
 *          if true the menu will adapt it's basic UI properies (font,
 *          foreground and background color) to the given chart.
 * @return a {@link JMenuItem} that allows to trigger the features related to
 *         {@link info.monitorenter.gui.chart.axis.AAxis} features.
 */
public JMenuItem createAxisMenuItem(final IAxis<?> axis, final int axisDimension,
    final boolean adaptUI2Chart) {
  final Chart2D chart = axis.getAccessor().getChart();
  JMenuItem item;

  // axis submenu
  JMenuItem axisMenuItem;
  if (adaptUI2Chart) {
    axisMenuItem = new PropertyChangeMenu(chart, "Axis" + axis.getAccessor().toString(),
        BasicPropertyAdaptSupport.RemoveAsListenerFromComponentNever.getInstance());
  } else {
    axisMenuItem = new JMenu("Axis" + axis.getAccessor().toString());
  }

  if ((this.m_showAxisXTypeMenu && axisDimension == Chart2D.X)
      || (this.m_showAxisYTypeMenu && axisDimension == Chart2D.Y)) {
    axisMenuItem.add(this.createAxisTypeMenu(chart, axis, axisDimension, adaptUI2Chart));
  }

  if (this.m_showAxisFormatterMenu) {
    axisMenuItem.add(this.createAxisFormatterMenu(chart, axis, axisDimension, adaptUI2Chart));
  }

  if ((this.m_showAxisXRangePolicyMenu && axisDimension == Chart2D.X)
      || this.m_showAxisYRangePolicyMenu && axisDimension == Chart2D.Y) {
    axisMenuItem.add(this.createAxisRangePolicyMenu(chart, axis, adaptUI2Chart));

    // Axis -> Range menu
    if (adaptUI2Chart) {

      item = new PropertyChangeMenuItem(chart, new AxisActionSetRange(chart, "Range",
          axisDimension), BasicPropertyAdaptSupport.RemoveAsListenerFromComponentNever
          .getInstance());
    } else {
      item = new JMenuItem(new AxisActionSetRange(chart, "Range", axisDimension));
    }
    if (!AxisActionSetRange.RANGE_CHOOSER_SUPPORTED) {
      item.setToolTipText("This is disabled as bislider.jar is missing on the class path.");
    }
    axisMenuItem.add(item);
  }
  if ((this.m_showAxisXTitleMenu && axisDimension == Chart2D.X)
      || (this.m_showAxisYTitleMenu && axisDimension == Chart2D.Y)) {
    axisMenuItem.add(this.createAxisTitleMenu(chart, axis, axisDimension, adaptUI2Chart));
  }

  return axisMenuItem;
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:64,代码来源:LayoutFactory.java

示例15: createChartGridMenu

/**
 * Creates a menu for controlling the grid (show x, show y, color).
 * <p>
 * 
 * @param chartPanel
 *          for adapting ui to and obtaining chart from.
 * 
 * @param adaptUI2Chart
 *          if true the menu will adapt it's basic UI properies (font,
 *          foreground and background color) to the given chart.
 * 
 * @return a menu for controlling the grid (show x, show y, color).
 */
public JMenuItem createChartGridMenu(ChartPanel chartPanel, boolean adaptUI2Chart) {
  Chart2D chart = chartPanel.getChart();
  // Grid submenu:
  JMenu gridMenu;
  if (adaptUI2Chart) {
    gridMenu = new PropertyChangeMenu(chart, "Grid",
        BasicPropertyAdaptSupport.RemoveAsListenerFromComponentNever.getInstance());
  } else {
    gridMenu = new JMenu("Grid");
  }
  if (this.m_showGridColorMenu) {
    gridMenu.add(this.createGridColorMenu(chartPanel, adaptUI2Chart));
  }

  JMenuItem item;

  if (this.m_showAxisXGridMenu) {
    // Grid -> show x grid submenu
    if (adaptUI2Chart) {
      item = new PropertyChangeCheckBoxMenuItem(chart, new AxisActionSetGrid(chart, "Grid X",
          Chart2D.X), chart.getAxisX().isPaintGrid(),
          BasicPropertyAdaptSupport.RemoveAsListenerFromComponentNever.getInstance());
    } else {
      item = new SelectionAdaptJCheckBoxMenuItem(
          new AxisActionSetGrid(chart, "Grid X", Chart2D.X), chart.getAxisX().isPaintGrid());
    }
    gridMenu.add(item);
  }
  if (this.m_showAxisYGridMenu) {
    // Grid -> show y grid submenu
    if (adaptUI2Chart) {
      item = new PropertyChangeCheckBoxMenuItem(chart, new AxisActionSetGrid(chart, "Grid Y",
          Chart2D.Y), chart.getAxisY().isPaintGrid(),
          BasicPropertyAdaptSupport.RemoveAsListenerFromComponentNever.getInstance());
    } else {
      item = new SelectionAdaptJCheckBoxMenuItem(
          new AxisActionSetGrid(chart, "Grid Y", Chart2D.Y), chart.getAxisX().isPaintGrid());
    }
    gridMenu.add(item);
  }
  return gridMenu;
}
 
开发者ID:lcm-proj,项目名称:lcm,代码行数:55,代码来源:LayoutFactory.java


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