/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
public final static int SCROLLBAR;
static {
}
int hsbSpace;
int vsbSpace;
super(target, parentWindow);
}
return "ScrollPane content";
}
}
super(target);
// Create the clip window. The field "clip" must be null when
// we call winCreate, or the parent of clip will be set to itself!
clip = c;
vsb = new XVerticalScrollbar(this);
hsb = new XHorizontalScrollbar(this);
} else {
}
int unitIncrement = 1;
if (vAdjustable != null){
}
unitIncrement = 1;
if (hAdjustable != null){
}
clip.xSetVisible(true);
}
public long getContentWindow()
{
}
repaint();
}
}
public int getHScrollbarHeight() {
return SCROLLBAR;
}
public int getVScrollbarWidth() {
return SCROLLBAR;
}
public void childResized(int w, int h) {
if (setScrollbarSpace()) {
}
repaint();
}
return c.size();
} else {
}
}
boolean setScrollbarSpace() {
boolean changed = false;
return changed;
}
int oldHsbSpace = hsbSpace;
int oldVsbSpace = vsbSpace;
}
}
changed = true;
}
}
if (vsbSpace > 0) {
// Adjustable vadj = sp.getVAdjustable();
// vadj.setVisibleAmount(vsb.vis);
// vadj.setMaximum(vsb.max);
// vadj.setBlockIncrement(vsb.page);
}
if (hsbSpace > 0) {
// Adjustable hadj = sp.getHAdjustable();
// hadj.setVisibleAmount(hsb.vis);
// hadj.setMaximum(hsb.max);
// hadj.setBlockIncrement(hsb.page);
}
// Check to see if we hid either of the scrollbars but left
// the pane to make it visible.
//
// Reminder: see if there is a better place to put this code.
boolean must_scroll = false;
// Get the point at which the ScrollPane is currently located
// if number of components > 0
p.y = 0;
must_scroll = true;
}
p.x = 0;
must_scroll = true;
}
}
if (must_scroll)
return changed;
}
void setViewportSize() {
}
vsb.setUnitIncrement(u);
} else {
// HORIZONTAL
hsb.setUnitIncrement(u);
}
}
} else {
// HORIZONTAL
}
}
public void setScrollPosition(int x, int y) {
}
}
/**
* Scroll the contents to position x, y
*/
Component c = getScrollChild();
if (c == null) {
return;
}
sx = -x;
sy = -y;
} else {
sx = p.x;
sy = p.y;
Graphics g = getGraphics();
try {
paintHorScrollbar(g, colors, true);
} finally {
g.dispose();
}
}
Graphics g = getGraphics();
try {
paintVerScrollbar(g, colors, true);
} finally {
g.dispose();
}
}
}
}
}
paintComponent(g);
}
if (vsbSpace > 0) {
paintVerScrollbar(g, colors, true);
// paint the whole scrollbar
}
if (hsbSpace > 0) {
paintHorScrollbar(g, colors, true);
// paint the whole scrollbar
}
}
void repaintScrollBars() {
Graphics g = getGraphics();
if (g != null) {
}
g.dispose();
}
Graphics g = getGraphics();
if (g != null) {
paintVerScrollbar(g,colors,true);
}
paintHorScrollbar(g,colors,true);
}
}
}
/**
* Paint the scrollpane.
*/
// paint rectangular region between scrollbars
if (MARGIN > 0) {
}
}
super.handleEvent(e);
switch(id) {
case PaintEvent.PAINT:
case PaintEvent.UPDATE:
break;
}
}
/**
* Paint the horizontal scrollbar to the screen
*
* @param g the graphics context to draw into
* @param colors the colors used to draw the scrollbar
* @param paintAll paint the whole scrollbar if true, just the thumb if false
*/
if (hsbSpace <= 0) {
return;
}
// SCROLLBAR is the height of scrollbar area
// but the actual scrollbar is SCROLLBAR-SPACE high;
// the rest must be filled with background color
try {
}
finally {
}
}
/**
* Paint the vertical scrollbar to the screen
*
* @param g the graphics context to draw into
* @param colors the colors used to draw the scrollbar
* @param paintAll paint the whole scrollbar if true, just the thumb if false
*/
if (vsbSpace <= 0) {
return;
}
// SCROLLBAR is the width of scrollbar area
// but the actual scrollbar is SCROLLBAR-SPACE wide;
// the rest must be filled with background color
try {
}
finally {
}
}
/**
*
* @see java.awt.event.MouseEvent
* MouseEvent.MOUSE_CLICKED
* MouseEvent.MOUSE_PRESSED
* MouseEvent.MOUSE_RELEASED
* MouseEvent.MOUSE_MOVED
* MouseEvent.MOUSE_ENTERED
* MouseEvent.MOUSE_EXITED
* MouseEvent.MOUSE_DRAGGED
*/
super.handleJavaMouseEvent(mouseEvent);
int x = mouseEvent.getX();
int y = mouseEvent.getY();
// super.handleMouseEvent(mouseEvent);
return;
}
switch (id) {
case MouseEvent.MOUSE_PRESSED:
if (inVerticalScrollbar(x,y )) {
} else if (inHorizontalScrollbar(x, y) ) {
active = HORIZONTAL;
}
break;
// On mouse up, pass the event through to the scrollbar to stop
// scrolling. The x & y passed do not matter.
case MouseEvent.MOUSE_RELEASED:
// winReleaseCursorFocus();
} else if (active == HORIZONTAL) {
}
break;
case MouseEvent.MOUSE_DRAGGED:
} else if ((active == HORIZONTAL)) {
}
break;
}
}
/**
* return value from the scrollbar
*/
}
}
/**
* return true if the x and y position is in the verticalscrollbar
*/
boolean inVerticalScrollbar(int x, int y) {
if (vsbSpace <= 0) {
return false;
}
}
/**
* return true if the x and y position is in the horizontal scrollbar
*/
boolean inHorizontalScrollbar(int x, int y) {
if (hsbSpace <= 0) {
return false;
}
}
try {
} catch (ArrayIndexOutOfBoundsException e) {
// do nothing. in this case we return null
}
return child;
}
int vval;
int hval;
int vmax;
int hmax;
/*
* Print the native component by rendering the Motif look ourselves.
* ToDo(aim): needs to query native motif for more accurate size and
* color information.
*/
Component c = getScrollChild();
if (c != null) {
} else {
}
switch (sbDisplay) {
case ScrollPane.SCROLLBARS_NEVER:
break;
case ScrollPane.SCROLLBARS_ALWAYS:
break;
}
}
}
if (vsbSpace > 0) {
vmin = 0;
vval = p.y;
}
if (hsbSpace > 0) {
hmin = 0;
hval = p.x;
}
// need to be careful to add the margins back in here because
// we're drawing the margin border, after all!
if (hsbSpace > 0) {
try {
} finally {
}
}
if (vsbSpace > 0) {
try {
} finally {
}
}
sp.printComponents(g);
}
}