it.tidalwave.swing.GenericProgressPane Maven / Gradle / Ivy
/***********************************************************************************************************************
*
* OpenBlueSky - NetBeans Platform Enhancements
* Copyright (C) 2006-2012 by Tidalwave s.a.s. (http://www.tidalwave.it)
*
***********************************************************************************************************************
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
* an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
* specific language governing permissions and limitations under the License.
*
***********************************************************************************************************************
*
* WWW: http://openbluesky.java.net
* SCM: https://bitbucket.org/tidalwave/openbluesky-src
*
**********************************************************************************************************************/
package it.tidalwave.swing;
//import it.tidalwave.bluemarine.lookandfeel.LookAndFeel;
import javax.swing.JPanel;
/*******************************************************************************
*
* @author Fabrizio Giudici
* @version $Id$
*
******************************************************************************/
public class GenericProgressPane extends JPanel
{
/***************************************************************************
*
*
**************************************************************************/
public GenericProgressPane()
{
initComponents();
lbLabel.setText("");
// FIXME lbLabel.setFont(UIManager.getFont(LookAndFeel.FONT_SMALL));
pbProgressBar.setIndeterminate(true);
}
/***************************************************************************
*
*
**************************************************************************/
public void setStepCount (final int n)
{
pbProgressBar.setMaximum(n);
pbProgressBar.setIndeterminate(false);
}
/***************************************************************************
*
*
**************************************************************************/
public void incrementStep (final String message)
{
incrementStep(message, 1);
}
/***************************************************************************
*
*
**************************************************************************/
public void incrementStep (final String message, final int amount)
{
setStep(message, pbProgressBar.getValue() + amount);
}
/***************************************************************************
*
*
**************************************************************************/
public void setStep (final String message, final int step)
{
pbProgressBar.setValue(step);
lbLabel.setText(message);
}
/***************************************************************************
*
* This method is called from within the constructor to
* initialize the form.
* WARNING: Do NOT modify this code. The content of this method is
* always regenerated by the Form Editor.
*
**************************************************************************/
// //GEN-BEGIN:initComponents
private void initComponents() {
pbProgressBar = new javax.swing.JProgressBar();
lbLabel = new javax.swing.JLabel();
lbLabel.setText(org.openide.util.NbBundle.getMessage(GenericProgressPane.class, "GenericProgressPane.lbLabel.text")); // NOI18N
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(32, 32, 32)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(pbProgressBar, javax.swing.GroupLayout.DEFAULT_SIZE, 420, Short.MAX_VALUE)
.addGap(32, 32, 32))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
.addComponent(lbLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 446, Short.MAX_VALUE)
.addContainerGap())))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(32, 32, 32)
.addComponent(pbProgressBar, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(lbLabel)
.addContainerGap(42, Short.MAX_VALUE))
);
}// //GEN-END:initComponents
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel lbLabel;
private javax.swing.JProgressBar pbProgressBar;
// End of variables declaration//GEN-END:variables
}