* kind.
* @return Increase button.
*/
protected JButton createGeneralIncreaseButton(final int orientation,
boolean isRegular) {
JButton result = new SubstanceScrollButton(orientation);
result.setFont(this.scrollbar.getFont());
Icon icon = new ArrowButtonTransitionAwareIcon(result, orientation);
// Icon icon = new TransitionAwareIcon(result,
// new TransitionAwareIcon.Delegate() {
// public Icon getColorSchemeIcon(SubstanceColorScheme scheme) {
// return SubstanceImageCreator.getArrowIcon(
// SubstanceSizeUtils
// .getComponentFontSize(scrollbar),
// orientation, scheme);
// }
// });
result.setIcon(icon);
result.setFont(scrollbar.getFont());
// JButton result = new SubstanceScrollBarButton(icon, orientation);
result.setPreferredSize(new Dimension(this.scrollBarWidth,
this.scrollBarWidth));
Set<Side> openSides = EnumSet.noneOf(Side.class);
Set<Side> straightSides = EnumSet.noneOf(Side.class);
switch (orientation) {
case SOUTH:
openSides.add(Side.TOP);
if (!isRegular)
openSides.add(Side.BOTTOM);
if (isRegular)
straightSides.add(Side.BOTTOM);
break;
case EAST:
openSides.add(Side.LEFT);
if (!isRegular)
openSides.add(Side.RIGHT);
if (isRegular)
straightSides.add(Side.RIGHT);
break;
case WEST:
openSides.add(Side.RIGHT);
if (!isRegular)
openSides.add(Side.LEFT);
if (isRegular)
straightSides.add(Side.LEFT);
break;
}
result.putClientProperty(
SubstanceLookAndFeel.BUTTON_OPEN_SIDE_PROPERTY, openSides);
result.putClientProperty(SubstanceLookAndFeel.BUTTON_SIDE_PROPERTY,
straightSides);
return result;
}