Examples of Pen


Examples of de.hpi.eworld.gui.util.Pen

  }

  @Override
  public void paint(mxGraphics2DCanvas canvas, mxCellState state) {
    canvas.getGraphics().setBackground(getFillColor(null, null));
    Pen pen = new Pen(getStrokeColor(null, null));
    pen.apply(canvas.getGraphics());
    canvas.getGraphics().translate(state.getX(), state.getY());
    canvas.getGraphics().draw(shape);
  }
View Full Code Here

Examples of limelight.ui.Pen

  private Pen pen;

  public void setUp() throws Exception
  {
    graphics = new MockGraphics();
    pen = new Pen(graphics);
  }
View Full Code Here

Examples of limelight.ui.Pen

  {
  }

  public void testWithColor() throws Exception
  {
    Pen result = pen.withColor(Color.red);

    assertSame(pen, result);
    assertEquals(Color.red, pen.getColor());
  }
View Full Code Here

Examples of limelight.ui.Pen

    assertEquals(Color.red, pen.getColor());
  }

  public void testWithStroke() throws Exception
  {
    Pen result = pen.withStroke(1);

    assertSame(pen, result);
    assertEquals(1, pen.getStroke().getLineWidth(), 0.1);
  }
View Full Code Here

Examples of limelight.ui.Pen

    assertEquals(1, pen.getStroke().getLineWidth(), 0.1);
  }

  public void testWithAntialiasing() throws Exception
  {
    Pen result = pen.withAntialiasing(false);

    assertSame(pen, result);
    assertEquals(RenderingHints.VALUE_ANTIALIAS_OFF, graphics.getRenderingHint(RenderingHints.KEY_ANTIALIASING));

    result = pen.withAntialiasing(true);
View Full Code Here

Examples of limelight.ui.Pen

  }

  public void paint(Graphics2D graphics, PaintablePanel panel)
  {
    Style style = panel.getStyle();
    Pen pen = new Pen(graphics);
    Border border = panel.getBorderShaper();

    if(border.hasTopBorder())
      pen.withColor(style.getCompiledTopBorderColor().getColor()).withStroke(border.getTopWidth()).withAntialiasing(false).draw(border.getTopLine());
    if(border.hasTopRightCorner())
      pen.withColor(style.getCompiledTopRightBorderColor().getColor()).withStroke(border.getTopRightWidth()).withAntialiasing(true).draw(border.getTopRightArc());
    if(border.hasRightBorder())
      pen.withColor(style.getCompiledRightBorderColor().getColor()).withStroke(border.getRightWidth()).withAntialiasing(false).draw(border.getRightLine());
    if(border.hasBottomRightCorner())
      pen.withColor(style.getCompiledBottomRightBorderColor().getColor()).withStroke(border.getBottomRightWidth()).withAntialiasing(true).draw(border.getBottomRightArc());
    if(border.hasBottomBorder())
      pen.withColor(style.getCompiledBottomBorderColor().getColor()).withStroke(border.getBottomWidth()).withAntialiasing(false).draw(border.getBottomLine());
    if(border.hasBottomLeftCorner())
      pen.withColor(style.getCompiledBottomLeftBorderColor().getColor()).withStroke(border.getBottomLeftWidth()).withAntialiasing(true).draw(border.getBottomLeftArc());
    if(border.hasLeftBorder())
      pen.withColor(style.getCompiledLeftBorderColor().getColor()).withStroke(border.getLeftWidth()).withAntialiasing(false).draw(border.getLeftLine());
    if(border.hasTopLeftCorner())
      pen.withColor(style.getCompiledTopLeftBorderColor().getColor()).withStroke(border.getTopLeftWidth()).withAntialiasing(true).draw(border.getTopLeftArc());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.