Package java.awt

Examples of java.awt.Graphics.drawLine()


      Location en = painter.getInstance().getPortLocation(inputs + 1);
      if (painter.getShowState()) {
        g.setColor(painter.getPort(inputs + 1).getColor());
      }
      int len = inputs == 2 ? 6 : 4;
      g.drawLine(en.getX() - len * dx, en.getY() - len * dy,
          en.getX(), en.getY());
    }
    GraphicsUtil.switchToWidth(g, 1);
   
    // draw a circle indicating where the select input is located
View Full Code Here


    Location loc = painter.getLocation();
    int x = loc.getX();
    int y = loc.getY();
    GraphicsUtil.switchToWidth(g, 2);
    g.setColor(Color.BLACK);
    g.drawLine(x - 15, y, x - 5, y);
    g.drawLine(x - 10, y - 5, x - 10, y + 5);
    GraphicsUtil.switchToWidth(g, 1);
  }

  static Value[] computeSum(BitWidth width, Value a, Value b, Value c_in) {
View Full Code Here

    int x = loc.getX();
    int y = loc.getY();
    GraphicsUtil.switchToWidth(g, 2);
    g.setColor(Color.BLACK);
    g.drawLine(x - 15, y, x - 5, y);
    g.drawLine(x - 10, y - 5, x - 10, y + 5);
    GraphicsUtil.switchToWidth(g, 1);
  }

  static Value[] computeSum(BitWidth width, Value a, Value b, Value c_in) {
    int w = width.getWidth();
View Full Code Here

    int x = loc.getX();
    int y = loc.getY();
    GraphicsUtil.switchToWidth(g, 2);
    g.setColor(Color.BLACK);
    g.fillOval(x - 12, y - 7, 4, 4);
    g.drawLine(x - 15, y, x - 5, y);
    g.fillOval(x - 12, y + 3, 4, 4);
    GraphicsUtil.switchToWidth(g, 1);
  }

  static Value[] computeResult(BitWidth width, Value a, Value b, Value upper) {
View Full Code Here

      int dy = state.yPos;
      int x0 = x - 15 + (dx > 5 ? 1 : dx < -5 ? -1 : 0);
      int y0 = y + 5 + (dy > 5 ? 1 : dy < 0 ? -1 : 0);
      int x1 = x - 15 + dx;
      int y1 = y + 5 + dy;
      g.drawLine(x0, y0, x1, y1);
      Color ballColor = painter.getAttributeValue(Io.ATTR_COLOR);
      Joystick.drawBall(g, x1, y1, ballColor, true);
    }
  }
}
View Full Code Here

   
    GraphicsUtil.switchToWidth(g, 2);
    Location loc = painter.getLocation();
    int x = loc.getX() - 10;
    int y = loc.getY();
    g.drawLine(x - 2, y - 5, x - 2, y + 5);
    g.drawLine(x + 2, y - 5, x + 2, y + 5);
    g.drawLine(x - 5, y - 2, x + 5, y - 2);
    g.drawLine(x - 5, y + 2, x + 5, y + 2);
  }
}
View Full Code Here

    GraphicsUtil.switchToWidth(g, 2);
    Location loc = painter.getLocation();
    int x = loc.getX() - 10;
    int y = loc.getY();
    g.drawLine(x - 2, y - 5, x - 2, y + 5);
    g.drawLine(x + 2, y - 5, x + 2, y + 5);
    g.drawLine(x - 5, y - 2, x + 5, y - 2);
    g.drawLine(x - 5, y + 2, x + 5, y + 2);
  }
}
View Full Code Here

    Location loc = painter.getLocation();
    int x = loc.getX() - 10;
    int y = loc.getY();
    g.drawLine(x - 2, y - 5, x - 2, y + 5);
    g.drawLine(x + 2, y - 5, x + 2, y + 5);
    g.drawLine(x - 5, y - 2, x + 5, y - 2);
    g.drawLine(x - 5, y + 2, x + 5, y + 2);
  }
}
View Full Code Here

    int x = loc.getX() - 10;
    int y = loc.getY();
    g.drawLine(x - 2, y - 5, x - 2, y + 5);
    g.drawLine(x + 2, y - 5, x + 2, y + 5);
    g.drawLine(x - 5, y - 2, x + 5, y - 2);
    g.drawLine(x - 5, y + 2, x + 5, y + 2);
  }
}
View Full Code Here

      int y = bds.getY() + BORDER + (ROW_HEIGHT + fm.getAscent()) / 2;
      for (int i = 0; i < rows; i++) {
        g.drawString(rowData[i], x, y);
        if (i == curRow) {
          int x0 = x + fm.stringWidth(rowData[i].substring(0, curCol));
          g.drawLine(x0, y - fm.getAscent(), x0, y);
        }
        y += ROW_HEIGHT;
      }
    } else {
      String str = Strings.get("ttyDesc", "" + rows, "" + cols);
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.