gt: 			if((i % 3) > 0){
context: /*
   * Created on 28-dic-2005
   *
   * TODO To change the template for this generated file go to
   * Window - Preferences - Java - Code Style - Code Templates
   */
  package org.herac.tuxguitar.gui.editors.effects;
  
  import java.util.ArrayList;
  import java.util.List;
  
  import org.eclipse.swt.SWT;
  import org.eclipse.swt.events.MouseAdapter;
  import org.eclipse.swt.events.PaintEvent;
  import org.eclipse.swt.events.PaintListener;
  import org.eclipse.swt.events.SelectionAdapter;
  import org.eclipse.swt.events.SelectionEvent;
  import org.eclipse.swt.graphics.Point;
  import org.eclipse.swt.layout.GridData;
  import org.eclipse.swt.layout.GridLayout;
  import org.eclipse.swt.widgets.Button;
  import org.eclipse.swt.widgets.Composite;
  import org.eclipse.swt.widgets.Shell;
  import org.herac.tuxguitar.gui.TuxGuitar;
  import org.herac.tuxguitar.gui.editors.TGPainter;
  import org.herac.tuxguitar.gui.util.DialogUtils;
  import org.herac.tuxguitar.song.models.TGNote;
  import org.herac.tuxguitar.song.models.effects.TGEffectTremoloBar;
  /**
   * @author julian
   *
   * TODO To change the template for this generated type comment go to
   * Window - Preferences - Java - Code Style - Code Templates
   */
  public class TremoloBarEditor{
  	public static final int X_SPACING = 30;
  	public static final int Y_SPACING = 10;
  	private static final int X_LENGTH = TGEffectTremoloBar.MAX_POSITION_LENGTH + 1;
  	private static final int Y_LENGTH = (TGEffectTremoloBar.MAX_VALUE_LENGTH * 2) + 1;
  	
  	private int[] x; 
  	private int[] y;
  	private int width;
  	private int height;
  	private List<Point> points;
  	protected Composite editor;
  	protected DefaultTremoloBar[] defaultTremoloBars;
  	protected TGEffectTremoloBar result;
  	
  	public TremoloBarEditor() {
  		this.init();
  	}
  	
  	private void init(){
  		this.x = new int[X_LENGTH];
  		this.y = new int[Y_LENGTH];
  		this.width = ((X_SPACING * X_LENGTH) - X_SPACING);
  		this.height = ((Y_SPACING * Y_LENGTH) - Y_SPACING);
  		this.points = new ArrayList<Point>();
  		
  		for(int i = 0;i < this.x.length;i++){
  			this.x[i] = ((i + 1) * X_SPACING);
  		}
  		for(int i = 0;i < this.y.length;i++){
  			this.y[i] = ((i + 1) * Y_SPACING);
  		}
  	}
  	
  	public TGEffectTremoloBar show(Shell shell,final TGNote note){
  		final Shell dialog = DialogUtils.newDialog(shell, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL);
  		
  		dialog.setLayout(new GridLayout());
  		dialog.setText(TuxGuitar.getProperty("effects.tremolo-bar-editor"));
  		
  		//----------------------------------------------------------------------
  		Composite composite = new Composite(dialog,SWT.NONE);
  		composite.setLayout(new GridLayout(2,false));
  		composite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  		
  		Composite leftComposite = new Composite(composite,SWT.NONE);
  		leftComposite.setLayout(new GridLayout());
  		leftComposite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  		
  		Composite rightComposite = new Composite(composite,SWT.NONE);
  		rightComposite.setLayout(new GridLayout());
  		rightComposite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  		
  		//-------------EDITOR---------------------------------------------------
  		this.editor = new Composite(leftComposite, SWT.BORDER | SWT.DOUBLE_BUFFERED);
  		this.editor.setBackground(this.editor.getDisplay().getSystemColor(SWT.COLOR_WHITE));
  		this.editor.setLayoutData(resizeData(new GridData(SWT.FILL,SWT.FILL,true,true) , getWidth() + (X_SPACING * 2),getHeight() + (Y_SPACING * 2))  );
  		this.editor.addPaintListener(new PaintListener() {
  			public void paintControl(PaintEvent e) {
  				TGPainter painter = new TGPainter(e.gc);
  				paintEditor(painter);
  			}
  		});
  		this.editor.addMouseListener(new MouseAdapter() {
  			public void mouseUp(org.eclipse.swt.events.MouseEvent e) {
  				checkPoint(e.x,e.y);
  				TremoloBarEditor.this.editor.redraw();
  			}
  		});
  		
  		//-------------DEFAULT BEND LIST---------------------------------------------------
  		this.resetDefaultTremoloBars();
  		final org.eclipse.swt.widgets.List defaultTremoloBarList = new org.eclipse.swt.widgets.List(rightComposite,SWT.BORDER);
          for (DefaultTremoloBar defaultTremoloBar : this.defaultTremoloBars) {
              defaultTremoloBarList.add(defaultTremoloBar.getName());
          }
  		defaultTremoloBarList.select(0);
  		defaultTremoloBarList.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
  		defaultTremoloBarList.addSelectionListener(new SelectionAdapter() {
  			public void widgetSelected(SelectionEvent e) {
  				int index = defaultTremoloBarList.getSelectionIndex();
  				if(index >= 0 && index < TremoloBarEditor.this.defaultTremoloBars.length){
  					setTremoloBar(TremoloBarEditor.this.defaultTremoloBars[index].getTremoloBar());
  					TremoloBarEditor.this.editor.redraw();
  				}
  			}
  		});
  		
  		//------------------BUTTONS--------------------------
  		Button buttonClean = new Button(rightComposite, SWT.PUSH);
  		buttonClean.setLayoutData(resizeData(new GridData(SWT.FILL,SWT.BOTTOM,true,true), 80,25));
  		buttonClean.setText(TuxGuitar.getProperty("clean"));
  		buttonClean.addSelectionListener(new SelectionAdapter() {
  			public void widgetSelected(SelectionEvent arg0) {
  				TremoloBarEditor.this.result = null;
  				dialog.dispose();
  			}
  		});
  		Button buttonOK = new Button(rightComposite, SWT.PUSH);
  		buttonOK.setLayoutData(resizeData(new GridData(SWT.FILL,SWT.BOTTOM,true,false), 80,25));
  		buttonOK.setText(TuxGuitar.getProperty("ok"));
  		buttonOK.addSelectionListener(new SelectionAdapter() {
  			public void widgetSelected(SelectionEvent arg0) {
  				TremoloBarEditor.this.result = getTremoloBar();
  				dialog.dispose();
  			}
  		});
  		Button buttonCancel = new Button(rightComposite, SWT.PUSH);
  		buttonCancel.setLayoutData(resizeData(new GridData(SWT.FILL,SWT.BOTTOM,true,false), 80,25));
  		buttonCancel.setText(TuxGuitar.getProperty("cancel"));
  		buttonCancel.addSelectionListener(new SelectionAdapter() {
  			public void widgetSelected(SelectionEvent arg0) {
  				TremoloBarEditor.this.result = note.getEffect().getTremoloBar();
  				dialog.dispose();
  			}
  		});
  		
  		if(note.getEffect().isTremoloBar()){
  			setTremoloBar(note.getEffect().getTremoloBar());
  		}else{
  			setTremoloBar(this.defaultTremoloBars[0].getTremoloBar());
  		}
  		
  		dialog.setDefaultButton( buttonOK );
  		
  		DialogUtils.openDialog(dialog, DialogUtils.OPEN_STYLE_CENTER | DialogUtils.OPEN_STYLE_PACK | DialogUtils.OPEN_STYLE_WAIT);
  		
  		return this.result;
  	}
  	
  	private GridData resizeData(GridData data,int minimumWidth,int minimumHeight){
  		data.minimumWidth = minimumWidth;
  		data.minimumHeight = minimumHeight;
  		return data;
  	}
  	
  	protected void paintEditor(TGPainter painter){
  		for(int i = 0;i < this.x.length;i++){
  			this.setStyleX(painter,i);
  			painter.initPath();
  			painter.setAntialias(false);
  			painter.moveTo(this.x[i],Y_SPACING);
  			painter.lineTo(this.x[i],Y_SPACING + this.height);
  			painter.closePath();
  		}
  		for(int i = 0;i < this.y.length;i++){
  			this.setStyleY(painter,i);
  			painter.initPath();
  			painter.setAntialias(false);
  			painter.moveTo(X_SPACING,this.y[i]);
  			painter.lineTo(X_SPACING + this.width,this.y[i]);
  			painter.closePath();
  		}
  
  		Point prevPoint = null;
  		painter.setLineStyle(SWT.LINE_SOLID);
  		painter.setLineWidth(2);
  		painter.setForeground(this.editor.getDisplay().getSystemColor(SWT.COLOR_GRAY));
          for (Point point : this.points) {
              if (prevPoint != null) {
                  painter.initPath();
                  painter.moveTo(prevPoint.x, prevPoint.y);
                  painter.lineTo(point.x, point.y);
                  painter.closePath();
              }
              prevPoint = point;
          }
  		
  		painter.setLineWidth(5);
  		painter.setForeground(this.editor.getDisplay().getSystemColor(SWT.COLOR_BLACK));
          for (Point point : this.points) {
              painter.initPath();
              painter.setAntialias(false);
              painter.addRectangle(point.x - 2, point.y - 2, 5, 5);
              painter.closePath();
          }
  		painter.setLineWidth(1);
  	}
  	
  	private void setStyleX(TGPainter painter,int i){
  		painter.setLineStyle(SWT.LINE_SOLID);
  		if(i == 0 || i == (X_LENGTH - 1)){
  			painter.setForeground(this.editor.getDisplay().getSystemColor(SWT.COLOR_BLACK));
  		}else{
  			painter.setForeground(this.editor.getDisplay().getSystemColor(SWT.COLOR_BLUE));
  