g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); if (scrollbar.getOrientation() == JScrollBar.VERTICAL) { g2.translate(thumbBounds.x + 1, thumbBounds.y + 2);
@Override protected void paintThumb(Graphics g, JComponent c, Rectangle thumbBounds) { int alpha = this.isThumbRollover() ? LightScrollPane.this.scrollBarAlphaRollover : LightScrollPane.this.scrollBarAlpha; int orientation = this.scrollbar.getOrientation(); int x = thumbBounds.x + THUMB_BORDER_SIZE; int y = thumbBounds.y + THUMB_BORDER_SIZE;
g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); if (scrollbar.getOrientation() == JScrollBar.VERTICAL) { int width = trackBounds.width - 4 + ANTI_WIDTH; int height = trackBounds.height;
/** * Checks if the scroll bar is a vertical one. * * @return <tt>true</tt> iff the scroll bar is vertical. */ private boolean isVertical() { return scrollbar.getOrientation() == Adjustable.VERTICAL; }
/** Returns the preferred size for the specified component */ public Dimension getPreferredSize(JComponent c) { if (scrollbar.getOrientation() == JScrollBar.VERTICAL) { return new Dimension(scrollBarWidth, scrollBarWidth * 3 + 10); } else // Horizontal { return new Dimension(scrollBarWidth * 3 + 10, scrollBarWidth); } }
@Override public Dimension getPreferredSize(JComponent c) { if (scrollbar.getOrientation() == JScrollBar.VERTICAL) { return new Dimension(scrollBarWidth, scrollBarWidth * 3 + 10); } else { // Horizontal return new Dimension(scrollBarWidth * 3 + 10, scrollBarWidth); // WAT?????????????????? zwei mal width } }
public Dimension getPreferredSize(JComponent c) { if(scrollbar.getOrientation() == JScrollBar.VERTICAL) { return new Dimension(scrollBarWidth, scrollBarWidth * 3 + 10); } else { // Horizontal return new Dimension(scrollBarWidth * 3 + 10, scrollBarWidth); } }
@Override public Dimension getPreferredSize(JComponent c) { if (scrollbar.getOrientation() == JScrollBar.VERTICAL) { return new Dimension(scrollBarWidth, Math.max(48, 5 * scrollBarWidth)); } else { return new Dimension(Math.max(48, 5 * scrollBarWidth), scrollBarWidth); } }
@Override public Dimension getPreferredSize(JComponent c) { if (scrollbar.getOrientation() == JScrollBar.VERTICAL) { return new Dimension(scrollBarWidth, Math.max(48, 5 * scrollBarWidth)); } else { return new Dimension(Math.max(48, 5 * scrollBarWidth), scrollBarWidth); } }
protected Point getBlockLocation(JScrollBar bar, boolean up) { boolean horizontal = bar.getOrientation() == JScrollBar.HORIZONTAL; Point p = getUnitLocation(bar, up); int offset = up ? BLOCK_OFFSET : -BLOCK_OFFSET; if (horizontal) p.x += offset; else p.y += offset; return p; }
private JScrollBar getHorizontalScrollBar(JComponent c) { for (Component component : c.getComponents()) { if (component instanceof JScrollBar && ((JScrollBar) component).getOrientation() == JScrollBar.HORIZONTAL) { return (JScrollBar) component; } } return null; }
/** * Gets the PreferredSize attribute of the GtkScrollbar object * * @param scrollbar Description of Parameter * @return The PreferredSize value */ public Dimension getPreferredSize(JScrollBar scrollbar) { return (scrollbar.getOrientation() == JScrollBar.VERTICAL) ? new Dimension(Math.max(10, Math.max(up.getWidth(), v_thumb.getWidth())), 48) : new Dimension(48, Math.max(10, Math.max(left.getHeight(), h_thumb.getHeight()))); }
@Override public Point call() throws Exception { boolean horizontal = bar.getOrientation() == JScrollBar.HORIZONTAL; int arrow = horizontal ? bar.getHeight() : bar.getWidth(); if (up) { return horizontal ? new Point(bar.getWidth() - arrow/2, arrow/2) : new Point(arrow/2, bar.getHeight() - arrow/2); } return new Point(arrow/2, arrow/2); } });
protected void paintTrack(SeaGlassContext ss, Graphics g, Rectangle trackBounds) { SeaGlassLookAndFeel.updateSubregion(ss, g, trackBounds); ss.getPainter().paintScrollBarTrackBackground(ss, g, trackBounds.x, trackBounds.y, trackBounds.width, trackBounds.height, scrollbar.getOrientation()); ss.getPainter().paintScrollBarTrackBorder(ss, g, trackBounds.x, trackBounds.y, trackBounds.width, trackBounds.height, scrollbar.getOrientation()); }
protected void paintCap(SeaGlassContext ss, Graphics g, Rectangle capBounds) { SeaGlassLookAndFeel.updateSubregion(ss, g, capBounds); int orientation = scrollbar.getOrientation(); ss.getPainter().paintScrollBarThumbBackground(ss, g, capBounds.x, capBounds.y, capBounds.width, capBounds.height, orientation); }
public void update(Graphics g, JComponent c) { SeaGlassContext context = getContext(c); SeaGlassLookAndFeel.update(context, g); context.getPainter().paintScrollBarBackground(context, g, 0, 0, c.getWidth(), c.getHeight(), scrollbar.getOrientation()); paint(context, g); context.dispose(); }
private boolean isMouseBeforeThumb() { return VERTICAL == myScrollBar.getOrientation() ? isMouseOnTop() : myScrollBar.getComponentOrientation().isLeftToRight() ? isMouseOnLeft() : isMouseOnRight(); }
private boolean isMouseAfterThumb() { return VERTICAL == myScrollBar.getOrientation() ? isMouseOnBottom() : myScrollBar.getComponentOrientation().isLeftToRight() ? isMouseOnRight() : isMouseOnLeft(); }
protected void paintThumb(SeaGlassContext ss, Graphics g, Rectangle thumbBounds) { SeaGlassLookAndFeel.updateSubregion(ss, g, thumbBounds); int orientation = scrollbar.getOrientation(); ss.getPainter().paintScrollBarThumbBackground(ss, g, thumbBounds.x, thumbBounds.y, thumbBounds.width, thumbBounds.height, orientation); ss.getPainter().paintScrollBarThumbBorder(ss, g, thumbBounds.x, thumbBounds.y, thumbBounds.width, thumbBounds.height, orientation); }
private void updateButtonDirections() { int orient = scrollbar.getOrientation(); if (scrollbar.getComponentOrientation().isLeftToRight()) { ((SeaGlassArrowButton) incrButton).setDirection(orient == HORIZONTAL ? EAST : SOUTH); ((SeaGlassArrowButton) decrButton).setDirection(orient == HORIZONTAL ? WEST : NORTH); } else { ((SeaGlassArrowButton) incrButton).setDirection(orient == HORIZONTAL ? WEST : SOUTH); ((SeaGlassArrowButton) decrButton).setDirection(orient == HORIZONTAL ? EAST : NORTH); } }