RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); r = getBox(r); g.setColor(progressBar.getForeground()); g.fillOval(r.x, r.y, r.width, r.height);
@Override protected void uninstallDefaults() { super.uninstallDefaults(); _cellBackground = null; _cellForeground = null; }
@Override public void installUI(JComponent c) { super.installUI(c); NapkinUtil.installUI(c); }
@Override protected void installDefaults() { super.installDefaults(); initRepaintInterval(); //initialize repaint interval }
@Override protected void uninstallListeners() { super.uninstallListeners(); progressBar.removePropertyChangeListener(this); }
@Override protected void installListeners() { super.installListeners(); progressBar.addPropertyChangeListener(this); }
return; int cellLength = getCellLength(); int cellSpacing = getCellSpacing(); int amountFull = getAmountFull(b, barRectWidth, barRectHeight); paintString(g, b.left, b.top, barRectWidth, barRectHeight, amountFull, b);
boxRect = getBox(boxRect); } catch (NullPointerException ignore) {} if(progressBar.getOrientation() == JProgressBar.HORIZONTAL) { paintString(g, b.left, b.top, barRectWidth, barRectHeight, boxRect.width, b); paintString(g, b.left, b.top, barRectWidth, barRectHeight, boxRect.height, b);
protected void paintDeterminate(Graphics g, JComponent c) { Insets b = progressBar.getInsets(); // area for border int barRectWidth = progressBar.getWidth() - (b.right + b.left); int barRectHeight = progressBar.getHeight() - (b.top + b.bottom); if(progressBar.getOrientation() == JProgressBar.HORIZONTAL) { int amountFull = getAmountFull(b, barRectWidth, barRectHeight); drawXpHorzProgress(g, b.left, b.top, barRectWidth, barRectHeight, amountFull); // Deal with possible text painting if(progressBar.isStringPainted()) { g.setFont(c.getFont()); paintString(g, b.left, b.top, barRectWidth, barRectHeight, amountFull, b); } } else { // VERTICAL int amountFull = getAmountFull(b, barRectWidth, barRectHeight); drawXpVertProgress(g, b.left, b.top, barRectWidth, barRectHeight, amountFull); // Deal with possible text painting if(progressBar.isStringPainted()) { g.setFont(c.getFont()); paintString(g, b.left, b.top, barRectWidth, barRectHeight, amountFull, b); } } }
@Override public void paint (Graphics g, JComponent c) { super.paint (MaterialDrawingUtils.getAliasedGraphics (g), c); }
@Override public void uninstallUI(JComponent c) { NapkinUtil.uninstallUI(c); super.uninstallUI(c); }
@Override public void installUI(JComponent c) { super.installUI(c); c.setOpaque(false); c.setBorder(BorderFactory.createLineBorder(Color.WHITE, 2)); JProgressBar pg = (JProgressBar) c; pg.setForeground(FOREGROUND_COLOR); }
@Override protected void installDefaults() { super.installDefaults(); this.displayedValue = progressBar.getValue(); LookAndFeel.installProperty(progressBar, "opaque", Boolean.FALSE); this.speed = (20.0f * UIManager.getInt("ProgressBar.repaintInterval")) / UIManager.getInt("ProgressBar.cycleTime"); float borderThickness = SubstanceSizeUtils .getBorderStrokeWidth(SubstanceSizeUtils .getComponentFontSize(this.progressBar)); this.margin = (int) Math.ceil(1.5 * borderThickness); }
@Override protected void uninstallListeners() { progressBar.removePropertyChangeListener(_propertyChangeListener); super.uninstallListeners(); }
@Override protected void installListeners() { super.installListeners(); progressBar.addPropertyChangeListener( _propertyChangeListener = new PropertyChangeHandler()); }
public void paint(Graphics g, JComponent c) { JProgressBar prog = (JProgressBar) c; Graphics2D gfx = (Graphics2D) g; Dimension size = c.getSize(); if (true) { gfx.setColor(c.getBackground()); } else if (prog.getOrientation() == JProgressBar.HORIZONTAL) { gfx.setPaint( new GradientPaint( 0, 0, UIManager.getColor("ProgressBar.gradientStart"), 0, size.height / 2, UIManager.getColor("ProgressBar.gradientEnd"), true)); } else { gfx.setPaint( new GradientPaint( 0, 0, UIManager.getColor("ProgressBar.gradientStart"), size.width / 2, 0, UIManager.getColor("ProgressBar.gradientEnd"), true)); } gfx.fill(new Rectangle(0, 0, size.width, size.height)); super.paint(g, c); }
public void uninstallUI(JComponent c) { c.removePropertyChangeListener(propertyChangeListener); super.uninstallUI(c); }
public void installUI(JComponent c) { super.installUI(c); c.setBorder(UIManager.getBorder("ProgressBar.border")); propertyChangeListener = new PropertyChangeHandler(); c.addPropertyChangeListener(propertyChangeListener); }
@Override protected void installDefaults() { super.installDefaults(); this.displayedValue = progressBar.getValue(); LookAndFeel.installProperty(progressBar, "opaque", Boolean.FALSE); this.speed = (20.0f * UIManager.getInt("ProgressBar.repaintInterval")) / UIManager.getInt("ProgressBar.cycleTime"); float borderThickness = SubstanceSizeUtils .getBorderStrokeWidth(SubstanceSizeUtils .getComponentFontSize(this.progressBar)); this.margin = (int) Math.ceil(1.5 * borderThickness); }
@Override protected void uninstallListeners() { this.progressBar .removeChangeListener(this.substanceValueChangeListener); this.substanceValueChangeListener = null; this.progressBar .removePropertyChangeListener(this.substancePropertyChangeListener); this.substancePropertyChangeListener = null; super.uninstallListeners(); }