Package jimm.datavision

Examples of jimm.datavision.Line


*/
public void eachLine(LineDrawer ld, Object arg) {
    Rectangle rect = field.getBounds();
    Section section = field.getSection();
    BorderEdge edge;
    Line line;

    edge = top;
    if (edge != null && edge.getThickness() > 0 && edge.getNumber() > 0) {
  line = new Line(null, section, edge.getThickness(),
      null, true, new Point(rect.x, rect.y),
      new Point(rect.x + rect.width, rect.y));
  for (int i = 0; i < edge.getNumber(); ++i) {
      ld.drawLine(line, arg);
      line.getPoint(0).y += BORDER_LINE_SPACE_MULT;
      line.getPoint(1).y += BORDER_LINE_SPACE_MULT;
  }
    }

    edge = bottom;
    if (edge != null && edge.getThickness() > 0 && edge.getNumber() > 0) {
  line = new Line(null, section, edge.getThickness(),
      null, true, new Point(rect.x, rect.y + rect.height),
      new Point(rect.x + rect.width, rect.y + rect.height));
  for (int i = 0; i < edge.getNumber(); ++i) {
      ld.drawLine(line, arg);
      line.getPoint(0).y -= BORDER_LINE_SPACE_MULT;
      line.getPoint(1).y -= BORDER_LINE_SPACE_MULT;
  }
    }

    edge = left;
    if (edge != null && edge.getThickness() > 0 && edge.getNumber() > 0) {
  line = new Line(null, section, edge.getThickness(),
      null, true, new Point(rect.x, rect.y),
      new Point(rect.x, rect.y + rect.height));
  for (int i = 0; i < edge.getNumber(); ++i) {
      ld.drawLine(line, arg);
      line.getPoint(0).x += BORDER_LINE_SPACE_MULT;
      line.getPoint(1).x += BORDER_LINE_SPACE_MULT;
  }
    }

    edge = right;
    if (edge != null && edge.getThickness() > 0 && edge.getNumber() > 0) {
  line = new Line(null, section, edge.getThickness(),
      null, true, new Point(rect.x + rect.width, rect.y),
      new Point(rect.x + rect.width, rect.y + rect.height));
  for (int i = 0; i < edge.getNumber(); ++i) {
      ld.drawLine(line, arg);
      line.getPoint(0).x -= BORDER_LINE_SPACE_MULT;
      line.getPoint(1).x -= BORDER_LINE_SPACE_MULT;
  }
    }
}
View Full Code Here

TOP

Related Classes of jimm.datavision.Line

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.