Package org.jfree.ui

Examples of org.jfree.ui.RectangleInsets


     * @since 1.0.7
     */
    protected double estimateMaximumTickLabelWidth(Graphics2D g2,
                                                   TickUnit unit) {

        RectangleInsets tickLabelInsets = getTickLabelInsets();
        double result = tickLabelInsets.getLeft() + tickLabelInsets.getRight();

        if (isVerticalTickLabels()) {
            // all tick labels have the same width (equal to the height of the
            // font)...
            FontRenderContext frc = g2.getFontRenderContext();
View Full Code Here


           double cursor,
           Rectangle2D dataArea,
           RectangleEdge edge)
   {

      RectangleInsets insets = getTickLabelInsets();
      float[] result = new float[2];
      if (edge == RectangleEdge.TOP)
      {
         result[0] = (float) valueToJava2D(tick.getValue(), dataArea, edge);
         result[1] = (float) (cursor - insets.getBottom() - 2.0);
      }
      else if (edge == RectangleEdge.BOTTOM)
      {
         result[0] = (float) valueToJava2D(tick.getValue(), dataArea, edge);
         result[1] = (float) (cursor + insets.getTop() + 2.0);
      }
      else if (edge == RectangleEdge.LEFT)
      {
         result[0] = (float) (cursor - insets.getLeft() - 2.0);
         result[1] = (float) valueToJava2D(tick.getValue(), dataArea, edge);
      }
      else if (edge == RectangleEdge.RIGHT)
      {
         result[0] = (float) (cursor + insets.getRight() + 2.0);
         result[1] = (float) valueToJava2D(tick.getValue(), dataArea, edge);
      }
      return result;
   }
View Full Code Here

           Graphics2D g2,
           Rectangle2D drawArea,
           boolean vertical)
   {

      RectangleInsets insets = getTickLabelInsets();
      Font font = getTickLabelFont();
      double maxHeight = 0.0;
      if (vertical)
      {
         FontMetrics fm = g2.getFontMetrics(font);
         Iterator iterator = ticks.iterator();
         while (iterator.hasNext())
         {
            Tick tick = (Tick) iterator.next();
            Rectangle2D labelBounds = TextUtilities.getTextBounds(
                    tick.getText(), g2, fm);
            if (labelBounds.getWidth() + insets.getTop()
                    + insets.getBottom() > maxHeight)
            {
               maxHeight = labelBounds.getWidth()
                       + insets.getTop() + insets.getBottom();
            }
         }
      }
      else
      {
         LineMetrics metrics = font.getLineMetrics("ABCxyz",
                 g2.getFontRenderContext());
         maxHeight = metrics.getHeight()
                 + insets.getTop() + insets.getBottom();
      }
      return maxHeight;

   }
View Full Code Here

           Graphics2D g2,
           Rectangle2D drawArea,
           boolean vertical)
   {

      RectangleInsets insets = getTickLabelInsets();
      Font font = getTickLabelFont();
      double maxWidth = 0.0;
      if (!vertical)
      {
         FontMetrics fm = g2.getFontMetrics(font);
         Iterator iterator = ticks.iterator();
         while (iterator.hasNext())
         {
            Tick tick = (Tick) iterator.next();
            Rectangle2D labelBounds = TextUtilities.getTextBounds(
                    tick.getText(), g2, fm);
            if (labelBounds.getWidth() + insets.getLeft()
                    + insets.getRight() > maxWidth)
            {
               maxWidth = labelBounds.getWidth()
                       + insets.getLeft() + insets.getRight();
            }
         }
      }
      else
      {
         LineMetrics metrics = font.getLineMetrics("ABCxyz",
                 g2.getFontRenderContext());
         maxWidth = metrics.getHeight()
                 + insets.getTop() + insets.getBottom();
      }
      return maxWidth;

   }
View Full Code Here

        if (info != null) {
            info.setPlotArea(area);
        }

        // adjust the drawing area for plot insets (if any)...
        RectangleInsets insets = getInsets();
        insets.trim(area);

        AxisSpace space = new AxisSpace();
        space = this.domainAxis.reserveSpace(g2, this, area,
                RectangleEdge.BOTTOM, space);
        space = this.rangeAxis.reserveSpace(g2, this, area, RectangleEdge.LEFT,
View Full Code Here

    @Override
    public void draw(Graphics2D g2, Rectangle2D area, Point2D anchor,
            PlotState parentState, PlotRenderingInfo info) {
       
        // adjust for insets...
        RectangleInsets insets = getInsets();
        insets.trim(area);

        if (info != null) {
            info.setPlotArea(area);
            info.setDataArea(area);
        }
View Full Code Here

            pieData = DatasetUtilities.createPieDatasetForColumn(catData, 0);
        else
            pieData = DatasetUtilities.createPieDatasetForRow(catData, 0);

        DiscPlot plot = new DiscPlot(pieData);
        plot.setInsets(new RectangleInsets(0.0, 5.0, 5.0, 5.0));
        plot.setDrawingSupplier(DRAWING_SUPPLIER_FACTORY.newDrawingSupplier());
        JFreeChart chart = new JFreeChart(null, JFreeChart.DEFAULT_TITLE_FONT,
                plot, false);

        if (parameters.get("skipItemLabels") != null
View Full Code Here

        this.axisStroke = DEFAULT_OUTLINE_STROKE;
        this.gridLinePaint = Color.lightGray;
        this.gridLineStroke = DEFAULT_OUTLINE_STROKE;
        this.plotLineStroke = DEFAULT_LINE_STROKE;
        setForegroundAlpha(0.5f);
        setInsets(new RectangleInsets(0, 5, 5, 5));
    }
View Full Code Here

     */
    @Override
    public void draw(Graphics2D g2, Rectangle2D plotArea, Point2D anchor,
            PlotState state, PlotRenderingInfo info) {
        // adjust for insets...
        RectangleInsets insets = getInsets();
        if (insets!=null) {
            plotArea.setRect(plotArea.getX()+insets.getLeft(),
                             plotArea.getY()+insets.getTop(),
                             plotArea.getWidth()-insets.getLeft()-insets.getRight(),
                             plotArea.getHeight()-insets.getTop()-insets.getBottom());
        }

        if (info != null) {
            info.setPlotArea(plotArea);
            info.setDataArea(plotArea);
View Full Code Here

  //renderer.setBaseToolTipGenerator(xyTTG);
  //plot.setRenderer(renderer);

  plot.setDomainCrosshairVisible(true);
  plot.setRangeCrosshairVisible(true);
  plot.setAxisOffset(new RectangleInsets(5.0,5.0,5.0,5.0));

  //plot.setBackgroundPaint(Color.lightGray);
  //plot.setRangeGridlinePaint(Color.white);

  //XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer(true,true);
View Full Code Here

TOP

Related Classes of org.jfree.ui.RectangleInsets

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.