private void checkAmpClipping(Recording testRecording) { String message; testRecording.checkForAmpClipping(); int db = (int) testRecording.getPeakAmplitude(); // Determine colour of bar in amplitude meter Color barColor = Color.GREEN; // Set to default (green) // If amplitude clipping occurred, then bar colour is red if (testRecording.isAmpClipped) { barColor = Color.RED; message = "Amplitude clipping detected: " + db + " dB"; } // Otherwise if within the warning threshold, bar colour is yellow else if (testRecording.isAmpWarning) { barColor = Color.YELLOW; message = "Near clipping threshold: " + db + " dB"; } else { // Else the bar remains green message = "No clipping detected:" + db + " dB"; } // Display results of check for amplitude clipping this.jProgressBar_Amplitude.setForeground(barColor); // PRI2 Doesn't seem to have any effect this.jProgressBar_Amplitude.setValue(db); // Update the message bar with the appropriate message this.showMessage(message); }
public void resetRegularSearchProgressBar() { this.regularSearchProgressBar.setForeground(originalregularSearchProgressBarColor); this.regularSearchProgressBar.setValue(0); this.regularSearchProgressBar.setStringPainted(false); }
public void setVolumeBar(int val) { if (TtheApp!=null) { if (TtheApp.isPauseScreen()==true) return; } if (val<40){ volumeBar.setForeground(Color.yellow); }else if((val>40)&&(val<70)){ volumeBar.setForeground(Color.green); }else { volumeBar.setForeground(Color.red); //greater 100 reset vol bar to 100 val=100; } // Set the class value // volumeBar.setValue(val); }
JFrame frame = new JFrame("ProgressBar test"); frame.setSize(300, 300); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); JPanel panel = new JPanel(); frame.add(panel); JProgressBar pb = new JProgressBar(50, 100); pb.setMinimum(0); pb.setMaximum(100); pb.setValue(75); pb.setForeground(Color.orange); pb.setBackground(Color.green); panel.add(pb); frame.setVisible(true);
@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); }
private void init() { frame = new JFrame( name ); frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); Container cp = frame.getContentPane(); cp.setBackground( Color.white ); cp.setLayout( new BoxLayout( cp, BoxLayout.Y_AXIS ) ); progressBar = new JProgressBar( JProgressBar.HORIZONTAL, 0, max - 1 ); progressBar.setStringPainted( true ); progressBar.setBackground( Color.white ); progressBar.setForeground( new Color( 255, 217, 119 ) ); // light orange progressBar.setStringPainted( true ); totalLabel = new JLabel( "Total: " + max ); totalLabel.setForeground( Color.orange.darker() ); currentLabel = new JLabel( "Current:" + current ); currentLabel.setForeground( Color.orange ); statusLabel = new JLabel(); statusLabel.setForeground( Color.gray.brighter() ); cp.add( progressBar ); cp.add( totalLabel ); cp.add( currentLabel ); cp.add( statusLabel ); frame.pack(); // shrink-wrap alternative Dimension d = frame.getSize(); frame.setSize( (int) ( d.getWidth() * 2 ), (int) ( d.getHeight() * 1.2 ) ); }
private void init() { frame = new JFrame( name ); frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); Container cp = frame.getContentPane(); cp.setBackground( Color.white ); cp.setLayout( new BoxLayout( cp, BoxLayout.Y_AXIS ) ); progressBar = new JProgressBar( JProgressBar.HORIZONTAL, 0, max - 1 ); progressBar.setStringPainted( true ); progressBar.setBackground( Color.white ); progressBar.setForeground( new Color( 255, 217, 119 ) ); // light orange progressBar.setStringPainted( true ); totalLabel = new JLabel( "Total: " + max ); totalLabel.setForeground( Color.orange.darker() ); currentLabel = new JLabel( "Current:" + current ); currentLabel.setForeground( Color.orange ); statusLabel = new JLabel(); statusLabel.setForeground( Color.gray.brighter() ); cp.add( progressBar ); cp.add( totalLabel ); cp.add( currentLabel ); cp.add( statusLabel ); frame.pack(); // shrink-wrap alternative Dimension d = frame.getSize(); frame.setSize( (int) ( d.getWidth() * 2 ), (int) ( d.getHeight() * 1.2 ) ); }
private void init() { frame = new JFrame( name ); frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE ); Container cp = frame.getContentPane(); cp.setBackground( Color.white ); cp.setLayout( new BoxLayout( cp, BoxLayout.Y_AXIS ) ); progressBar = new JProgressBar( JProgressBar.HORIZONTAL, 0, max - 1 ); progressBar.setStringPainted( true ); progressBar.setBackground( Color.white ); progressBar.setForeground( new Color( 255, 217, 119 ) ); // light orange progressBar.setStringPainted( true ); totalLabel = new JLabel( "Total: " + max ); totalLabel.setForeground( Color.orange.darker() ); currentLabel = new JLabel( "Current:" + current ); currentLabel.setForeground( Color.orange ); statusLabel = new JLabel(); statusLabel.setForeground( Color.gray.brighter() ); cp.add( progressBar ); cp.add( totalLabel ); cp.add( currentLabel ); cp.add( statusLabel ); frame.pack(); // shrink-wrap alternative Dimension d = frame.getSize(); frame.setSize( (int) ( d.getWidth() * 2 ), (int) ( d.getHeight() * 1.2 ) ); }
/** * Create a user monitor on step processing. * There is exactly one instance of this class (and no instance when running in batch mode) */ public StepMonitor () { bar.setToolTipText("On going Step activity"); bar.setStringPainted(true); displayAnimation(false); bar.setString(""); bar.setForeground(Colors.PROGRESS_BAR); }
@Override public void run () { int total = (int) Math.rint(Memory.total() / MEGA); int used = (int) Math.rint(Memory.occupied() / MEGA); int threshold = (int) Math.rint(constants.alarmThreshold.getValue() * total); if ((total != lastTotal) || (used != lastUsed) || (threshold != lastThreshold)) { progressBar.setMaximum(total); progressBar.setValue(used); progressBar.setString(String.format("%d/%d MB", used, total)); lastTotal = total; lastUsed = used; lastThreshold = threshold; if (used > threshold) { progressBar.setForeground(Color.red); } else { progressBar.setForeground(defaultForeground); } } } };
@Override public void installUI (JComponent c) { super.installUI (c); JProgressBar progressBar = (JProgressBar) c; progressBar.setBorder (MaterialBorders.LIGHT_LINE_BORDER); progressBar.setBackground (MaterialColors.GRAY_200); progressBar.setForeground (MaterialColors.LIGHT_BLUE_400); }
jprogressbarReadPermissions.setForeground(Color.BLUE); jprogressbarReadPermissions.setBackground(Color.LIGHT_GRAY); jprogressbarReadPermissions.setStringPainted(true); jprogressbarSetPermissions.setForeground(Color.BLUE); jprogressbarSetPermissions.setBackground(Color.LIGHT_GRAY); jprogressbarSetPermissions.setStringPainted(true);
private JProgressBar getLoadingJProgressBar() { if (loadProgressBar == null) { loadProgressBar = new JProgressBar(); loadProgressBar.setPreferredSize(DisplayUtils.getScaledDimension(100, 12)); loadProgressBar.setMinimum(0); loadProgressBar.setMaximum(100); loadProgressBar.setValue(50); loadProgressBar.setBorder(BorderFactory.createLineBorder(Color.black)); loadProgressBar.setUI(new CustomProgressBarUI()); loadProgressBar.setForeground(Color.decode("#4389FF")); setLoadingCompletion(0.0D); } return loadProgressBar; }
progress1.setBorder(null); progress2.setFont(new ComponentsFactory().getFont(FontStyle.BOLD, 82)); progress2.setForeground(AppThemeColor.TEXT_DEFAULT);
progressBar.setMinimum(0); progressBar.setMaximum(100); progressBar.setForeground(Themes.currentTheme.infoAlertBackground());
cpe.getRegularSearchProgressBar().setForeground( COLOR_FOREGROUND_GOOD ); // Color.GREEN); } else { cpe.getRegularSearchProgressBar().setForeground(COLOR_FOREGROUND_BAD ); // Color.RED);
builder.addSeparator(title, cst.xyw(1, r, 3)); builder.add(progressBar, cst.xyw(5, r, 7)); progressBar.setForeground(Colors.PROGRESS_BAR);
private void defineLayout () { progressBar.setForeground(Colors.PROGRESS_BAR); FormLayout layout = Panel.makeFormLayout( 3, 3, "", Trainer.LABEL_WIDTH, Trainer.FIELD_WIDTH); PanelBuilder builder = new PanelBuilder(layout, component); CellConstraints cst = new CellConstraints(); int r = 1; // ---------------------------- builder.addSeparator("Selection", cst.xyw(1, r, 3)); builder.add(progressBar, cst.xyw(5, r, 7)); r += 2; // ---------------------------- builder.add(nbRepoSamples.getLabel(), cst.xy(5, r)); builder.add(nbRepoSamples.getField(), cst.xy(7, r)); builder.add(nbTrainSamples.getLabel(), cst.xy(9, r)); builder.add(nbTrainSamples.getField(), cst.xy(11, r)); r += 2; // ---------------------------- builder.add(new JButton(selectAction), cst.xy(3, r)); builder.add(new JButton(storeAction), cst.xy(5, r)); builder.add(nbTestSamples.getLabel(), cst.xy(9, r)); builder.add(nbTestSamples.getField(), cst.xy(11, r)); }
progressBar.setForeground(Colors.PROGRESS_BAR);
public static void configuraWebLaf(JProgressBar field) { if (!WeblafUtils.weblafEstaInstalado()) { return; } ((WebProgressBarUI)field.getUI()).setProgressTopColor(ColorController.PROGRESS_BAR); ((WebProgressBarUI)field.getUI()).setProgressBottomColor(ColorController.PROGRESS_BAR); ((WebProgressBarUI)field.getUI()).setBgBottom(ColorController.FUNDO_ESCURO); ((WebProgressBarUI)field.getUI()).setBgTop(ColorController.FUNDO_ESCURO); ((WebProgressBarUI)field.getUI()).setIndeterminateBorder(null); ((WebProgressBarUI)field.getUI()).setPaintIndeterminateBorder(false); ((WebProgressBarUI)field.getUI()).setInnerRound(0); ((WebProgressBarUI)field.getUI()).setRound(0); ((WebProgressBarUI)field.getUI()).setHighlightWhite(ColorController.PROGRESS_BAR); ((WebProgressBarUI)field.getUI()).setShadeWidth(0); ((WebProgressBarUI)field.getUI()).setHighlightDarkWhite(ColorController.PROGRESS_BAR); field.setBorder(new EmptyBorder(15,15,15,15)); field.setOpaque(true); field.setBackground(ColorController.COR_DESTAQUE); field.setForeground(ColorController.COR_LETRA); field.setBorderPainted(false); }