예제 #1
0
 public void paint(Graphics g) {
   super.paint(g);
   if (!isEditing) return;
   Dimension psize = getPreferredSize();
   if (isFocused) g.setColor(Color.yellow);
   else g.setColor(Color.green);
   g.drawLine(0, 0, psize.width, 0);
   g.drawLine(0, 0, 0, psize.height);
   g.drawLine(0, psize.height - 1, psize.width - 1, psize.height - 1);
   g.drawLine(psize.width - 1, 0, psize.width - 1, psize.height - 1);
 }
예제 #2
0
  @Override
  protected void paintChildren(Graphics g) {

    autoscale();

    super.paintChildren(g);
    if (IGV.getInstance().isRulerEnabled()) {
      int start = MouseInfo.getPointerInfo().getLocation().x - getLocationOnScreen().x;
      g.setColor(Color.BLACK);
      g.drawLine(start, 0, start, getHeight());
    }
  }