JXStatusBar
Code IndexAdd Codota to your IDE (free)

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

  • Common ways to obtain JXStatusBar
private void myMethod () {
JXStatusBar j =
  • JXFrame jXFrame;jXFrame.getRootPaneExt().getStatusBar()
  • JXDialog jXDialog;jXDialog.getRootPane().getStatusBar()
  • Smart code suggestions by Codota
}
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((StatusBarUI) LookAndFeelAddons
      .getUI(this, StatusBarUI.class));
}
origin: RaiMan/SikuliX-2014

/**
 * Creates a new JXStatusBar
 */
public JXStatusBar() {
  super();
  updateUI();
}
origin: RaiMan/SikuliX-2014

protected void installDefaults(JXStatusBar sb) {
  //only set the border if it is an instanceof UIResource
  //In other words, only replace the border if it has not been
  //set by the developer. UIResource is the flag we use to indicate whether
  //the value was set by the UIDelegate, or by the developer.
  Border b = statusBar.getBorder();
  if (b == null || b instanceof UIResource) {
    statusBar.setBorder(createBorder());
  }
  LookAndFeel.installProperty(sb, "opaque", Boolean.TRUE);
}
origin: RaiMan/SikuliX-2014

protected void paintBackground(Graphics2D g, JXStatusBar bar) {
  if (bar.isOpaque()) {
    g.setColor(bar.getBackground());
    g.fillRect(0, 0, bar.getWidth(), bar.getHeight());
  }
}
origin: RaiMan/SikuliX-2014

protected void uninstallDefaults(JXStatusBar sb) {
  if (sb.getBorder() instanceof UIResource) {
    sb.setBorder(null);
  }
}
origin: RaiMan/SikuliX-2014

private boolean isHandleAreaPoint(Point point) {
  if (window == null || window.isMaximumSizeSet()) {
    return false;
  }
  if (statusBar.getComponentOrientation().isLeftToRight()) {
    return point.x >= statusBar.getWidth() - handleBoundary;
  } else {
    return point.x <= handleBoundary;
  }
}
origin: org.swinglabs.swingx/swingx-core

/**
 * @param resizeHandleEnabled the resizeHandleEnabled to set
 */
public void setResizeHandleEnabled(boolean resizeHandleEnabled) {
  boolean oldValue = isResizeHandleEnabled();
  this.resizeHandleEnabled = resizeHandleEnabled;
  firePropertyChange("resizeHandleEnabled", oldValue, isResizeHandleEnabled());
}
origin: RaiMan/SikuliX-2014

/**
 * {@inheritDoc}
 */
@Override
public void uninstallUI(JComponent c) {
  assert c instanceof JXStatusBar;
  uninstallDefaults(statusBar);
  uninstallListeners(statusBar);
  if (statusBar.getLayout() instanceof UIResource) {
    statusBar.setLayout(null);
  }
}
origin: RaiMan/SikuliX-2014

private int getHandleBoundary() {
  Border border = statusBar.getBorder();
  if (border == null || !statusBar.isResizeHandleEnabled()) {
    return 0;
  }
  if (statusBar.getComponentOrientation().isLeftToRight()) {
    return border.getBorderInsets(statusBar).right;
  } else {
    return border.getBorderInsets(statusBar).left;
  }
}
origin: org.swinglabs/swingx-core

protected void paintBackground(Graphics2D g, JXStatusBar bar) {
  if (bar.isOpaque()) {
    g.setColor(bar.getBackground());
    g.fillRect(0, 0, bar.getWidth(), bar.getHeight());
  }
}

origin: org.swinglabs/swingx-core

private boolean isHandleAreaPoint(Point point) {
  if (window == null || window.isMaximumSizeSet()) {
    return false;
  }
  
  if (statusBar.getComponentOrientation().isLeftToRight()) {
    return point.x >= statusBar.getWidth() - handleBoundary;
  } else {
    return point.x <= handleBoundary;
  }
}

origin: org.swinglabs/swingx-core

/**
 * Creates a new JXStatusBar
 */
public JXStatusBar() {
  super();
  updateUI();
}
origin: org.swinglabs.swingx/swingx-all

protected void paintBackground(Graphics2D g, JXStatusBar bar) {
  if (bar.isOpaque()) {
    g.setColor(bar.getBackground());
    g.fillRect(0, 0, bar.getWidth(), bar.getHeight());
  }
}
 
origin: org.swinglabs/swingx

protected void installDefaults(JXStatusBar sb) {
  //only set the border if it is an instanceof UIResource
  //In other words, only replace the border if it has not been
  //set by the developer. UIResource is the flag we use to indicate whether
  //the value was set by the UIDelegate, or by the developer.
  Border b = statusBar.getBorder();
  if (b == null || b instanceof UIResource) {
    statusBar.setBorder(createBorder());
  }
  
  LookAndFeel.installProperty(sb, "opaque", Boolean.TRUE);
}

origin: RaiMan/SikuliX-2014

/**
 * @param resizeHandleEnabled the resizeHandleEnabled to set
 */
public void setResizeHandleEnabled(boolean resizeHandleEnabled) {
  boolean oldValue = isResizeHandleEnabled();
  this.resizeHandleEnabled = resizeHandleEnabled;
  firePropertyChange("resizeHandleEnabled", oldValue, isResizeHandleEnabled());
}
org.jdesktop.swingxJXStatusBar

Javadoc

A container for JComponents that is typically placed at the bottom of a form and runs the entire width of the form. There are 3 important functions that JXStatusBar provides. First, JXStatusBar provides a hook for a pluggable look. There is a definite look associated with status bars on windows, for instance. By implementing a subclass of JComponent, we provide a way for the pluggable look and feel system to modify the look of the status bar.

Second, JXStatusBar comes with its own layout manager. Each item is added to the JXStatusBar with a JXStatusBar.Constraint as the constraint argument. The JXStatusBar.Constraint contains an Insets object, as well as a ResizeBehavior, which can be FIXED or FILL. The resize behaviour applies to the width of components. All components added will maintain there preferred height, and the height of the JXStatusBar will be the height of the highest component plus insets.

A constraint with JXStatusBar.Constraint.ResizeBehavior.FIXED will cause the component to occupy a fixed area on the JXStatusBar. The size of the area remains constant when the JXStatusBar is resized. A constraint with this behavior may also take a width value, see JXStatusBar.Constraint#setFixedWidth(int). The width is a preferred minimum width. If the component preferred width is greater than the constraint width, the component width will apply.

All components with constraint JXStatusBar.Constraint.ResizeBehavior.FILL will share equally any spare space in the JXStatusBar. Spare space is that left over after allowing for all FIXED component and the preferred width of FILL components, plus insets

Constructing a JXStatusBar is very straightforward:

 
JXStatusBar bar = new JXStatusBar(); 
JLabel statusLabel = new JLabel("Ready"); 
JXStatusBar.Constraint c1 = new JXStatusBar.Constraint() 
c1.setFixedWidth(100); 
bar.add(statusLabel, c1);     // Fixed width of 100 with no inserts 
JXStatusBar.Constraint c2 = new JXStatusBarConstraint( 
JXStatusBar.Constraint.ResizeBehavior.FILL) // Fill with no inserts 
JProgressBar pbar = new JProgressBar(); 
bar.add(pbar, c2);            // Fill with no inserts - will use remaining space 

Two common use cases for status bars include tracking application status and progress. JXStatusBar does not manage these tasks, but instead special components exist or can be created that do manage these tasks. For example, if your application has a TaskManager or some other repository of currently running jobs, you could easily create a TaskManagerProgressBar that tracks those jobs. This component could then be added to the JXStatusBar like any other component.

Client Properties

The BasicStatusBarUI.AUTO_ADD_SEPARATOR client property can be specified, which will disable the auto-adding of separators. In this case, you must add your own JSeparator components. To use:

 
JXStatusBar sbar = new JXStatusBar(); 
sbar.putClientProperty(BasicStatusBarUI.AUTO_ADD_SEPARATOR, false); 
sbar.add(comp1); 
sbar.add(new JSeparator(JSeparator.VERTICAL)); 
sbar.add(comp2); 
sbar.add(comp3); 

Most used methods

  • setBorder
  • setUI
    Sets the look and feel (L&F) object that renders this component.
  • addMouseListener
  • addMouseMotionListener
  • addPropertyChangeListener
  • firePropertyChange
  • getBackground
  • getBorder
  • getClientProperty
  • getComponent
  • getComponentCount
  • getComponentOrientation
  • getComponentCount,
  • getComponentOrientation,
  • getComponents,
  • getHeight,
  • getLayout,
  • getMaximumSize,
  • getMinimumSize,
  • getParent,
  • getPreferredSize,
  • getRootPane

Popular classes and methods

  • getOriginalFilename (MultipartFile)
  • setContentView (Activity)
  • GridBagLayout (java.awt)
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Reference (javax.naming)
  • JFileChooser (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base

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)