daily pastebin goal
48%
SHARE
TWEET

Untitled

a guest Jan 21st, 2018 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // 63170079
  2. import java.awt.*;
  3.  
  4. public class Oddaja {
  5.    
  6.     public static abstract class Lik {
  7.         public abstract boolean narisi(boolean[][] polje);
  8.     }
  9.  
  10.  
  11.  
  12.     public static class Pravokotnik extends Lik {
  13.  
  14.         private int xLevo;
  15.         private int yZgoraj;
  16.         private int sirina;
  17.         private int visina;
  18.  
  19.         public Pravokotnik(int xLevo, int yZgoraj, int sirina, int visina) {
  20.             this.xLevo = xLevo;
  21.             this.yZgoraj = yZgoraj;
  22.             this.sirina = sirina;
  23.             this.visina = visina;
  24.         }
  25.  
  26.         @Override
  27.         public boolean narisi(boolean[][] polje) {
  28.             for(int i = yZgoraj; i < (yZgoraj + visina); i++) {
  29.                 for(int j = xLevo; j < (xLevo + sirina); j++) {
  30.                     polje[i][j] = true;
  31.                 }
  32.             }
  33.  
  34.         }
  35.     }
  36.  
  37.     public static class Mnogokotnik extends Lik {
  38.  
  39.     }
  40.  
  41.     public static class Elipsa extends Lik {
  42.  
  43.     }
  44.    
  45.     public static class Presek extends Lik {
  46.  
  47.     }
  48.  
  49.     public static class Razlika extends Lik {
  50.  
  51.     }
  52.  
  53.     public static class Risar {
  54.         boolean[][] slika;
  55.         public Risar() {
  56.             slika = new boolean[100][100];
  57.             napolniSliko();
  58.         }
  59.        
  60.         public void napolniSliko() {
  61.             for(int i = 0; i < slika.length; i++) {
  62.                 for(int j = 0; j < slika[i].length; j++) {
  63.                     slika[i][j] = false;
  64.                 }
  65.             }
  66.         }
  67.  
  68.         public boolean[][] slika() {
  69.             return slika;
  70.         }
  71.  
  72.         public void narisiLik(Lik lik) {
  73.             lik.narisi(slika);
  74.         }
  75.  
  76.         public void narisiRob(Lik lik, int debelina) {
  77.            
  78.         }
  79.     }
  80. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top