示例#1
0
        public void draw(
            GFX gfx,
            ListView listView,
            Paint paint,
            int index,
            double x,
            double y,
            double w,
            double h) {
          gfx.translate(x, y);

          if (paint instanceof PatternPaint) {
            PatternPaint pp = (PatternPaint) paint;
            double pw = pp.getImage().getWidth();
            double ph = pp.getImage().getHeight();
            double sx = w / pw;
            double sy = h / ph;
            gfx.scale(sx, sy);
            gfx.setPaint(pp);
            gfx.fillRect(0, 0, pw, ph);
            gfx.scale(1 / sx, 1 / sy);
          } else {
            gfx.setPaint(paint);
            gfx.fillRect(0, 0, w, h);
          }

          gfx.setPaint(FlatColor.BLACK);
          gfx.drawRect(0, 0, w, h);
          gfx.translate(-x, -y);
        }
示例#2
0
 @Override
 public void draw(GFX g) {
   if (!isVisible()) return;
   g.setPaint(FlatColor.BLACK);
   g.fillRect(0, 0, getWidth(), getHeight());
   g.setPaint(FlatColor.WHITE);
   g.fillRect(0 + 1, 0 + 1, getWidth() - 2, getHeight() - 2);
   g.setPaint(selectedFill);
   g.fillRect(inset, inset, getWidth() - inset * 2, getHeight() - inset * 2);
 }