@Test(expected = IllegalArgumentException.class) public void testSetAlphaWithGreaterThanOne() { new JXPanel().setAlpha(Math.nextUp(1f)); }
@Override public void setAlpha(float alpha) { if (isPatch()) { setAlphaPatch(alpha); return; } if (alpha < 0f || alpha > 1f) { throw new IllegalArgumentException("invalid alpha value " + alpha); } float oldValue = getAlpha(); this.alpha = alpha; if (getAlpha() < 1f) { if (oldValue == 1) { oldOpaque = isOpaque(); super.setOpaque(false); } installRepaintManager(); } else { uninstallRepaintManager(); if (oldOpaque) { super.setOpaque(true); } } firePropertyChange("alpha", oldValue, getAlpha()); repaint(); }
JXPanel extends JPanel implements AlphaPaintable, BackgroundPaintable, Scrollable { @Override public void setAlpha(float alpha) { if (isPatch()) { setAlphaPatch(alpha); return; } if (alpha < 0f || alpha > 1f) { throw new IllegalArgumentException("invalid alpha value " + alpha); } float oldValue = getAlpha(); this.alpha = alpha; if (getAlpha() < 1f) { if (oldValue == 1) { oldOpaque = isOpaque(); super.setOpaque(false); } installRepaintManager(); } else { uninstallRepaintManager(); if (oldOpaque) { super.setOpaque(true); } } firePropertyChange("alpha", oldValue, getAlpha()); repaint(); } }
JXPanel extends JPanel implements AlphaPaintable, BackgroundPaintable, Scrollable { @Override public void setAlpha(float alpha) { if (isPatch()) { setAlphaPatch(alpha); return; } if (alpha < 0f || alpha > 1f) { throw new IllegalArgumentException("invalid alpha value " + alpha); } float oldValue = getAlpha(); this.alpha = alpha; if (getAlpha() < 1f) { if (oldValue == 1) { oldOpaque = isOpaque(); super.setOpaque(false); } installRepaintManager(); } else { uninstallRepaintManager(); if (oldOpaque) { super.setOpaque(true); } } firePropertyChange("alpha", oldValue, getAlpha()); repaint(); } JXPanel();  JXPanel(boolean isDoubleBuffered);  JXPanel(LayoutManager layout);  JXPanel(LayoutManager layout, boolean isDoubleBuffered); }
JXPanel extends JPanel implements AlphaPaintable, BackgroundPaintable, Scrollable { @Override public void setAlpha(float alpha) { if (isPatch()) { setAlphaPatch(alpha); return; } if (alpha < 0f || alpha > 1f) { throw new IllegalArgumentException("invalid alpha value " + alpha); } float oldValue = getAlpha(); this.alpha = alpha; if (getAlpha() < 1f) { if (oldValue == 1) { oldOpaque = isOpaque(); super.setOpaque(false); } installRepaintManager(); } else { uninstallRepaintManager(); if (oldOpaque) { super.setOpaque(true); } } firePropertyChange("alpha", oldValue, getAlpha()); repaint(); } JXPanel();  JXPanel(boolean isDoubleBuffered);  JXPanel(LayoutManager layout);  JXPanel(LayoutManager layout, boolean isDoubleBuffered); @Override void setOpaque(boolean opaque); @Override boolean isOpaque(); @Override float getAlpha(); @Override void setAlpha(float alpha); @Override float getEffectiveAlpha(); @Override boolean isInheritAlpha(); @Override void setInheritAlpha(boolean val); final void setScrollableWidthHint(ScrollableSizeHint hint); final void setScrollableHeightHint(ScrollableSizeHint hint); @Override boolean getScrollableTracksViewportHeight(); @Override boolean getScrollableTracksViewportWidth(); @Override Dimension getPreferredScrollableViewportSize(); @Override int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction); @Override int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction); void setScrollableTracksViewportHeight(boolean scrollableTracksViewportHeight); void setScrollableTracksViewportWidth(boolean scrollableTracksViewportWidth); @Override void setBackgroundPainter(Painter p); @Override Painter getBackgroundPainter(); @Override boolean isPaintBorderInsets(); @Override void setPaintBorderInsets(boolean paintBorderInsets); @Override void paint(Graphics g); }
JXPanel extends JPanel implements AlphaPaintable, BackgroundPaintable, Scrollable { @Override public void setAlpha(float alpha) { if (isPatch()) { setAlphaPatch(alpha); return; } if (alpha < 0f || alpha > 1f) { throw new IllegalArgumentException("invalid alpha value " + alpha); } float oldValue = getAlpha(); this.alpha = alpha; if (getAlpha() < 1f) { if (oldValue == 1) { oldOpaque = isOpaque(); super.setOpaque(false); } installRepaintManager(); } else { uninstallRepaintManager(); if (oldOpaque) { super.setOpaque(true); } } firePropertyChange("alpha", oldValue, getAlpha()); repaint(); } JXPanel();  JXPanel(boolean isDoubleBuffered);  JXPanel(LayoutManager layout);  JXPanel(LayoutManager layout, boolean isDoubleBuffered); @Override void setOpaque(boolean opaque); @Override boolean isOpaque(); @Override float getAlpha(); @Override void setAlpha(float alpha); @Override float getEffectiveAlpha(); @Override boolean isInheritAlpha(); @Override void setInheritAlpha(boolean val); final void setScrollableWidthHint(ScrollableSizeHint hint); final void setScrollableHeightHint(ScrollableSizeHint hint); @Override boolean getScrollableTracksViewportHeight(); @Override boolean getScrollableTracksViewportWidth(); @Override Dimension getPreferredScrollableViewportSize(); @Override int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction); @Override int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction); void setScrollableTracksViewportHeight(boolean scrollableTracksViewportHeight); void setScrollableTracksViewportWidth(boolean scrollableTracksViewportWidth); @Override void setBackgroundPainter(Painter p); @Override Painter getBackgroundPainter(); @Override boolean isPaintBorderInsets(); @Override void setPaintBorderInsets(boolean paintBorderInsets); @Override void paint(Graphics g);  }