+ /**
+ * The general orientation of the component.
+ *
+ * @return TRUE for vertical orientation, FALSE for horisontal orientation
+ */
+ public boolean getOrientation() {
+ return vertical;
+ }
+
+ /**
+ * Update the general orientation of the component.
+ *
+ * @param vertical
+ * TRUE for vertical orientation, FALSE for horisontal
+ * orientation
+ *
+ * @return TRUE if it changed something
+ */
+ public boolean setOrientation(boolean vertical) {
+ if (getWidth() == 0 || this.vertical != vertical) {
+ this.vertical = vertical;
+
+ BoxLayout layout = new BoxLayout(this,
+ vertical ? BoxLayout.Y_AXIS : BoxLayout.X_AXIS);
+ this.removeAll();
+ setLayout(layout);
+
+ this.add(first);
+ this.add(previous);
+ if (vertical) {
+ this.add(pageLabel);
+ } else {
+ this.add(page);
+ }
+ this.add(maxPage);
+ this.add(next);
+ this.add(last);
+
+ if (!vertical) {
+ this.add(label);
+ }
+
+ this.revalidate();
+ this.repaint();
+
+ return true;
+ }
+
+ return false;
+ }
+