use of org.apache.pivot.wtk.SplitPane in project pivot by apache.
the class TerraSplitPaneSkin method install.
@Override
public void install(Component component) {
super.install(component);
SplitPane splitPane = (SplitPane) component;
splitPane.getSplitPaneListeners().add(this);
splitPane.add(splitter);
updateSplitterCursor();
}
use of org.apache.pivot.wtk.SplitPane in project pivot by apache.
the class TerraSplitPaneSkin method getPreferredSize.
@Override
public Dimensions getPreferredSize() {
int preferredWidth = splitterThickness;
int preferredHeight = splitterThickness;
SplitPane splitPane = (SplitPane) getComponent();
Component topLeft = splitPane.getTopLeft();
if (topLeft != null) {
Dimensions size = topLeft.getPreferredSize();
preferredWidth += size.width;
preferredHeight += size.height;
}
Component bottomRight = splitPane.getBottomRight();
if (bottomRight != null) {
Dimensions size = bottomRight.getPreferredSize();
preferredWidth += size.width;
preferredHeight += size.height;
}
return new Dimensions(preferredWidth, preferredHeight);
}
use of org.apache.pivot.wtk.SplitPane in project pivot by apache.
the class TerraSplitPaneSkin method updateSplitterCursor.
private void updateSplitterCursor() {
Cursor cursor = Cursor.DEFAULT;
SplitPane splitPane = (SplitPane) getComponent();
if (!splitPane.isLocked()) {
switch(splitPane.getOrientation()) {
case HORIZONTAL:
{
switch(splitPane.getPrimaryRegion()) {
case TOP_LEFT:
{
cursor = Cursor.RESIZE_EAST;
break;
}
case BOTTOM_RIGHT:
{
cursor = Cursor.RESIZE_WEST;
break;
}
default:
{
break;
}
}
break;
}
case VERTICAL:
{
switch(splitPane.getPrimaryRegion()) {
case TOP_LEFT:
{
cursor = Cursor.RESIZE_SOUTH;
break;
}
case BOTTOM_RIGHT:
{
cursor = Cursor.RESIZE_NORTH;
break;
}
default:
{
break;
}
}
break;
}
default:
{
break;
}
}
}
splitter.setCursor(cursor);
}
Aggregations