Example usage for java.awt.geom Line2D.Float Line2D.Float

List of usage examples for java.awt.geom Line2D.Float Line2D.Float

Introduction

In this page you can find the example usage for java.awt.geom Line2D.Float Line2D.Float.

Prototype

public Float(Point2D p1, Point2D p2) 

Source Link

Document

Constructs and initializes a Line2D from the specified Point2D objects.

Usage

From source file:tufts.vue.LWComponent.java

private void drawDebugInfo(DrawContext dc, AffineTransform zeroTransform) {

    if (this instanceof LWLink)
        return;/*w w  w . j ava 2 s. c  o m*/

    dc.g.setTransform(zeroTransform);

    dc.setAbsoluteStroke(1);

    //dc.g.setColor(Color.blue);
    //dc.g.draw(debugZeroRect);

    // scaling testing -- draw an exactly 8x8 pixel (rendered) box
    dc.g.setColor(Color.green);
    dc.g.drawRect(0, 0, 7, 7);

    // show the center-point to corner intersect line (debug slide icon placement):
    dc.g.setColor(Color.red);
    //dc.setAbsoluteStroke(1);
    dc.g.setStroke(STROKE_ONE);
    dc.g.draw(new Line2D.Float(new Point2D.Float(getWidth() / 2, getHeight() / 2), getZeroSouthEastCorner()));

    if (DEBUG.LINK && isSelected() && getLinks().size() > 0) {
        final Rectangle2D.Float pureFan = getFanBounds();
        final Rectangle2D.Float fan = getCenteredFanBounds();
        final float cx = getMapCenterX();
        final float cy = getMapCenterY();
        final Line2D xaxis = new Line2D.Float(fan.x, cy, fan.x + fan.width, cy);
        final Line2D yaxis = new Line2D.Float(cx, fan.y, cx, fan.y + fan.height);
        dc.setMapDrawing();
        dc.setAbsoluteStroke(4);
        //dc.g.setColor(getRenderFillColor(dc));
        dc.g.setColor(Color.blue);
        dc.g.draw(pureFan);

        dc.setAbsoluteStroke(2);
        dc.g.setColor(Color.red);
        dc.g.draw(fan);
        dc.g.draw(xaxis);
        dc.g.draw(yaxis);
    }
}