CPD Results

The following document contains the results of PMD's CPD 3.7.

Duplications

FileLine
org/microemu/device/swt/SwtMutableImage.java91
org/microemu/device/swt/SwtImmutableImage.java58
	}  
	
	
	public void getRGB(int[] argb, int offset, int scanlength, int x, int y, int width, int height) 
	{
        if (width <= 0 || height <= 0) {
            return;
        }
        if (x < 0 || y < 0 || x + width > getWidth() || y + height > getHeight()) {
            throw new IllegalArgumentException("Specified area exceeds bounds of image");
        }
        if ((scanlength < 0 ? -scanlength : scanlength) < width) {
            throw new IllegalArgumentException("abs value of scanlength is less than width");
        }
        if (argb == null) { 
            throw new NullPointerException("null rgbData");
        }
        if (offset < 0 || offset + width > argb.length) {
            throw new ArrayIndexOutOfBoundsException();
        }
        if (scanlength < 0) { 
            if (offset + scanlength*(height-1) < 0) {
                throw new ArrayIndexOutOfBoundsException();
            }
        } else {
            if (offset + scanlength*(height-1) + width > argb.length) {
                throw new ArrayIndexOutOfBoundsException();
            }
        }
                
        ImageData imageData = img.getImageData();
        for (int i = 0; i < height; i++) {
        		imageData.getPixels(x, y + i, width, argb, offset + i * scanlength);
        }
	}
  
}

FileLine
org/microemu/device/swt/GrayImageFilter.java48
org/microemu/device/swt/RGBImageFilter.java40
    backgroundColor = SwtDeviceComponent.getColor(new RGB(
    		((SwtDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay()).getBackgroundColor().getRed(),
    		((SwtDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay()).getBackgroundColor().getGreen(),
    		((SwtDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay()).getBackgroundColor().getBlue()));
    foregroundColor = SwtDeviceComponent.getColor(new RGB(
    		((SwtDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay()).getForegroundColor().getRed(),
    		((SwtDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay()).getForegroundColor().getGreen(),
    		((SwtDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay()).getForegroundColor().getBlue()));
    Rr = foregroundColor.getRed() - backgroundColor.getRed();

FileLine
org/microemu/device/swt/GrayImageFilter.java48
org/microemu/device/swt/BWImageFilter.java49
    backgroundColor = SwtDeviceComponent.getColor(new RGB(
    		((SwtDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay()).getBackgroundColor().getRed(),
    		((SwtDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay()).getBackgroundColor().getGreen(),
    		((SwtDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay()).getBackgroundColor().getBlue()));
    foregroundColor = SwtDeviceComponent.getColor(new RGB(
    		((SwtDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay()).getForegroundColor().getRed(),
    		((SwtDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay()).getForegroundColor().getGreen(),
    		((SwtDeviceDisplay) DeviceFactory.getDevice().getDeviceDisplay()).getForegroundColor().getBlue()));

FileLine
org/microemu/device/swt/SwtSystemFont.java42
org/microemu/device/swt/SwtTrueTypeFont.java43
		this.style = style.toLowerCase();
		this.size = size;
		this.antialiasing = antialiasing;
		
		this.initialized = false;
	}

	public void setAntialiasing(boolean antialiasing) {
		if (this.antialiasing != antialiasing) {
			this.antialiasing = antialiasing;
			initialized = false;
		}
	}

	public Font getFont() {
		checkInitialized();

		return font;
	}

	private synchronized void checkInitialized() {
		if (!initialized) {
			int swtStyle = 0;
			if (style.indexOf("plain") != -1) {
				swtStyle |= SWT.NORMAL;
			}
			if (style.indexOf("bold") != -1) {
				swtStyle |= SWT.BOLD;
			}
			if (style.indexOf("italic") != -1) {
				swtStyle |= SWT.ITALIC;
			}
			if (style.indexOf("underlined") != -1) {
				// TODO underlined style not implemented
			}

FileLine
org/microemu/app/ui/swt/SwtDeviceComponent.java147
org/microemu/app/ui/swt/SwtDeviceComponent.java210
		public void mouseUp(MouseEvent e) 
		{
	    	if (MIDletBridge.getCurrentMIDlet() == null) {
	    		return;
	    	}

			Device device = DeviceFactory.getDevice();
			org.microemu.device.impl.Rectangle rect = ((SwtDeviceDisplay) device.getDeviceDisplay()).getDisplayRectangle();
			SwtInputMethod inputMethod = (SwtInputMethod) device.getInputMethod();
			boolean fullScreenMode = device.getDeviceDisplay().isFullScreenMode();
			if (rect.x <= e.x && (rect.x + rect.width) > e.x
					&& rect.y <= e.y && (rect.y + rect.height) > e.y) {
				if (device.hasPointerEvents()) {
					if (!fullScreenMode) {

FileLine
org/microemu/app/ui/swt/SwtDeviceComponent.java153
org/microemu/app/ui/swt/SwtDeviceComponent.java285
				Device device = DeviceFactory.getDevice();
				org.microemu.device.impl.Rectangle rect = ((SwtDeviceDisplay) device.getDeviceDisplay()).getDisplayRectangle();
				SwtInputMethod inputMethod = (SwtInputMethod) device.getInputMethod();
				boolean fullScreenMode = device.getDeviceDisplay().isFullScreenMode();
				if (rect.x <= e.x && (rect.x + rect.width) > e.x
						&& rect.y <= e.y && (rect.y + rect.height) > e.y) {
					if (device.hasPointerMotionEvents()) {