title: Design pattern code for conditional code scattered across multiple classes
body: <p>Some code needs to be refactored in approx 10 classes, of these
  classes there are conditionals scattered throughout the classes painting
  text onto the screen where appropriate. I want to add all this code conditional/painting
  code into one centralised location. 
  Is there a design pattern appropriate for this ?</p>
  
  <pre><code>if (fontWidth == 100) {
      fontSize = large;
  } else {
      fontSize = small;
  }
  
  if (fontWidth == 100) {
      graphics.drawText("100", xVal, yVal);
  } else {
      xText = Utils.calculateXText(param1, param2);
      graphics.drawText("200", xVal, yVal);
  }
  </code></pre>
  
  <p>For delegation does it mean I need to write defferent wrapper objects, one for setting the font size and one for drawing the text based on above  code ?</p>
  
  <pre><code>public void paint(Graphics graphics){
  
      super.paint(graphics);
      Font font;
  
  
      if(ScreenDimension.getFontWidth() == 320){
          font = Font.getDefault().derive(Font.PLAIN,10,Ui.UNITS_pt);
      }
      else {
          font = Font.getDefault().derive(Font.PLAIN,12,Ui.UNITS_pt);
      }
  
  String strScore = String.valueOf(score);
      graphics.setFont(font); 
      int pixelWidth = font.getAdvance(strScore);
  
  
      if(ScreenDimension.getFontWidth() == 320){
          graphics.drawText(strScore, (int) (this.backgroundBitmap.getWidth() * 0.50) - (pixelWidth/2), 10);
      }
      else {
          graphics.drawText(strScore, (int) (this.backgroundBitmap.getWidth() * 0.50) - (pixelWidth/2), 20);
      }
  
      if(ScreenDimension.getFontWidth() == 320){
          font = Font.getDefault().derive(Font.PLAIN,6,Ui.UNITS_pt);
      }
      else {
          font = Font.getDefault().derive(Font.PLAIN,8,Ui.UNITS_pt);
      }
  
      int namePixelWidth = font.getAdvance(judgeName);
      graphics.setFont(font);
  
  if(ScreenDimension.getFontWidth() == 320){
      graphics.drawText(judgeName, (int) (this.backgroundBitmap.getWidth() * 0.50) - (namePixelWidth/2), this.backgroundBitmap.getHeight() - font.getHeight() - 2);
  }
      else {
          graphics.drawText(judgeName, (int) (this.backgroundBitmap.getWidth() * 0.50) - (namePixelWidth/2), this.backgroundBitmap.getHeight() - font.getHeight() - 15);
      }
  }
  </code></pre>