src/share/classes/java/awt/image/DataBufferInt.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1997, 2008, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 152,162 ****
* @param dataArray The integer arrays for the <CODE>DataBuffer</CODE>.
* @param size The size of the banks in the <CODE>DataBuffer</CODE>.
*/
public DataBufferInt(int dataArray[][], int size) {
super(UNTRACKABLE, TYPE_INT, size, dataArray.length);
! bankdata = (int [][]) dataArray.clone();
data = bankdata[0];
}
/**
* Constructs an integer-based <CODE>DataBuffer</CODE> with the specified arrays, size,
--- 152,162 ----
* @param dataArray The integer arrays for the <CODE>DataBuffer</CODE>.
* @param size The size of the banks in the <CODE>DataBuffer</CODE>.
*/
public DataBufferInt(int dataArray[][], int size) {
super(UNTRACKABLE, TYPE_INT, size, dataArray.length);
! bankdata = dataArray.clone();
data = bankdata[0];
}
/**
* Constructs an integer-based <CODE>DataBuffer</CODE> with the specified arrays, size,
*** 177,187 ****
* @param size The size of the banks in the <CODE>DataBuffer</CODE>.
* @param offsets The offsets into each array.
*/
public DataBufferInt(int dataArray[][], int size, int offsets[]) {
super(UNTRACKABLE, TYPE_INT, size, dataArray.length, offsets);
! bankdata = (int [][]) dataArray.clone();
data = bankdata[0];
}
/**
* Returns the default (first) int data array in <CODE>DataBuffer</CODE>.
--- 177,187 ----
* @param size The size of the banks in the <CODE>DataBuffer</CODE>.
* @param offsets The offsets into each array.
*/
public DataBufferInt(int dataArray[][], int size, int offsets[]) {
super(UNTRACKABLE, TYPE_INT, size, dataArray.length, offsets);
! bankdata = dataArray.clone();
data = bankdata[0];
}
/**
* Returns the default (first) int data array in <CODE>DataBuffer</CODE>.
*** 224,234 ****
*
* @return All of the data arrays.
*/
public int[][] getBankData() {
theTrackable.setUntrackable();
! return (int [][]) bankdata.clone();
}
/**
* Returns the requested data array element from the first (default) bank.
*
--- 224,234 ----
*
* @return All of the data arrays.
*/
public int[][] getBankData() {
theTrackable.setUntrackable();
! return bankdata.clone();
}
/**
* Returns the requested data array element from the first (default) bank.
*
*** 276,284 ****
* @param val The integer value to which you want to set the specified data array element.
* @see #getElem(int)
* @see #getElem(int, int)
*/
public void setElem(int bank, int i, int val) {
! bankdata[bank][i+offsets[bank]] = (int)val;
theTrackable.markDirty();
}
}
--- 276,284 ----
* @param val The integer value to which you want to set the specified data array element.
* @see #getElem(int)
* @see #getElem(int, int)
*/
public void setElem(int bank, int i, int val) {
! bankdata[bank][i+offsets[bank]] = val;
theTrackable.markDirty();
}
}