/*
* 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.
*/
/**
* Divider used for Motif split pane.
* <p>
* <strong>Warning:</strong>
* Serialized objects of this class will not be compatible with
* future Swing releases. The current serialization support is appropriate
* for short term storage or RMI between applications running the same
* version of Swing. A future release of Swing will provide support for
* long term persistence.
*
* @author Jeff Dinkins
*/
{
/**
* Default cursor, supers is package private, so we have to have one
* too.
*/
/**
* Creates a new Motif SplitPaneDivider
*/
super(ui);
}
/**
* overrides to hardcode the size of the divider
* PENDING(jeff) - rewrite JSplitPane so that this ins't needed
*/
int borderSize = 0;
if (getBasicSplitPaneUI().getOrientation() ==
}
}
}
} else {
super.setDividerSize(newSize);
}
}
/**
* Paints the divider.
*/
// PENDING(jeff) - the thumb's location and size is currently hard coded.
// It should be dynamic.
// fill
g.setColor(getBackground());
if(getBasicSplitPaneUI().getOrientation() ==
int y = hThumbOffset;
// split line
g.setColor(shadowColor);
// draw thumb
getBackground());
g.setColor(shadowColor);
} else {
// split line
g.setColor(shadowColor);
// draw thumb
getBackground());
g.setColor(shadowColor);
}
super.paint(g);
}
/**
* The minimums size is the same as the preferredSize
*/
return getPreferredSize();
}
/**
* Sets the SplitPaneUI that is using the receiver. This is completely
* overriden from super to create a different MouseHandler.
*/
if (mouseHandler != null) {
mouseHandler = null;
}
}
splitPaneUI = newUI;
if (splitPane.isOneTouchExpandable()) {
}
}
}
else {
}
}
/**
* Returns true if the point at <code>x</code>, <code>y</code>
* is inside the thumb.
*/
private boolean isInThumb(int x, int y) {
int thumbX;
int thumbY;
int thumbWidth;
int thumbHeight;
if (getBasicSplitPaneUI().getOrientation() ==
}
else {
}
}
//
// Two methods are exposed so that MotifMouseHandler can see the
// superclass protected ivars
//
return dragger;
}
return splitPane;
}
/**
* MouseHandler is subclassed to only pass off to super if the mouse
* is in the thumb. Motif only allows dragging when the thumb is clicked
* in.
*/
// Constrain the mouse pressed to the thumb.
if (e.getSource() == MotifSplitPaneDivider.this &&
super.mousePressed(e);
}
}
if (getDragger() != null) {
return;
}
if (getCursor() != defaultCursor) {
}
return;
}
super.mouseMoved(e);
}
}
}