congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
RectangleEdge
Code IndexAdd Tabnine to your IDE (free)

How to use
RectangleEdge
in
org.jfree.ui

Best Java code snippets using org.jfree.ui.RectangleEdge (Showing top 20 results out of 315)

origin: jenkinsci/jenkins

if (edge.equals(RectangleEdge.TOP)) {
  double h = state.getMax();
  state.cursorUp(h);
else if (edge.equals(RectangleEdge.BOTTOM)) {
  double h = state.getMax();
  state.cursorDown(h);
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Calculates the bar thickness.
 *
 * @param plotArea  the plot area.
 * @param edge  the location.
 *
 * @return The thickness.
 */
private double calculateBarThickness(Rectangle2D plotArea,
                   RectangleEdge edge) {
  double result = 0.0;
  if (RectangleEdge.isLeftOrRight(edge)) {
    result = plotArea.getWidth() * this.colorBarThicknessPercent;
  }
  else {
    result = plotArea.getHeight() * this.colorBarThicknessPercent;
  }
  return result;
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Draws the tick marks for the axis.
 *
 * @param g2  the graphics device.
 * @param state  the axis state.
 * @param dataArea  the data area.
 * @param edge  the edge.
 */
protected void drawTickMarks(Graphics2D g2, AxisState state,
               Rectangle2D dataArea,
               RectangleEdge edge) {
  if (RectangleEdge.isTopOrBottom(edge)) {
    drawTickMarksHorizontal(g2, state, dataArea, edge);
  }
  else if (RectangleEdge.isLeftOrRight(edge)) {
    drawTickMarksVertical(g2, state, dataArea, edge);
  }
}
origin: org.codehaus.jtstand/jtstand-chart

  float yy = 0.0f;
  for (int i = 0; i < subCategoryCount; i++) {
    if (RectangleEdge.isTopOrBottom(edge)) {
      xx = (float) (x0 + (i + 0.5) * width);
      yy = (float) area.getCenterY();
if (edge.equals(RectangleEdge.TOP)) {
  double h = maxdim;
  state.cursorUp(h);
else if (edge.equals(RectangleEdge.BOTTOM)) {
  double h = maxdim;
  state.cursorDown(h);
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns the edge for a domain axis.
 *
 * @param index  the axis index.
 *
 * @return The edge.
 *
 * @see #getRangeAxisEdge(int)
 */
public RectangleEdge getDomainAxisEdge(int index) {
  AxisLocation location = getDomainAxisLocation(index);
  RectangleEdge result = Plot.resolveDomainAxisLocation(location,
      this.orientation);
  if (result == null) {
    result = RectangleEdge.opposite(getDomainAxisEdge());
  }
  return result;
}
origin: org.codehaus.jtstand/jtstand-chart

double cursor = RectangleEdge.coordinate(dataArea, domainEdge);
AxisState axisState = axis.draw(g2, cursor, area, dataArea,
    domainEdge, info);
origin: org.codehaus.jtstand/jtstand-chart

g2.setStroke(new BasicStroke(1.0f));
if (RectangleEdge.isTopOrBottom(edge)) {
  double y1 = colorBarArea.getY();
  double y2 = colorBarArea.getMaxY();
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Selects an appropriate tick value for the axis.  The strategy is to
 * display as many ticks as possible (selected from an array of 'standard'
 * tick units) without the labels overlapping.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area defined by the axes.
 * @param edge  the axis location.
 */
protected void selectAutoTickUnit(Graphics2D g2,
                 Rectangle2D dataArea,
                 RectangleEdge edge) {
  if (RectangleEdge.isTopOrBottom(edge)) {
    selectHorizontalAutoTickUnit(g2, dataArea, edge);
  }
  else if (RectangleEdge.isLeftOrRight(edge)) {
    selectVerticalAutoTickUnit(g2, dataArea, edge);
  }
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns the edge for a range axis.
 *
 * @param index  the axis index.
 *
 * @return The edge.
 */
public RectangleEdge getRangeAxisEdge(int index) {
  AxisLocation location = getRangeAxisLocation(index);
  RectangleEdge result = Plot.resolveRangeAxisLocation(location,
      this.orientation);
  if (result == null) {
    result = RectangleEdge.opposite(getRangeAxisEdge(0));
  }
  return result;
}
origin: org.codehaus.jtstand/jtstand-chart

double cursor = RectangleEdge.coordinate(dataArea, edge);
AxisState axisState = axis.draw(g2, cursor, area, dataArea, edge, info);
origin: org.codehaus.jtstand/jtstand-chart

Rectangle2D r = new Rectangle2D.Double();
if (RectangleEdge.isTopOrBottom(getPosition())) {
  RectangleEdge axisEdge = Plot.resolveRangeAxisLocation(
      this.axisLocation, PlotOrientation.HORIZONTAL);
origin: org.jfree/com.springsource.org.jfree

/**
 * Ensures that serialization returns the unique instances.
 * 
 * @return The object.
 * 
 * @throws ObjectStreamException if there is a problem.
 */
private Object readResolve() throws ObjectStreamException {
  RectangleEdge result = null;
  if (this.equals(RectangleEdge.TOP)) {
    result = RectangleEdge.TOP;
  }
  else if (this.equals(RectangleEdge.BOTTOM)) {
    result = RectangleEdge.BOTTOM;
  }
  else if (this.equals(RectangleEdge.LEFT)) {
    result = RectangleEdge.LEFT;
  }
  else if (this.equals(RectangleEdge.RIGHT)) {
    result = RectangleEdge.RIGHT;
  }
  return result;
}
 
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Selects an appropriate tick value for the axis.  The strategy is to
 * display as many ticks as possible (selected from an array of 'standard'
 * tick units) without the labels overlapping.
 *
 * @param g2  the graphics device.
 * @param dataArea  the area defined by the axes.
 * @param edge  the axis location.
 */
protected void selectAutoTickUnit(Graphics2D g2,
                 Rectangle2D dataArea,
                 RectangleEdge edge) {
  if (RectangleEdge.isTopOrBottom(edge)) {
    selectHorizontalAutoTickUnit(g2, dataArea, edge);
  }
  else if (RectangleEdge.isLeftOrRight(edge)) {
    selectVerticalAutoTickUnit(g2, dataArea, edge);
  }
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns the maximum of the relevant dimension (height or width) of the
 * subcategory labels.
 *
 * @param g2  the graphics device.
 * @param edge  the edge.
 *
 * @return The maximum dimension.
 */
private double getMaxDim(Graphics2D g2, RectangleEdge edge) {
  double result = 0.0;
  g2.setFont(this.subLabelFont);
  FontMetrics fm = g2.getFontMetrics();
  Iterator iterator = this.subCategories.iterator();
  while (iterator.hasNext()) {
    Comparable subcategory = (Comparable) iterator.next();
    String label = subcategory.toString();
    Rectangle2D bounds = TextUtilities.getTextBounds(label, g2, fm);
    double dim = 0.0;
    if (RectangleEdge.isLeftOrRight(edge)) {
      dim = bounds.getWidth();
    }
    else {  // must be top or bottom
      dim = bounds.getHeight();
    }
    result = Math.max(result, dim);
  }
  return result;
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns the edge for a domain axis.
 *
 * @param index  the axis index.
 *
 * @return The edge (never <code>null</code>).
 */
public RectangleEdge getDomainAxisEdge(int index) {
  RectangleEdge result = null;
  AxisLocation location = getDomainAxisLocation(index);
  if (location != null) {
    result = Plot.resolveDomainAxisLocation(location, this.orientation);
  }
  else {
    result = RectangleEdge.opposite(getDomainAxisEdge(0));
  }
  return result;
}
origin: org.codehaus.jtstand/jtstand-chart

double cursor = RectangleEdge.coordinate(dataArea, edge);
AxisState axisState = axis.draw(g2, cursor, area, dataArea, edge, info);
if (parentState == null) {
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Fetches the latest legend items.
 */
protected void fetchLegendItems() {
  this.items.clear();
  RectangleEdge p = getPosition();
  if (RectangleEdge.isTopOrBottom(p)) {
    this.items.setArrangement(this.hLayout);
  }
  else {
    this.items.setArrangement(this.vLayout);
  }
  for (int s = 0; s < this.sources.length; s++) {
    LegendItemCollection legendItems = this.sources[s].getLegendItems();
    if (legendItems != null) {
      for (int i = 0; i < legendItems.getItemCount(); i++) {
        LegendItem item = legendItems.get(i);
        Block block = createLegendItemBlock(item);
        this.items.add(block);
      }
    }
  }
}
origin: jfree/jcommon

/**
 * Ensures that serialization returns the unique instances.
 * 
 * @return The object.
 * 
 * @throws ObjectStreamException if there is a problem.
 */
private Object readResolve() throws ObjectStreamException {
  RectangleEdge result = null;
  if (this.equals(RectangleEdge.TOP)) {
    result = RectangleEdge.TOP;
  }
  else if (this.equals(RectangleEdge.BOTTOM)) {
    result = RectangleEdge.BOTTOM;
  }
  else if (this.equals(RectangleEdge.LEFT)) {
    result = RectangleEdge.LEFT;
  }
  else if (this.equals(RectangleEdge.RIGHT)) {
    result = RectangleEdge.RIGHT;
  }
  return result;
}
 
origin: org.codehaus.jtstand/jtstand-chart

/**
 * A regular translation from a data value to a Java2D value.
 *
 * @param value  the value.
 * @param area  the data area.
 * @param edge  the edge along which the axis lies.
 *
 * @return The Java2D coordinate.
 */
private double trans(double value, Rectangle2D area, RectangleEdge edge) {
  double min = 0.0;
  double max = 0.0;
  if (RectangleEdge.isTopOrBottom(edge)) {
    min = area.getX();
    max = area.getX() + area.getWidth();
  }
  else if (RectangleEdge.isLeftOrRight(edge)) {
    min = area.getMaxY();
    max = area.getMaxY() - area.getHeight();
  }
  if (isInverted()) {
    return max - ((value - this.displayStart)
        / (this.displayEnd - this.displayStart)) * (max - min);
  }
  else {
    return min + ((value - this.displayStart)
        / (this.displayEnd - this.displayStart)) * (max - min);
  }
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Converts a length in data coordinates into the corresponding length in
 * Java2D coordinates.
 *
 * @param length  the length.
 * @param area  the plot area.
 * @param edge  the edge along which the axis lies.
 *
 * @return The length in Java2D coordinates.
 */
public double lengthToJava2D(double length, Rectangle2D area,
               RectangleEdge edge) {
  double axisLength = 0.0;
  if (this.displayEnd > this.displayStart) {
    axisLength = this.displayEnd - this.displayStart;
  }
  else {
    axisLength = (this.fixedRange.getUpperBound() - this.displayStart)
      + (this.displayEnd - this.fixedRange.getLowerBound());
  }
  double areaLength = 0.0;
  if (RectangleEdge.isLeftOrRight(edge)) {
    areaLength = area.getHeight();
  }
  else {
    areaLength = area.getWidth();
  }
  return (length / axisLength) * areaLength;
}
org.jfree.uiRectangleEdge

Javadoc

Used to indicate the edge of a rectangle.

Most used methods

  • equals
    Returns true if this object is equal to the specified object, and false otherwise.
  • isLeftOrRight
    Returns true if the edge is LEFT orRIGHT, and false otherwise.
  • coordinate
    Returns the x or y coordinate of the specified edge.
  • isTopOrBottom
    Returns true if the edge is TOP orBOTTOM, and false otherwise.
  • opposite
    Returns the opposite edge.

Popular in Java

  • Creating JSON documents from java classes using gson
  • addToBackStack (FragmentTransaction)
  • onRequestPermissionsResult (Fragment)
  • getResourceAsStream (ClassLoader)
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Modifier (javassist)
    The Modifier class provides static methods and constants to decode class and member access modifiers
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now