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

How to use
RectangleAnchor
in
org.jfree.ui

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

origin: jenkinsci/jenkins

    (y1 - y0));
if(r==null || !r.intersects(area)) {
  Point2D anchorPoint = RectangleAnchor.coordinates(area,
      position.getCategoryAnchor());
  TextBlock block = tick.getLabel();
origin: org.codehaus.jtstand/jtstand-chart

private RectangleAnchor flipAnchorH(RectangleAnchor anchor) {
  RectangleAnchor result = anchor;
  if (anchor.equals(RectangleAnchor.TOP_LEFT)) {
    result = RectangleAnchor.TOP_RIGHT;
  }
  else if (anchor.equals(RectangleAnchor.TOP_RIGHT)) {
    result = RectangleAnchor.TOP_LEFT;
  }
  else if (anchor.equals(RectangleAnchor.LEFT)) {
    result = RectangleAnchor.RIGHT;
  }
  else if (anchor.equals(RectangleAnchor.RIGHT)) {
    result = RectangleAnchor.LEFT;
  }
  else if (anchor.equals(RectangleAnchor.BOTTOM_LEFT)) {
    result = RectangleAnchor.BOTTOM_RIGHT;
  }
  else if (anchor.equals(RectangleAnchor.BOTTOM_RIGHT)) {
    result = RectangleAnchor.BOTTOM_LEFT;
  }
  return result;
}
origin: org.codehaus.jtstand/jtstand-chart

Rectangle2D bounds = RectangleAnchor.createRectangle(new Size2D(w, h),
    pt.getX(), pt.getY(), this.frameAnchor);
g2.clip(fb);
Point2D pt2 = RectangleAnchor.coordinates(bounds, this.valueAnchor);
g2.setPaint(this.paint);
g2.setFont(this.font);
origin: org.jfree/jcommon

final Size2D d2 = new Size2D(w, h);
final Rectangle2D bounds
    = RectangleAnchor.createRectangle(d2, x, y, anchor);
double xx = bounds.getX();
double yy = bounds.getY();
origin: org.codehaus.jtstand/jtstand-chart

/**
 * Returns a hash code for this object.
 *
 * @return A hash code.
 */
public int hashCode() {
  int result = 19;
  result = 37 * result + this.categoryAnchor.hashCode();
  result = 37 * result + this.labelAnchor.hashCode();
  result = 37 * result + this.rotationAnchor.hashCode();
  return result;
}
origin: jfree/jcommon

final Size2D d2 = new Size2D(w, h);
final Rectangle2D bounds
    = RectangleAnchor.createRectangle(d2, x, y, anchor);
double xx = bounds.getX();
double yy = bounds.getY();
origin: jfree/jcommon

/**
 * Translates a shape to a new location such that the anchor point
 * (relative to the rectangular bounds of the shape) aligns with the
 * specified (x, y) coordinate in Java2D space.
 *
 * @param shape  the shape (<code>null</code> not permitted).
 * @param anchor  the anchor (<code>null</code> not permitted).
 * @param locationX  the x-coordinate (in Java2D space).
 * @param locationY  the y-coordinate (in Java2D space).
 *
 * @return A new and translated shape.
 */
public static Shape createTranslatedShape(final Shape shape,
                     final RectangleAnchor anchor,
                     final double locationX,
                     final double locationY) {
  if (shape == null) {
    throw new IllegalArgumentException("Null 'shape' argument.");
  }
  if (anchor == null) {
    throw new IllegalArgumentException("Null 'anchor' argument.");
  }
  Point2D anchorPoint = RectangleAnchor.coordinates(
      shape.getBounds2D(), anchor);
  final AffineTransform transform = AffineTransform.getTranslateInstance(
      locationX - anchorPoint.getX(), locationY - anchorPoint.getY());
  return transform.createTransformedShape(shape);
}
origin: org.codehaus.jtstand/jtstand-chart

private RectangleAnchor flipAnchorV(RectangleAnchor anchor) {
  RectangleAnchor result = anchor;
  if (anchor.equals(RectangleAnchor.TOP_LEFT)) {
    result = RectangleAnchor.BOTTOM_LEFT;
  }
  else if (anchor.equals(RectangleAnchor.TOP_RIGHT)) {
    result = RectangleAnchor.BOTTOM_RIGHT;
  }
  else if (anchor.equals(RectangleAnchor.TOP)) {
    result = RectangleAnchor.BOTTOM;
  }
  else if (anchor.equals(RectangleAnchor.BOTTOM)) {
    result = RectangleAnchor.TOP;
  }
  else if (anchor.equals(RectangleAnchor.BOTTOM_LEFT)) {
    result = RectangleAnchor.TOP_LEFT;
  }
  else if (anchor.equals(RectangleAnchor.BOTTOM_RIGHT)) {
    result = RectangleAnchor.TOP_RIGHT;
  }
  return result;
}
origin: org.jfree/com.springsource.org.jfree

final Size2D d2 = new Size2D(w, h);
final Rectangle2D bounds 
  = RectangleAnchor.createRectangle(d2, x, y, anchor);
origin: org.jfree/jcommon

/**
 * Translates a shape to a new location such that the anchor point
 * (relative to the rectangular bounds of the shape) aligns with the
 * specified (x, y) coordinate in Java2D space.
 *
 * @param shape  the shape (<code>null</code> not permitted).
 * @param anchor  the anchor (<code>null</code> not permitted).
 * @param locationX  the x-coordinate (in Java2D space).
 * @param locationY  the y-coordinate (in Java2D space).
 *
 * @return A new and translated shape.
 */
public static Shape createTranslatedShape(final Shape shape,
                     final RectangleAnchor anchor,
                     final double locationX,
                     final double locationY) {
  if (shape == null) {
    throw new IllegalArgumentException("Null 'shape' argument.");
  }
  if (anchor == null) {
    throw new IllegalArgumentException("Null 'anchor' argument.");
  }
  Point2D anchorPoint = RectangleAnchor.coordinates(
      shape.getBounds2D(), anchor);
  final AffineTransform transform = AffineTransform.getTranslateInstance(
      locationX - anchorPoint.getX(), locationY - anchorPoint.getY());
  return transform.createTransformedShape(shape);
}
origin: org.jfree/jcommon

if (this.equals(RectangleAnchor.CENTER)) {
  result = RectangleAnchor.CENTER;
else if (this.equals(RectangleAnchor.TOP)) {
  result = RectangleAnchor.TOP;
else if (this.equals(RectangleAnchor.BOTTOM)) {
  result = RectangleAnchor.BOTTOM;
else if (this.equals(RectangleAnchor.LEFT)) {
  result = RectangleAnchor.LEFT;
else if (this.equals(RectangleAnchor.RIGHT)) {
  result = RectangleAnchor.RIGHT;
else if (this.equals(RectangleAnchor.TOP_LEFT)) {
  result = RectangleAnchor.TOP_LEFT;
else if (this.equals(RectangleAnchor.TOP_RIGHT)) {
  result = RectangleAnchor.TOP_RIGHT;
else if (this.equals(RectangleAnchor.BOTTOM_LEFT)) {
  result = RectangleAnchor.BOTTOM_LEFT;
else if (this.equals(RectangleAnchor.BOTTOM_RIGHT)) {
  result = RectangleAnchor.BOTTOM_RIGHT;
origin: org.jfree/com.springsource.org.jfree

/**
 * Translates a shape to a new location such that the anchor point 
 * (relative to the rectangular bounds of the shape) aligns with the 
 * specified (x, y) coordinate in Java2D space.
 *  
 * @param shape  the shape (<code>null</code> not permitted).
 * @param anchor  the anchor (<code>null</code> not permitted).
 * @param locationX  the x-coordinate (in Java2D space).
 * @param locationY  the y-coordinate (in Java2D space).
 * 
 * @return A new and translated shape.
 */
public static Shape createTranslatedShape(final Shape shape, 
                     final RectangleAnchor anchor, 
                     final double locationX,
                     final double locationY) {
  if (shape == null) {
    throw new IllegalArgumentException("Null 'shape' argument.");
  }        
  if (anchor == null) {
    throw new IllegalArgumentException("Null 'anchor' argument.");
  }
  Point2D anchorPoint = RectangleAnchor.coordinates(
    shape.getBounds2D(), anchor
  );
  final AffineTransform transform = AffineTransform.getTranslateInstance(
    locationX - anchorPoint.getX(), locationY - anchorPoint.getY()
  );
  return transform.createTransformedShape(shape);   
}
origin: org.codehaus.jtstand/jtstand-chart

if (anchor.equals(RectangleAnchor.TOP_LEFT)) {
  result = TextAnchor.TOP_RIGHT;
else if (anchor.equals(RectangleAnchor.TOP)) {
  result = TextAnchor.TOP_CENTER;
else if (anchor.equals(RectangleAnchor.TOP_RIGHT)) {
  result = TextAnchor.TOP_LEFT;
else if (anchor.equals(RectangleAnchor.LEFT)) {
  result = TextAnchor.HALF_ASCENT_RIGHT;
else if (anchor.equals(RectangleAnchor.RIGHT)) {
  result = TextAnchor.HALF_ASCENT_LEFT;
else if (anchor.equals(RectangleAnchor.BOTTOM_LEFT)) {
  result = TextAnchor.BOTTOM_RIGHT;
else if (anchor.equals(RectangleAnchor.BOTTOM)) {
  result = TextAnchor.BOTTOM_CENTER;
else if (anchor.equals(RectangleAnchor.BOTTOM_RIGHT)) {
  result = TextAnchor.BOTTOM_LEFT;
origin: org.codehaus.jtstand/jtstand-chart

      labelOffsetType, LengthAdjustmentType.CONTRACT);
return RectangleAnchor.coordinates(anchorRect, anchor);
origin: org.jfree/com.springsource.org.jfree

if (this.equals(RectangleAnchor.CENTER)) {
  result = RectangleAnchor.CENTER;
else if (this.equals(RectangleAnchor.TOP)) {
  result = RectangleAnchor.TOP;
else if (this.equals(RectangleAnchor.BOTTOM)) {
  result = RectangleAnchor.BOTTOM;
else if (this.equals(RectangleAnchor.LEFT)) {
  result = RectangleAnchor.LEFT;
else if (this.equals(RectangleAnchor.RIGHT)) {
  result = RectangleAnchor.RIGHT;
else if (this.equals(RectangleAnchor.TOP_LEFT)) {
  result = RectangleAnchor.TOP_LEFT;
else if (this.equals(RectangleAnchor.TOP_RIGHT)) {
  result = RectangleAnchor.TOP_RIGHT;
else if (this.equals(RectangleAnchor.BOTTOM_LEFT)) {
  result = RectangleAnchor.BOTTOM_LEFT;
else if (this.equals(RectangleAnchor.BOTTOM_RIGHT)) {
  result = RectangleAnchor.BOTTOM_RIGHT;
origin: org.codehaus.jtstand/jtstand-chart

      LengthAdjustmentType.CONTRACT, labelOffsetForRange);
return RectangleAnchor.coordinates(anchorRect, anchor);
origin: org.codehaus.jtstand/jtstand-chart

if (this.blockAnchor.equals(RectangleAnchor.BOTTOM_LEFT)) {
  this.xOffset = 0.0;
  this.yOffset = 0.0;
else if (this.blockAnchor.equals(RectangleAnchor.BOTTOM)) {
  this.xOffset = -this.blockWidth / 2.0;
  this.yOffset = 0.0;
else if (this.blockAnchor.equals(RectangleAnchor.BOTTOM_RIGHT)) {
  this.xOffset = -this.blockWidth;
  this.yOffset = 0.0;
else if (this.blockAnchor.equals(RectangleAnchor.LEFT)) {
  this.xOffset = 0.0;
  this.yOffset = -this.blockHeight / 2.0;
else if (this.blockAnchor.equals(RectangleAnchor.CENTER)) {
  this.xOffset = -this.blockWidth / 2.0;
  this.yOffset = -this.blockHeight / 2.0;
else if (this.blockAnchor.equals(RectangleAnchor.RIGHT)) {
  this.xOffset = -this.blockWidth;
  this.yOffset = -this.blockHeight / 2.0;
else if (this.blockAnchor.equals(RectangleAnchor.TOP_LEFT)) {
  this.xOffset = 0.0;
  this.yOffset = -this.blockHeight;
else if (this.blockAnchor.equals(RectangleAnchor.TOP)) {
origin: org.codehaus.jtstand/jtstand-chart

      LengthAdjustmentType.CONTRACT, labelOffsetType);
return RectangleAnchor.coordinates(anchorRect, anchor);
origin: org.codehaus.jtstand/jtstand-chart

if (anchor.equals(RectangleAnchor.TOP_LEFT)) {
  result = TextAnchor.BOTTOM_LEFT;
else if (anchor.equals(RectangleAnchor.TOP)) {
  result = TextAnchor.BOTTOM_CENTER;
else if (anchor.equals(RectangleAnchor.TOP_RIGHT)) {
  result = TextAnchor.BOTTOM_RIGHT;
else if (anchor.equals(RectangleAnchor.LEFT)) {
  result = TextAnchor.HALF_ASCENT_LEFT;
else if (anchor.equals(RectangleAnchor.RIGHT)) {
  result = TextAnchor.HALF_ASCENT_RIGHT;
else if (anchor.equals(RectangleAnchor.BOTTOM_LEFT)) {
  result = TextAnchor.TOP_LEFT;
else if (anchor.equals(RectangleAnchor.BOTTOM)) {
  result = TextAnchor.TOP_CENTER;
else if (anchor.equals(RectangleAnchor.BOTTOM_RIGHT)) {
  result = TextAnchor.TOP_RIGHT;
origin: org.codehaus.jtstand/jtstand-chart

Point2D location = RectangleAnchor.coordinates(area,
    this.shapeLocation);
Shape aLine = ShapeUtilities.createTranslatedShape(getLine(),
Point2D location = RectangleAnchor.coordinates(area,
    this.shapeLocation);
org.jfree.uiRectangleAnchor

Javadoc

Used to indicate an anchor point for a rectangle.

Most used methods

  • coordinates
    Returns the (x, y) coordinates of the specified anchor.
  • equals
    Returns true if this object is equal to the specified object, and false otherwise.
  • createRectangle
    Creates a new rectangle with the specified dimensions that is aligned to the given anchor point (anc
  • hashCode
    Returns a hash code value for the object.

Popular in Java

  • Making http post requests using okhttp
  • setScale (BigDecimal)
  • requestLocationUpdates (LocationManager)
  • onRequestPermissionsResult (Fragment)
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Runner (org.openjdk.jmh.runner)
  • Top 12 Jupyter Notebook extensions
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