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

How to use
RectangleInsets
in
org.jfree.ui

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

Refine searchRefine arrow

  • JFreeChart
  • Rectangle2D
  • CategoryPlot
  • CategoryAxis
  • Graphics2D
  • ChartFactory
  • NumberAxis
origin: jenkinsci/jenkins

final JFreeChart chart = ChartFactory.createLineChart(null, // chart title
    );
chart.setBackgroundPaint(Color.white);
final CategoryPlot plot = chart.getCategoryPlot();
plot.setBackgroundPaint(Color.WHITE);
plot.setOutlinePaint(null);
plot.setRangeGridlinesVisible(true);
plot.setRangeGridlinePaint(Color.black);
plot.setDomainAxis(domainAxis);
domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
domainAxis.setLowerMargin(0.0);
domainAxis.setUpperMargin(0.0);
domainAxis.setCategoryMargin(0.0);
final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
plot.setInsets(new RectangleInsets(0, 0, 0, 5.0));
origin: org.jfree/jcommon

/**
 * Shrinks the given rectangle by the amount of these insets.
 * 
 * @param area  the area (<code>null</code> not permitted).
 */
public void trim(final Rectangle2D area) {
  final double w = area.getWidth();
  final double h = area.getHeight();
  final double l = calculateLeftInset(w);
  final double r = calculateRightInset(w);
  final double t = calculateTopInset(h);
  final double b = calculateBottomInset(h);
  area.setRect(area.getX() + l, area.getY() + t, w - l - r, h - t - b);    
}
 
origin: jfree/jcommon

       final RectangleAnchor anchor) {
final Size2D d1 = this.textBlock.calculateDimensions(g2);
final double w = this.interiorGap.extendWidth(d1.getWidth());
final double h = this.interiorGap.extendHeight(d1.getHeight());
final Size2D d2 = new Size2D(w, h);
final Rectangle2D bounds
    = RectangleAnchor.createRectangle(d2, x, y, anchor);
double xx = bounds.getX();
double yy = bounds.getY();
    bounds.getWidth(), bounds.getHeight());
  g2.setPaint(this.shadowPaint);
  g2.fill(shadow);
  g2.setPaint(this.backgroundPaint);
  g2.fill(bounds);
    (float) (xx + this.interiorGap.calculateLeftInset(w)),
    (float) (yy + this.interiorGap.calculateTopInset(h)),
    TextBlockAnchor.TOP_LEFT);
origin: org.jfree/jcommon

double bottomMargin = 0.0;
if (vertical) {
  topMargin = calculateTopOutset(base.getHeight());
  bottomMargin = calculateBottomOutset(base.getHeight());
  leftMargin = calculateLeftOutset(base.getWidth());
  rightMargin = calculateRightOutset(base.getWidth());
origin: org.codehaus.jtstand/jtstand-chart

FontMetrics fm = g2.getFontMetrics(this.labelInfo[band].getLabelFont());
if (edge == RectangleEdge.BOTTOM) {
  delta1 = this.labelInfo[band].getPadding().calculateTopOutset(
      fm.getHeight());
  delta1 = this.labelInfo[band].getPadding().calculateBottomOutset(
      fm.getHeight());
long axisMin = this.first.getFirstMillisecond();
long axisMax = this.last.getLastMillisecond();
g2.setFont(this.labelInfo[band].getLabelFont());
g2.setPaint(this.labelInfo[band].getLabelPaint());
Rectangle2D b2 = TextUtilities.getTextBounds(label2, g2,
    g2.getFontMetrics());
double w = Math.max(b1.getWidth(), b2.getWidth());
long ww = Math.round(java2DToValue(dataArea.getX() + w + 5.0,
    dataArea, edge));
if (isInverted()) {
    used += this.labelInfo[band].getPadding().calculateBottomOutset(
        fm.getHeight());
    used += this.labelInfo[band].getPadding().calculateTopOutset(
        fm.getHeight());
origin: org.codehaus.jtstand/jtstand-chart

  PiePlotState state) {
Composite originalComposite = g2.getComposite();
g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER,
    1.0f));
RectangleInsets labelInsets = new RectangleInsets(UnitType.RELATIVE,
    0.18, 0.18, 0.18, 0.18);
Rectangle2D labelsArea = labelInsets.createInsetRectangle(pieArea);
double runningTotal = 0.0;
Iterator iterator = keys.iterator();
      continue;
    g2.setFont(this.labelFont);
    FontMetrics fm = g2.getFontMetrics();
    Rectangle2D bounds = TextUtilities.getTextBounds(label, g2, fm);
    Rectangle2D out = this.labelPadding.createOutsetRectangle(
        bounds);
    Shape bg = ShapeUtilities.createTranslatedShape(out,
        x - bounds.getCenterX(), y - bounds.getCenterY());
    if (this.labelShadowPaint != null) {
      Shape shadow = ShapeUtilities.createTranslatedShape(bg,
origin: stackoverflow.com

private RectangleInsets insets = new RectangleInsets(1, 1, 1, 1);
public void draw(Graphics2D g2, Rectangle2D area) {
  Dimension arcs = new Dimension(45,45);
  double t = this.insets.calculateTopInset(area.getHeight());
  double b = this.insets.calculateBottomInset(area.getHeight());
  double l = this.insets.calculateLeftInset(area.getWidth());
  double r = this.insets.calculateRightInset(area.getWidth());
  double x = area.getX();
  double w = area.getWidth();
  double h = area.getHeight();
  g2.setPaint(this.paint);
  g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
    g2.fill(myrect);
origin: org.codehaus.jtstand/jtstand-chart

double w = area.getWidth();
double h = area.getHeight();
double t = this.insets.calculateTopInset(h);
double b = this.insets.calculateBottomInset(h);
double l = this.insets.calculateLeftInset(w);
double r = this.insets.calculateRightInset(w);
double x = area.getX();
double y = area.getY();
double x0 = x + l / 2.0;
double y0 = y + h - b / 2.0;
double y1 = y + t / 2.0;
g2.setPaint(getPaint());
g2.setStroke(getStroke());
Line2D line = new Line2D.Double();
if (t > 0.0) {
  line.setLine(x0, y1, x1, y1);
  g2.draw(line);
origin: org.codehaus.jtstand/jtstand-chart

  topSpace = padding.calculateTopOutset(h);
  bottomSpace = padding.calculateBottomOutset(h);
  leftSpace = padding.calculateLeftOutset(w);
  rightSpace = padding.calculateRightOutset(w);
  startX = chartArea.getX() + leftSpace;
  startX = chartArea.getMaxX() - rightSpace - w;
double startY = 0.0;
if (alignment == VerticalAlignment.CENTER) {
  startY = chartArea.getMinY() + topSpace
       + chartArea.getHeight() / 2.0 - h / 2.0;
g2.drawImage(this.image, (int) startX, (int) startY, (int) w, (int) h,
    null);
origin: jfree/jcommon

  throw new IllegalArgumentException("Null 'base' argument.");
double x = base.getX();
double y = base.getY();
double w = base.getWidth();
double h = base.getHeight();
if (horizontal == LengthAdjustmentType.EXPAND) {
  final double leftOutset = calculateLeftOutset(w);
  x = x - leftOutset;
  w = w + leftOutset + calculateRightOutset(w);
  final double leftMargin = calculateLeftInset(w);
  x = x + leftMargin;
  w = w - leftMargin - calculateRightInset(w);
  final double topMargin = calculateTopOutset(h);
  y = y - topMargin;
  h = h + topMargin + calculateBottomOutset(h);
  final double topMargin = calculateTopInset(h);
  y = y + topMargin;
  h = h - topMargin - calculateBottomInset(h);
origin: jenkinsci/jenkins

final JFreeChart chart = ChartFactory.createStackedAreaChart(null, // chart
    );
chart.setBackgroundPaint(Color.white);
final CategoryPlot plot = chart.getCategoryPlot();
plot.setBackgroundPaint(Color.WHITE);
plot.setOutlinePaint(null);
plot.setForegroundAlpha(0.8f);
plot.setDomainAxis(domainAxis);
domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
domainAxis.setLowerMargin(0.0);
domainAxis.setUpperMargin(0.0);
domainAxis.setCategoryMargin(0.0);
final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
ChartUtil.adjustChebyshev(dataset, rangeAxis);
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
plot.setInsets(new RectangleInsets(0, 0, 0, 5.0));
origin: org.codehaus.jtstand/jtstand-chart

  CategoryAxis xAxis = (CategoryAxis) this.domainAxes.get(index);
  if (xAxis != null) {
    axisCollection.add(xAxis, getDomainAxisEdge(index));
  ValueAxis yAxis = (ValueAxis) this.rangeAxes.get(index);
  if (yAxis != null) {
    axisCollection.add(yAxis, getRangeAxisEdge(index));
double cursor = dataArea.getMinY() - this.axisOffset.calculateTopOutset(
    dataArea.getHeight());
Iterator iterator = axisCollection.getAxesAtTop().iterator();
while (iterator.hasNext()) {
cursor = dataArea.getMaxY()
     + this.axisOffset.calculateBottomOutset(dataArea.getHeight());
iterator = axisCollection.getAxesAtBottom().iterator();
while (iterator.hasNext()) {
cursor = dataArea.getMinX()
     - this.axisOffset.calculateLeftOutset(dataArea.getWidth());
iterator = axisCollection.getAxesAtLeft().iterator();
while (iterator.hasNext()) {
cursor = dataArea.getMaxX()
     + this.axisOffset.calculateRightOutset(dataArea.getWidth());
iterator = axisCollection.getAxesAtRight().iterator();
while (iterator.hasNext()) {
origin: org.codehaus.jtstand/jtstand-chart

RectangleInsets s = new RectangleInsets(UnitType.RELATIVE,
  depth, depth, depth, depth);
Rectangle2D innerArcBounds = new Rectangle2D.Double();
innerArcBounds.setRect(arcBounds);
s.trim(innerArcBounds);
    Shape shadowArc = ShapeUtilities.createTranslatedShape(
        path, (float) shadowXOffset, (float) shadowYOffset);
    g2.setPaint(shadowPaint);
    g2.fill(shadowArc);
  g2.setPaint(paint);
  g2.fill(path);
  Paint outlinePaint = lookupSectionOutlinePaint(key);
origin: org.jenkins-ci.plugins/vectorcast-coverage

 JFreeChart chart = ChartFactory.createStackedAreaChart(null, Constants.AXIS_LABEL,
  Constants.AXIS_LABEL_VALUE, null, PlotOrientation.VERTICAL, true, false, false);
JFreeChart chart = ChartFactory.createLineChart("", Constants.AXIS_LABEL, Constants.AXIS_LABEL_VALUE,
 buildDataSet(summaries), PlotOrientation.VERTICAL, true, false, false);
chart.setBackgroundPaint(Color.white);
final CategoryPlot plot = chart.getCategoryPlot();
plot.setBackgroundPaint(Color.WHITE);
plot.setOutlinePaint(null);
plot.setRangeGridlinesVisible(true);
plot.setRangeGridlinePaint(Color.black);
CategoryAxis domainAxis = new ShiftedCategoryAxis(null);
plot.setDomainAxis(domainAxis);
domainAxis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
domainAxis.setLowerMargin(0.0);
domainAxis.setUpperMargin(0.0);
domainAxis.setCategoryMargin(0.0);
final NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
rangeAxis.setUpperBound(100);
rangeAxis.setLowerBound(0);
plot.setInsets(new RectangleInsets(5.0, 0, 0, 5.0));
plot.setDataset(1, buildComplexityDataSet(summaries));
origin: org.sakaiproject.sitestats/sitestats-impl

private byte[] generateStackedAreaChart (CategoryDataset dataset, int width, int height)
  JFreeChart chart = ChartFactory.createStackedAreaChart (null, // chart title
  chart.setBackgroundPaint (parseColor (statsManager.getChartBackgroundColor ()));
  chart.setPadding (new RectangleInsets (10, 5, 5, 5));
  chart.setBorderVisible (true);
  chart.setBorderPaint (parseColor ("#cccccc"));
  plot.setForegroundAlpha (0.7f);
  plot.setAxisOffset (new RectangleInsets (5.0, 5.0, 5.0, 5.0));
  plot.setBackgroundPaint (Color.lightGray);
  plot.setDomainGridlinesVisible (true);
  plot.setDomainGridlinePaint (Color.white);
  NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis ();
  rangeAxis.setStandardTickUnits (NumberAxis.createIntegerTickUnits ());
  CategoryAxis domainAxis = (CategoryAxis) plot.getDomainAxis ();
  domainAxis.setCategoryLabelPositions (CategoryLabelPositions.DOWN_45);
  domainAxis.setLowerMargin(0.0);
  domainAxis.setUpperMargin(0.0);
  BufferedImage img = chart.createBufferedImage (width, height);
origin: awslabs/aws-device-farm-jenkins-plugin

JFreeChart chart = ChartFactory.createStackedAreaChart(null, null, yLabel, dataset, PlotOrientation.VERTICAL, true, true, false);
chart.setBackgroundPaint(Color.WHITE);
LegendTitle legend = chart.getLegend();
legend.setPosition(RectangleEdge.RIGHT);
CategoryPlot plot = (CategoryPlot) chart.getPlot();
plot.setForegroundAlpha(0.7f);
plot.setBackgroundPaint(Color.WHITE);
plot.setRangeGridlinePaint(Color.darkGray);
domain.setCategoryLabelPositions(CategoryLabelPositions.UP_45);
domain.setLowerMargin(0.0);
domain.setUpperMargin(0.0);
domain.setCategoryMargin(0.0);
plot.setDomainAxis(domain);
NumberAxis range = (NumberAxis) plot.getRangeAxis();
range.setAutoRange(true);
range.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
CategoryItemRenderer renderer = plot.getRenderer();
plot.setInsets(new RectangleInsets(5.0, 0, 0, 5.0));
origin: org.sakaiproject.sitestats/sitestats-impl

JFreeChart chart = ChartFactory.createBarChart (
chart.setBackgroundPaint (parseColor (statsManager.getChartBackgroundColor ()));
chart.setPadding (new RectangleInsets (10, 5, 5, 5));
chart.setBorderVisible (true);
chart.setBorderPaint (parseColor ("#cccccc"));
plot.setForegroundAlpha (0.7f);
plot.setAxisOffset (new RectangleInsets (5.0, 5.0, 5.0, 5.0));
plot.setBackgroundPaint (Color.lightGray);
plot.setDomainGridlinesVisible (false);
plot.setRangeGridlinesVisible (true);
CategoryAxis domainAxis = plot.getDomainAxis();
domainAxis.setVisible(false);
domainAxis.setUpperMargin (0);
domainAxis.setLowerMargin (0);
NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis();
rangeAxis.setUpperMargin(0.20);
rangeAxis.setStandardTickUnits (NumberAxis.createIntegerTickUnits ());
BarRenderer renderer = (BarRenderer) plot.getRenderer();
origin: org.sakaiproject.sitestats/sitestats-impl

private byte[] generateBoxAndWhiskerChart (BoxAndWhiskerCategoryDataset dataset, int width, int height)
{
  JFreeChart chart = ChartFactory.createBoxAndWhiskerChart (null, null,
      null, dataset, false);
  // set background
  chart.setBackgroundPaint (parseColor (statsManager.getChartBackgroundColor ()));
  // set chart border
  chart.setPadding (new RectangleInsets (10, 5, 5, 5));
  chart.setBorderVisible (true);
  chart.setBorderPaint (parseColor ("#cccccc"));
  // set anti alias
  chart.setAntiAlias (true);
  CategoryPlot plot = (CategoryPlot) chart.getPlot ();
  plot.setDomainGridlinePaint (Color.white);
  plot.setDomainGridlinesVisible (true);
  plot.setRangeGridlinePaint (Color.white);
  NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis ();
  rangeAxis.setStandardTickUnits (NumberAxis.createIntegerTickUnits ());
  CategoryAxis domainAxis = (CategoryAxis) plot.getDomainAxis ();
  domainAxis.setLowerMargin (0.0);
  domainAxis.setUpperMargin (0.0);
  BufferedImage img = chart.createBufferedImage (width, height);
  final ByteArrayOutputStream out = new ByteArrayOutputStream();
  try{
    ImageIO.write(img, "png", out);
  }catch(IOException e){
    log.warn("Error occurred while generating SiteStats chart image data", e);
  }
  return out.toByteArray();
}
origin: webanno/webanno

JFreeChart chart = ChartFactory.createBarChart(null, null, null, dataset,
    PlotOrientation.HORIZONTAL, false, false, false);
CategoryPlot plot = chart.getCategoryPlot();
plot.setOutlineVisible(false);
plot.setBackgroundPaint(null);
plot.setNoDataMessage("No data");
plot.setInsets(new RectangleInsets(UnitType.ABSOLUTE, 0, 20, 0, 20));
if (aMaxValue > 0) {
  plot.getRangeAxis().setRange(0.0, aMaxValue);
  ((NumberAxis) plot.getRangeAxis()).setNumberFormatOverride(new DecimalFormat("0"));
    NumberAxis tick = new NumberAxis();
    tick.setTickUnit(new NumberTickUnit(1));
    standardUnits.add(tick.getTickUnit());
    plot.getRangeAxis().setStandardTickUnits(standardUnits);
  plot.getRangeAxis().setVisible(false);
  plot.getDomainAxis().setVisible(false);
chart.getCategoryPlot().setRenderer(renderer);
origin: psi-probe/psi-probe

chart = ChartFactory.createXYAreaChart("", labelX, labelY, ds, PlotOrientation.VERTICAL,
  showLegend, false, false);
((XYAreaRenderer) chart.getXYPlot().getRenderer()).setOutline(true);
chart = ChartFactory.createStackedXYAreaChart("", labelX, labelY, ds,
  PlotOrientation.VERTICAL, showLegend, false, false);
chart = ChartFactory.createXYLineChart("", labelX, labelY, ds, PlotOrientation.VERTICAL,
  showLegend, false, false);
chart.getXYPlot().setRenderer(renderer);
chart.setAntiAlias(true);
chart.setBackgroundPaint(new Color(backgroundColor));
for (int i = 0; i < seriesMaxCount; i++) {
chart.getXYPlot().setDomainAxis(0, new DateAxis());
chart.getXYPlot().setDomainAxis(1, new DateAxis());
chart.getXYPlot().setInsets(new RectangleInsets(-15, 0, 0, 10));
org.jfree.uiRectangleInsets

Javadoc

Represents the insets for a rectangle, specified in absolute or relative terms. This class is immutable.

Most used methods

  • <init>
    Creates a new instance.
  • calculateBottomInset
    Returns the bottom margin.
  • calculateBottomOutset
    Returns the bottom margin.
  • calculateLeftInset
    Returns the left margin.
  • calculateLeftOutset
    Returns the left margin.
  • calculateRightInset
    Returns the right margin.
  • calculateRightOutset
    Returns the right margin.
  • calculateTopInset
    Returns the top margin.
  • calculateTopOutset
    Returns the top margin.
  • createInsetRectangle
    Creates an 'inset' rectangle.
  • createOutsetRectangle
    Creates an outset rectangle.
  • extendHeight
    Extends the given height to allow for the insets.
  • createOutsetRectangle,
  • extendHeight,
  • extendWidth,
  • hashCode,
  • getBottom,
  • getTop,
  • trim,
  • createAdjustedRectangle,
  • equals,
  • getLeft

Popular in Java

  • Parsing JSON documents to java classes using gson
  • requestLocationUpdates (LocationManager)
  • getSupportFragmentManager (FragmentActivity)
  • getContentResolver (Context)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Timer (java.util)
    Timers schedule one-shot or recurring TimerTask for execution. Prefer java.util.concurrent.Scheduled
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • JOptionPane (javax.swing)
  • From CI to AI: The AI layer in your organization
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