Tabnine Logo
RectangleEdge.isLeftOrRight
Code IndexAdd Tabnine to your IDE (free)

How to use
isLeftOrRight
method
in
org.jfree.ui.RectangleEdge

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

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

/**
 * 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

/**
 * 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;
}
origin: org.codehaus.jtstand/jtstand-chart

  max = area.getX() + area.getWidth() * length1 / (length1 + length2);
else if (RectangleEdge.isLeftOrRight(edge)) {
  min = area.getMaxY();
  max = area.getMaxY() - area.getHeight() * length1
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Calculates the positions of the tick labels for the axis, storing the
 * results in the tick label list (ready for drawing).
 *
 * @param g2  the graphics device.
 * @param state  the axis state.
 * @param dataArea  the area in which the plot should be drawn.
 * @param edge  the location of the axis.
 *
 * @return A list of ticks.
 *
 */
public List refreshTicks(Graphics2D g2, AxisState state,
    Rectangle2D dataArea, RectangleEdge edge) {
  List result = new java.util.ArrayList();
  if (RectangleEdge.isTopOrBottom(edge)) {
    result = refreshTicksHorizontal(g2, dataArea, edge);
  }
  else if (RectangleEdge.isLeftOrRight(edge)) {
    result = refreshTicksVertical(g2, dataArea, edge);
  }
  return result;
}
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Calculates the positions of the tick labels for the axis, storing the
 * results in the tick label list (ready for drawing).
 *
 * @param g2  the graphics device.
 * @param state  the axis state.
 * @param dataArea  the area in which the plot should be drawn.
 * @param edge  the location of the axis.
 *
 * @return A list of ticks.
 *
 */
public List refreshTicks(Graphics2D g2,
             AxisState state,
             Rectangle2D dataArea,
             RectangleEdge edge) {
  List result = new java.util.ArrayList();
  if (RectangleEdge.isTopOrBottom(edge)) {
    result = refreshTicksHorizontal(g2, dataArea, edge);
  }
  else if (RectangleEdge.isLeftOrRight(edge)) {
    result = refreshTicksVertical(g2, dataArea, edge);
  }
  return result;
}
origin: org.codehaus.jtstand/jtstand-chart

  max = area.getMaxX();
else if (RectangleEdge.isLeftOrRight(edge)) {
  min = area.getMaxY();
  max = area.getY();
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

/**
 * 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

/**
 * 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

/**
 * Calculates the positions of the tick labels for the axis, storing the
 * results in the tick label list (ready for drawing).
 *
 * @param g2  the graphics device.
 * @param state  the axis state.
 * @param dataArea  the area in which the data should be drawn.
 * @param edge  the location of the axis.
 *
 * @return A list of ticks.
 */
public List refreshTicks(Graphics2D g2,
             AxisState state,
             Rectangle2D dataArea,
             RectangleEdge edge) {
  List ticks = null;
  if (RectangleEdge.isTopOrBottom(edge)) {
    ticks = refreshTicksHorizontal(g2, dataArea, edge);
  }
  else if (RectangleEdge.isLeftOrRight(edge)) {
    ticks = refreshTicksVertical(g2, dataArea, edge);
  }
  return ticks;
}
origin: org.codehaus.jtstand/jtstand-chart

  max = area.getMaxX();
else if (RectangleEdge.isLeftOrRight(edge)) {
  min = area.getMaxY();
  max = area.getY();
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.
 *
 * @since 1.0.7
 */
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

/**
 * Calculates the positions of the tick labels for the axis, storing the
 * results in the tick label list (ready for drawing).
 *
 * @param g2  the graphics device.
 * @param state  the axis state.
 * @param dataArea  the area in which the plot should be drawn.
 * @param edge  the location of the axis.
 *
 * @return A list of ticks.
 */
public List refreshTicks(Graphics2D g2,
             AxisState state,
             Rectangle2D dataArea,
             RectangleEdge edge) {
  List result = null;
  if (RectangleEdge.isTopOrBottom(edge)) {
    result = refreshTicksHorizontal(g2, dataArea, edge);
  }
  else if (RectangleEdge.isLeftOrRight(edge)) {
    result = refreshTicksVertical(g2, dataArea, edge);
  }
  return result;
}
origin: org.codehaus.jtstand/jtstand-chart

  max = plotArea.getMaxX();
else if (RectangleEdge.isLeftOrRight(edge)) {
  min = plotArea.getMaxY();
  max = plotArea.getMinY();
origin: org.codehaus.jtstand/jtstand-chart

  max = area.getMaxX();
else if (RectangleEdge.isLeftOrRight(edge)) {
  min = area.getMaxY();
  max = area.getY();
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Draws the grid bands.  Alternate bands are colored using
 * <CODE>gridBandPaint<CODE> (<CODE>DEFAULT_GRID_BAND_PAINT</CODE> by
 * default).
 *
 * @param g2  the graphics device.
 * @param plotArea  the area within which the chart should be drawn.
 * @param dataArea  the area within which the plot should be drawn (a
 *                  subset of the drawArea).
 * @param edge  the axis location.
 * @param ticks  the ticks.
 */
protected void drawGridBands(Graphics2D g2,
               Rectangle2D plotArea,
               Rectangle2D dataArea,
               RectangleEdge edge,
               List ticks) {
  Shape savedClip = g2.getClip();
  g2.clip(dataArea);
  if (RectangleEdge.isTopOrBottom(edge)) {
    drawGridBandsHorizontal(g2, plotArea, dataArea, true, ticks);
  }
  else if (RectangleEdge.isLeftOrRight(edge)) {
    drawGridBandsVertical(g2, plotArea, dataArea, true, ticks);
  }
  g2.setClip(savedClip);
}
origin: org.codehaus.jtstand/jtstand-chart

  plotMax = plotArea.getMaxX();
else if (RectangleEdge.isLeftOrRight(edge)) {
  plotMin = plotArea.getMaxY();
  plotMax = plotArea.getMinY();
origin: org.codehaus.jtstand/jtstand-chart

  space.add(maxdim, edge);
else if (RectangleEdge.isLeftOrRight(edge)) {
  space.add(maxdim, edge);
org.jfree.uiRectangleEdgeisLeftOrRight

Javadoc

Returns true if the edge is LEFT or RIGHT, and false otherwise.

Popular methods of RectangleEdge

  • equals
    Returns true if this object is equal to the specified object, 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

  • Making http post requests using okhttp
  • addToBackStack (FragmentTransaction)
  • runOnUiThread (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Table (org.hibernate.mapping)
    A relational table
  • Top Sublime Text plugins
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