JXBusyLabel
Code IndexAdd Codota to your IDE (free)

Best code snippets using org.jdesktop.swingx.JXBusyLabel(Showing top 15 results out of 315)

origin: RaiMan/SikuliX-2014

@Override
public void removeNotify() {
  // fix for #698
  wasBusyOnNotify = isBusy();
  // fix for #626
  stopAnimation();
  super.removeNotify();
}
origin: RaiMan/SikuliX-2014

private void stopAnimation() {
  if (busy != null) {
    busy.stop();
    getBusyPainter().setFrame(-1);
    repaint();
    busy = null;
  }
}
origin: RaiMan/SikuliX-2014

/**
 * @param busyPainter the busyPainter to set
 */
public final void setBusyPainter(BusyPainter busyPainter) {
  this.busyPainter = busyPainter;
  initPainter(new Dimension(getIcon().getIconWidth(), getIcon().getIconHeight()));
}
origin: RaiMan/SikuliX-2014

/**
 * Creates a new instance of <code>JXBusyLabel</code> initialized to the arbitrary size and using default circular progress indicator.
 * @param dim Preferred size of the label.
 */
public JXBusyLabel(Dimension dim) {
  super();
  this.setPreferredSize(dim);
  // Initialize the BusyPainter.
  getBusyPainter();
}
origin: RaiMan/SikuliX-2014

@Override
public void addNotify() {
  super.addNotify();
  // fix for #698
  if (wasBusyOnNotify) {
    // fix for #626
    startAnimation();
  }
}
origin: RaiMan/SikuliX-2014

  @Override
  public void actionPerformed(ActionEvent e) {
    frame = (frame+1)%busyPainter.getPoints();
    busyPainter.setFrame(direction == BusyPainter.Direction.LEFT ? busyPainter.getPoints() - frame : frame);
    frameChanged();
  }
});
origin: RaiMan/SikuliX-2014

/**
 * Notification from the <code>UIManager</code> that the L&F has changed.
 * Replaces the current UI object with the latest version from the
 * <code>UIManager</code>.
 *
 * @see javax.swing.JComponent#updateUI
 */
@Override
public void updateUI() {
  setUI((LabelUI) LookAndFeelAddons.getUI(this, BusyLabelUI.class));
}
origin: RaiMan/SikuliX-2014

/**
 * Sets direction of rotation. <code>Direction.RIGHT</code> is the default
 * value. Direction is taken from the very top point so <code>Direction.RIGHT</code> enables rotation clockwise.
 * @param dir Direction of rotation.
 */
public void setDirection(BusyPainter.Direction dir) {
  direction = dir;
  getBusyPainter().setDirection(dir);
}
origin: org.swinglabs/swingx

@Override
public void addNotify() {
  super.addNotify();
  // fix for #698
  if (wasBusyOnNotify) {
    // fix for #626
    startAnimation();
  }
}
origin: org.swinglabs/swingx

private void stopAnimation() {
  if (busy != null) {
    busy.stop();
    getBusyPainter().setFrame(-1);
    repaint();
    busy = null;
  }
}

origin: org.swinglabs/swingx

/**
 * Creates a new instance of <code>JXBusyLabel</code> initialized to the arbitrary size and using default circular progress indicator.
 * @param dim Preferred size of the label.
 */
public JXBusyLabel(Dimension dim) {
  super();
  this.setPreferredSize(dim);
  
  // Initialize the BusyPainter.
  getBusyPainter();
}
origin: org.swinglabs/swingx

  public void actionPerformed(ActionEvent e) {
    frame = (frame+1)%busyPainter.getPoints();
    busyPainter.setFrame(direction == Direction.LEFT ? busyPainter.getPoints() - frame : frame);
    frameChanged();
  }
});
origin: org.swinglabs/swingx

/**
 * @param busyPainter the busyPainter to set
 */
public final void setBusyPainter(BusyPainter busyPainter) {
  this.busyPainter = busyPainter;
  initPainter(new Dimension(getIcon().getIconWidth(), getIcon().getIconHeight()));
}
origin: org.swinglabs.swingx/swingx-core

@Override
public void removeNotify() {
  // fix for #698
  wasBusyOnNotify = isBusy();
  // fix for #626
  stopAnimation();
  super.removeNotify();
}
 
origin: org.swinglabs/swingx-core

@Override
public void removeNotify() {
  // fix for #698
  wasBusyOnNotify = isBusy();
  // fix for #626
  stopAnimation();
  super.removeNotify();
}

org.jdesktop.swingxJXBusyLabel

Javadoc

A simple circular animation, useful for denoting an action is taking place that may take an unknown length of time to complete. Similar to an indeterminant JProgressBar, but with a different look.

For example:

 
JXFrame frame = new JXFrame("test", true); 
JXBusyLabel label = new JXBusyLabel(); 
frame.add(label); 
//... 
label.setBusy(true); 

Another more complicated example:
 
JXBusyLabel label = new JXBusyLabel(new Dimension(100,84)); 
BusyPainter painter = new BusyPainter( 
new Rectangle2D.Float(0, 0,13.500001f,1), 
new RoundRectangle2D.Float(12.5f,12.5f,59.0f,59.0f,10,10)); 
painter.setTrailLength(5); 
painter.setPoints(31); 
painter.setFrame(1); 
label.setPreferredSize(new Dimension(100,84)); 
label.setIcon(new EmptyIcon(100,84)); 
label.setBusyPainter(painter); 
Another example:
 
JXBusyLabel label = new MyBusyLabel(new Dimension(100, 84)); 
where MyBusyLabel is:
 
public class MyBusyLabel extends JXBusyLabel { 
public MyBusyLabel(Dimension prefSize) { 
super(prefSize); 
} 
protected BusyLabel createBusyLabel(Dimension dim) { 
BusyPainter painter = new BusyPainter( 
new Rectangle2D.Float(0, 0,13.500001f,1), 
new RoundRectangle2D.Float(12.5f,12.5f,59.0f,59.0f,10,10)); 
painter.setTrailLength(5); 
painter.setPoints(31); 
painter.setFrame(1); 
return painter; 
} 
} 

Most used methods

  • createBusyPainter
    Create and return a BusyPpainter to use for the Label. This may be overridden to return any painter
  • firePropertyChange
  • frameChanged
  • getBusyPainter
    Returns the current BusyPainter. If no BusyPainter is currently set on this BusyLabel, the #createBu
  • getDelay
  • getIcon
  • getPreferredSize
  • getUI
  • initPainter
    Initialize the BusyPainter and (this) JXBusyLabel with the given preferred size. This method is call
  • isBusy
    Gets whether this JXBusyLabel is busy. If busy, then the JXBusyLabel instance will indicate that it
  • isPreferredSizeSet
  • repaint
  • isPreferredSizeSet,
  • repaint,
  • setIcon,
  • setPreferredSize,
  • setUI,
  • startAnimation,
  • stopAnimation,
  • <init>,
  • setBusy,
  • setHorizontalAlignment

Popular classes and methods

  • getSharedPreferences (Context)
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • Component (java.awt)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • Notification (javax.management)
    Notifications are events emitted by NotificationEmitters
  • Option (scala)

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)