Package java.awt

Examples of java.awt.Shape


        return result;
      }

      int series = 0;
      final Iterator iterator = keys.iterator();
      final Shape shape = getLegendItemShape();
      while (iterator.hasNext())
      {
        final Comparable key = (Comparable) iterator.next();
        if (key instanceof GridCategoryItem)
        {
View Full Code Here


        if ( (pass == 1) && !isItemLabelVisible(row, column) )  {
          return;
        }

        // setup for collecting optional entity info...
        Shape entityArea = null;
        final EntityCollection entities = state.getEntityCollection();

        double y1 = 0.0;
        Number n = dataset.getValue(row, column);
        if (n != null) {
View Full Code Here

      if (sampleValue != null)
      {
        Graphics2D g2d = (Graphics2D) g;
        Stroke origStroke = g2d.getStroke();
        Color origColor = g2d.getColor();
        Shape origClip = g2d.getClip();

        g2d.setStroke(sampleValue);

        g2d.drawLine(getInsets().left + 1, (getHeight() / 2) + 1, getWidth() - (getInsets().right + 1), (getHeight() / 2) + 1);
View Full Code Here

            if (currentEditable != null) {

                currentEditable.getStateMachine().setSelected();
                currentEditable.redraw(me, true);

                Shape ces = currentEditable.getGraphic().getShape();
                if (ces != null) {
                    Rectangle rect = ces.getBounds();
                    windowx = (int) rect.getX();
                    windowy = (int) rect.getY() - 50;
                }
            }
View Full Code Here

    }

    public boolean isOnMap(Projection proj) {
        generate(proj); // Should only generate if needed...

        Shape shape = getShape();
        if (shape == null) {
            return false;
        }

        Point p1 = proj.forward(proj.getUpperLeft());
        Point p2 = proj.forward(proj.getLowerRight());
        int h = (int) (p2.getY() - p1.getY());
        int w = (int) (p2.getX() - p1.getX());

        Rectangle mapRect = new Rectangle((int) p1.getX(), (int) p1.getY(), w, h);

        return mapRect.intersects(shape.getBounds());
    }
View Full Code Here

     * Called from the OMGrid.generate() method to tell the generator
     * to create something to represent the grid contents.
     */
    public OMGraphic generate(OMGrid grid, Projection proj) {

        Shape gridShape = grid.getShape();

        // Don't generate the raster if the grid is off-map...
        if (gridShape == null
                || !gridShape.intersects(0,
                        0,
                        proj.getWidth(),
                        proj.getHeight())) {
            if (Debug.debugging("grid")) {
                Debug.output("SlopeGenerator: OMGrid does not overlap map, skipping generation.");
View Full Code Here

            float transx = (float) x1;
            float transy = (float) y1;
            float x = transx - fwidth / 2f;
            float y = transy - fheight / 2f;

            Shape arcShape = createArcShape(x, y, fwidth, fheight);

            if (rotationAngle != DEFAULT_ROTATIONANGLE) {
                af = new AffineTransform();
                af.rotate(rotationAngle, transx, transy);
            }
            pi = arcShape.getPathIterator(af);
            gp = new GeneralPath();
            gp.append(pi, false);
            // In X/Y or Offset RenderType, there is only one shape.
            setShape(gp);
View Full Code Here

     */
    public void render(Graphics g, int width, int height,
                       DrawingAttributes appDA) {

        // Handle clip area in Graphics, first
        Shape clip = getClip();
        if (clip != null) {
            g.setClip(clip);
        }

        DrawingAttributes da = getRenderingAttributes();
View Full Code Here

        GeneralPath geometry = null;
        Iterator it = iterator();
        while (it.hasNext()) {
            IconPart part = (IconPart) it.next();

            Shape shp = part.getGeometry();

            if (shp == null) {
                continue;
            }
View Full Code Here

     * @param y Y pixel coordinate of the point.
     * @return getShape().contains(x, y), false if the OMGraphic
     *         hasn't been generated yet.
     */
    public boolean contains(int x, int y) {
        Shape shape = getShape();
        boolean ret = false;

        if (shape != null) {
            ret = shape.contains((double) x, (double) y);
        }

        return ret;
    }
View Full Code Here

TOP

Related Classes of java.awt.Shape

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.