Java Code Examples for org.jfree.chart.labels.ItemLabelAnchor#INSIDE1

The following examples show how to use org.jfree.chart.labels.ItemLabelAnchor#INSIDE1 . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BarRenderer.java    From ECG-Viewer with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns <code>true</code> if the specified anchor point is inside a bar.
 *
 * @param anchor  the anchor point.
 *
 * @return A boolean.
 */
private boolean isInternalAnchor(ItemLabelAnchor anchor) {
    return anchor == ItemLabelAnchor.CENTER
           || anchor == ItemLabelAnchor.INSIDE1
           || anchor == ItemLabelAnchor.INSIDE2
           || anchor == ItemLabelAnchor.INSIDE3
           || anchor == ItemLabelAnchor.INSIDE4
           || anchor == ItemLabelAnchor.INSIDE5
           || anchor == ItemLabelAnchor.INSIDE6
           || anchor == ItemLabelAnchor.INSIDE7
           || anchor == ItemLabelAnchor.INSIDE8
           || anchor == ItemLabelAnchor.INSIDE9
           || anchor == ItemLabelAnchor.INSIDE10
           || anchor == ItemLabelAnchor.INSIDE11
           || anchor == ItemLabelAnchor.INSIDE12;
}
 
Example 2
Source File: XYBarRenderer.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns <code>true</code> if the specified anchor point is inside a bar.
 *
 * @param anchor  the anchor point.
 *
 * @return A boolean.
 */
private boolean isInternalAnchor(ItemLabelAnchor anchor) {
    return anchor == ItemLabelAnchor.CENTER
           || anchor == ItemLabelAnchor.INSIDE1
           || anchor == ItemLabelAnchor.INSIDE2
           || anchor == ItemLabelAnchor.INSIDE3
           || anchor == ItemLabelAnchor.INSIDE4
           || anchor == ItemLabelAnchor.INSIDE5
           || anchor == ItemLabelAnchor.INSIDE6
           || anchor == ItemLabelAnchor.INSIDE7
           || anchor == ItemLabelAnchor.INSIDE8
           || anchor == ItemLabelAnchor.INSIDE9
           || anchor == ItemLabelAnchor.INSIDE10
           || anchor == ItemLabelAnchor.INSIDE11
           || anchor == ItemLabelAnchor.INSIDE12;
}
 
Example 3
Source File: BarRenderer.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns <code>true</code> if the specified anchor point is inside a bar.
 *
 * @param anchor  the anchor point.
 *
 * @return A boolean.
 */
private boolean isInternalAnchor(ItemLabelAnchor anchor) {
    return anchor == ItemLabelAnchor.CENTER
           || anchor == ItemLabelAnchor.INSIDE1
           || anchor == ItemLabelAnchor.INSIDE2
           || anchor == ItemLabelAnchor.INSIDE3
           || anchor == ItemLabelAnchor.INSIDE4
           || anchor == ItemLabelAnchor.INSIDE5
           || anchor == ItemLabelAnchor.INSIDE6
           || anchor == ItemLabelAnchor.INSIDE7
           || anchor == ItemLabelAnchor.INSIDE8
           || anchor == ItemLabelAnchor.INSIDE9
           || anchor == ItemLabelAnchor.INSIDE10
           || anchor == ItemLabelAnchor.INSIDE11
           || anchor == ItemLabelAnchor.INSIDE12;
}
 
Example 4
Source File: XYBarRenderer.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns <code>true</code> if the specified anchor point is inside a bar.
 *
 * @param anchor  the anchor point.
 *
 * @return A boolean.
 */
private boolean isInternalAnchor(ItemLabelAnchor anchor) {
    return anchor == ItemLabelAnchor.CENTER
           || anchor == ItemLabelAnchor.INSIDE1
           || anchor == ItemLabelAnchor.INSIDE2
           || anchor == ItemLabelAnchor.INSIDE3
           || anchor == ItemLabelAnchor.INSIDE4
           || anchor == ItemLabelAnchor.INSIDE5
           || anchor == ItemLabelAnchor.INSIDE6
           || anchor == ItemLabelAnchor.INSIDE7
           || anchor == ItemLabelAnchor.INSIDE8
           || anchor == ItemLabelAnchor.INSIDE9
           || anchor == ItemLabelAnchor.INSIDE10
           || anchor == ItemLabelAnchor.INSIDE11
           || anchor == ItemLabelAnchor.INSIDE12;
}
 
Example 5
Source File: BarRenderer.java    From opensim-gui with Apache License 2.0 6 votes vote down vote up
/**
 * Returns <code>true</code> if the specified anchor point is inside a bar.
 * 
 * @param anchor  the anchor point.
 * 
 * @return A boolean.
 */
private boolean isInternalAnchor(ItemLabelAnchor anchor) {
    return anchor == ItemLabelAnchor.CENTER 
           || anchor == ItemLabelAnchor.INSIDE1
           || anchor == ItemLabelAnchor.INSIDE2
           || anchor == ItemLabelAnchor.INSIDE3
           || anchor == ItemLabelAnchor.INSIDE4
           || anchor == ItemLabelAnchor.INSIDE5
           || anchor == ItemLabelAnchor.INSIDE6
           || anchor == ItemLabelAnchor.INSIDE7
           || anchor == ItemLabelAnchor.INSIDE8
           || anchor == ItemLabelAnchor.INSIDE9
           || anchor == ItemLabelAnchor.INSIDE10
           || anchor == ItemLabelAnchor.INSIDE11
           || anchor == ItemLabelAnchor.INSIDE12;  
}
 
Example 6
Source File: BarRenderer.java    From buffer_bci with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns <code>true</code> if the specified anchor point is inside a bar.
 *
 * @param anchor  the anchor point.
 *
 * @return A boolean.
 */
private boolean isInternalAnchor(ItemLabelAnchor anchor) {
    return anchor == ItemLabelAnchor.CENTER
           || anchor == ItemLabelAnchor.INSIDE1
           || anchor == ItemLabelAnchor.INSIDE2
           || anchor == ItemLabelAnchor.INSIDE3
           || anchor == ItemLabelAnchor.INSIDE4
           || anchor == ItemLabelAnchor.INSIDE5
           || anchor == ItemLabelAnchor.INSIDE6
           || anchor == ItemLabelAnchor.INSIDE7
           || anchor == ItemLabelAnchor.INSIDE8
           || anchor == ItemLabelAnchor.INSIDE9
           || anchor == ItemLabelAnchor.INSIDE10
           || anchor == ItemLabelAnchor.INSIDE11
           || anchor == ItemLabelAnchor.INSIDE12;
}
 
Example 7
Source File: BarRenderer.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns <code>true</code> if the specified anchor point is inside a bar.
 * 
 * @param anchor  the anchor point.
 * 
 * @return A boolean.
 */
private boolean isInternalAnchor(ItemLabelAnchor anchor) {
    return anchor == ItemLabelAnchor.CENTER 
           || anchor == ItemLabelAnchor.INSIDE1
           || anchor == ItemLabelAnchor.INSIDE2
           || anchor == ItemLabelAnchor.INSIDE3
           || anchor == ItemLabelAnchor.INSIDE4
           || anchor == ItemLabelAnchor.INSIDE5
           || anchor == ItemLabelAnchor.INSIDE6
           || anchor == ItemLabelAnchor.INSIDE7
           || anchor == ItemLabelAnchor.INSIDE8
           || anchor == ItemLabelAnchor.INSIDE9
           || anchor == ItemLabelAnchor.INSIDE10
           || anchor == ItemLabelAnchor.INSIDE11
           || anchor == ItemLabelAnchor.INSIDE12;  
}
 
Example 8
Source File: XYBarRenderer.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns <code>true</code> if the specified anchor point is inside a bar.
 * 
 * @param anchor  the anchor point.
 * 
 * @return A boolean.
 */
private boolean isInternalAnchor(ItemLabelAnchor anchor) {
    return anchor == ItemLabelAnchor.CENTER 
           || anchor == ItemLabelAnchor.INSIDE1
           || anchor == ItemLabelAnchor.INSIDE2
           || anchor == ItemLabelAnchor.INSIDE3
           || anchor == ItemLabelAnchor.INSIDE4
           || anchor == ItemLabelAnchor.INSIDE5
           || anchor == ItemLabelAnchor.INSIDE6
           || anchor == ItemLabelAnchor.INSIDE7
           || anchor == ItemLabelAnchor.INSIDE8
           || anchor == ItemLabelAnchor.INSIDE9
           || anchor == ItemLabelAnchor.INSIDE10
           || anchor == ItemLabelAnchor.INSIDE11
           || anchor == ItemLabelAnchor.INSIDE12;  
}
 
Example 9
Source File: BarRenderer.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns <code>true</code> if the specified anchor point is inside a bar.
 *
 * @param anchor  the anchor point.
 *
 * @return A boolean.
 */
private boolean isInternalAnchor(ItemLabelAnchor anchor) {
    return anchor == ItemLabelAnchor.CENTER
           || anchor == ItemLabelAnchor.INSIDE1
           || anchor == ItemLabelAnchor.INSIDE2
           || anchor == ItemLabelAnchor.INSIDE3
           || anchor == ItemLabelAnchor.INSIDE4
           || anchor == ItemLabelAnchor.INSIDE5
           || anchor == ItemLabelAnchor.INSIDE6
           || anchor == ItemLabelAnchor.INSIDE7
           || anchor == ItemLabelAnchor.INSIDE8
           || anchor == ItemLabelAnchor.INSIDE9
           || anchor == ItemLabelAnchor.INSIDE10
           || anchor == ItemLabelAnchor.INSIDE11
           || anchor == ItemLabelAnchor.INSIDE12;
}
 
Example 10
Source File: XYBarRenderer.java    From astor with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns <code>true</code> if the specified anchor point is inside a bar.
 *
 * @param anchor  the anchor point.
 *
 * @return A boolean.
 */
private boolean isInternalAnchor(ItemLabelAnchor anchor) {
    return anchor == ItemLabelAnchor.CENTER
           || anchor == ItemLabelAnchor.INSIDE1
           || anchor == ItemLabelAnchor.INSIDE2
           || anchor == ItemLabelAnchor.INSIDE3
           || anchor == ItemLabelAnchor.INSIDE4
           || anchor == ItemLabelAnchor.INSIDE5
           || anchor == ItemLabelAnchor.INSIDE6
           || anchor == ItemLabelAnchor.INSIDE7
           || anchor == ItemLabelAnchor.INSIDE8
           || anchor == ItemLabelAnchor.INSIDE9
           || anchor == ItemLabelAnchor.INSIDE10
           || anchor == ItemLabelAnchor.INSIDE11
           || anchor == ItemLabelAnchor.INSIDE12;
}
 
Example 11
Source File: XYBarRenderer.java    From openstock with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns <code>true</code> if the specified anchor point is inside a bar.
 *
 * @param anchor  the anchor point.
 *
 * @return A boolean.
 */
private boolean isInternalAnchor(ItemLabelAnchor anchor) {
    return anchor == ItemLabelAnchor.CENTER
           || anchor == ItemLabelAnchor.INSIDE1
           || anchor == ItemLabelAnchor.INSIDE2
           || anchor == ItemLabelAnchor.INSIDE3
           || anchor == ItemLabelAnchor.INSIDE4
           || anchor == ItemLabelAnchor.INSIDE5
           || anchor == ItemLabelAnchor.INSIDE6
           || anchor == ItemLabelAnchor.INSIDE7
           || anchor == ItemLabelAnchor.INSIDE8
           || anchor == ItemLabelAnchor.INSIDE9
           || anchor == ItemLabelAnchor.INSIDE10
           || anchor == ItemLabelAnchor.INSIDE11
           || anchor == ItemLabelAnchor.INSIDE12;
}
 
Example 12
Source File: XYBarRenderer.java    From ECG-Viewer with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns <code>true</code> if the specified anchor point is inside a bar.
 *
 * @param anchor  the anchor point.
 *
 * @return A boolean.
 */
private boolean isInternalAnchor(ItemLabelAnchor anchor) {
    return anchor == ItemLabelAnchor.CENTER
           || anchor == ItemLabelAnchor.INSIDE1
           || anchor == ItemLabelAnchor.INSIDE2
           || anchor == ItemLabelAnchor.INSIDE3
           || anchor == ItemLabelAnchor.INSIDE4
           || anchor == ItemLabelAnchor.INSIDE5
           || anchor == ItemLabelAnchor.INSIDE6
           || anchor == ItemLabelAnchor.INSIDE7
           || anchor == ItemLabelAnchor.INSIDE8
           || anchor == ItemLabelAnchor.INSIDE9
           || anchor == ItemLabelAnchor.INSIDE10
           || anchor == ItemLabelAnchor.INSIDE11
           || anchor == ItemLabelAnchor.INSIDE12;
}
 
Example 13
Source File: BarRenderer.java    From SIMVA-SoS with Apache License 2.0 6 votes vote down vote up
/**
 * Returns <code>true</code> if the specified anchor point is inside a bar.
 *
 * @param anchor  the anchor point.
 *
 * @return A boolean.
 */
private boolean isInternalAnchor(ItemLabelAnchor anchor) {
    return anchor == ItemLabelAnchor.CENTER
           || anchor == ItemLabelAnchor.INSIDE1
           || anchor == ItemLabelAnchor.INSIDE2
           || anchor == ItemLabelAnchor.INSIDE3
           || anchor == ItemLabelAnchor.INSIDE4
           || anchor == ItemLabelAnchor.INSIDE5
           || anchor == ItemLabelAnchor.INSIDE6
           || anchor == ItemLabelAnchor.INSIDE7
           || anchor == ItemLabelAnchor.INSIDE8
           || anchor == ItemLabelAnchor.INSIDE9
           || anchor == ItemLabelAnchor.INSIDE10
           || anchor == ItemLabelAnchor.INSIDE11
           || anchor == ItemLabelAnchor.INSIDE12;
}
 
Example 14
Source File: XYBarRenderer.java    From SIMVA-SoS with Apache License 2.0 6 votes vote down vote up
/**
 * Returns <code>true</code> if the specified anchor point is inside a bar.
 *
 * @param anchor  the anchor point.
 *
 * @return A boolean.
 */
private boolean isInternalAnchor(ItemLabelAnchor anchor) {
    return anchor == ItemLabelAnchor.CENTER
           || anchor == ItemLabelAnchor.INSIDE1
           || anchor == ItemLabelAnchor.INSIDE2
           || anchor == ItemLabelAnchor.INSIDE3
           || anchor == ItemLabelAnchor.INSIDE4
           || anchor == ItemLabelAnchor.INSIDE5
           || anchor == ItemLabelAnchor.INSIDE6
           || anchor == ItemLabelAnchor.INSIDE7
           || anchor == ItemLabelAnchor.INSIDE8
           || anchor == ItemLabelAnchor.INSIDE9
           || anchor == ItemLabelAnchor.INSIDE10
           || anchor == ItemLabelAnchor.INSIDE11
           || anchor == ItemLabelAnchor.INSIDE12;
}
 
Example 15
Source File: BarRenderer.java    From ccu-historian with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns <code>true</code> if the specified anchor point is inside a bar.
 *
 * @param anchor  the anchor point.
 *
 * @return A boolean.
 */
private boolean isInternalAnchor(ItemLabelAnchor anchor) {
    return anchor == ItemLabelAnchor.CENTER
           || anchor == ItemLabelAnchor.INSIDE1
           || anchor == ItemLabelAnchor.INSIDE2
           || anchor == ItemLabelAnchor.INSIDE3
           || anchor == ItemLabelAnchor.INSIDE4
           || anchor == ItemLabelAnchor.INSIDE5
           || anchor == ItemLabelAnchor.INSIDE6
           || anchor == ItemLabelAnchor.INSIDE7
           || anchor == ItemLabelAnchor.INSIDE8
           || anchor == ItemLabelAnchor.INSIDE9
           || anchor == ItemLabelAnchor.INSIDE10
           || anchor == ItemLabelAnchor.INSIDE11
           || anchor == ItemLabelAnchor.INSIDE12;
}
 
Example 16
Source File: XYBarRenderer.java    From ccu-historian with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns <code>true</code> if the specified anchor point is inside a bar.
 *
 * @param anchor  the anchor point.
 *
 * @return A boolean.
 */
private boolean isInternalAnchor(ItemLabelAnchor anchor) {
    return anchor == ItemLabelAnchor.CENTER
           || anchor == ItemLabelAnchor.INSIDE1
           || anchor == ItemLabelAnchor.INSIDE2
           || anchor == ItemLabelAnchor.INSIDE3
           || anchor == ItemLabelAnchor.INSIDE4
           || anchor == ItemLabelAnchor.INSIDE5
           || anchor == ItemLabelAnchor.INSIDE6
           || anchor == ItemLabelAnchor.INSIDE7
           || anchor == ItemLabelAnchor.INSIDE8
           || anchor == ItemLabelAnchor.INSIDE9
           || anchor == ItemLabelAnchor.INSIDE10
           || anchor == ItemLabelAnchor.INSIDE11
           || anchor == ItemLabelAnchor.INSIDE12;
}
 
Example 17
Source File: BarRenderer.java    From openstock with GNU General Public License v3.0 6 votes vote down vote up
/**
 * Returns <code>true</code> if the specified anchor point is inside a bar.
 *
 * @param anchor  the anchor point.
 *
 * @return A boolean.
 */
private boolean isInternalAnchor(ItemLabelAnchor anchor) {
    return anchor == ItemLabelAnchor.CENTER
           || anchor == ItemLabelAnchor.INSIDE1
           || anchor == ItemLabelAnchor.INSIDE2
           || anchor == ItemLabelAnchor.INSIDE3
           || anchor == ItemLabelAnchor.INSIDE4
           || anchor == ItemLabelAnchor.INSIDE5
           || anchor == ItemLabelAnchor.INSIDE6
           || anchor == ItemLabelAnchor.INSIDE7
           || anchor == ItemLabelAnchor.INSIDE8
           || anchor == ItemLabelAnchor.INSIDE9
           || anchor == ItemLabelAnchor.INSIDE10
           || anchor == ItemLabelAnchor.INSIDE11
           || anchor == ItemLabelAnchor.INSIDE12;
}
 
Example 18
Source File: CustomClusteredXYBarRenderer.java    From openbd-core with GNU General Public License v3.0 4 votes vote down vote up
private Point2D calculateLabelAnchorPoint(ItemLabelAnchor anchor, Rectangle2D bar, PlotOrientation orientation) {
	Point2D result = null;
	double offset = getItemLabelAnchorOffset();
	double x0 = bar.getX() - offset;
	double x1 = bar.getX();
	double x2 = bar.getX() + offset;
	double x3 = bar.getCenterX();
	double x4 = bar.getMaxX() - offset;
	double x5 = bar.getMaxX();
	double x6 = bar.getMaxX() + offset;

	double y0 = bar.getMaxY() + offset;
	double y1 = bar.getMaxY();
	double y2 = bar.getMaxY() - offset;
	double y3 = bar.getCenterY();
	double y4 = bar.getMinY() + offset;
	double y5 = bar.getMinY();
	double y6 = bar.getMinY() - offset;

	if (anchor == ItemLabelAnchor.CENTER) {
		result = new Point2D.Double(x3, y3);
	} else if (anchor == ItemLabelAnchor.INSIDE1) {
		result = new Point2D.Double(x4, y4);
	} else if (anchor == ItemLabelAnchor.INSIDE2) {
		result = new Point2D.Double(x4, y4);
	} else if (anchor == ItemLabelAnchor.INSIDE3) {
		result = new Point2D.Double(x4, y3);
	} else if (anchor == ItemLabelAnchor.INSIDE4) {
		result = new Point2D.Double(x4, y2);
	} else if (anchor == ItemLabelAnchor.INSIDE5) {
		result = new Point2D.Double(x4, y2);
	} else if (anchor == ItemLabelAnchor.INSIDE6) {
		result = new Point2D.Double(x3, y2);
	} else if (anchor == ItemLabelAnchor.INSIDE7) {
		result = new Point2D.Double(x2, y2);
	} else if (anchor == ItemLabelAnchor.INSIDE8) {
		result = new Point2D.Double(x2, y2);
	} else if (anchor == ItemLabelAnchor.INSIDE9) {
		result = new Point2D.Double(x2, y3);
	} else if (anchor == ItemLabelAnchor.INSIDE10) {
		result = new Point2D.Double(x2, y4);
	} else if (anchor == ItemLabelAnchor.INSIDE11) {
		result = new Point2D.Double(x2, y4);
	} else if (anchor == ItemLabelAnchor.INSIDE12) {
		result = new Point2D.Double(x3, y4);
	} else if (anchor == ItemLabelAnchor.OUTSIDE1) {
		result = new Point2D.Double(x5, y6);
	} else if (anchor == ItemLabelAnchor.OUTSIDE2) {
		result = new Point2D.Double(x6, y5);
	} else if (anchor == ItemLabelAnchor.OUTSIDE3) {
		result = new Point2D.Double(x6, y3);
	} else if (anchor == ItemLabelAnchor.OUTSIDE4) {
		result = new Point2D.Double(x6, y1);
	} else if (anchor == ItemLabelAnchor.OUTSIDE5) {
		result = new Point2D.Double(x5, y0);
	} else if (anchor == ItemLabelAnchor.OUTSIDE6) {
		result = new Point2D.Double(x3, y0);
	} else if (anchor == ItemLabelAnchor.OUTSIDE7) {
		result = new Point2D.Double(x1, y0);
	} else if (anchor == ItemLabelAnchor.OUTSIDE8) {
		result = new Point2D.Double(x0, y1);
	} else if (anchor == ItemLabelAnchor.OUTSIDE9) {
		result = new Point2D.Double(x0, y3);
	} else if (anchor == ItemLabelAnchor.OUTSIDE10) {
		result = new Point2D.Double(x0, y5);
	} else if (anchor == ItemLabelAnchor.OUTSIDE11) {
		result = new Point2D.Double(x1, y6);
	} else if (anchor == ItemLabelAnchor.OUTSIDE12) {
		result = new Point2D.Double(x3, y6);
	}

	return result;
}
 
Example 19
Source File: PseudoSpectraRenderer.java    From mzmine2 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Calculates the item label anchor point.
 *
 * @param anchor the anchor.
 * @param bar the bar.
 * @param orientation the plot orientation.
 *
 * @return The anchor point.
 */
private Point2D calculateLabelAnchorPoint(ItemLabelAnchor anchor, Rectangle2D bar,
    PlotOrientation orientation) {

  Point2D result = null;
  double offset = getItemLabelAnchorOffset();
  double x0 = bar.getX() - offset;
  double x1 = bar.getX();
  double x2 = bar.getX() + offset;
  double x3 = bar.getCenterX();
  double x4 = bar.getMaxX() - offset;
  double x5 = bar.getMaxX();
  double x6 = bar.getMaxX() + offset;

  double y0 = bar.getMaxY() + offset;
  double y1 = bar.getMaxY();
  double y2 = bar.getMaxY() - offset;
  double y3 = bar.getCenterY();
  double y4 = bar.getMinY() + offset;
  double y5 = bar.getMinY();
  double y6 = bar.getMinY() - offset;

  if (anchor == ItemLabelAnchor.CENTER) {
    result = new Point2D.Double(x3, y3);
  } else if (anchor == ItemLabelAnchor.INSIDE1) {
    result = new Point2D.Double(x4, y4);
  } else if (anchor == ItemLabelAnchor.INSIDE2) {
    result = new Point2D.Double(x4, y4);
  } else if (anchor == ItemLabelAnchor.INSIDE3) {
    result = new Point2D.Double(x4, y3);
  } else if (anchor == ItemLabelAnchor.INSIDE4) {
    result = new Point2D.Double(x4, y2);
  } else if (anchor == ItemLabelAnchor.INSIDE5) {
    result = new Point2D.Double(x4, y2);
  } else if (anchor == ItemLabelAnchor.INSIDE6) {
    result = new Point2D.Double(x3, y2);
  } else if (anchor == ItemLabelAnchor.INSIDE7) {
    result = new Point2D.Double(x2, y2);
  } else if (anchor == ItemLabelAnchor.INSIDE8) {
    result = new Point2D.Double(x2, y2);
  } else if (anchor == ItemLabelAnchor.INSIDE9) {
    result = new Point2D.Double(x2, y3);
  } else if (anchor == ItemLabelAnchor.INSIDE10) {
    result = new Point2D.Double(x2, y4);
  } else if (anchor == ItemLabelAnchor.INSIDE11) {
    result = new Point2D.Double(x2, y4);
  } else if (anchor == ItemLabelAnchor.INSIDE12) {
    result = new Point2D.Double(x3, y4);
  } else if (anchor == ItemLabelAnchor.OUTSIDE1) {
    result = new Point2D.Double(x5, y6);
  } else if (anchor == ItemLabelAnchor.OUTSIDE2) {
    result = new Point2D.Double(x6, y5);
  } else if (anchor == ItemLabelAnchor.OUTSIDE3) {
    result = new Point2D.Double(x6, y3);
  } else if (anchor == ItemLabelAnchor.OUTSIDE4) {
    result = new Point2D.Double(x6, y1);
  } else if (anchor == ItemLabelAnchor.OUTSIDE5) {
    result = new Point2D.Double(x5, y0);
  } else if (anchor == ItemLabelAnchor.OUTSIDE6) {
    result = new Point2D.Double(x3, y0);
  } else if (anchor == ItemLabelAnchor.OUTSIDE7) {
    result = new Point2D.Double(x1, y0);
  } else if (anchor == ItemLabelAnchor.OUTSIDE8) {
    result = new Point2D.Double(x0, y1);
  } else if (anchor == ItemLabelAnchor.OUTSIDE9) {
    result = new Point2D.Double(x0, y3);
  } else if (anchor == ItemLabelAnchor.OUTSIDE10) {
    result = new Point2D.Double(x0, y5);
  } else if (anchor == ItemLabelAnchor.OUTSIDE11) {
    result = new Point2D.Double(x1, y6);
  } else if (anchor == ItemLabelAnchor.OUTSIDE12) {
    result = new Point2D.Double(x3, y6);
  }

  return result;

}
 
Example 20
Source File: PseudoSpectraRenderer.java    From mzmine3 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Calculates the item label anchor point.
 *
 * @param anchor the anchor.
 * @param bar the bar.
 * @param orientation the plot orientation.
 *
 * @return The anchor point.
 */
private Point2D calculateLabelAnchorPoint(ItemLabelAnchor anchor, Rectangle2D bar,
    PlotOrientation orientation) {

  Point2D result = null;
  double offset = getItemLabelAnchorOffset();
  double x0 = bar.getX() - offset;
  double x1 = bar.getX();
  double x2 = bar.getX() + offset;
  double x3 = bar.getCenterX();
  double x4 = bar.getMaxX() - offset;
  double x5 = bar.getMaxX();
  double x6 = bar.getMaxX() + offset;

  double y0 = bar.getMaxY() + offset;
  double y1 = bar.getMaxY();
  double y2 = bar.getMaxY() - offset;
  double y3 = bar.getCenterY();
  double y4 = bar.getMinY() + offset;
  double y5 = bar.getMinY();
  double y6 = bar.getMinY() - offset;

  if (anchor == ItemLabelAnchor.CENTER) {
    result = new Point2D.Double(x3, y3);
  } else if (anchor == ItemLabelAnchor.INSIDE1) {
    result = new Point2D.Double(x4, y4);
  } else if (anchor == ItemLabelAnchor.INSIDE2) {
    result = new Point2D.Double(x4, y4);
  } else if (anchor == ItemLabelAnchor.INSIDE3) {
    result = new Point2D.Double(x4, y3);
  } else if (anchor == ItemLabelAnchor.INSIDE4) {
    result = new Point2D.Double(x4, y2);
  } else if (anchor == ItemLabelAnchor.INSIDE5) {
    result = new Point2D.Double(x4, y2);
  } else if (anchor == ItemLabelAnchor.INSIDE6) {
    result = new Point2D.Double(x3, y2);
  } else if (anchor == ItemLabelAnchor.INSIDE7) {
    result = new Point2D.Double(x2, y2);
  } else if (anchor == ItemLabelAnchor.INSIDE8) {
    result = new Point2D.Double(x2, y2);
  } else if (anchor == ItemLabelAnchor.INSIDE9) {
    result = new Point2D.Double(x2, y3);
  } else if (anchor == ItemLabelAnchor.INSIDE10) {
    result = new Point2D.Double(x2, y4);
  } else if (anchor == ItemLabelAnchor.INSIDE11) {
    result = new Point2D.Double(x2, y4);
  } else if (anchor == ItemLabelAnchor.INSIDE12) {
    result = new Point2D.Double(x3, y4);
  } else if (anchor == ItemLabelAnchor.OUTSIDE1) {
    result = new Point2D.Double(x5, y6);
  } else if (anchor == ItemLabelAnchor.OUTSIDE2) {
    result = new Point2D.Double(x6, y5);
  } else if (anchor == ItemLabelAnchor.OUTSIDE3) {
    result = new Point2D.Double(x6, y3);
  } else if (anchor == ItemLabelAnchor.OUTSIDE4) {
    result = new Point2D.Double(x6, y1);
  } else if (anchor == ItemLabelAnchor.OUTSIDE5) {
    result = new Point2D.Double(x5, y0);
  } else if (anchor == ItemLabelAnchor.OUTSIDE6) {
    result = new Point2D.Double(x3, y0);
  } else if (anchor == ItemLabelAnchor.OUTSIDE7) {
    result = new Point2D.Double(x1, y0);
  } else if (anchor == ItemLabelAnchor.OUTSIDE8) {
    result = new Point2D.Double(x0, y1);
  } else if (anchor == ItemLabelAnchor.OUTSIDE9) {
    result = new Point2D.Double(x0, y3);
  } else if (anchor == ItemLabelAnchor.OUTSIDE10) {
    result = new Point2D.Double(x0, y5);
  } else if (anchor == ItemLabelAnchor.OUTSIDE11) {
    result = new Point2D.Double(x1, y6);
  } else if (anchor == ItemLabelAnchor.OUTSIDE12) {
    result = new Point2D.Double(x3, y6);
  }

  return result;

}