@Override
	public void mouseDragged(int oldX, int oldY, int newX, int newY) {
		if(sliding) {
			float oldValue = sliderValue;
			
			switch(orientation) {
			case Horizontal:
				//Restrict newX to size of slider
				newX = newX>staticBar.getMinX()? newX:(int)staticBar.getMinX();
				newX = newX<staticBar.getMaxX()+1? newX:(int)staticBar.getMaxX()+1;
				//Update dynamicBar
				dynamicBar.setCenterX(newX);
				//Save new sliderValue
				sliderValue = (float)(newX-(int)staticBar.getMinX())/(int)staticBar.getWidth();
				break;
			case Vertical:
				//Restrict newX to size of slider
				newY = newY>staticBar.getMinY()? newY:(int)staticBar.getMinY();
				newY = newY<staticBar.getMaxY()+1? newY:(int)staticBar.getMaxY()+1;
				//Update dynamicBar
				dynamicBar.setCenterY(newY);
				//Save new sliderValue
				sliderValue = (float)(newY-(int)staticBar.getMinY())/(int)staticBar.getHeight();
				break;
			}
			
			for(SliderListener listener : listeners)
				listener.sliderMoved(oldValue, sliderValue, this);
		}
	}